gnome.weatherers.cleanup¶
oil removal from various cleanup options add these as weatherers
Classes¶
create a mixin for mass removal. These methods are used by CleanUpBase and |
|
Just need to add a few internal methods for Skimmer + Burn common code |
|
Just need to add a few internal methods for Skimmer + Burn common code |
|
Just need to add a few internal methods for Skimmer + Burn common code |
|
Just need to add a few internal methods for Skimmer + Burn common code |
Module Contents¶
- class gnome.weatherers.cleanup.RemoveMass¶
Bases:
object
create a mixin for mass removal. These methods are used by CleanUpBase and also by manual_beaching.
- valid_vol_units¶
- valid_mass_units¶
- 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.
- class gnome.weatherers.cleanup.CleanUpBase(efficiency=1.0, **kwargs)¶
Bases:
RemoveMass
,gnome.weatherers.Weatherer
Just need to add a few internal methods for Skimmer + Burn common code Currently defined as a base class.
add ‘frac_water’ to array_types and pass **kwargs to base class __init__ using super
- 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.
- class gnome.weatherers.cleanup.Skimmer(amount=0, units=None, water=None, **kwargs)¶
Bases:
CleanUpBase
Just need to add a few internal methods for Skimmer + Burn common code Currently defined as a base class.
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
- water = None¶
- amount = 0¶
- property units¶
return units for amount skimmed
- prepare_for_model_run(sc)¶
no need to call base class since no new array_types were added
- 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.
- 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
- class gnome.weatherers.cleanup.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:
CleanUpBase
Just need to add a few internal methods for Skimmer + Burn common code Currently defined as a base class.
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.
- Parameters:
area (float) – area of boomed oil/water mixture to burn
thickness (float) – thickness of boomed oil/water mixture
active_range (datetime) – time when the burn starts is the only thing we track. However we give a range to be consistent with all other weatherers.
area_units (str) – default is ‘m^2’
thickness_units (str) – default is ‘m’
efficiency (float) – burn efficiency, must be greater than 0 and less than or equal to 1.0
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:
- Parameters:
name (str) – name of object
on (bool) – whether object is on or not for the run
- valid_area_units¶
- valid_length_units¶
- area = None¶
- property area_units¶
- property thickness_units¶
- wind = None¶
- water = None¶
- property active_range¶
- property thickness¶
- 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
- prepare_for_model_step(sc, time_step, model_time)¶
set ‘active’ flag based on active start, and model_time
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
- weather_elements(sc, time_step, model_time)¶
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.
update ‘mass’ array and the amount burned in mass_balance dict
append to _burn_duration for each timestep
- class gnome.weatherers.cleanup.ChemicalDispersion(fraction_sprayed, active_range=(InfDateTime('-inf'), InfDateTime('inf')), waves=None, efficiency=1.0, **kwargs)¶
Bases:
CleanUpBase
Just need to add a few internal methods for Skimmer + Burn common code Currently defined as a base class.
another mass removal mechanism. The volume specified gets dispersed with efficiency based on wave conditions.
- Parameters:
volume (float) – volume of oil (not oil/water?) applied with surfactant
units (str) – volume units
active_range (2-tuple of datetimes) – Range of datetimes for when the mover should be active
waves (an object with same interface as gnome.environment.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
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
- Parameters:
efficiency (float between 0 and 1) – efficiency of operation.
remaining kwargs include ‘on’ and ‘name’ and these are passed to base class via super
- fraction_sprayed¶
- waves = None¶
- make_default_refs = False¶
- prepare_for_model_run(sc)¶
reset _rate to None. It gets set when LEs are marked to be dispersed.
- prepare_for_model_step(sc, time_step, model_time)¶
invoke base class method (using super) to set active flag
mark LEs for removal
set internal _rate attribute for mass removal [kg/sec]
- weather_elements(sc, time_step, model_time)¶
for now just take away 0.1% at every step