Skip to content

Commit

Permalink
[skip ci] Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-build committed Mar 8, 2024
1 parent e8de62d commit d5d5e8d
Show file tree
Hide file tree
Showing 278 changed files with 334,163 additions and 313,928 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: e36d92882cbff06d990f33b55f556eca
config: 5d9e0e9a7bc6ca85ecd21cda503e4d4b
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified _downloads/46b4cb42d5bb56cc39e2b5b2b520b38d/gallery_python.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Biodegradation of oil\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\nfrom datetime import datetime, timedelta\nfrom opendrift.readers import reader_netCDF_CF_generic\nfrom opendrift.models.openoil import OpenOil\n\no = OpenOil(loglevel=0) # Set loglevel to 0 for debug information\ntime = datetime.now()\n\n# No motion is needed for this test\no.set_config('environment:constant', {k: 0 for k in\n ['x_wind', 'y_wind', 'x_sea_water_velocity', 'y_sea_water_velocity']})\no.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Seeding some particles\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o.set_config('drift:vertical_mixing', False) # Keeping oil at fixed depths\no.set_config('processes:biodegradation', True)\no.set_config('biodegradation:method', 'decay_rate')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Fast decay for droplets, and slow decay for slick \n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"decay = {'biodegradation_decay_rate_slick': np.log(2)/timedelta(days=100).total_seconds(),\n 'biodegradation_decay_rate_droplet': np.log(2)/timedelta(days=3).total_seconds(),\n 'oil_type': 'GENERIC MEDIUM CRUDE'}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Seed 5000 oil elements at surface, and 5000 elements at 100m depth\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o.seed_elements(lon=4, lat=60.0, z=0, number=5000, time=datetime.now(), **decay)\no.seed_elements(lon=4, lat=60.0, z=-100, number=5000, time=datetime.now(), **decay)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Running model\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o.run(duration=timedelta(hours=24), time_step=900)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Print and plot results\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"o.plot_oil_budget(show_watercontent_and_viscosity=False, show_wind_and_current=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"file://gallery/animations/example_biodegradation_0.gif\">\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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python
"""
Biodegradation of oil
======================
"""

import numpy as np
from datetime import datetime, timedelta
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.openoil import OpenOil

o = OpenOil(loglevel=0) # Set loglevel to 0 for debug information
time = datetime.now()

# No motion is needed for this test
o.set_config('environment:constant', {k: 0 for k in
['x_wind', 'y_wind', 'x_sea_water_velocity', 'y_sea_water_velocity']})
o.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0})

#%%
# Seeding some particles
o.set_config('drift:vertical_mixing', False) # Keeping oil at fixed depths
o.set_config('processes:biodegradation', True)
o.set_config('biodegradation:method', 'decay_rate')

#%%
# Fast decay for droplets, and slow decay for slick
decay = {'biodegradation_decay_rate_slick': np.log(2)/timedelta(days=100).total_seconds(),
'biodegradation_decay_rate_droplet': np.log(2)/timedelta(days=3).total_seconds(),
'oil_type': 'GENERIC MEDIUM CRUDE'}

#%%
# Seed 5000 oil elements at surface, and 5000 elements at 100m depth
o.seed_elements(lon=4, lat=60.0, z=0, number=5000, time=datetime.now(), **decay)
o.seed_elements(lon=4, lat=60.0, z=-100, number=5000, time=datetime.now(), **decay)

#%%
# Running model
o.run(duration=timedelta(hours=24), time_step=900)

#%%
# Print and plot results
o.plot_oil_budget(show_watercontent_and_viscosity=False, show_wind_and_current=False)

