-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conversion elder benchmark to notebook See merge request ogs/ogs!5068
- Loading branch information
Showing
11 changed files
with
217 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 26 additions & 26 deletions
52
Tests/Data/Parabolic/ComponentTransport/elder/elder_reference.pvd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<VTKFile type="Collection" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor"> | ||
<Collection> | ||
<DataSet timestep="0" group="" part="0" file="elder_pcs_0_ts_0_t_0.000000_reference.vtu"/> | ||
<DataSet timestep="5259600" group="" part="0" file="elder_pcs_0_ts_20_t_5259600.000000_reference.vtu"/> | ||
<DataSet timestep="10519200" group="" part="0" file="elder_pcs_0_ts_40_t_10519200.000000_reference.vtu"/> | ||
<DataSet timestep="15778800" group="" part="0" file="elder_pcs_0_ts_60_t_15778800.000000_reference.vtu"/> | ||
<DataSet timestep="21038400" group="" part="0" file="elder_pcs_0_ts_80_t_21038400.000000_reference.vtu"/> | ||
<DataSet timestep="26298000" group="" part="0" file="elder_pcs_0_ts_100_t_26298000.000000_reference.vtu"/> | ||
<DataSet timestep="31557600" group="" part="0" file="elder_pcs_0_ts_120_t_31557600.000000_reference.vtu"/> | ||
<DataSet timestep="36817200" group="" part="0" file="elder_pcs_0_ts_140_t_36817200.000000_reference.vtu"/> | ||
<DataSet timestep="42076800" group="" part="0" file="elder_pcs_0_ts_160_t_42076800.000000_reference.vtu"/> | ||
<DataSet timestep="47336400" group="" part="0" file="elder_pcs_0_ts_180_t_47336400.000000_reference.vtu"/> | ||
<DataSet timestep="52596000" group="" part="0" file="elder_pcs_0_ts_200_t_52596000.000000_reference.vtu"/> | ||
<DataSet timestep="57855600" group="" part="0" file="elder_pcs_0_ts_220_t_57855600.000000_reference.vtu"/> | ||
<DataSet timestep="63115200" group="" part="0" file="elder_pcs_0_ts_240_t_63115200.000000_reference.vtu"/> | ||
<DataSet timestep="68374800" group="" part="0" file="elder_pcs_0_ts_260_t_68374800.000000_reference.vtu"/> | ||
<DataSet timestep="73634400" group="" part="0" file="elder_pcs_0_ts_280_t_73634400.000000_reference.vtu"/> | ||
<DataSet timestep="78894000" group="" part="0" file="elder_pcs_0_ts_300_t_78894000.000000_reference.vtu"/> | ||
<DataSet timestep="84153600" group="" part="0" file="elder_pcs_0_ts_320_t_84153600.000000_reference.vtu"/> | ||
<DataSet timestep="89413200" group="" part="0" file="elder_pcs_0_ts_340_t_89413200.000000_reference.vtu"/> | ||
<DataSet timestep="94672800" group="" part="0" file="elder_pcs_0_ts_360_t_94672800.000000_reference.vtu"/> | ||
<DataSet timestep="99932400" group="" part="0" file="elder_pcs_0_ts_380_t_99932400.000000_reference.vtu"/> | ||
<DataSet timestep="105192000" group="" part="0" file="elder_pcs_0_ts_400_t_105192000.000000_reference.vtu"/> | ||
<DataSet timestep="110451600" group="" part="0" file="elder_pcs_0_ts_420_t_110451600.000000_reference.vtu"/> | ||
<DataSet timestep="115711200" group="" part="0" file="elder_pcs_0_ts_440_t_115711200.000000_reference.vtu"/> | ||
<DataSet timestep="120970800" group="" part="0" file="elder_pcs_0_ts_460_t_120970800.000000_reference.vtu"/> | ||
<DataSet timestep="126230400" group="" part="0" file="elder_pcs_0_ts_480_t_126230400.000000_reference.vtu"/> | ||
<DataSet timestep="131490000" group="" part="0" file="elder_pcs_0_ts_500_t_131490000.000000_reference.vtu"/> | ||
<DataSet timestep="0" group="" part="0" file="elder_ts_0_t_0.000000_reference.vtu"/> | ||
<DataSet timestep="5259600" group="" part="0" file="elder_ts_20_t_5259600.000000_reference.vtu"/> | ||
<DataSet timestep="10519200" group="" part="0" file="elder_ts_40_t_10519200.000000_reference.vtu"/> | ||
<DataSet timestep="15778800" group="" part="0" file="elder_ts_60_t_15778800.000000_reference.vtu"/> | ||
<DataSet timestep="21038400" group="" part="0" file="elder_ts_80_t_21038400.000000_reference.vtu"/> | ||
<DataSet timestep="26298000" group="" part="0" file="elder_ts_100_t_26298000.000000_reference.vtu"/> | ||
<DataSet timestep="31557600" group="" part="0" file="elder_ts_120_t_31557600.000000_reference.vtu"/> | ||
<DataSet timestep="36817200" group="" part="0" file="elder_ts_140_t_36817200.000000_reference.vtu"/> | ||
<DataSet timestep="42076800" group="" part="0" file="elder_ts_160_t_42076800.000000_reference.vtu"/> | ||
<DataSet timestep="47336400" group="" part="0" file="elder_ts_180_t_47336400.000000_reference.vtu"/> | ||
<DataSet timestep="52596000" group="" part="0" file="elder_ts_200_t_52596000.000000_reference.vtu"/> | ||
<DataSet timestep="57855600" group="" part="0" file="elder_ts_220_t_57855600.000000_reference.vtu"/> | ||
<DataSet timestep="63115200" group="" part="0" file="elder_ts_240_t_63115200.000000_reference.vtu"/> | ||
<DataSet timestep="68374800" group="" part="0" file="elder_ts_260_t_68374800.000000_reference.vtu"/> | ||
<DataSet timestep="73634400" group="" part="0" file="elder_ts_280_t_73634400.000000_reference.vtu"/> | ||
<DataSet timestep="78894000" group="" part="0" file="elder_ts_300_t_78894000.000000_reference.vtu"/> | ||
<DataSet timestep="84153600" group="" part="0" file="elder_ts_320_t_84153600.000000_reference.vtu"/> | ||
<DataSet timestep="89413200" group="" part="0" file="elder_ts_340_t_89413200.000000_reference.vtu"/> | ||
<DataSet timestep="94672800" group="" part="0" file="elder_ts_360_t_94672800.000000_reference.vtu"/> | ||
<DataSet timestep="99932400" group="" part="0" file="elder_ts_380_t_99932400.000000_reference.vtu"/> | ||
<DataSet timestep="105192000" group="" part="0" file="elder_ts_400_t_105192000.000000_reference.vtu"/> | ||
<DataSet timestep="110451600" group="" part="0" file="elder_ts_420_t_110451600.000000_reference.vtu"/> | ||
<DataSet timestep="115711200" group="" part="0" file="elder_ts_440_t_115711200.000000_reference.vtu"/> | ||
<DataSet timestep="120970800" group="" part="0" file="elder_ts_460_t_120970800.000000_reference.vtu"/> | ||
<DataSet timestep="126230400" group="" part="0" file="elder_ts_480_t_126230400.000000_reference.vtu"/> | ||
<DataSet timestep="131490000" group="" part="0" file="elder_ts_500_t_131490000.000000_reference.vtu"/> | ||
</Collection> | ||
</VTKFile> |
182 changes: 182 additions & 0 deletions
182
Tests/Data/Parabolic/ComponentTransport/elder_jupyter/elder_jupyter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
# %% [markdown] | ||
# +++ | ||
# title = "Saturated Varible-Densitty Flow and Mass Transport(Elder)" | ||
# date = "2024-08-09" | ||
# author = "Marc Walther, Lion Ahrendt" | ||
# project = ["Parabolic/ComponentTransport/elder_jupyter/elder.prj"] | ||
# web_subsection = "hydro-component" | ||
# +++ | ||
|
||
# %% [markdown] | ||
# ## Overview | ||
# | ||
# The elder benchmark is based on a experiment in a Hele-Shaw cells conducted by John W. Elder in 1965. | ||
# Although unlike the original experiment the flow is caused by a difference in density then a difference in temperature, but by scaling the parameters a similar Rayleigh number can be achieved and therefore similar results observed. | ||
# Due to being used to test early modeling software it has become a basic test case for such problem. | ||
# Over the years studies about this benchmark where conducted, for example by if and when the results converge with the grid density and numerical stability. | ||
# | ||
# ### Problem description | ||
# | ||
# Unfortunately the is at the moment no analytical solution for the Elder benchmark. | ||
# The simulation works by assuming a dense fluid in a mixable single phase environment. | ||
# On with a hight-concentration fluid is placed on top (in our case on the top right) witch is dissolved and by the power of gravity and diffusion is able to penetrate in to the domain and builds concentration fingers. | ||
# | ||
# ### Setup | ||
# | ||
# For the simulation the following variables where chosen: | ||
# | variable | value | unit | | ||
# |---- |---- | ---- | | ||
# | length (L) | 300 | $m$ | | ||
# | height (d) | 150 | $m$ | | ||
# | extent of intrusion (e) | 150 | $m$ | | ||
# | pore diffusion ($D_d$) | $3.57\cdot 10^{-6}$ | $m^2/s$ | | ||
# | retardation factor | 1 | - | | ||
# | viscosity ($\mu$) | $10^{-3}$ | $kg/m\cdot s$ | | ||
# | permeability | 4.8404 $\cdot 10^{-13}$ | $m^2$ | | ||
# | longitudinal diversity ($\beta_L$) | 0 | $m$ | | ||
# | transversal diversity ($\beta_T$) | 0 | $m$ | | ||
# | gravitational acceleration(g) | 9,81 | $m/s^{2}$ | | ||
# | expansion coefficient($\alpha$) | 0.2 | - | | ||
# | porosity ($\epsilon$) | 0.1 | - | | ||
# | density ($\rho$) | 1000 | $kg/m^{3}$ | | ||
# | ||
# ## Running the simulation | ||
# | ||
# The simulation of the Elder experiment takes too long to be executed as part of the webpage benchmark. | ||
# Instead, in the next section pre-computed reference results will be loaded. | ||
# To actually run the simulation, you can use following code: | ||
|
||
# %% | ||
# import ogstools as ogs | ||
# path_to_prj = '../elder/elder.prj' | ||
# model = ogs.Project(input_file = path_to_prj, output_file=path_to_prj) | ||
# model.run_model(write_logs=True) | ||
|
||
# %% [markdown] | ||
# ## Post processing | ||
# | ||
# ### Defining the variables of interest | ||
|
||
# %% | ||
import matplotlib.pyplot as plt | ||
import ogstools as ogs | ||
from IPython.display import HTML, Image | ||
|
||
# %% | ||
ogs.plot.setup.dpi = 30 # resolution | ||
ogs.plot.setup.fontsize = 30 | ||
|
||
si = ogs.variables.Scalar(data_name="Si", output_name="Concentration", output_unit="%") | ||
pressure = ogs.variables.Scalar( | ||
data_name="pressure", output_name="Pressure", output_unit="" | ||
) | ||
|
||
# %% [markdown] | ||
# ### Read data | ||
# | ||
# First, we are going to load the dataset produces by the simulation: | ||
|
||
# %% | ||
mesh_series = ogs.meshlib.MeshSeries("../elder/elder_reference.pvd") | ||
|
||
# %% [markdown] | ||
# Next, the data at the 1st time step is read: | ||
|
||
# %% | ||
mesh_t0 = mesh_series.mesh(1).slice(normal="y") | ||
|
||
# %% [markdown] | ||
# and at the last one: | ||
|
||
# %% | ||
mesh_tend = mesh_series.mesh(-1).slice(normal="y") | ||
|
||
# %% [markdown] | ||
# ### Plotting results | ||
# | ||
# The concentration and pressure at the beginning of the simulation are shown in the figures below. | ||
|
||
# %% | ||
fig_t0_si = ogs.plot.contourf(mesh_t0, si, vmin=0) | ||
plt.show() | ||
|
||
# %% | ||
fig_t0_p = ogs.plot.contourf(mesh_t0, pressure) | ||
plt.show() | ||
|
||
# %% [markdown] | ||
# The concentration and pressure at the end of the simulation are shown in the figures below. | ||
|
||
# %% | ||
fig_tend_si = ogs.plot.contourf(mesh_tend, si, vmin=0) | ||
plt.show() | ||
|
||
# %% | ||
fig_tend_p = ogs.plot.contourf(mesh_tend, pressure) | ||
plt.show() | ||
|
||
|
||
# %% [markdown] | ||
# ### Animate results | ||
# | ||
# Down below the results are shown in an animated plot | ||
|
||
|
||
# %% | ||
def mesh_func(mesh: ogs.Mesh) -> ogs.Mesh: | ||
"Slice 2D mesh out of 3D mesh" | ||
return mesh.slice("y", [0, 0, 0]) | ||
|
||
|
||
def plot_func(ax: plt.Axes, timevalue: float) -> None: | ||
"Add the time to the title." | ||
ax.set_title(f"{timevalue/(365.25*86400):.1f} yrs", loc="center") | ||
|
||
|
||
# %% | ||
anim = mesh_series.animate( | ||
si, | ||
mesh_series.timevalues(), | ||
mesh_func=mesh_func, | ||
plot_func=plot_func, | ||
) | ||
HTML(anim.to_jshtml()) | ||
|
||
# %% [markdown] | ||
# ### Compare simulation results OGS-5 vs. OGS-6 | ||
# | ||
# Here, we compare numerical results of OGS-6 to those of OGS-5. | ||
# Settings of both simulators were chosen to be as identical as possible. | ||
# Simulation times were and for $3300 s$ OGS-6 and $7800 s$ OGS-5, respectively. | ||
|
||
# %% | ||
Image(url="../elder/elder.gif") | ||
|
||
# %% [markdown] | ||
# ## Literature | ||
# | ||
# <!-- vale off --> | ||
# | ||
# Diersch, H.-J.G., Kolditz, O., 1998. Coupled groundwater flow and transport: 2. Thermohaline and 3D convection systems. Adv. Water Resour. 21, 401–425. doi:10.1016/S0309-1708(97)00003-1. | ||
# | ||
# Elder, J.W., 1965. Numerical experiments with free convection in a vertical slot. J. Fluid Mech. 24, 823. doi:10.1017/S0022112066001022. | ||
# | ||
# Elder, J., Simmons, C., Diersch, H.-J., Frolkovič, P., Holzbecher, E., Johannsen, K., 2017. The Elder Problem. Fluids 2, 11. doi:10.3390/fluids2010011. | ||
# | ||
# Graf, T., Degener, L., 2011. Grid convergence of variable-density flow simulations in discretely-fractured porous media. Adv. Water Resour. 34, 760–769. doi:10.1016/j.advwatres.2011.04.002. | ||
# | ||
# Guo, W., Langevin, C.D., 2002. User`s Guide to SEAWAT: A computer program for simulation of three-dimensional variable-density ground-water flow, USGS Techniques of Water Resources Investigations. ISBN: 0607992573. | ||
# | ||
# Johannsen, K., 2003. On the Validity of the Boussinesq Approximation for the Elder Problem. Comput. Geosci. 7, 169–182. doi:10.1023/A:1025515229807. | ||
# | ||
# Kolditz, O., Görke, U.-J., Shao, H., Wang, W., 2012. Thermo-Hydro-Mechanical-Chemical Processes in Porous Media: Benchmarks and Examples, Lecture notes in computational science and engineering. Springer. ISBN: 3642271766. | ||
# | ||
# Musuuza, J.L., Attinger, S., Radu, F.A., 2009. An extended stability criterion for density-driven flows in homogeneous porous media. Adv. Water Resour. 32, 796–808. doi:10.1016/j.advwatres.2009.01.012. | ||
# | ||
# H.-J.G. Diersch, O. Kolditz, 2002,Variable-density flow and transport in porous media: approaches and challenges,Advances in Water Resources.25, 899-944,do:10.1016/S0309-1708(02)00063-5. | ||
# | ||
# Elder, John W., Craig T. Simmons, Hans-Jörg Diersch, Peter Frolkovič, Ekkehard Holzbecher, and Klaus Johannsen. 2017. "The Elder Problem" Fluids 2, no. 1: 11. https://doi.org/10.3390/fluids2010011 | ||
# | ||
# <!--vale on --> | ||
|
||
# %% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
48 changes: 0 additions & 48 deletions
48
web/content/docs/benchmarks/hydro-component/elder/index.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ .Inner }} |