Skip to content

Commit ec03bad

Browse files
author
Lukas Fuchs
committed
update docs
1 parent 2d8c300 commit ec03bad

File tree

3 files changed

+52
-86
lines changed

3 files changed

+52
-86
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The **Geod**ynamic **Mod**elling Tool**Box** is a julia package mainly used for
77
2) [**momentum**](./docs/src/man/MomentumMain.md),
88
3) [**mass** and **compositon**](./docs/src/man/AdvectMain.md).
99

10-
The ```GeoModBox.jl``` includes a series of [exercises](/exercises/) and [examples](/examples/) of different geodynamically well defined problems. The exercises are given as Jupyter notebooks for the students to complete. The theoretical background and detailed explenations of the examples and functions are mainly given in the [documentation](https://lukasfuchs.github.io/GeoModBox.jl/).
10+
The ```GeoModBox.jl``` includes a series of [exercises](/exercises/) and [examples](/examples/) of different geodynamically well defined problems. The exercises are given as Jupyter notebooks for the students to complete. The solutions of the exercises are available upon request. The goal of the course is to teach the students the advantages and disadvantages of certain finite difference scheme, to combine different solution techniques and to finally build a two-dimensional, thermal convection model. The theoretical background and detailed explenations of the examples and functions are mainly given in the [documentation](https://geosci-ffm.github.io/GeoModBox.jl/).
1111

1212
<!--
1313
- Different properties can be advected!
@@ -28,28 +28,27 @@ The ```GeoModBox.jl``` includes a series of [exercises](/exercises/) and [exampl
2828
- Defect correction
2929
-->
3030

31-
## Structure
31+
<!-- ## Structure
3232
33-
<!-- The ```GeoModBox.jl``` is -->
33+
The ```GeoModBox.jl``` is a two-dimensional, staggered, finite difference code to solve the governing equations for certain geodynamical problems (so far, only for linear viscous problems). One can use the solvers for the *temperature*, *momentum*, and *mass* equations seperately or couple them using a so-called *operator splitting* method.
3434
35-
<!-- ## Initial Conditions -->
35+
In any case, first, one needs to setup the specific model parameters, that is the geometry (xmin,xmax,ymin,ymax), the grid (e.g., nc, nv, $\Delta$), and the physical constants (e.g., $\rho$, $\eta$).
3636
37-
<!---
38-
- Set Up, Geometry, Grid, etc.
39-
- IniTemperature, IniVelocity, IniPhase,
40-
- Tracer Initialization
41-
- Solution of Stokes equation, Diffusion equation, Advection Equation,
42-
- ...
43-
-->
37+
Second, one needs to allocate the array of each needed variable. Third, one needs to define the boundary conditions and the initial time stepping. Before the time loop, one also needs to initialize the tracers and the parameters for the system of equations. Some initial conditions (temperature, density, velocity) can be setup, either via the marker funktion ```IniTracer2D()``` or the functions located in 2Dini.jl.
4438
45-
<!-- ## Scaling -->
39+
Within the time loop, one first solves the *momentum* equation, followed by the reevaluation of the time step. Second, one solves the *advection* part of the *temperature equation*, followed by its *diffusion* part. All figures can either be stored for certain time steps or as *gif* animations of the entire problem.
4640
41+
For more details on how to use the different functions, please see the [examples](./examples/), [exercises](./exercises/), and [documentation](https://geosci-ffm.github.io/GeoModBox.jl/).
42+
-->
43+
<!-- ## Scaling -->
4744

4845
## [Benchmarks and Examples](./examples/)
4946

47+
In the following, some highlights of the ```GeoModBox.jl``` are shown. For more details on the examples and benchmarks, please see the [documentation](https://geosci-ffm.github.io/GeoModBox.jl/).
48+
5049
### [Gaussian Temperature Diffusion](./examples/DiffusionEquation/2D/Gaussian_Diffusion.jl)
5150
<img src="./examples/DiffusionEquation/2D/Results/Gaussian_Diffusion_CNA_nx_100_ny_100.gif" alt="drawing" width="600"/> <br>
52-
**Figure 1. Gaussian Diffusion.** Time-dependent, diffusive solution of a 2-D Gaussian temperature anomaly using the [Crank-Nicholson approach](./src/HeatEquation/CNA.jl) in comparison to its analytical solution. Top Left: 2-D temperature field of the numerical solution and isotherms lines of the numerical (solid black) and analytical (dashed yellow) solution. Top Right: Total deviation to the analytical solution. Bottom Left: 1-D y-profile along x=0. Bottom Right: Root Mean Square total devation of the temperature over time.
51+
**Figure 1. Gaussian Diffusion.** Time-dependent, diffusive solution of a 2-D Gaussian temperature anomaly using the [Crank-Nicholson approach](./src/HeatEquation/2Dsolvers.jl) in comparison to its analytical solution. Top Left: 2-D temperature field of the numerical solution and isotherms lines of the numerical (solid black) and analytical (dashed yellow) solution. Top Right: Total deviation to the analytical solution. Bottom Left: 1-D y-profile along x=0. Bottom Right: Root Mean Square total devation of the temperature over time.
5352

5453
<img src="./examples/DiffusionEquation/2D/Results/Gaussian_ResTest.png" alt="drawing" width="600"/> <br>
5554
**Figure 2. Resolution test.** Maximum *RMS* $\varepsilon$, maximum, and mean temperature for each **FD**-scheme and multiple resolutions.
@@ -61,7 +60,7 @@ The ```GeoModBox.jl``` includes a series of [exercises](/exercises/) and [exampl
6160
<img src="./examples/AdvectionEquation/Results/2D_advection_circle_RigidBody_tracers_100_100_nth_1.gif" alt="drawing" width="300"/>
6261
<br>
6362

64-
**Figure 3. Rigid-Body-Rotation.** Time-dependent solution of a rotating circular temperature anomaly using the **upwind (first)**, **semi-lagrangian (second)**, and **tracer (third)** method. Within a circular area of our model domain the velocity is set to the velocity of a rigid rotation and outside euqal to zero. The temperature is scaled by the maximum temperature of the anomaly.
63+
**Figure 3. Rigid-Body-Rotation.** Time-dependent solution of a rotating circular temperature anomaly using the **upwind (first)**, **semi-lagrangian (second)**, and **tracer (third)** method. Within a circular area of our model domain the velocity is set to the velocity of a rigid rotation and outside euqal to zero. The temperature is scaled by the maximum temperature of the anomaly. Empty cells are not refilled with markers.
6564

6665
### [Falling Block](./examples/StokesEquation/2D/FallingBlockBenchmark.jl)
6766

@@ -79,8 +78,8 @@ The ```GeoModBox.jl``` includes a series of [exercises](/exercises/) and [exampl
7978

8079
<!--
8180
- Blanckenbach
82-
- Channel Flow
83-
- Falling Block
81+
- Channel Flow (2D)
82+
- Falling Block, check!
8483
- Gauss Diffusion, check!
8584
- RTI
8685
- Rigid Body Rotation, check!

docs/src/index.md

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,54 @@
11
# GeoModBox.jl
22

33
The **Geod**ynamic **Mod**elling Tool**Box** is a julia package mainly used for teaching purposes. The package provides different finite difference, staggered, discretization schemes to numerically solve the governing equations for a two-dimensional geodynamic problem. The governing equations are the conservation equations of
4+
45
1) [**energy**](./man/DiffMain.md),
56
2) [**momentum**](./man/MomentumMain.md),
67
3) [**mass** and **compositon**](./man/AdvectMain.md).
78

8-
The ```GeoModBox.jl``` includes a series of [exercises](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/) and [examples](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/) of different geodynamically well defined problems. The exercises are given as Jupyter notebooks for the students to complete. The theoretical background is mainly given here in the documentation.
9-
10-
------------------
11-
12-
## Staggered Finite Difference
9+
The ```GeoModBox.jl``` includes a series of [exercises](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/exercises/) and [examples](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/) of different geodynamically well defined problems. The exercises are given as Jupyter notebooks for the students to complete. The theoretical background is mainly given here in the documentation.
1310

14-
------------------
11+
## [Staggered Finite Difference](./man/GESolution.md)
1512

16-
## [Energy Conservation Equation](./man/DiffMain.md)
13+
To properly solve the governing equations, a staggered finite difference scheme is choosen for the *energy* and *momentum* equations. A staggered grid enables a correct, straight forward implementation of certain boundary conditions and enables the conservation of stress between the nodes in case of a variable viscosity. This also requires that certain parameters are defined on different grids.
1714

18-
In geodynamics, the energy is described by the temperature and needs to be conserved within a closed system. Here, we solve the *temperature conservation equation*, or *temperature equation*, using an operator splitting method, that is, we first solve the *advective* part of the *temperature equation*, followed by the *diffusive* part.
15+
Here, the temperature, density, pressure are defined on the *centroids*, ... are defined on the *vertices*, the velocities are defined in between the *vertices*, and the viscosity is needed on both.
1916

20-
------------------
17+
For more details on how this is used in the ```GeoModBox.jl``` see [here](./man/GESolution.md).
2118

22-
### [Heat Diffusion Equation](./man/DiffOneD.md)
19+
## Energy Conservation Equation
2320

24-
The ```GeoModBox.jl``` provides different finite difference (**FD**) schemes (e.g., [forward](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/ForwardEuler.jl) and [backward](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/BackwardEuler.jl) Euler, [Crank-Nicholson approach](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/CNA.jl), [ADI](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/ADI.jl)) to solve the *diffusive part* of the time-dependent or steady-state *temperature equation* including radioactive heating, in [1-D](./man/DiffOneD.md) and [2-D](./man/DiffTwoD.md). The solvers are located in [src/HeatEquation](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/). So far, only *Dirichlet* and *Neumann* thermal boundary conditions are available. Currently, most of the functions assume constant thermal parameters (except for the 1-D solvers).
21+
In geodynamics, the energy is described by the temperature and needs to be conserved within a closed system. Here, we solve the *temperature conservation equation*, or *temperature equation*, using an *operator splitting* method, that is, we first solve the *advective* part of the *temperature equation*, followed by the *diffusive* part.
2522

26-
The examples of solving the *heat diffusion equation* include, amongst others:
27-
- the determination of an [oceanic](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/1D/OceanicGeotherm_1D.jl) and [continental](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/1D/ContinentalGeotherm_1D.jl) 1-D geotherm profile,
28-
- [a comparison of the different **FD**-schemes applied on a 1-D gaussian temperature anomaly](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/1D/Heat_1D_discretization.jl),
29-
- [a 2-D resolution test for each **FD**-scheme using a gaussian temperature anomaly](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/2D/Gaussian_Diffusion.jl), and
30-
- [a resolution test for a 2-D poisson problem](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/2D/Poisson_ResTest.jl).
23+
### [Heat Diffusion Equation](./man/DiffMain.md)
3124

32-
For more examples see the [example folder](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/).
33-
34-
The [exercises](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/) include solving
35-
- the 1-D diffusion equation using the [forward](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/02_1D_Heat_explicit.ipynb) and [backward](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/03_1D_Heat_implicit.ipynb) Euler methods,
36-
- [a 2-D poisson problem](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/04_2D_Diffusion_Stationary.ipynb), and
37-
- a time-dependent temperature distribution within the lithosphere assuming a [plume](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/05_2D_Diffusion_TD_Plume.ipynb) or [sill](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/05_2D_Diffusion_TD_Sill.ipynb).
25+
The ```GeoModBox.jl``` provides different finite difference (**FD**) schemes to solve the *diffusive part* of the time-dependent or steady-state *temperature equation* including radioactive heating, in [1-D](./man/DiffOneD.md) and [2-D](./man/DiffTwoD.md). The solvers are located in [src/HeatEquation](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/src/HeatEquation/). So far, only *Dirichlet* and *Neumann* thermal boundary conditions are available. Most of the functions assume constant thermal parameters (except for the 1-D solvers and the 2-D defect correction solver).
3826

3927
### [Heat Advection Equation](./man/AdvectMain.md)
4028

41-
To solve the *advective part* of the *temperature equation*, the ```GeoModBox.jl``` provides the following different methods:
42-
- an upwind scheme,
43-
- the staggered -leaped frog scheme,
44-
- a semi-lagrangian advection, and
45-
- passive tracers/markers.
46-
47-
The solvers for a the tracer advection method are located in [src/Tracers](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/Tracers/), where the remaining advection routines are located in [src/AdvectionEquation](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/AdvectionEquation/). The routines are structured in such a way, that any property, as long as the property is defined on the *centroids* including *ghost nodes* on all boundaries, can be advected with the first **three** advection methods listed above. Using passive tracers, one can, so far, choose to either advect the temperature or phases. In case of advecting phases, one can define a certain rheology ($\eta$) or density ($\rho$) associated to each phase. The phase ID is used to interpolate the corresponding property from the tracers to the *centroids*.
48-
49-
A key aspect for the advection equation is the conservation of the **amplitude** and the **shape** of an anomaly. Depending on the method, numerical diffusion or interpolation effects lead to strong deviations of the initial anomaly. For more details see [here](./man/AdvectMain.md). The ```GeoModBox.jl``` contains several [routines](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/InitialCondition/2Dini.jl) to setup a certain initial anomaly, either for properties defined on their correspondig grid (i.e., temperature, velocity, or phase) or for tracers advecting (so far) a certain temperature or phase. Within the examples and the exercise one can choose different initial temperature and velocity conditions.
50-
51-
The examples for a two dimensional advection problem include:
52-
- [a 2-D advection, assuming a constant velocity field (e.g., a rigid body rotation)](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/AdvectionEquation/2D_Advection.jl), and
53-
- [a resolution test of the same advection example](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/AdvectionEquation/2D_Advection_ResolutionTest.jl).
54-
55-
The exercises include a:
56-
- [1-D advection of a gaussian or block anomaly](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/06_1D_Advection.ipynb), and
57-
- [a 2-D advection coupled with the solution of the diffusion equation](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/exercises/07_2D_Energy_Equation.ipynb).
58-
59-
------------------
29+
The ```GeoModBox.jl``` provides different methods to advect certain properties within the model domain. The corresponding routines are structured in such a way, that any property can be advected with the described advection solvers, as long as the property is defined on the *centroids* including *ghost nodes* at all boundaries. Using passive tracers, one can, so far, choose to either advect the absolute temperature or the phase ID.
6030

6131
## [Momentum Conservation Equation](./man/MomentumMain.md)
6232

63-
------------------
64-
6533
## Code Structure
6634

6735
### Initial Conditions
6836

6937
### Scaling
7038

71-
------------------
72-
------------------
73-
## [Benchmarks and Examples](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/)
39+
## [Benchmarks and Examples](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/)
7440

75-
### [Gaussian Temperature Diffusion](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/DiffusionEquation/2D/Gaussian_Diffusion.jl)
41+
### [Gaussian Temperature Diffusion](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/DiffusionEquation/2D/Gaussian_Diffusion.jl)
7642

7743
![GaussianDiffusion](./assets/Gaussian_Diffusion_CNA_nx_100_ny_100.gif)
7844

79-
**Figure 1. Gaussian Diffusion.** Time-dependent, diffusive solution of a 2-D Gaussian temperature anomaly using the [Crank-Nicholson approach](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/src/HeatEquation/CNA.jl) in comparison to its analytical solution. Top Left: 2-D temperature field of the numerical solution and isotherms lines of the numerical (solid black) and analytical (dashed yellow) solution. Top Right: Total deviation to the analytical solution. Bottom Left: 1-D y-profile along x=0. Bottom Right: Root Mean Square total devation of the temperature over time.
45+
**Figure 1. Gaussian Diffusion.** Time-dependent, diffusive solution of a 2-D Gaussian temperature anomaly using the [Crank-Nicholson approach](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/src/HeatEquation/CNA.jl) in comparison to its analytical solution. Top Left: 2-D temperature field of the numerical solution and isotherms lines of the numerical (solid black) and analytical (dashed yellow) solution. Top Right: Total deviation to the analytical solution. Bottom Left: 1-D y-profile along x=0. Bottom Right: Root Mean Square total devation of the temperature over time.
8046

8147
![GDResTest](./assets/Gaussian_ResTest.png)
8248

8349
**Figure 2. Resolution test.** Maximum *RMS* $\varepsilon$, maximum, and mean temperature for each **FD**-scheme and multiple resolutions.
8450

85-
### [Rigid-Body-Rotation](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/AdvectionEquation/2D_Advection.jl)
51+
### [Rigid-Body-Rotation](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/AdvectionEquation/2D_Advection.jl)
8652

8753
![RigidBodyI](./assets/2D_advection_circle_RigidBody_upwind_100_100_nth_1.gif)
8854

@@ -92,7 +58,7 @@ The exercises include a:
9258

9359
**Figure 3. Rigid-Body-Rotation.** Time-dependent solution of a rotating circular temperature anomaly using the **upwind (first)**, **semi-lagrangian (second)**, and **tracer (third)** method. Within a circular area of our model domain the velocity is set to the velocity of a rigid rotation and outside euqal to zero. The temperature is scaled by the maximum temperature of the anomaly.
9460

95-
### [Falling Block](https://github.com/LukasFuchs/GeoModBox.jl/blob/main/examples/StokesEquation/2D/FallingBlockBenchmark.jl)
61+
### [Falling Block](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/StokesEquation/2D/FallingBlockBenchmark.jl)
9662

9763
![FallingBlockTD](./assets/Falling_block_ηr_0.0_tracers.gif)
9864

0 commit comments

Comments
 (0)