opendrift.models.oceandrift

Module Contents

Classes

Lagrangian3DArray

Extending LagrangianArray for elements moving in 3 dimensions

OceanDrift

Open source buoyant particle trajectory model based on OpenDrift.

opendrift.models.oceandrift.logger
class opendrift.models.oceandrift.Lagrangian3DArray(**kwargs)[source]

Bases: opendrift.elements.LagrangianArray

Extending LagrangianArray for elements moving in 3 dimensions The Particle may be buoyant and/or subject to vertical mixing buoyant bahaviour is described by terminal velocity

Initialises a LagrangianArray with given properties.

Args:

Keyword arguments (kwargs) with names corresponding to the OrderedDict ‘variables’ of the class, and corresponding values. The values must be ndarrays of equal length, or scalars. All (or none) variables must be given, unless a default value is specified in the OrderedDict ‘variables’ An empty object may be created by giving no input.

variables
class opendrift.models.oceandrift.OceanDrift(*args, **kwargs)[source]

Bases: opendrift.models.basemodel.OpenDriftSimulation

Open source buoyant particle trajectory model based on OpenDrift.

Developed at MET Norway

Generic module for particles that move in 3 dimensions and may be to vertical turbulent mixing with the possibility for positive or negative buoyancy

Particles could be e.g. oil droplets, plankton, nutrients or sediments, Model may be subclassed for more specific behaviour.

Initialise OpenDriftSimulation

Args:
seed: integer or None. A given integer will yield identical

random numbers drawn each simulation. Random numbers are e.g. used to distribute particles spatially when seeding, and may be used by modules (subclasses) for e.g. diffusion. Specifying a fixed value (default: 0) is useful for sensitivity tests. With seed = None, different random numbers will be drawn for subsequent runs, even with identical configuration/input.

iomodule: name of module used to export data

default: netcdf, see opendrift.io for more alternatives. iomodule is module/filename without preceeding io_

loglevel: set to 0 (default) to retrieve all debug information.

Provide a higher value (e.g. 20) to receive less output. Use the string ‘custom’ to configure logging from outside.

logtime: if True, a time stamp is given for each logging line.

logtime can also be given as a python time specifier (e.g. ‘%H:%M:%S’)

ElementType
max_speed = 1
required_variables
required_profiles_z_range
update(self)[source]

Update positions and properties of elements.

disable_vertical_motion(self)[source]

Deactivate any vertical processes/advection

update_terminal_velocity(self, Tprofiles=None, Sprofiles=None, z_index=None)[source]

Calculate terminal velocity due to bouyancy from own properties and environmental variables. Sub-modules should overload this method for particle-specific behaviour

prepare_vertical_mixing(self)[source]
vertical_advection(self)[source]

Move particles vertically according to vertical ocean current

Vertical advection by ocean currents is normally small compared to termical velocity

vertical_buoyancy(self)[source]

Move particles vertically according to their buoyancy

surface_stick(self)[source]

To be overloaded by subclasses, e.g. downward mixing of oil

bottom_interaction(self, Zmin=None)[source]

To be overloaded by subclasses, e.g. radionuclides in sediments

surface_wave_mixing(self, time_step_seconds)[source]

To be overloaded by subclasses, e.g. downward mixing of oil

get_diffusivity_profile(self, model)[source]
vertical_mixing(self, store_depths=False)[source]

Mix particles vertically according to eddy diffusivity and buoyancy

Buoyancy is expressed as terminal velocity, which is the steady-state vertical velocity due to positive or negative buoyant behaviour. It is usually a function of particle density, diameter, and shape.

Vertical particle displacemend du to turbulent mixing is calculated using a random walk scheme” (Visser et al. 1996)

animate_vertical_distribution(self, depths=None, maxdepth=None, bins=50, filename=None)[source]

Function to animate vertical distribution of particles

plot_vertical_distribution(self)[source]

Function to plot vertical distribution of particles

plotter_vertical_distribution_time(self, ax=None, mask=None, dz=1.0, maxrange=- 100, bins=None, step=1)[source]

Function to plot vertical distribution of particles.

Use mask to plot any selection of particles.