Functions

OceanTurb.BoundaryConditionsFunction
BoundaryConditions([T=Float64;] bottom = GradientBoundaryCondition(-zero(T)),
                                   top = FluxBoundaryCondition(-zero(T)))

Returns FieldBoundaryConditions with a bottom and top boundary condition. The type T is only relevant for the default values of bottom and top.

source
OceanTurb.DefaultBoundaryConditionsFunction
DefaultBoundaryConditions(T=Float64)

Returns default oceanic boundary conditions: a zero GradientBoundaryCondition on bottom and a zero FluxBoundaryCondition on top.

source
OceanTurb.absolute_errorFunction
absolute_error(c, d, p=2)

Compute the absolute error between c and d with norm p, defined as

$\mathrm{abs \, error} = \left ( L^{-1} \int_{-L}^0 |c-d|^p \, \mathrm{d} z \right )^(1/p)$.

When c and d are on different grids, d is interpolated to the same grid as c.

source
OceanTurb.arraytypeMethod
arraytype(grid::Grid)

Return the array type corresponding to data that lives on grid. Defaults to Array. New data types (for example, grids that exist on GPUs) must implement new array types.

source
OceanTurb.fill_bottom_ghost_cell!Method
fill_bottom_ghost_cell!(c, κ, model, bc)

Update the bottom ghost cell of c given the boundary condition bc, model, and diffusivity kappa. kappa is used only if a flux boundary condition is specified.

source
OceanTurb.oncellMethod
onface(c, i)

Return the interpolation of the function f onto cell point i, where f is assumed to be a function of m::AbstractModel and to return a quantity at cell interfaces.

source
OceanTurb.onfaceMethod
onface(c, i)

Return the interpolation of the function f onto face point i, where f is assumed to be a function of m::AbstractModel and to return a quantity at cell centers.

source
OceanTurb.prettytimeMethod
prettytime(t)

Convert a floating point value t representing an amount of time in seconds to a more human-friendly formatted string with three decimal places. Depending on the value of t the string will be formatted to show t in nanoseconds (ns), microseconds (μs), milliseconds (ms), seconds (s), minutes (min), hours (hr), or days (day).

source
OceanTurb.relative_errorFunction
relative_error(c, d, p=2)

Compute the relative error between c and d with norm p, defined as

\[\beq \mathrm{rel \, error} = \frac{\left ( int_{-L}^0 (c-d)^p \, \mathrm{d} z \right )^(1/p)} {\left ( int_{-L}^0 d^p \, \mathrm{d} z \right )^(1/p)} \eeq\]
source
OceanTurb.set!Method
set!(solution, kwargs...)

Set the fields of a solution. For example, use

T0 = rand(4) S0(z) = exp(-z^2/10) set!(solution, T=T0, S=S0)

To set solution.T and solution.S to T0 and S0.

source
OceanTurb.set_bcs!Method
set_bcs!(model; bcspecs...)

Set boundary conditions of model solution fields. The keyword argument name must be the name of a model solution and its value is a (bottombc, topbc) tuple.

Example

julia> set_bcs!(model, c=(FluxBoundaryCondition(-1), FluxBoundaryCondition(0)) )

source
OceanTurb.∂zMethod
∂z(a, i)

Return the discrete derivative of a at grid point i.

The derivative of a CellField is computed at face points, and the derviative of a FaceField is computed at cell points.

source