Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ makedocs(
"Forward Euler (2D)" => "man/examples/ForwardEuler_DC.md", # Checked!
"Gaussian Diffusion (2D)" => "man/examples/GaussianDiffusion2D.md", # Checked!
"Poisson Problem (2D)" => "man/examples/PoissonRestest.md", # Checked!
"Poisson Problem; variable k (2D)" => "man/examples/PoissonVariablek.md",
"Poisson Problem; variable k (2D)" => "man/examples/PoissonVariablek.md", # Checked!
],
"Advection Equtaion" => Any[
"Advection (2D)" => "man/examples/Advection2D.md", # Checked!
Expand All @@ -54,7 +54,7 @@ makedocs(
"Channel Flow (1D)" => "man/examples/ChannelFlow1D.md", # Checked!
"Falling Block Benchmark" => "man/examples/FallingBlockBenchmark.md", # Checked!
"Falling Block" => "man/examples/FallingBlockDC.md", # Checked!
"Rayleigh Taylor Instability (RTI)" => "man/examples/RTI.md",
"Rayleigh Taylor Instability (RTI)" => "man/examples/RTI.md", # Checked!
"RTI - Growth Rate" => "man/examples/RTI_growth_rate.md",
"Viscous Inclusion" => "man/examples/ViscousInclusion.md",
],
Expand Down
14 changes: 7 additions & 7 deletions docs/src/man/examples/PoissonVariablek.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Poisson Problem (variable $k$)](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/examples/DiffusionEquation/2D/Poisson_variable_k.jl)

This examples solves the steady-state, 2-D temperature equation, i.e. a Poisson equation, assuming a variable thermal conductivity $k$.
This example solves the steady-state 2-D temperature equationi.e., the Poisson equationassuming a variable thermal conductivity $k$.

