Sediment drift with resuspension

from datetime import timedelta, datetime
from opendrift.readers import reader_oscillating
from opendrift.models.sedimentdrift import SedimentDrift

Constructing an artificial current field where x- and y-components are oscilating with different amplitude and period

reader_oscx = reader_oscillating.Reader('x_sea_water_velocity',
    amplitude=0.6, zero_time=datetime.utcnow())
reader_oscy = reader_oscillating.Reader('y_sea_water_velocity',
    amplitude=.3, period_seconds=3600*5, zero_time=datetime.utcnow())

o = SedimentDrift(loglevel=50)  # 0 for debug output

if True:
    o.add_reader([reader_oscx, reader_oscy])
    o.set_config('environment:fallback:y_wind', -6)
    o.set_config('environment:fallback:x_wind', -3)
    o.set_config('environment:fallback:sea_floor_depth_below_sea_level', 30)  # 100m depth
else:  # Using live data from Thredds instead of oscillating currents
    o.add_readers_from_list([
        'https://thredds.met.no/thredds/dodsC/sea/norkyst800m/1h/aggregate_be'])

Set threshold for bottom resuspension

o.set_config('vertical_mixing:resuspension_threshold', .5)

# Adding some horizontal and vertical diffusion
o.set_config('drift:current_uncertainty', 0.1)
o.set_config('drift:wind_uncertainty', 1)
o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')
#o.set_config('vertical_mixing:diffusivitymodel', 'environment')

Seeding sediments

o.seed_elements(lon=4.65, lat=60, number=10000,
                time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=6)],
                terminal_velocity=-.01)  # 1 cm/s settling speed

o.run(time_step=1800, time_step_output=1800, duration=timedelta(hours=72))
<xarray.Dataset> Size: 145MB
Dimensions:                                                                              (
                                                                                          trajectory: 10000,
                                                                                          time: 145)
Coordinates:
  * trajectory                                                                           (trajectory) int64 80kB ...
  * time                                                                                 (time) datetime64[ns] 1kB ...
Data variables: (12/25)
    status                                                                               (trajectory, time) float32 6MB ...
    moving                                                                               (trajectory, time) float32 6MB ...
    age_seconds                                                                          (trajectory, time) float32 6MB ...
    origin_marker                                                                        (trajectory, time) float32 6MB ...
    lon                                                                                  (trajectory, time) float32 6MB ...
    lat                                                                                  (trajectory, time) float32 6MB ...
    ...                                                                                   ...
    sea_surface_wave_period_at_variance_spectral_density_maximum                         (trajectory, time) float32 6MB ...
    sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment  (trajectory, time) float32 6MB ...
    land_binary_mask                                                                     (trajectory, time) float32 6MB ...
    ocean_vertical_diffusivity                                                           (trajectory, time) float32 6MB ...
    ocean_mixed_layer_thickness                                                          (trajectory, time) float32 6MB ...
    sea_floor_depth_below_sea_level                                                      (trajectory, time) float32 6MB ...
Attributes: (12/122)
    Conventions:                                                             ...
    standard_name_vocabulary:                                                ...
    featureType:                                                             ...
    title:                                                                   ...
    summary:                                                                 ...
    keywords:                                                                ...
    ...                                                                                                               ...
    geospatial_lon_units:                                                    ...
    geospatial_lon_resolution:                                               ...
    runtime:                                                                 ...
    geospatial_vertical_min:                                                 ...
    geospatial_vertical_max:                                                 ...
    geospatial_vertical_positive:                                            ...


Plotting the depth vs time

o.plot_property('z')
z

Animate sediment particles

o.animation(color='moving', colorbar=False, legend=['Sedimented', 'Moving'], fast=True, buffer=.01)
#o.animation_profile()
../_images/example_sediments_resuspension_0.gif

Total running time of the script: (2 minutes 26.850 seconds)

Gallery generated by Sphinx-Gallery