OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
231 stars 113 forks source link

Seeking Guidance on Utilizing OceanDrift's o.run() Function with Runge-Kutta 4 Numerical Scheme #1232

Closed HatYaz closed 4 months ago

HatYaz commented 4 months ago

Discussed in https://github.com/OpenDrift/opendrift/discussions/1231

Originally posted by **HatYaz** February 15, 2024 Hello everyone, I'm currently working on a project that involves simulating ocean drift using the OceanDrift library. I've been exploring the documentation and various examples provided, but I'm facing some challenges when it comes to implementing the Runge-Kutta 4 numerical scheme with the o.run() function. Specifically, I'm interested in understanding how to properly integrate the Runge-Kutta 4 scheme into my simulation process using the o.run() function. I've read through the documentation, but I'm still unclear about the exact steps and parameters needed to execute this numerical scheme effectively. Could someone provide me with some guidance or perhaps a sample code snippet demonstrating the correct usage of the Runge-Kutta 4 scheme with the o.run() function in OceanDrift? Any insights, tips, or resources would be greatly appreciated. Here my line code in python: o.run(duration=timedelta(hours=sim_hours), time_step=timedelta(seconds=timestep)) Thank you in advance for your help! Note. Shall I use: o.set_config('drift:advection_scheme', 'runge-kutta') befaure o.run() ???
knutfrode commented 4 months ago

Hi,

Yes you need to set the configuration before running the simulation. These two examples illustrate this:

https://opendrift.github.io/gallery/example_advection_schemes_eddy.html https://opendrift.github.io/gallery/example_rungekutta_norkyst.html