{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Parameterised Stokesdrift\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If surface Stokes drift is not available from a wave model, there are two alternatives:\n - one can increase the wind_drift_factor by e.g. 1.5%, as the Stokes Drift is typically 1.5% of the wind speed\n - or the surface Stokes drift can be parameterized from wind speed and fetch distance\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The latter option is activated in OpenDrift with the config setting\n`o.set_config('drift:use_tabularised_stokes_drift', True)`\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This activates a paramterisation of Stokes drift with the following method, as implemented by Petter Nygren from SMHI:\nhttps://opendrift.github.io/_modules/opendrift/models/physics_methods.html#wave_stokes_drift_parameterised\nThe code and corresponding plot below shows how the Stokes drift factor (fraction of wind speed) varies with wind speed and fetch (3 different tabulated fetch distances).\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom opendrift.models.physics_methods import wave_stokes_drift_parameterised\n\nfor fetch in ['5000', '25000', '50000']:\n wind = ([np.arange(1, 35), np.array([0])])\n sx, sy = wave_stokes_drift_parameterised(wind=wind, fetch=fetch)\n plt.plot(wind[0], sx/wind[0], label=f'Fetch: {fetch[:-3]} km')\nplt.xlabel('Wind speed [m/s]')\nplt.ylabel('Stokes drift / wind speed [ratio]')\nplt.legend()\nplt.show()" ] } ], "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 }