gnome.weatherers.spreading¶
objects used to model the spreading of oil Include the Langmuir process here as well
Attributes¶
Classes¶
Model the FayGravityViscous spreading of the oil. For instantaneous release, |
|
Used for testing and diagnostics |
|
Easiest to define this as a weathering process that updates 'area' array |
Module Contents¶
- gnome.weatherers.spreading.PI¶
- gnome.weatherers.spreading.PISQUARED¶
- class gnome.weatherers.spreading.FayGravityViscous(water=None, thickness_limit=None, **kwargs)¶
Bases:
gnome.weatherers.core.Weatherer
Model the FayGravityViscous spreading of the oil. For instantaneous release, this assumes all LEs released together spread as a blob following Fay (1971). The blob can be partitioned into ‘N’ LEs and the assumption is that the thickness and initial volume of the blob applies to all LEs in it. For continuous release, the spreading algorithm is similar to Dodge et al., (1983), where blob volume is considered as the cumulative volume of oil varying with time during the release period
initialize object - invoke super, add required data_arrays.
- spreading_const = (1.53, 1.21, 1.45)¶
- water = None¶
- thickness_limit = None¶
- use_langmuir_correction = True¶
- init_area(water_viscosity, relative_buoyancy, blob_init_vol)¶
This takes scalars inputs since water_viscosity, init_volume and relative_buoyancy for a bunch of LEs released together will be the same
- Parameters:
water_viscosity (float) – viscosity of water
blob_init_volume (float) – total initial volume of all LEs released together
relative_buoyancy (float) – relative buoyancy of oil wrt water: (rho_water - rho_oil)/rho_water where rho is the density
Equation for gravity spreading:
A0 = PI*(k2**4/k1**2)*((V0**5*g*dbuoy)/(nu_h2o**2))**(1./6.)
- update_area(water_viscosity, relative_buoyancy, blob_init_vol, area, max_area_le, time_step, vol_frac_le_st, age)¶
update area array in place, also return area array each blob is defined by its age. This updates the area of each blob, as such, use the mean relative_buoyancy for each blob. Still check and ensure relative buoyancy is > 0 for all LEs
- Parameters:
water_viscosity (float) – viscosity of water
relative_buoyancy (float) – relative buoyancy of oil wrt water at release time. This does not change over time.
blob_init_volume (numpy array) – numpy array of floats containing initial release volume of blob. This is the same for all LEs released together. Note that for continuous release, the blob_init_vol will be updated as cumulative volume within the release duration.
area (numpy array) – numpy array of floats containing area of each LE. Assume The LEs with same age belong to the same blob. Sum these up to get the area of the blob to compare it to max_area (or min thickness). Keep updating blob area till max_area is achieved. Equally divide updated_blob_area into the number of LEs used to model the blob.
max_area_le (float) – bool array. If a LE area reaches max_area_le beyond which it will not spread, toggle the LEs associated with that LE to True. Max spreading is based on min thickness based on initial viscosity of oil. This is used by Langmuir since the process acts on particles after spreading completes.
time_step – time step of simulation, which is in seconds.
vol_frac_le_st (numpy array of int32) – numpy array the same size as area. This is the volume fraction of each LE. It is used to convert the computation into element-based.
age (numpy array of int32) – numpy array the same size as area and blob_init_volume. This is the age of each LE. The LEs with the same age belong to the same blob. Age is in seconds.
- Returns:
(updated ‘area’ array, updated ‘at_max_area’ array). It also changes the input ‘area’ array and the ‘at_max_area’ bool array inplace. However, the input arrays could be copies so best to also return the updates.
- static get_thickness_limit(vo)¶
return the spreading thickness limit based on viscosity todo: documented in langmiur docs
vo >= 1e-4; limit = 1e-4 m
1e-4 > vo >= 1e-6; limit = 1e-5 + 0.9091*(vo - 1e-6) m
1e-6 > vo; limit = 1e-5 m
- prepare_for_model_run(sc)¶
Assumes only one type of substance is spilled
That’s now TRUE!
- initialize_data(sc, num_released)¶
initialize ‘relative_buoyancy’. Note that initialization of spreading area for LEs is done in release object.
If on is False, then arrays should not be included - dont’ initialize
- weather_elements(sc, time_step, model_time)¶
Update ‘area’, ‘fay_area’ for previously released particles The updated ‘area’, ‘fay_area’ is associated with age of particles at:
model_time + time_step
- class gnome.weatherers.spreading.ConstantArea(area, **kwargs)¶
Bases:
gnome.weatherers.core.Weatherer
Used for testing and diagnostics - must be manually hooked up
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.
- area¶
- initialize_data(sc, num_released)¶
If on is False, then arrays should not be included - dont’ initialize
- weather_elements(sc, time_step, model_time)¶
return the area array as it was entered since that contains area per LE if there is more than one LE. Kept the interface the same as FayGravityViscous since WeatheringData will call it the same way.
- class gnome.weatherers.spreading.Langmuir(water=None, wind=None, **kwargs)¶
Bases:
gnome.weatherers.core.Weatherer
Easiest to define this as a weathering process that updates ‘area’ array
initialize wind to (0, 0) if it is None
- wind = None¶
- water = None¶
- weather_elements(sc, time_step, model_time)¶
set the ‘area’ array based on the Langmuir process This only applies to particles marked for weathering on the surface: ie fate_status is surface_weather