Newsletter #7, April 2025
With many members of the DREAM developer council occupied with thesis and paper writing in the past few months, progress in this last period has been relatively slow, with contributions dominated by bug fixes. Several new developments are underway however, which should appear on the master branch later this year.
The DREAM Developer Council
Latest DREAM release: version 25.4
I. New features
i. Runaway ionization rate as other quantity
by Mathias Hoppe
A number of OtherQuantity
s have been introduced which provide information
on the number density of electrons created by the different runaway electron
impact ionization source terms. Specifically, the new quantities are
fluid/reioniz_rate
: Rate at which the cold electron density is increased due to runaway electron impact ionization, as used in fluid mode.fluid/reioniz_vsigma
: Electron speed times the ionization cross-section for fast-electron impact ionization, as used in fluid mode.hottail/kinioniz_rate
: Rate at which the cold electron density is increased due to runaway electron impact ionization, resulting from interactions withf_hot
.hottail/kinioniz_vsigma
: Electron speed times the ionization cross-section for fast-electron impact ionization, evaluated on the hottail grid.runaway/kinioniz_rate
: Rate at which the cold electron density is increased due to runaway electron impact ionization, resulting from interactions withf_re
.runaway/kinioniz_vsigma
: Electron speed times the ionization cross-section for fast-electron impact ionization, evaluated on the runaway grid.
These quantities are also listed in the online documentation.
These quantities were added in pull request #405 and are now available on master.
ii. Runaway ionization scale factor
by Mathias Hoppe
An arbitrary scaling factor has been added to the runaway electron impact ionization cross-section. The default value of this scale factor is 1, corresponding the cross-section as described in the DREAM paper and Hoppe et al (2025). The scaling factor can be used to study the impact of weaker or stronger coupling between the runaway electrons and the background electrons.
This feature was added in pull request #417 and is now available on master.
II. Bug fixes
i. Memory deallocation bug in IonSourceTerm
by Mathias Hoppe
A bug was discovered in the implementation of the IonSourceTerm
, which can
be used to add ions of any species and charge state at the edge of the plasma,
according to an arbitrary function of time. Due to an error in the C++
implementation, if particle sources for multiple species were added, the
code would crash at the very final deallocation stage of the simulation
(occurring even after the output has been saved). The problem was that all
instances of the IonSourceTerm
in the C++ code used the same
MultiInterpolator1D
for the source function, and all tried to deallocate the
memory for this object. After the first IonSourceTerm
had deallocated this
object, the next term which tried to deallocate it would fail with a
segmentation fault as a result.
The fix now implemented was to construct one MultiInterpolator1D
object for
each IonSourceTerm
(one for each species). While this will occupy somewhat
more memory, this memory usage should be negligible and avoids a more
significant restructuring of the C++ code.
This bug was fixed in pull request #412 and is now available on master.
ii. Use different ‘expint()’ function
by Björn Zaar
It was discovered that some recent versions of the Apple LLVM compiler did
not implement the C++ standard function expint()
, presumably because it was
added with the C++23 standard (the double
version). To resolve this, the
call to expint()
made in the plasmoid drift module of the code was replaced
with a call to the corresponding GSL function. Subsequent full-simulation tests
confirmed that the GSL routine functioned exactly like the C++ standard
function.
Since DREAM was originally developed to conform to the C++17 standard, avoiding C++23 functionality is consistent with previous development decisions.
This bug was fixed in pull request #408 and is now available on master.
iii. Ion coronal equilibrium settings not loaded in Python interface
by Mathias Hoppe
It was discovered that settings for the initialization of ions in coronal
equilibrium were not loaded in the fromdict()
method of the Ions
class
in the Python settings interface. As a consequence, settings would not be
retained when copying DREAMSettings
objects, or loading previously saved
settings files. Appropriate loading statements were added to the
fromdict()
method to resolve this issue.
This bug was fixed in pull request #404 and is now available on master.
iv. Adjust factor in TransportCoefficientReader
by Lorenzo Votta
A factor was previously introduced in the TransportCoefficientReader
class
(tools/TransportCoefficientReader.py
) to adjust to a previously discovered
inconsistency where the reader assumed that the quantity ds.radialgrid.R0
was initialized when setting a numerical grid (this is not the case, since that
R0
is only initialized by the analytic toroidal grid). It was however
recently discovered
that the factor introduced into the TransportCoefficientReader
had
unintended effects on other parts of the code. The factor has now been removed
and should instead by applied manually to all simulations concerned.
This bug was fixed in pull request #416 and is now available on master.
v. Fix bug in Rechester-Rosenbluth coefficient for n_re
by Lorenzo Votta
A bug was discovered in the implementation of the Rechester-Rosenbluth radial transport operator for the runaway electron density. This operator is relatively recent, having only been introduced with pull request #364 in January 2025 (see Newsletter #6 for more details). The bug consisted in the magnetic perturbation amplitude, , only appearing linearly, instead of quadratically as prescribed by the RR theory.
This bug was fixed in pull request #422 and is now available on master.