{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Sediment drift from Glomma river outlet\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from datetime import timedelta, datetime\nfrom opendrift.models.sedimentdrift import SedimentDrift\n\no = SedimentDrift(loglevel=20) # 0 for debug output\n\nif False: # Using constant south-westwards current and wind\n o.set_config('environment:fallback:x_sea_water_velocity', -.05)\n o.set_config('environment:fallback:y_sea_water_velocity', -.1)\n o.set_config('environment:fallback:y_wind', -6)\n o.set_config('environment:fallback:x_wind', -2)\n o.set_config('environment:fallback:sea_floor_depth_below_sea_level', 100) # 100m depth\nelse: # Using live data from Thredds\n o.add_readers_from_list([\n 'https://thredds.met.no/thredds/dodsC/sea/norkyst800m/1h/aggregate_be'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Adding some diffusion\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.set_config('drift:current_uncertainty', .2)\no.set_config('drift:wind_uncertainty', 2)\no.set_config('vertical_mixing:diffusivitymodel', 'windspeed_Large1994')\n#o.set_config('vertical_mixing:diffusivitymodel', 'environment')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Source of sediments at Glomma river outlet\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "lat=59.169194\nlon=10.962920\no.seed_elements(lon=lon, lat=lat, number=10000,\n time=[datetime.utcnow(), datetime.utcnow()+timedelta(hours=48)],\n terminal_velocity=-.001) # 1 mm/s settling speed\n\no.run(time_step=600, time_step_output=1800, duration=timedelta(hours=36))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plotting the depth vs time\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.plot_property('z')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Animate sediment particles colored by their depth\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "o.animation(color='z', fast=False, buffer=.01)\n#o.animation(color='moving', fast=False, buffer=.01, colorbar=False, legend=['Sedimented', 'Moving'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 0 }