gnome.spills.substance ====================== .. py:module:: gnome.spills.substance .. autoapi-nested-parse:: The substance is an abstraction for the various types of "things" one might model with pyGNOME. The role of a substance is to: - Define what data is carried with the elements - Provide a way to initialize the elements - Optionally, provide tools to support computation during the run - for example, GnomeOil can compute changes in density, etc of the elements as the model runs. Classes ------- .. autoapisummary:: gnome.spills.substance.Substance gnome.spills.substance.NonWeatheringSubstance gnome.spills.substance.SubsurfaceSubstance Module Contents --------------- .. py:class:: Substance(windage_range=None, windage_persist=None, standard_density=1000.0, *args, **kwargs) Bases: :py:obj:`gnome.gnomeobject.GnomeId` A class for assigning a unique ID for an object :param windage_range: Range of windages for the substance (leeway). Default: (.01, .04) :type windage_range: tuple of values between 0 and 1 :param windage_persist=900: persistence of windage settings in seconds. -1 or Inf means infinite. :type windage_persist: integer seconds. :param standard_density=1000.0: The density of the substance, used to convert mass to/from volume :type standard_density: float in units of kg/m^3 .. py:property:: windage_range .. py:property:: windage_persist .. py:attribute:: initializers .. py:property:: all_array_types should the initializers be what holds the array types? don't we know that this should have already? :type: Fixme .. py:property:: is_weatherable .. py:method:: get_initializer_by_name(name) get first initializer in list whose name matches 'name' .. py:method:: has_initializer(name) Returns True if an initializer is present in the list which sets the data_array corresponding with 'name', otherwise returns False .. py:method:: initialize_LEs(to_rel, arrs, environment=None) :param to_rel - number of new LEs to initialize :param arrs - dict-like of data arrays representing LEs .. py:method:: density_at_temp(temp=273.15) For non-weathering substance, we just return the standard density. .. py:class:: NonWeatheringSubstance(windage_range=None, windage_persist=None, standard_density=1000.0, *args, **kwargs) Bases: :py:obj:`Substance` A class for assigning a unique ID for an object :param windage_range: Range of windages for the substance (leeway). Default: (.01, .04) :type windage_range: tuple of values between 0 and 1 :param windage_persist=900: persistence of windage settings in seconds. -1 or Inf means infinite. :type windage_persist: integer seconds. :param standard_density=1000.0: The density of the substance, used to convert mass to/from volume :type standard_density: float in units of kg/m^3 .. py:property:: is_weatherable .. py:method:: initialize_LEs(to_rel, arrs, environment=None) :param to_rel - number of new LEs to initialize :param arrs - dict-like of data arrays representing LEs .. py:class:: SubsurfaceSubstance(distribution, *args, **kwargs) Bases: :py:obj:`NonWeatheringSubstance` Substance that can be used subsurface key feature is that it initializes rise velocity from a distribution Note: this should probably be part of a Release Object, not a Substance. :param distribution='UniformDistribution': which distribution to use :type distribution: Distribution Object Note: distribution should return values in m/s See gnome.utilities.distributions for details