Air-water interaction
This section describes the function that can be used for the light interaction between the atmosphere and water. This section can be skipped entirely, if the simulation only considered the light within the water medium.
To setup the stage for light refraction, the data of water surface distribution is needed: water elevation $\eta$, the slope in x direction $\eta_{x} = \frac{\partial \eta}{\partial x}$ and y direction $\eta_{y} = \frac{\partial \eta}{\partial y}$. OceanLight.jl offers random wave distribution or input in .h5
format.
Setting random water surface distribution
OceanLight.setwave!
— Methodsetwave!(η::Array{<:Float64,2},ηx::Array{<:Float64,2},ηy::Array{<:Float64,2},rms::Float64,p::Param)
Giving the value to the existed wave surface distribution grid
Arguments
η::Array{<:Float64,2}
: water surface elevation.ηx::Array{<:Float64,2}
: partial derivative of water surface elevation in x direction.ηy::Array{<:Float64,2}
: partial derivative of water surface elevation in y direction.rms::Float64
: random number.p::Param
: simulation parameters.
Importing water surface distribution data
OceanLight.readdata
— Methodreaddata(datdir::String,fname::String,n::Tuple{<:Int64,<:Int64},pexy::Tuple{<:Float64,<:Float64})
Reading the wave surface distribution data (surface elevation η and partial derivative of it in x and y ηx and ηy) from the .h5 file, given the directory datdir
and the file name fname
The water surface distribution data may or may not match the input irradiance field. Hece, OceanLight.jl interpolates the value $\eta$, $\eta_x$, and $\eta_y$, to match the corresponding irradiance field.
OceanLight.convertwave!
— Functionconvertwave!(η, ηx, ηy, η0, ηx0, ηy0, kbc)
Convert the surface wave geometry η0
, ηx0
, ηy0
to η
, ηx
, ηy
with the same size as irradiance field. Can be used for nonperiodic BCkbc=1
(no interpolation) or periodic BC kbc=0
(interpolation using FFT)
Refraction
OceanLight.interface!
— Methodinterface!(xpb::Array{<:Float64,2},ypb::Array{<:Float64,2},zpb::Array{<:Float64,2},
θ::Array{<:Float64,2},ϕ::Array{<:Float64,2},fres::Array{<:Float64,2},
η::Array{<:Float64,2},ηx::Array{<:Float64,2},ηy::Array{<:Float64,2},p::Param)
Calculate the reflection and refraction of the photon or light ray that transmit from the atmosphere to the water.
Arguments
xpb::Array{<:Float64,2}
: initial x coordination of the photon.ypb::Array{<:Float64,2}
: initial y coordination of the photon.zpb::Array{<:Float64,2}
: initial z coordination of the photon.θ::Array{<:Float64,2}
: angle of the light ray relative to the z axis: polar angle.ϕ::Array{<:Float64,2}
: angle of the light ray relative to the x axis: azimuthal angle.fres::Array{<:Float64,2}
: fresnel coefficient or fractional transmission for unpolarized lightη::Array{<:Float64,2}
: water surface elevation.ηx::Array{<:Float64,2}
: partial derivative of water surface elevation in x direction.ηy::Array{<:Float64,2}
: partial derivative of water surface elevation in y direction.p::Param
: simulation parameters.