gnome.ops.density

Module Contents

Functions

init_density(sc, num_released[, water, substance, ...])

Initializes the density of the last num_rel elements of a spill container (sc),

recalc_density(sc[, water, aggregate])

Recalculates the density of the elements in a spill container. This is necessary

_get_k_rho_weathering_dens_update(substance, temp_in_k)

use lru_cache on substance. substance is expected to be a GnomeOil,

Attributes

logger

gnome.ops.density.logger
gnome.ops.density.init_density(sc, num_released, water=None, substance=None, aggregate=True)

Initializes the density of the last num_rel elements of a spill container (sc), taking into account environmental conditions.

Parameters:
  • sc – spill container

  • num_rel – int

  • water – Water object to use. If None, uses default values

  • substance – gnome.spills.substance.Substance or subclass thereof

  • aggregate – Flag for whether to trigger mass balance updates in spill container

gnome.ops.density.recalc_density(sc, water=None, aggregate=True)

Recalculates the density of the elements in a spill container. This is necessary if ‘mass_components’ have changed. :param sc: spill container :param water: Water object to use. If None, uses default :param aggregate: Flag for whether to trigger mass balance updates in spill container

gnome.ops.density._get_k_rho_weathering_dens_update(substance, temp_in_k)

use lru_cache on substance. substance is expected to be a GnomeOil, if this object stays the same, then return the cached value for k_rho This depends on initial mass fractions, initial density and fixed component densities