To evolve the ion densities and temperatures in DREAM simulations, we solve
ion rate equations which use rate coefficients from the Atomic Data and
Analysis Structure (ADAS). The necessary
coefficients are downloaded from Open-ADAS at build-time and compiled into the
source file src/ADAS/adasdata.cpp
, which is then subsequently compiled and
built into DREAM. Rate coefficients are only downloaded for a select set of
elements which are regulated through the file tools/elements.json
.
Currently, DREAM implements support for four different rate coefficients:
Signature |
Description |
---|---|
ACD |
Effective recombination coefficients |
PLT |
Line power driven by excitation of dominant ions |
PRB |
Continuum and line power driven by recombination and Bremsstrahlung of dominant ions |
SCD |
Effective ionisation coefficients |
In DREAM, the coefficients are stored numerically in static arrays declared in
src/ADAS/adasdata.cpp
(which is automatically generated by
tools/get_adas.py
during build time). During initialization of a
Simulation
, an ADAS
object is constructed. This ADAS
object in turn
constructs separate ADASRateInterpolator
objects for every element in the
DREAM ADAS subset database and for every type of rate coefficient. The job of
the ADASRateInterpolator
is to evaluate a particular ADAS rate coefficient,
for a particular element, at any given charge state, background density and
temperature. Thus, the ADAS
object (and all its ADASRateInterpolator
objects) are accessible to, for example, the IonRateEquation
equation term
during a simulation so that rate coefficients can be evaluated.
The ADASRateInterpolator
takes the ion charge state, background plasma
density (in \(\mathrm{m}^{-3}\)) and temperature (in \(\mathrm{eV}\))
as input and interpolates in the tabulated values. Prior to interpolation, the
input density and temperature are logarithmized as this is how the ADAS values
are tabulated. The coefficient tables also store the 10-logarithm of
coefficients, but the ADASRateInterpolator
appropriately exponentiates the
coefficient before returning it.
Data for the rate coefficients are not stored in the DREAM git repository.
Instead, the user will have download the necessary ADAS data while building
DREAM. This is done using the Python script tools/get_adas.py
which should
automatically be invoked when running CMake. The script downloads data for the
elements listed in tools/elements.json
and generates the file
src/ADAS/adasdata.cpp
which contains the actual coefficient data.
Adding support for new elements in the DREAM ADAS databased is fairly
straightforward and only requires you to add another entry in the file
tools/elements.json
. This file (as its name indicates) contains data in the
JSON format and generally looks
something like the following:
{
"H": "96",
"He": "96",
"Ne": "96",
"Ar": "89"
}
The key in each key-value pair gives the name of the element to download data for, while the value is a two-digit integer giving the year in which the dataset was published. The Open-ADAS database contains several sets of data for most elements and we can only pick one. Which dataset to pick can be difficult to decide, but the ADAS manual can sometimes provide some guidance. Generally, we want to pick the dataset which has the highest indicated quality and contains all the rate coefficients we need (see the table above).
Warning
In general, adding new elements to DREAM is more complicated than simply
adding them to the ADAS database. In addition to rate coefficients, data for
the mean excitation energies of ions are also needed by the
SlowingDownFrequency
object. Such data is not available in the literature
for Z>18, and is therefore not yet supported by DREAM.
The script tools/get_adas.py
can also be run manually. It has a number of
configuration options which can be listed by running ./get_adas.py --help
.