pylag.settling module

Module for settling velocity calculators.

Note

settling is implemented in Cython. Only a small portion of the API is exposed in Python with accompanying documentation.

class pylag.settling.ConstantSettlingVelocityCalculator(config)

Bases: SettlingVelocityCalculator

Constant settling velocity calculator

A constant settling velocity calculator assigns a constant settling velocity to a particle. The value does not change with time. The settling velocity can be initialised in one of two ways: either as a fixed value which is specified in the run configuration file, or as a random value bounded by limits given in the run configuration file.

Parameters

config (ConfigParser) – Configuration object

Variables
  • config (ConfigParser) – Configuration object

  • _settling_velocity_variable_name (str) – The name of the variable with which the settling velocity is associated.

  • _w_settling_fixed (float) – Fixed settling velocity. Used if initialisation_method is set to fixed_value. Set using the configuration option settling_velocity.

  • _w_settling_min (float) – Minimum settling velocity. Used if initialisation_method is set to uniform_random. Set using the configuration option min_settling_velocity.

  • _w_settling_max (float) – Maximum settling velocity. Used if initialisation_method is set to uniform_random. Set using the configuration option max_settling_velocity.

class pylag.settling.DelayedSettlingVelocityCalculator(config)

Bases: SettlingVelocityCalculator

Delayed settling velocity calculator

A delayed settling velocity calculator assumes that particles stay at or close to the surface for some period of time which is specified in the run configuration file. After this time, the particles begin to sink at a specified rate.

The calculator is included as a basic way of simulating the transport and fate of objects such as sea weed detritus, which are initially positively buoyant in seawater, but after time degrade and sink.

Parameters

config (ConfigParser) – Configuration object

Variables
  • config (ConfigParser) – Configuration object

  • _duration_of_surface_transport_phase_variable_name (str) – The name of the variable with which the duration of the surface transport phase is associated.

  • _duration_of_surface_transport_phase_in_seconds (float) – The time in seconds over which the particle remains positively buoyant and is transported along the surface (units: seconds).

  • _settling_velocity_variable_name (str) – The name of the variable with which the settling velocity is associated.

  • _settling_velocity (float) – Fixed settling velocity for the particle after it has begun to sink (units: m/s).

class pylag.settling.SettlingVelocityCalculator

Bases: object

Abstract base class for PyLag settling velocity calculators

SettlingVelocityCalculators set the settling velocity of particles.

For efficiency reasons, SettlingVelocityCalculator has been implemented in Cython and only part of its API is exposed in Python. In order to make it possible to use SettlingVelocityCalculator objects in Python, a set of Python wrappers have been added to the SettlingVelocityCalculator base class. These are documented here.

init_particle_settling_velocity_wrapper(self, DataReader data_reader, DTYPE_FLOAT_t time, ParticleSmartPtr particle)

Python friendly wrapper for init_particle_settling_velocity()

Parameters

particle (pylag.particle_cpp_wrapper.ParticleSmartPtr) – PyLag ParticleSmartPtr.

set_particle_settling_velocity_wrapper(self, DataReader data_reader, DTYPE_FLOAT_t time, ParticleSmartPtr particle)

Python friendly wrapper for set_particle_settling_velocity()

Parameters
pylag.settling.get_settling_velocity_calculator(config)

Factory method for settling velocity calculators

Parameters

config (ConfigParser) – PyLag configuraton object

Returns

A settling velocity calculator

Return type

SettlingVelocityCalculator