Light within water

In OceanLight.jl simulation, the scattering photons inside the water medium using the distribution based on Petzold(1972,) in which the value need to be called manually and stored in the variable ph and θps.

OceanLight.phasePetzoldMethod
phasePetzold()

return 2 arrays: ϕps and θps.

When ϕps is the cumulation distribution of scattering angle and θps is the angle between new trajectory and the direction of the photon before scattering corresponding to each ϕps.

source

OceanLight.jl gives the options of constructing the irradiance solution field, depending on the initial condition and the problem one wish to solve.

Single point source

If the problem is consisted of incoming photons on a single point (i.e. incoming photons only at the center of irradiance field,) the solution grid field is stored directly at ed solution field.

OceanLight.transfer!Function
transfer!(ed::Array{<:Float64,3},esol::Array{<:Float64,2},θ::Float64,ϕ::Float64,fres::Float64,ip::Int64,
               xpb::Float64,ypb::Float64,zpb::Float64,area::Vector{Float64},interi::Vector{Int64},
               interj::Vector{Int64},randrng,η::Array{<:Float64,2},ph::Array{<:Float64,1},
               θps::Array{<:Float64,1},p::Param,mode=0::Int64)

Doing the Monte Carlo Simulation.

Arguments

  • ed::Array{<:Float64,3}: Irradiance solution grid
  • esol::Array{<:Float64,2}: Irradiance solution grid for solar mode (under deverlopment)
  • θ::Float64: angle of the light ray relative to the z axis: polar angle.
  • ϕ::Float64: angle of the light ray relative to the x axis: azimuthal angle.
  • fres::Float64: fresnel coefficient or fractional transmission for unpolarized light
  • ip::Int64: current photon's number being simulated (ie. ip ∈ {1, 2,..., nphoton})
  • xpb::Float64: initial x coordination of the photon.
  • ypb::Float64: initial y coordination of the photon.
  • zpb::Float64: initial z coordination of the photon.
  • area::Vector{Float64}: 4 values of the area inside a single grid where a photon lands corresponding to: 4 corners of the square grid.
  • interi::Vector{Int64}: x coordination (grid number) of a single grid where a photon lands: from bottom left, bottom right, upper left, and upper right.
  • interj::Vector{Int64}: y coordination (grid number) of a single grid where a photon lands: from bottom left, bottom right, upper left, and upper right.
  • randrng: PRNGs (pseudorandom number generators) exported by the Random package.
  • η::Array{<:Float64,2}: water surface elevation.
  • ph::Array{<:Float64,1}: cumulation distribution of scattering angle (obtained from phasePetzold())
  • θps::Array{<:Float64,1}: angle between new trajectory and the direction of the photon before scattering corresponding to each ϕps (obtained from phasePetzold())
  • p::Param: simulation parameters.
  • mode::Int64: mode of different irradinace calculation (under deverlopment)
source

Multiple points source

If the problem is consisted of incoming photons on a multiple point (i.e. incoming photons everywhere on irradiance field,) OceanLight.jl will track each photon individually and stored the irradiance contribution on ed1d with its coordination at edi, edj, and edk, and later, combine into a single solution.

OceanLight.transfer!Function
transfer!(ed1d::Array{<:Float64,1},edi::Array{<:Int64,1},edj::Array{<:Int64,1},
               edk::Array{<:Int64,1},count::Array{<:Int64,1},esol::Array{<:Float64,2},θ::Float64,ϕ::Float64,fres::Float64,
               ip::Int64,xpb::Float64,ypb::Float64,zpb::Float64,randrng,η::Array{<:Float64,2},
               ph::Array{<:Float64,1},θps::Array{<:Float64,1},p::Param,mode=0::Int64)

Doing the Monte Carlo Simulation.

Arguments

  • ed1d::Array{<:Float64,1}: fraction of irradiance that will be assigned to 4 corners of a grid where a photon lands
  • edi::Array{<:Int64,1}: x coordination (grid number) of a single grid where a photon lands: from bottom left, bottom right, upper left, and upper right.
  • edj::Array{<:Int64,1}: y coordination (grid number) of a single grid where a photon lands: from bottom left, bottom right, upper left, and upper right.
  • edk::Array{<:Int64,1}: number of the energy layer that the photons travel, from the top ztop in 1 by 4 array
  • count::Array{<:Int64,1}: (parrallel computing) dummy integer span from 1 to 4 to keep track of the size of the ed1d, edi, edj, edk.
  • esol::Array{<:Float64,2}: Irradiance solution grid for solar mode (under deverlopment)
  • θ::Float64: angle of the light ray relative to the z axis: polar angle.
  • ϕ::Float64: angle of the light ray relative to the x axis: azimuthal angle.
  • fres::Float64: fresnel coefficient or fractional transmission for unpolarized light.
  • ip::Int64: current photon's number being simulated (ie. ip ∈ {1, 2,..., nphoton})
  • xpb::Float64: initial x coordination of the photon.
  • ypb::Float64: initial y coordination of the photon.
  • zpb::Float64: initial z coordination of the photon.
  • randrng: PRNGs (pseudorandom number generators) exported by the Random package
  • η::Array{<:Float64,2}: water surface elevation.
  • ph::Array{<:Float64,1}: cumulation distribution of scattering angle (obtained from phasePetzold())
  • θps::Array{<:Float64,1}: angle between new trajectory and the direction of the photon before scattering corresponding to each ϕps (obtained from phasePetzold())
  • p::Param: simulation parameters.
  • mode::Int64: mode of different irradinace calculation (under deverlopment)
source