gnome.weatherers.cleanup ======================== .. py:module:: gnome.weatherers.cleanup .. autoapi-nested-parse:: oil removal from various cleanup options add these as weatherers Classes ------- .. autoapisummary:: gnome.weatherers.cleanup.RemoveMass gnome.weatherers.cleanup.CleanUpBase gnome.weatherers.cleanup.Skimmer gnome.weatherers.cleanup.Burn gnome.weatherers.cleanup.ChemicalDispersion Module Contents --------------- .. py:class:: RemoveMass Bases: :py:obj:`object` create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching. .. py:attribute:: valid_vol_units .. py:attribute:: valid_mass_units .. py:method:: prepare_for_model_step(sc, time_step, model_time) Do sub timestep resolution here so numbers add up correctly Mark LEs to be skimmed - do them in order right now. Assume all LEs that are released together will be skimmed together since they would be closer to each other in position. Assumes: there is more mass in water than amount of mass to be skimmed. The LEs marked for Skimming are marked only once - code checks to see if any LEs are marked for skimming and if none are found, it marks them. .. py:class:: CleanUpBase(efficiency=1.0, **kwargs) Bases: :py:obj:`RemoveMass`, :py:obj:`gnome.weatherers.Weatherer` create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching. Base weatherer class; defines the API for all weatherers Passes optional arguments to base (Process) class via super. See base class for optional arguments: `gnome.movers.mover.Process` adds 'mass_components', 'mass' to array_types since all weatherers need these. .. py:property:: efficiency - Efficiency can be None since it indicates that we use wind to compute efficiency. - If efficiency is not None, it must be a number greater than or equal to 0.0 and less than or equal to 1.0. .. py:class:: Skimmer(amount=0, units=None, water=None, **kwargs) Bases: :py:obj:`CleanUpBase` create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching. initialize Skimmer object - calls base class __init__ using super() active_range is required cleanup operations must have a valid datetime - cannot use -inf and inf active_range is used to get the mass removal rate .. py:attribute:: water :value: None .. py:attribute:: amount :value: 0 .. py:property:: units return units for amount skimmed .. py:method:: prepare_for_model_run(sc) no need to call base class since no new array_types were added .. py:method:: prepare_for_model_step(sc, time_step, model_time) Do sub timestep resolution here so numbers add up correctly Mark LEs to be skimmed - do them in order right now. Assume all LEs that are released together will be skimmed together since they would be closer to each other in position. Assumes: there is more mass in water than amount of mass to be skimmed. The LEs marked for Skimming are marked only once - code checks to see if any LEs are marked for skimming and if none are found, it marks them. .. py:method:: weather_elements(sc, time_step, model_time) Assumes there is only ever 1 substance being modeled! remove mass equally from LEs marked to be skimmed .. py:class:: Burn(area=None, thickness=None, active_range=(InfDateTime('-inf'), InfDateTime('inf')), area_units='m^2', thickness_units='m', efficiency=1.0, wind=None, water=None, **kwargs) Bases: :py:obj:`CleanUpBase` create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching. Set the area of boomed oil to be burned. Cleanup operations must have a valid datetime for active start, cannot use -inf. Cannot set active stop - burn automatically stops when oil/water thickness reaches 2mm. :param float area: area of boomed oil/water mixture to burn :param float thickness: thickness of boomed oil/water mixture :param datetime active_range: time when the burn starts is the only thing we track. However we give a range to be consistent with all other weatherers. :param str area_units: default is 'm^2' :param str thickness_units: default is 'm' :param float efficiency: burn efficiency, must be greater than 0 and less than or equal to 1.0 :param wind: gnome.environment.Wind object. Only used to set efficiency if efficiency is None. Efficiency is defined as: 1 - 0.07 * wind.get_value(model_time) where wind.get_value(model_time) is value of wind at model_time Kwargs passed onto base class: :param str name: name of object :param bool on: whether object is on or not for the run .. py:attribute:: valid_area_units .. py:attribute:: valid_length_units .. py:attribute:: area :value: None .. py:property:: area_units .. py:property:: thickness_units .. py:attribute:: wind :value: None .. py:attribute:: water :value: None .. py:property:: active_range .. py:property:: thickness .. py:method:: prepare_for_model_run(sc) resets internal _oilwater_thickness variable to initial thickness specified by user and active stop to 'inf' again. initializes sc.mass_balance['burned'] = 0.0 .. py:method:: prepare_for_model_step(sc, time_step, model_time) 1. set 'active' flag based on active start, and model_time 2. Mark LEs to be burned - do them in order right now. Assume all LEs that are released together will be burned together since they would be closer to each other in position. Assumes: there is more mass in water than amount of mass to be burned. The LEs marked for Burning are marked only once - during the very first step that the object becomes active .. py:method:: weather_elements(sc, time_step, model_time) 1. figure out the mass to remove for current timestep based on rate and efficiency. Find fraction of total mass and remove equally from all 'mass_components' of LEs marked for burning. 2. update 'mass' array and the amount burned in mass_balance dict 3. append to _burn_duration for each timestep .. py:class:: ChemicalDispersion(fraction_sprayed, active_range=(InfDateTime('-inf'), InfDateTime('inf')), waves=None, efficiency=1.0, **kwargs) Bases: :py:obj:`CleanUpBase` create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching. another mass removal mechanism. The volume specified gets dispersed with efficiency based on wave conditions. :param volume: volume of oil (not oil/water?) applied with surfactant :type volume: float :param units: volume units :type units: str :param active_range: Range of datetimes for when the mover should be active :type active_range: 2-tuple of datetimes :param waves: waves object - query to get height. It must contain get_value() method. Default is None to support object creation by WebClient before a waves object is defined :type waves: an object with same interface as gnome.environment.Waves Optional Argument: Either efficiency or waves must be set before running the model. If efficiency is not set, then use wave height to estimate an efficiency :param efficiency: efficiency of operation. :type efficiency: float between 0 and 1 remaining kwargs include 'on' and 'name' and these are passed to base class via super .. py:attribute:: fraction_sprayed .. py:attribute:: waves :value: None .. py:attribute:: make_default_refs :value: False .. py:method:: prepare_for_model_run(sc) reset _rate to None. It gets set when LEs are marked to be dispersed. .. py:method:: prepare_for_model_step(sc, time_step, model_time) 1. invoke base class method (using super) to set active flag 2. mark LEs for removal 3. set internal _rate attribute for mass removal [kg/sec] .. py:method:: weather_elements(sc, time_step, model_time) for now just take away 0.1% at every step