Sediment drift from Glomma river outlet

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

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

Source of sediments at Glomma river outlet

lat=59.169194
lon=10.962920
o.seed_elements(lon=lon, lat=lat, number=10000,
                time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=48)],
                terminal_velocity=-.001)  # 1 mm/s settling speed

if False:  # Using constant south-westwards current and wind
    o.set_config('environment:fallback:x_sea_water_velocity', -.05)
    o.set_config('environment:fallback:y_sea_water_velocity', -.1)
    o.set_config('environment:fallback:y_wind', -6)
    o.set_config('environment:fallback:x_wind', -2)
    o.set_config('environment:fallback:sea_floor_depth_below_sea_level', 100)  # 100m depth
else:  # Using live data from Thredds
    o.add_readers_from_list([
        'https://thredds.met.no/thredds/dodsC/sea/norkyst800m/1h/aggregate_be'])

Adding some diffusion

o.set_config('drift:current_uncertainty', .2)
o.set_config('drift:wind_uncertainty', 2)
o.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')
#o.set_config('vertical_mixing:diffusivitymodel', 'environment')

o.run(time_step=600, time_step_output=1800, duration=timedelta(hours=48))

Plotting the depth vs time

o.plot_property('z')
z

Animate sediment particles colored by their depth

o.animation(color='z', fast=False, buffer=.01)
o.animation(color='moving', fast=False, buffer=.01, colorbar=False, legend=['Sedimented', 'Moving'])

Out:

MovieWriter imagemagick unavailable; using Pillow instead.
MovieWriter imagemagick unavailable; using Pillow instead.
../_images/example_sediments_0.gif

Total running time of the script: ( 9 minutes 19.918 seconds)

Gallery generated by Sphinx-Gallery