Skip to content

Commit 60fa350

Browse files
ArturYeritsyanDanielDoehringranocha
authored
add docstrings for 1D ideal multicomponent glm-mhd equations (#2642)
* add docstrings for 1D ideal multicomponent glm-mhd equations * Apply suggestions from code review * small addition * added docstrings for 2D ideal glm-mhd multicomponent equations --------- Co-authored-by: Daniel Doehring <[email protected]> Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent af2d1f9 commit 60fa350

File tree

2 files changed

+91
-2
lines changed

2 files changed

+91
-2
lines changed

src/equations/ideal_glm_mhd_multicomponent_1d.jl

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,45 @@
88
@doc raw"""
99
IdealGlmMhdMulticomponentEquations1D
1010
11-
The ideal compressible multicomponent GLM-MHD equations in one space dimension.
11+
The ideal compressible multicomponent GLM-MHD equations
12+
```math
13+
\frac{\partial}{\partial t}
14+
\begin{pmatrix}
15+
\rho v_1 \\ \rho v_2 \\ \rho v_3 \\ \rho e \\ B_1 \\ B_2 \\ B_3 \\ \rho_1 \\ \vdots \\ \rho_{n}
16+
\end{pmatrix}
17+
+
18+
\frac{\partial}{\partial x}
19+
\begin{pmatrix}
20+
\rho v_1^2 + p + \frac{1}{2} \Vert \mathbf{B} \Vert_2 ^2 - B_1^2 \\ \rho v_1 v_2 - B_1 B_2 \\ \rho v_1 v_3 - B_1 B_3
21+
\\ (\frac{1}{2} \rho \Vert \mathbf{v} \Vert_2 ^2 + \frac{\gamma p}{\gamma - 1} + \Vert \mathbf{B} \Vert_2 ^2) v_1 - B_1 (\mathbf{v} \cdot \mathbf{B})
22+
\\ 0 \\ v_1 B_2 - v_2 B_1 \\ v_1 B_3 - v_3 B_1 \\ \rho_1 v_1 \\ \vdots \\ \rho_{n} v_1
23+
\end{pmatrix}
24+
=
25+
\begin{pmatrix}
26+
0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ \vdots \\ 0
27+
\end{pmatrix}
28+
```
29+
for calorically perfect gases in one space dimension.
30+
Here, ``\rho_i`` is the density of component ``i``, ``\rho=\sum_{i=1}^n\rho_i`` the sum of the individual ``\rho_i``,
31+
``\mathbf{v}`` the velocity, ``\mathbf{B}`` the magnetic field, ``e`` the specific total energy **rather than** specific internal energy, and
32+
```math
33+
p = (\gamma - 1) \left( \rho e - \frac{1}{2} \rho \Vert \mathbf{v} \Vert_2 ^2 - \frac{1}{2} \Vert \mathbf{B} \Vert_2 ^2 \right)
34+
```
35+
the pressure,
36+
```math
37+
\gamma=\frac{\sum_{i=1}^n\rho_i C_{v,i}\gamma_i}{\sum_{i=1}^n\rho_i C_{v,i}}
38+
```
39+
total heat capacity ratio, ``\gamma_i`` heat capacity ratio of component ``i``,
40+
```math
41+
C_{v,i}=\frac{R_i}{\gamma_i-1}
42+
```
43+
specific heat capacity at constant volume of component ``i``.
44+
45+
In case of more than one component, the specific heat ratios `gammas` and the gas constants
46+
`gas_constants` should be passed as tuples, e.g., `gammas = (1.4, 1.667)`.
47+
48+
The remaining variables like the specific heats at constant volume `cv` or the specific heats at
49+
constant pressure `cp` are then calculated considering a calorically perfect gas.
1250
"""
1351
struct IdealGlmMhdMulticomponentEquations1D{NVARS, NCOMP, RealT <: Real} <:
1452
AbstractIdealGlmMhdMulticomponentEquations{1, NVARS, NCOMP}

src/equations/ideal_glm_mhd_multicomponent_2d.jl

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,58 @@
88
@doc raw"""
99
IdealGlmMhdMulticomponentEquations2D
1010
11-
The ideal compressible multicomponent GLM-MHD equations in two space dimensions.
11+
The ideal compressible multicomponent GLM-MHD equations
12+
```math
13+
\frac{\partial}{\partial t}
14+
\begin{pmatrix}
15+
\rho \mathbf{v} \\ \rho e \\ \mathbf{B} \\ \psi \\ \rho_1 \\ \vdots \\ \rho_{n}
16+
\end{pmatrix}
17+
+
18+
\nabla \cdot
19+
\begin{pmatrix}
20+
\rho (\mathbf{v} \otimes \mathbf{v}) + (p + \frac{1}{2} \Vert \mathbf{B} \Vert_2 ^2) \underline{I} - \mathbf{B} \otimes \mathbf{B} \\
21+
\mathbf{v} (\frac{1}{2} \rho \Vert \mathbf{v} \Vert_2 ^2 + \frac{\gamma p}{\gamma - 1} + \Vert \mathbf{B} \Vert_2 ^2) - \mathbf{B} (\mathbf{v} \cdot \mathbf{B}) + c_h \psi \mathbf{B} \\
22+
\mathbf{v} \otimes \mathbf{B} - \mathbf{B} \otimes \mathbf{v} + c_h \psi \underline{I} \\
23+
c_h \mathbf{B} \\ \rho_1 \mathbf{v} \\ \vdots \\ \rho_{n} \mathbf{v}
24+
\end{pmatrix}
25+
+
26+
(\nabla \cdot \mathbf{B})
27+
\begin{pmatrix}
28+
\mathbf{B} \\ \mathbf{v} \cdot \mathbf{B} \\ \mathbf{v} \\ 0 \\ 0 \\ \vdots \\ 0
29+
\end{pmatrix}
30+
+
31+
(\nabla \psi) \cdot
32+
\begin{pmatrix}
33+
0 \\ \mathbf{v} \cdot \psi \\ 0 \\ \mathbf{v} \\ \mathbf{0} \\ \vdots \\ \mathbf{0}
34+
\end{pmatrix}
35+
=
36+
\begin{pmatrix}
37+
\mathbf{0} \\ 0 \\ \mathbf{0} \\ 0 \\ 0 \\ \vdots \\ 0
38+
\end{pmatrix}
39+
```
40+
for calorically perfect gases in two space dimensions.
41+
Here, ``\rho_i`` is the density of component ``i``, ``\rho=\sum_{i=1}^n\rho_i`` the sum of the individual ``\rho_i``,
42+
``\mathbf{v}`` the velocity, ``\mathbf{B}`` the magnetic field, ``c_h`` the hyperbolic divergence cleaning speed,
43+
``\psi`` the generalized Lagrangian Multiplier (GLM),
44+
``e`` the specific total energy **rather than** specific internal energy, and
45+
```math
46+
p = (\gamma - 1) \left( \rho e - \frac{1}{2} \rho \Vert \mathbf{v} \Vert_2 ^2 - \frac{1}{2} \Vert \mathbf{B} \Vert_2 ^2 - \frac{1}{2} \psi^2 \right)
47+
```
48+
the pressure,
49+
```math
50+
\gamma=\frac{\sum_{i=1}^n\rho_i C_{v,i}\gamma_i}{\sum_{i=1}^n\rho_i C_{v,i}}
51+
```
52+
total heat capacity ratio, ``\gamma_i`` heat capacity ratio of component ``i``,
53+
```math
54+
C_{v,i}=\frac{R_i}{\gamma_i-1}
55+
```
56+
specific heat capacity at constant volume of component ``i`` and ``\underline{I}`` the ``2\times 2`` identity matrix.
57+
58+
In case of more than one component, the specific heat ratios `gammas` and the gas constants
59+
`gas_constants` should be passed as tuples, e.g., `gammas = (1.4, 1.667)`.
60+
61+
The remaining variables like the specific heats at constant volume `cv` or the specific heats at
62+
constant pressure `cp` are then calculated considering a calorically perfect gas.
1263
"""
1364
struct IdealGlmMhdMulticomponentEquations2D{NVARS, NCOMP, RealT <: Real} <:
1465
AbstractIdealGlmMhdMulticomponentEquations{2, NVARS, NCOMP}

0 commit comments

Comments
 (0)