#%%
# .. image:: /gallery/animations/example_biodegradation_0.gif
Binary file modified _downloads/fcaddee3a42ae2e2c41e00ae08d70347/gallery_jupyter.zip
Binary file not shown.
Binary file modified _images/example_2d_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_chemicaldrift_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_chemicaldrift_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_coastline_options_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_codegg_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_codegg_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_cone_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_depth_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_dominating_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_ensemble_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_entrainment_rate_oil_types_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_entrainment_rate_oil_types_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_huge_output_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_huge_output_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_leeway_backtrack_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_macondo_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_mixed_layer_depth_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_mixed_layer_depth_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_mixed_layer_depth_2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_oil_ice_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_oil_thickness_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_oil_thickness_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_oil_verticalmixing_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_oil_verticalmixing_1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_plot_0.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/example_radionuclides_0.gif
Binary file modified _images/example_radionuclides_1.gif
Binary file modified _images/example_river_runoff_0.gif
Binary file modified _images/example_sediments_0.gif
Binary file modified _images/example_sediments_resuspension_0.gif
Binary file modified _images/example_seed_from_shapefile_0.gif
Binary file modified _images/example_shipdrift_0.gif
Binary file modified _images/example_shipdrift_leeway_0.gif
Binary file modified _images/example_static_2d_current_0.gif
Binary file modified _images/sphx_glr_example_2d_001.png
Binary file modified _images/sphx_glr_example_2d_thumb.png
Binary file modified _images/sphx_glr_example_advection_schemes_eddy_001.png
Binary file modified _images/sphx_glr_example_advection_schemes_eddy_thumb.png
Binary file added _images/sphx_glr_example_biodegradation_001.png
Binary file added _images/sphx_glr_example_biodegradation_thumb.png
Binary file modified _images/sphx_glr_example_chemicaldrift_001.png
Binary file modified _images/sphx_glr_example_chemicaldrift_thumb.png
Binary file modified _images/sphx_glr_example_coastline_options_001.png
Binary file modified _images/sphx_glr_example_coastline_options_thumb.png
Binary file modified _images/sphx_glr_example_codegg_001.png
Binary file modified _images/sphx_glr_example_codegg_thumb.png
Binary file modified _images/sphx_glr_example_cone_001.png
Binary file modified _images/sphx_glr_example_cone_thumb.png
Binary file modified _images/sphx_glr_example_depth_001.png
Binary file modified _images/sphx_glr_example_depth_thumb.png
Binary file modified _images/sphx_glr_example_entrainment_rate_oil_types_001.png
Binary file modified _images/sphx_glr_example_entrainment_rate_oil_types_002.png
Binary file modified _images/sphx_glr_example_entrainment_rate_oil_types_thumb.png
Binary file modified _images/sphx_glr_example_huge_output_001.png
Binary file modified _images/sphx_glr_example_huge_output_thumb.png
Binary file modified _images/sphx_glr_example_leeway_backtrack_002.png
Binary file modified _images/sphx_glr_example_macondo_001.png
Binary file modified _images/sphx_glr_example_macondo_002.png
Binary file modified _images/sphx_glr_example_macondo_thumb.png
Binary file modified _images/sphx_glr_example_oil_ice_001.png
Binary file modified _images/sphx_glr_example_oil_ice_thumb.png
Binary file modified _images/sphx_glr_example_oil_thickness_001.png
Binary file modified _images/sphx_glr_example_oil_thickness_002.png
Binary file modified _images/sphx_glr_example_oil_thickness_thumb.png
Binary file modified _images/sphx_glr_example_oil_verticalmixing_001.png
Binary file modified _images/sphx_glr_example_oil_verticalmixing_002.png
Binary file modified _images/sphx_glr_example_oil_verticalmixing_003.png
Binary file modified _images/sphx_glr_example_oil_verticalmixing_thumb.png
Binary file modified _images/sphx_glr_example_openberg_new_001.png
Binary file modified _images/sphx_glr_example_openberg_new_thumb.png
Binary file modified _images/sphx_glr_example_radionuclides_001.png
Binary file modified _images/sphx_glr_example_radionuclides_002.png
Binary file modified _images/sphx_glr_example_radionuclides_thumb.png
Binary file modified _images/sphx_glr_example_river_runoff_001.png
Binary file modified _images/sphx_glr_example_river_runoff_002.png
Binary file modified _images/sphx_glr_example_river_runoff_thumb.png
Binary file modified _images/sphx_glr_example_sediments_001.png
Binary file modified _images/sphx_glr_example_sediments_resuspension_001.png
Binary file modified _images/sphx_glr_example_sediments_resuspension_thumb.png
Binary file modified _images/sphx_glr_example_sediments_thumb.png
Binary file modified _images/sphx_glr_example_seed_from_shapefile_001.png
Binary file modified _images/sphx_glr_example_seed_from_shapefile_thumb.png
Binary file modified _images/sphx_glr_example_shipdrift_001.png
Binary file modified _images/sphx_glr_example_shipdrift_leeway_001.png
Binary file modified _images/sphx_glr_example_shipdrift_leeway_thumb.png
Binary file modified _images/sphx_glr_example_shipdrift_thumb.png
Loading

0 comments on commit d5d5e8d

Please sign in to comment.