For more details on the model setup and the physics or the numerical scheme, please see the [exercise](https://github.com/GeoSci-FFM/GeoModBox.jl/blob/main/exercise/04_2D_Diffusion_Stationary.ipynb) or the [documentation](../DiffTwoD.md)

Expand Down Expand Up @@ -30,7 +30,7 @@ P = (
# ----------------------------------------------------------------------- #
```

Now, one needs the set up the grid and its coordinates.
Next, define the grid and its coordinates.

```Julia
# Numerische Parameter -------------------------------------------------- #
Expand Down Expand Up @@ -60,7 +60,7 @@ y = (
# ----------------------------------------------------------------------- #
```

Dirichlet boudnary condition are assumed on all sides.
Dirichlet boundary conditions are applied on all sides.

```Julia
# Boundary conditions --------------------------------------------------- #
Expand All @@ -72,7 +72,7 @@ BC = (
# ----------------------------------------------------------------------- #
```

In addition to the temperature and the heat source one needs to define two fields for the thermal conductivity, one for the horizontal and one for the vertical conductivity. The heat source and conductivity need to be assinged to the corresponding nodes.
In addition to temperature and heat source terms, two fields must be defined for thermal conductivityone for the horizontal and one for the vertical components. The heat source and thermal conductivity must be assigned to their corresponding grid nodes.

```Julia
# Initialcondition ------------------------------------------------------ #
Expand All @@ -96,7 +96,7 @@ D.ky[x.c.<P.L/2.0,:] .= P.k2
# ----------------------------------------------------------------------- #
```

To solve the linear system of equations, one needs to define the coefficient matrix and its degree of freedom and initialized the right-hand side vector.
To solve the linear system of equations, define the coefficient matrix, determine the degrees of freedom, and initialize the right-hand side vector.

```Julia
# Linear System of Equations -------------------------------------------- #
Expand All @@ -107,15 +107,15 @@ rhs = zeros(ndof)
# ----------------------------------------------------------------------- #
```

Now, all parameter are defined and one can solve the linear system of equations using the function ```Poisson2D!()```.
With all parameters defined, the linear system can now be solved using the function ```Poisson2D!()```.

```Julia
# Solve equation -------------------------------------------------------- #
Poisson2D!(D.T, D.Q, D.kx, D.ky, Δ.x, Δ.y, NC, BC, K, rhs, Num )
# ----------------------------------------------------------------------- #
```

Finally, one can plot the steady-state solution of the temperature conservation equation and, for clarity, the different thermal conductivities.
Finally, the steady-state temperature solution is visualized along with the horizontal and vertical thermal conductivity fields for comparison.

```Julia
# Plot solution --------------------------------------------------------- #
Expand Down
24 changes: 12 additions & 12 deletions docs/src/man/examples/RTI.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This example demonstrates the transient behavior of a well-known problem in geodynamics: the Rayleigh–Taylor instability (RTI) in a two-layered system with different densities and viscosities. The script presents the setup and dynamic evolution of an RTI, which is also used in another script within `GeoModBox.jl` to benchmark the solution of the momentum equation under purely density-driven conditions.

The RTI setup consists of two horizontally oriented layers, each with specified thickness, viscosity, and density. No-slip boundary conditions are applied at the top and bottom, and symmetric velocity boundary conditions at the lateral boundaries. If the boundary between the layers is uneven, e.g., like a sinusoidal perturbation, the system becomes instable. The more buoyant lower layer is rising and the less buoyant upper layer is sinking, while the velocities are enhancing with time until a stable layering is reached again.
The RTI model consists of two horizontally layered materials, each characterized by specified thickness, viscosity, and density. No-slip boundary conditions are applied at the top and bottom, and symmetric velocity boundary conditions at the lateral boundaries. If the interface between the layers is perturbed (e.g., sinusoidally), the system becomes unstable. The more buoyant lower layer rises while the denser upper layer sinks, with velocities increasing over time until a new stable configuration is reached.

The initial growth rate of the instability is primarily governed by the density contrast between the layers, as well as the wavelength and amplitude of the perturbation. This can be estimated analytically. A benchmark example therefore is given in an [additional script](./RTI_growth_rate.md).
The initial growth rate of the instability is mainly controlled by the density contrast, as well as the perturbation’s wavelength and amplitude. This can be estimated analytically. A benchmark example therefore is given in an [additional script](./RTI_growth_rate.md).

In the following, the focus lies on setting up the RTI instability using tracers, solving the momentum equation, and advecting the phase field.

Expand Down Expand Up @@ -34,7 +34,7 @@ Ini = (p=:RTI,) # Set RTI
# ------------------------------------------------------------------- #
```

The following paramers are required for visalization.
The following parameters are used for visualization.

```Julia
# Plot Settings ===================================================== #
Expand Down Expand Up @@ -98,7 +98,7 @@ y = merge(y,y1)
# -------------------------------------------------------------------- #
```

Now, the physical parameter of the two layers can be defined.
Next, define the physical parameters for the two layers.

```Julia
# Physics ============================================================ #
Expand Down Expand Up @@ -128,7 +128,7 @@ filename = string(Ini.p,"_ηr_",round(ηᵣ),
# ------------------------------------------------------------------- #
```

The problem does not consider the solution of the energy equation and thus one needs to initialize less data fields. The momentum equation is solved using the defect correction method. Therefore the strain rate and stress components are requirerd as well.
Since the energy equation is not solved, fewer data fields need to be initialized. The momentum equation is solved using the defect correction method. Therefore the strain rate and stress components are requirerd as well.

```Julia
# Allocation ======================================================== #
Expand Down Expand Up @@ -163,7 +163,7 @@ divV = zeros(Float64,NC...)
# ------------------------------------------------------------------- #
```

As velocity boundary condition, noslip is defined at the top and bottom and freeslip on the sides.
No-slip velocity boundary conditions are applied at the top and bottom, and free-slip conditions along the lateral boundaries.

```Julia
# Boundary Conditions =============================================== #
Expand All @@ -174,7 +174,7 @@ VBC = (
# ------------------------------------------------------------------- #
```

The parameters are set arbitrarily to a maximum iteration of 50. This enables the rise of multiple dikes without reaching a full overturn of the system.
The number of time steps is arbitrarily limited to a maximum of 50 iterations. This enables the rise of multiple dikes without reaching a full overturn of the system.

```Julia
# Time ============================================================== #
Expand Down Expand Up @@ -257,7 +257,7 @@ FPt = zeros(Float64,NC...)
# ------------------------------------------------------------------- #
```

No, one can start the time loop.
Now, the time loop can be started.

```Julia
# Time Loop ========================================================= #
Expand All @@ -270,7 +270,7 @@ for it = 1:T.itmax
Time[it]/(60*60*24*365.25)/1.0e6)
```

To solve the momentum equation an initial guess is provided to solve for the residuals. Using the defect correction method, the coefficient matrix needs to be assembed to calculate the correction term for the initial guess.
An initial guess is provided for the momentum equation, and residuals are computed iteratively. Within the defect correction method, the coefficient matrix is assembled to calculate the correction term for the initial guess.

```Julia
# Momentum Equation ===
Expand Down Expand Up @@ -299,7 +299,7 @@ To solve the momentum equation an initial guess is provided to solve for the res
# --------------------------------------------------------------- #
```

For visualization purposes, the centroid velocity is calculated. The density, marker distribution, absolut velocity and centroid viscosity is plotted for certain time steps. Depending on the parameter `save_fig` the plot is displayed or stored to generate a gif animation.
For visualization, the centroid velocity field is computed. The density, marker distribution, absolut velocity and centroid viscosity is plotted for certain time steps. Depending on the parameter `save_fig` the plot is displayed or stored to generate a gif animation.

```Julia
# --------------------------------------------------------------- #
Expand Down Expand Up @@ -361,7 +361,7 @@ For visualization purposes, the centroid velocity is calculated. The density, ma
end
```

Since only the momentum and mass conservation euqations are solved, the maximum time step is fully governed by the *Courant* criterium.
Since only the momentum and mass conservation equations are solved, the maximum time step is fully governed by the *Courant* criterium.

```Julia
# Calculate Time Stepping ---
Expand Down Expand Up @@ -406,4 +406,4 @@ end

![RTI_transient](../../assets/RTI_ηr_-6.0_tracers_DC.gif)

**Figure 1. Rayleigh–Taylor Instability.** Transient evolution of a two-layered system with a density contrast of 100 kg/m³ and a viscosity contrast spanning six orders of magnitude. Panels show: density (top left), tracer distribution (top right), centroid viscosity (bottom left), and absolute centroid velocity (bottom right).
**Figure 1. Rayleigh–Taylor Instability.** Transient evolution of a two-layer system with a density contrast of 100 kg/m³ and a viscosity contrast spanning six orders of magnitude. Panels show: density (top left), tracer distribution (top right), centroid viscosity (bottom left), and absolute centroid velocity (bottom right).
Loading