version 4.2 authored by Udo Ziegler's avatar Udo Ziegler
......@@ -1574,16 +1574,16 @@ by definition of the following macros:
| `TUSR(rho,eth)` | temperature |
| `ETUSR(rho,eth)` | thermal energy density |
The macros are in general functions of the mass density $\varrho$
(`rho`) and thermal energy density $\varepsilon$ (`eth`). It are
The macros are in general functions of the mass density 𝜚 (`rho`)
and thermal energy density *ε* (`eth`). It are
declared in the header file `nirvanaUser.h`. In order to give an
example, the following code fragment (taken from `nirvanaUser.h` in
testproblem `/nirvana/testproblems/GRAVITY/problem4`) illustrates the
definition of a barotropic EOS of the form
$p(\varrho)=a^2\varrho \left[1+(\varrho/\varrho_0)^{4/3}\right]^{1/2}$
*p*(𝜚) = *a*<sup>2</sup>𝜚\[1+(𝜚/𝜚<sub>0</sub>)<sup>4/3</sup>\]<sup>1/2</sup>
with $a=200$ and $\varrho_0=10^{-10}$.
with *a*=200 and 𝜚<sub>0</sub>=10<sup>−10</sup>.
#define PUSR(rho,eth) (40000.*(rho)*sqrt(1.+pow((rho)/1.e-10,4./3.))+0*(eth))
#define CS2USR(rho,eth) (40000.*sqrt(1.+pow((rho)/1.e-10,4./3.)) \
......@@ -1592,10 +1592,10 @@ with $a=200$ and $\varrho_0=10^{-10}$.
#define TUSR(rho,eth) (MOK*_C.mean_molecular_weight*PUSR(rho,eth)/rho)
#define ETUSR(rho,eth) (PUSR(rho,eth)/(_C.gamma-1.))
Since $p$ solely depends on $\varrho$ the energy density parameter `eth`
Since *p* solely depends on 𝜚 the energy density parameter `eth`
is irrelevant is this case. The `ETUSR` definition makes use of the
prior definition of `PUSR` and assumes the usual caloric EOS with ratio
of specific heats $\gamma$ (code variable `_C.gamma`). A barotropic EOS
of specific heats *γ* (code variable `_C.gamma`). A barotropic EOS
is consistent with solving no energy equation.
**Important:** If an energy equation is solved together with an analytic
......@@ -1616,19 +1616,19 @@ An analytic EOS is enabled by appropriately choosing the parameter
NIRVANA also permits the implementation of a tabulated EOS. However, the
procedure is more involved and requires the creation of look-up tables
for the logarithm of pressure, $\log p$, and logarithm of temperature,
$\log T$, both as functions of the logarithm of mass density $\varrho$
and the logarithm of thermal energy density $\varepsilon$. The look-up
tables for a prescribed $(\log\varrho, \log\varepsilon)$-range are
generated by cubic interpolation from user-specified data
$\{(\log p)_{ij}\}$ and $\{(\log T)_{ij}\}$ on an rectilinear mesh
$\{(\log\varrho)_i\}\times\{(\log\varepsilon)_j\}$, $i=0,{\tt n1}-1$ and
$j=0,{\tt n2}-1$ with `n1`$\times$`n2` the number of mesh points.
for the logarithm of pressure, log *p*, and logarithm of temperature,
log *T*, both as functions of the logarithm of mass density log 𝜚
and the logarithm of thermal energy density *ε*.
The look-up tables for a prescribed (log 𝜚, log *ε*)-range
are generated by cubic interpolation from user-specified data
{(log *p*)<sub>*ij*</sub>} and ({(log *T*)<sub>*ij*</sub>})
on an rectilinear mesh {(log 𝜚)<sub>*i*</sub>} × {(log *ε*)<sub>*j*</sub>},
*i*=0,n1-1 and *j*=0,n2-1, with n1 × n2 the number of mesh points.
Data for the look-up tables has to be defined in the function
`eosTabPressureUser()` in module `eosTabPressureUser.c` for $\log p$,
`eosTabPressureUser()` in module `eosTabPressureUser.c` for log *p*,
and in the function `eosTabTemperatureUser()` in module
`eosTabTemperatureUser.c` for $\log T$.
`eosTabTemperatureUser.c` for log *T*.
In both, `eosTabPressureUser()` and `eosTabTemperatureUser()`, the user
must assign and return a structure of type `UTAB` (declared in header
......@@ -1646,7 +1646,7 @@ Denoting by `ut` an instance of `UTAB` the structure is accessed by
Here is an example how to code `eosTabPressureUser()` taken from
testproblem `/nirvana/testproblem/MHD/problem1B` which provides data for
the standard EOS of caloric type, $p=(\gamma -1)\varepsilon$, in
the standard EOS of caloric type, *p*=(*γ* − 1)*ε*, in
tabulated form:
UTAB eosTabPressureUser(void)
......@@ -1713,14 +1713,14 @@ tabulated form:
First, the number of mesh points, `ut.n1` and `ut.n2`, in
$\log\varrho$-direction and $\log\varepsilon$-direction is set. It
follows the range \[`ut.u1_lo`,`ut.u1_up`\] for $\log\varrho$ and
\[`ut.u2_lo`,`ut.u2_up`\] for $\log\varepsilon$, respectively. Then, the
2D array `ut.dt2` is allocated and $\{(\log p)_{ij}\}$ data is assigned.
`ut` is returned and used by the code to finally create the look-up
table `_TABLP`. Actually, `_TABLP` is a (global) pointer of struct type
`TAB` (declared in the header file `tabular.h`) and represents the
tabulated EOS $\log p(\log\varrho,\log\varepsilon)$. Correspondingly,
coding `eosTabTemperatureUser()` for $\log T$ would provide the input
follows the range \[`ut.u1_lo`,`ut.u1_up`\] for log 𝜚 and
\[`ut.u2_lo`,`ut.u2_up`\] for log *ε*, respectively. Then, the
2D array `ut.dt2` is allocated and {(log *p*)<sub>*ij*</sub>}
data is assigned. `ut` is returned and used by the code to finally create
the look-up table `_TABLP`. Actually, `_TABLP` is a (global) pointer of
struct type `TAB` (declared in the header file `tabular.h`) and represents
the tabulated EOS log *p*(log 𝜚, log *ε*). Correspondingly,
coding `eosTabTemperatureUser()` for log *T* would provide the input
for the look-up table `_TABLT`. `_TABLP` and `_TABLT` are used in the
code function `TDeos()` in module `utilTD.c`.
......
......