:py:mod:`gnome.ops.density` =========================== .. py:module:: gnome.ops.density Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: gnome.ops.density.init_density gnome.ops.density.recalc_density gnome.ops.density._get_k_rho_weathering_dens_update Attributes ~~~~~~~~~~ .. autoapisummary:: gnome.ops.density.logger .. py:data:: logger .. py:function:: 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. :param sc: spill container :param num_rel: int :param water: Water object to use. If None, uses default values :param substance: gnome.spills.substance.Substance or subclass thereof :param aggregate: Flag for whether to trigger mass balance updates in spill container .. py:function:: 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 .. py:function:: _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