Library

Documenting the user interface.

GiantKelpDynamics.jl

GiantKelpDynamics.GiantKelpMethod
GiantKelp(; grid, 
            holdfast_x, holdfast_y,
            scalefactor = ones(length(holdfast_x)),
            number_nodes = 8,
            segment_unstretched_length = 3.,
            initial_stipe_radii = 0.004,
            initial_blade_areas = 3.0 * (isa(segment_unstretched_length, Number) ? 
                                           ones(number_nodes) ./ number_nodes :
                                           segment_area_fraction(segment_unstretched_length)),
            initial_pneumatocyst_volume = (2.5 / (5 * 9.81)) .* (isa(segment_unstretched_length, Number) ?
                                                                   1 / number_nodes .* ones(number_nodes) :
                                                                   segment_unstretched_length ./ sum(segment_unstretched_length)),
            kinematics = UtterDenny(),
            timestepper = Euler(),
            max_Δt = Inf,
            tracer_forcing = NamedTuple(),
            custom_dynamics = nothingfunc)

Constructs a model of giant kelps with bases at holdfast_x, _y, _z.

Keyword Arguments

  • grid: (required) the geometry to build the model on
  • holdfast_x, holdfast_y, holdfast_z: An array of the base/holdfast positions of the individuals
  • scalefactor: array of the scalefactor for each plant (used to allow each plant model to represnt the effect of multiple individuals)
  • number_nodes: the number of nodes to split each individual interior
  • segment_unstretched_length: either a scalar specifying the unstretched length of all segments, or an array of the length of each segment (at the moment each plant must have the same)
  • initial_stipe_radii: either a scalar specifying the stipe radii of all segments, or an array of the stipe radii of each segment (at the moment each plant must have the same)
  • initial_blade_areas: an array of the blade area attatched to each segment
  • initial_pneumatocyst_volume: an array of the volume of pneumatocyst attatched to each segment
  • kinematics: the kinematics model specifying the individuals motion
  • timestepper: the timestepper to integrate the motion with (at each substep)
  • max_Δt: the maximum timestep for integrating the motion
  • tracer_forcing: a NamedTuple of Oceananigans.Forcings(func; field_dependencies, parameters) with for discrete form forcing only. Functions must be of the form func(i, j, k, p, n, grid, clock, tracers, particles, parameters) where field_dependencies can be particle properties or fields from the underlying model (tracers or velocities)
  • custom_dynamics: function of the form func(particles, model, bgc, Δt) to be executed at every timestep after the kelp model properties are updated.

Example

julia> using GiantKelpDynamics, Oceananigans

julia> grid = RectilinearGrid(size=(16, 16, 16), extent=(100, 100, 8));

julia> kelp = GiantKelp(; grid, holdfast_x = [10., 20.], holdfast_y = [10., 20])
Giant kelp (Macrocystis pyrifera) model with 2 individuals of 2 nodes.
 Base positions:
 - x ∈ [10.0, 20.0]
 - y ∈ [10.0, 20.0]
 - z ∈ [-8.0, -8.0]
source
GiantKelpDynamics.NothingBGCType
NothingBGC()

An Oceananigans AbstractContinuousFormBiogeochemistry which specifies no biogeochemical interactions to allow the giant kelp model to be run alone.

Example

julia> using GiantKelpDynamics, Oceananigans, OceanBioME

julia> grid = RectilinearGrid(size=(16, 16, 16), extent=(100, 100, 8));

julia> kelp = GiantKelp(; grid, number_nodes = 2, holdfast_x = [10., 20.], holdfast_y = [10., 20])
Giant kelp (Macrocystis pyrifera) model with 2 individuals of 2 nodes.
 Base positions:
 - x ∈ [10.0, 20.0]
 - y ∈ [10.0, 20.0]
 - z ∈ [-8.0, -8.0]

julia> biogeochemistry = Biogeochemistry(NothingBGC(); particles = kelp)
No biogeochemistry
 Light attenuation: Nothing
 Sediment: Nothing
 Particles: Giant kelp (Macrocystis pyrifera) model with 2 individuals of 2 nodes.
 Modifiers: Nothing
source
GiantKelpDynamics.UtterDennySpeedType
UtterDennySpeed(; spring_constant = 1.91 * 10 ^ 7,
             spring_exponent = 1.41,
             water_density = 1026.0,
             pneumatocyst_specific_buoyancy = 5.,
             gravitational_acceleration = 9.81,
             stipe_drag_coefficient = 1.,
             blade_drag_coefficient = 0.4 * 12 ^ -0.485,
             added_mass_coefficient = 3.,
             damping_timescale = 5.)

Sets up the kinematic model for giant kelp motion from Utter and Denny (1996) and Rosman et al. (2013).

source
Oceananigans.Fields.set!Method
set!(kelp::GiantKelp; kwargs...)

Sets the properties of the kelp model. The keyword arguments kwargs... take the form name=data, where name refers to one of the properties of kelp, and the data may be an array mathcing the size of the property for one individual (i.e. size(kelp.name[1])), or for all (i.e. size(kelp.name)).

Example

julia> using GiantKelpDynamics, Oceananigans

julia> grid = RectilinearGrid(size=(16, 16, 16), extent=(100, 100, 8));

julia> kelp = GiantKelp(; grid, number_nodes = 2, holdfast_x = [10., 20.], holdfast_y = [10., 20])
Giant kelp (Macrocystis pyrifera) model with 2 individuals of 2 nodes.
 Base positions:
 - x ∈ [10.0, 20.0]
 - y ∈ [10.0, 20.0]
 - z ∈ [-8.0, -8.0]

julia> set!(kelp, positions = (x = [0, 8], y = zeros(2), z = [0, 8]))
source