Changes
Page history
version 4.2
authored
Oct 30, 2025
by
Udo Ziegler
Hide whitespace changes
Inline
Side-by-side
3-NIRVANA-user-guide/3.2-User-interfaces.md
View page @
688c4ed7
...
...
@@ -1445,9 +1445,6 @@ below category PHYSICS SPECIFICATIONS.
### User-defined coefficient for ambipolar diffusion
The module
`APdiffusionCoeffUser.c`
serves as template for a
user-defined ambipolar diffusion coefficient.
Ambipolar diffusion enters the induction equation and energy equation as
a field contribution given by
...
...
@@ -1455,8 +1452,7 @@ a field contribution given by
where
*η*
<sub>
*AD*
</sub>
in units
\[
V⋅m⋅A
<sup>
−1
</sup>
⋅T
<sup>
−2
</sup>
\]
denotes the ambipolar diffusion coefficient.
The prefactor
* *
η
*<sub>*
AD
*</sub>/*
μ
*
has units
The prefactor
*η*
<sub>
*AD*
</sub>
/
*μ*
has units
m
<sup>
2
</sup>
⋅s
<sup>
−1
</sup>
⋅T
<sup>
−2
</sup>
.
A user-defined coefficients,
*η*
<sub>
*AD*
</sub>
,
...
...
@@ -1490,8 +1486,8 @@ found in testproblem `/nirvana/testproblems/APDIFF/problem1`.
### User-defined body force
The module
`forceUser.c`
serves as template for a user-defined
*specific*
body force
$
\m
athbf{f}$
(force per mass in units
N$
\c
dot$kg$^{-1}$).
The body force enters the momentum equation and
*specific*
body force
**f**
(force per mass in units
N⋅kg
<sup>
−1
</sup>
).
The body force enters the momentum equation and
energy equation as source term.
A user body force has to be defined in the function
...
...
@@ -1526,12 +1522,13 @@ be found in testproblem `/nirvana/testproblems/MHD/problem21`.
The modules
`sourceCoolingUser.c`
and
`sourceHeatingUser.c`
serve as
templates for coding a user-defined cooling function,
$L_
\m
athrm{cool}
\l
e 0$, and heating function, $L_
\m
athrm{heat}
\g
e 0$,
respectively. Both functions are allowed to depend on temperature $T$
and density $
\v
arrho$. The net heatloss, i.e. the sum
$L_
\m
athrm{cool}(T,
\v
arrho)+L_
\m
athrm{heat}(T,
\v
arrho)$, enters as
source term in the energy equation. $L_
\m
athrm{cool}$ and
$L_
\m
athrm{heat}$ are measured in units J$
\c
dot$s$^{-1}
\c
dot$m$^{-3}$.
*L*
<sub>
*cool*
</sub>
≤0, and heating function,
*L*
<sub>
*heat*
</sub>
≥0,
respectively. Both functions are allowed to depend on temperature
*T*
and density 𝜚. The net heatloss, i.e. the sum
*L*
<sub>
*cool*
</sub>
(
*T*
,𝜚)+
*L*
<sub>
*heat*
</sub>
(
*T*
,𝜚), enters as
source term in the energy equation.
*L*
<sub>
*cool*
</sub>
and
*L*
<sub>
*heat*
</sub>
are measured
in units J⋅s
<sup>
−1
</sup>
⋅m
<sup>
−3
</sup>
.
User-defined cooling/heating rates are to be defined in the functions
...
...
@@ -1541,11 +1538,10 @@ User-defined cooling/heating rates are to be defined in the functions
taking arguments
`T`
, the temperature,
`rho`
, the gas density, the
pointer
`deriv`
, a flag to tell the calling function whether the user
provides the derivatives $
\p
artial L_
\m
athrm{cool}
\p
artial
\v
arrho$,
$
\p
artial L_
\m
athrm{cool}
\p
artial T$ to be stored in the 2-element
vector
`dfc[0], dfc[1]`
and the derivatives
$
\p
artial L_
\m
athrm{heat}
\p
artial
\v
arrho$,
$
\p
artial L_
\m
athrm{heat}
\p
artial T$ to be stored in the 2-element
provides the derivatives ∂
*L*
<sub>
*cool*
</sub>
/∂𝜚,
∂
*L*
<sub>
*cool*
</sub>
/∂
*T*
to be stored in the 2-element
vector
`dfc[0], dfc[1]`
and the derivatives ∂
*L*
<sub>
*heat*
</sub>
/∂𝜚,
∂
*L*
<sub>
*heat*
</sub>
/∂
*T*
to be stored in the 2-element
vector
`dfh[0], dfh[1]`
. The default value is preset to
`deriv=YES`
in
both functions. The user may avoid to explicitely calculating
derivatives by setting
`deriv=NO`
. Then, derivatives are computed by the
...
...
...
...