Changes
Page history
version 4.2
authored
Oct 29, 2025
by
Udo Ziegler
Hide whitespace changes
Inline
Side-by-side
3-NIRVANA-user-guide/3.2-User-interfaces.md
View page @
856925ee
...
...
@@ -168,7 +168,7 @@ possible values or a numeric range.
- `_C.freq_ana`: interval in units of timesteps at which the user
interface function `analysisUser()` is called for user-specific
analysis tasks (cf. [Data analysis](3.
3-Output-data#d
ata-analysis)).
analysis tasks (cf. [Data analysis](3.
5-D
ata-analysis)).
- `_C.freq_walltime`: interval in seconds at which the special
snapshot `NIRLAST.#` (cf. [Snapshot files](3.3-Output-data#snapshot-files)) is
...
...
@@ -297,14 +297,14 @@ possible values or a numeric range.
$u_o=u_i$ for the perpendicular magnetic field component.
- `R`: reflection-on-axis (only of relevance in cylindrical
geometry at the $y$-lower boundary
(
at $R=0$
)
or in
spherical geometry at the $y$-lower/upper boundaries
(
at
$\theta=0,\pi$
)
) -- reflecting conditions at the geometric
geometry at the $y$-lower boundary at $R=0$ or in
spherical geometry at the $y$-lower/upper boundaries at
$\theta
=0,\pi
$) -- reflecting conditions at the geometric
axis. Same as M except for the azimutal magnetic field
component for which $u_o=-u_i$.
- `C`: reflection-at-center (only of relevance in spherical
geometry at the $x$-lower boundary
(
at $r=0$)
)
-- reflecting
geometry at the $x$-lower boundary at $r=0$) -- reflecting
conditions at the coordinate center. Same as M except for
the non-radial magnetic field components for which
$u_o=-u_i$.
...
...
@@ -316,9 +316,9 @@ possible values or a numeric range.
(pseudo-vacuum condition) for the magnetic field.
- `F`: free boundary (only of relevance in cylindrical
geometry at the $y$-lower boundary
(
at $R=0$
)
or in
spherical geometry at the $y$-lower/upper boundaries
(
at
$\theta=0,\pi$
)
and $x$-lower boundary
(
at $r=0$)
)
--
geometry at the $y$-lower boundary at $R=0$ or in
spherical geometry at the $y$-lower/upper boundaries at
$\theta
=0,\pi$ and $x$-lower boundary at $r=0$) --
'natural' boundary condition at the geometric axis. Boundary
values are not set explictely but are implicitly given by
$\pi$-shifted values. Note that when a `F`-type boundary
...
...
@@ -400,13 +400,13 @@ possible values or a numeric range.
value `_C.amr_exp>1` (`_C.amr_exp<1`) means that mesh refinement
becomes progressively more difficult (easier) with increasing
refinement level compared to the standard linear dependence
(`_C.amr_exp=1`) (cf. [AMR](#adaptive-mesh-refinement)).
(`_C.amr_exp=1`) (cf. [AMR](
3.1-Code-basics
#adaptive-mesh-refinement)).
-
`05`
(
`_C.amr_Jeans`
,
`_C.amr_exp`
,
`_C.amr_Field`
)
- `_C.amr_Jeans` (typical value: $0.2$): threshold in the
Jeans-length-based mesh refinement criterion (cf.
[AMR](#adaptive-mesh-refinement)). The value `_C.amr_Jeans`
[AMR](
3.1-Code-basics
#adaptive-mesh-refinement)). The value `_C.amr_Jeans`
defines the fraction of local Jeans length to be resolved by one
grid cell. A zero or negative value means that the
Jeans-length-based criterion is disabled.
...
...
@@ -426,7 +426,7 @@ possible values or a numeric range.
- `_C.amr_Field` (typical value: $0.2$): threshold in the
Field-length-based mesh refinement criterion (cf.
[AMR](#adaptive-mesh-refinement)). The value `_C.amr_Field`
[AMR](
3.1-Code-basics
#adaptive-mesh-refinement)). The value `_C.amr_Field`
defines the fraction of the local Field length to be resolved by
one grid cell. A zero or negative value means that the
Field-length-based criterion is disabled.
...
...
@@ -603,7 +603,7 @@ possible values or a numeric range.
given by the parameter `_C.diffusion_coeff` described below. U
enables Ohmic diffusion with a user-defined magnetic diffusion
coefficient as coded in the user interface function
**
diffusionCoeffUser()
**
. (cf. [Ohmic
`
diffusionCoeffUser()
`
. (cf. [Ohmic
diffusion](#ohmic-diffusion)). N disables Ohmic diffusion.
- `_C.diffusion_coeff`: constant magnetic diffusion coefficient.
...
...
@@ -646,7 +646,7 @@ possible values or a numeric range.
coefficient given by the parameter `_C.APdiffusion_coeff`
described below. U enables ambipolar diffusion with a
user-defined anbipolar diffusion coefficient as coded in the
user interface function
**
APdiffusionCoeffUser()
**
(cf.
user interface function
`
APdiffusionCoeffUser()
`
(cf.
[Ambipolar diffusion](#user-defined-coefficient-for-ambipolar-diffusion)).
N disables ambipolar diffusion.
...
...
@@ -800,7 +800,7 @@ The module `configUser.c` serves as user interface for the definition of
initial conditions (IC). To do this the user must program the function
`configUser()`
in the module. Defining IC means assigning values to
primary physical variables on the mesh, that are
$
\{\v
arrho,
\m
athbf{m},e,
\m
athbf{B},C_
\m
c,n_
\m
s
\}
$ -- gas density,
$
\{\v
arrho,
\m
athbf{m},e,
\m
athbf{B},C_c,n_s
\}
$ -- gas density,
momentum,total energy density, magnetic field, tracer
($c=0,{
\t
t
\_
C.tracer}-1$), species number densities
($s=0,{
\t
t
\_
C.species}-1$). The parameter
`_C.tracer`
(
`_C.species`
)
...
...
@@ -819,7 +819,7 @@ considered as primary variables and must be assigned by the user. The
parameter
`_C.testfields`
denotes the number of testfields.
**Important:**
In case magnetic field splitting is enabled (cf.
[
Code
features
](
#code-features
)
) the variable $
\m
athbf{B}$ represents the
features
](
3.1-Code-basics
#code-features
)
) the variable $
\m
athbf{B}$ represents the
residual magnetic field, i.e., total field minus background field. In
addition, $e$ represents the residual total energy density, i.e, has a
magnetic energy density contribution solely from the residual magnetic
...
...
@@ -843,7 +843,7 @@ il=0,`_C.level`, and all its superblocks:
}
Please recall in this context the introduction to NIRVANA's
[
Mesh data
structure
](
#mesh-data-structure
)
.
structure
](
3.1-Code-basics
#mesh-data-structure
)
.
There are two types of mesh variables: cell-averaged variables and
face-averaged variables. Cell-averaged variables are
...
...
@@ -944,7 +944,7 @@ divergence-free setup:
**(I)**
Explicit computation of cell-face-averaged magnetic field
components by exact integration of given analytical expressions. For a
grid cell (
,,
) on superblock
`g`
the discretized components would then
grid cell (
ix,iy,iz
) on superblock
`g`
the discretized components would then
read
$$
\m
athtt{g->bx
[
iz
][
iy
]
[ix]}=
\f
rac{1}{
\d
elta
\m
athcal{A}_x}
\i
nt
\l
imits_
\m
athtt{g->y[iy]}^
\m
athtt{g->y[iy+1]}
...
...
@@ -957,8 +957,8 @@ $$\mathtt{g->bz[iz][iy][ix]}=\frac{1}{\delta \mathcal{A}_z}\int
\i
nt
\l
imits_
\m
athtt{g->y[iy]}^
\m
athtt{g->y[iy+1]} B_z(x,y,
\m
athtt{g->z[iz]})h_ydxdy$$
where the numerical expressions for the cell faces are:
| cell face
| expression |
|:-------------------
--
|:-----------------------------------------|
| cell face | expression |
|:-------------------|:-----------------------------------------|
|
*δ*
𝒜
<sub>
*x*
</sub>
|
`g->hyh[ix]*g->hyh[ix]*g->dvy[iy]*g->dz`
|
|
*δ*
𝒜
<sub>
*y*
</sub>
|
`g->dax[ix]*g->hzyh[iy]*g->dz`
|
|
*δ*
𝒜
<sub>
*z*
</sub>
|
`g->dax[ix]*g->dy`
|
...
...
@@ -982,21 +982,21 @@ integral form of $\mathbf{B}=\nabla\times \mathbf{A}$:
where the difference operators $
\D
elta_{ix}$, $
\D
elta_{iy}$ and
$
\D
elta_{iz}$ are given by
$
\D
elta_{ix}X=X(
\m
athtt{i
x+1
,iy,i
z
})-X(
\m
athtt{i
x
,iy,i
z
})$,
$
\D
elta_{ix}X=X(
\m
athtt{i
z
,iy,i
x+1
})-X(
\m
athtt{i
z
,iy,i
x
})$,
$
\D
elta_{iy}X=X(
\m
athtt{i
x
,iy+1,i
z
})-X(
\m
athtt{i
x
,iy,i
z
})$,
$
\D
elta_{iy}X=X(
\m
athtt{i
z
,iy+1,i
x
})-X(
\m
athtt{i
z
,iy,i
x
})$,
$
\D
elta_{iz}X=X(
\m
athtt{i
x
,iy,i
z
+1})-X(
\m
athtt{i
x
,iy,i
z
})$
$
\D
elta_{iz}X=X(
\m
athtt{i
z
,iy,i
x
+1})-X(
\m
athtt{i
z
,iy,i
x
})$
and $(
\h
at{A}_x,
\h
at{A}_y,
\h
at{A}_z)$ are the cell-edge integrals
$$
\h
at{A}_x(
\m
athtt{i
x
,iy,i
z
})=
\i
nt
\l
imits_
\m
athtt{g->x[ix]}^
\m
athtt{g->x[ix+1]}
$$
\h
at{A}_x(
\m
athtt{i
z
,iy,i
x
})=
\i
nt
\l
imits_
\m
athtt{g->x[ix]}^
\m
athtt{g->x[ix+1]}
A_x(x,
\m
athtt{g->y[iy]},
\m
athtt{g->z[iz]})dx$$
$$
\h
at{A}_y(
\m
athtt{i
x
,iy,i
z
})=
\i
nt
\l
imits_
\m
athtt{g->y[iy]}^
\m
athtt{g->y[iy+1]}
$$
\h
at{A}_y(
\m
athtt{i
z
,iy,i
x
})=
\i
nt
\l
imits_
\m
athtt{g->y[iy]}^
\m
athtt{g->y[iy+1]}
A_y(
\m
athtt{g->x[ix]},y,
\m
athtt{g->z[iz]})dy$$
$$
\h
at{A}_z(
\m
athtt{i
x
,iy,i
z
})=
\i
nt
\l
imits_
\m
athtt{g->z[iz]}^
\m
athtt{g->z[iz+1]}
$$
\h
at{A}_z(
\m
athtt{i
z
,iy,i
x
})=
\i
nt
\l
imits_
\m
athtt{g->z[iz]}^
\m
athtt{g->z[iz+1]}
A_z(
\m
athtt{g->x[ix]},
\m
athtt{g->y[iy]},z)dz$$
The $
\h
at{A}$'s are usually easier to compute than the face-averaged
...
...
@@ -1025,7 +1025,7 @@ for two problems: the Orszag-Tang vortex problem (example 1) and a
shock-cloud interaction problem (example 2).
**Example 1**
(taken from
`/nirvana/testproblems/MHD/problem2`
; cf.
[@Z04
])
\[
[
Z04
](
#references
)
\
]
)
IC for the Orszag-Tang vortex problem simulated in a doubly-periodic
square domain of length $L$ (given by
`_C.up[0]-_C.lo[0]`
):
...
...
...
...