OceanTurb.jl

Models and parameterizations for the turbulent ocean surface boundary layer in Julia
Author glwagner
Popularity
25 Stars
Updated Last
4 Months Ago
Started In
November 2018

OceanTurb.jl

Documentation Build Status License
docs travis MIT license

OceanTurb.jl provides software for solving one-dimensional models that approximate the physics of the ocean's turbulent surface boundary layer.

Installation

Open julia, press ] to enter package manager mode, and type

pkg> add OceanTurb

Example(s)

With OceanTurb.jl installed, try

using OceanTurb

@use_pyplot_utils # add utilities for plotting OceanTurb Fields

     N = 128        # Model resolution
     H = 128        # Vertical extent of the model domain
    Qb = 1e-7       # Surface buoyancy flux (positive implies cooling)
  dTdz = 1e-3       # Interior/initial temperature gradient
    Δt = 10minute   # Time step size
tfinal = 8hour      # Final time

# Build the model with a Backward Euler timestepper
model = KPP.Model(N=N, H=H, stepper=:BackwardEuler)

# Set initial condition
T₀(z) = 20 + dTdz * z
model.solution.T = T₀

# Set boundary conditions
model.bcs.T.top = FluxBoundaryCondition(Qb / (model.constants.α * model.constants.g))
model.bcs.T.bottom = GradientBoundaryCondition(dTdz)

# Run the model
run_until!(model, Δt, tfinal)

plot(model.solution.T)
removespines("top", "right")
xlabel("Temperature (\$ {}^\\circ \\mathrm{C} \$)")
ylabel(L"z \, \mathrm{(m)}")

to make a plot that looks something like this:

For a more complicated example, see examples/modular_kpp_example.jl to produce

which compares various flavors of the 'KPP' boundary layer model with one another.

The turbulence models

Check the documentation or src/models/ for the latest update on turbulence models we have implemented.

Authors

Gregory Wagner.

Used By Packages

No packages found.