Newsletter #10, May 2026

The 2026 spring edition of the DREAM newsletter, and DREAM, is here. A large number of bug fixes have been implemented and we are now preparing for an eventful summer and autumn. Several major pull requests are in the pipeline and will add new, highly unique functionality to the code, including a new framework for large-angle collisions, mid-simulation equation changes, customized time stepping, and much more!

The DREAM Developer Council

Latest DREAM release: version 26.5

I. New features

i. Support for Boron

by Peter Halldestam

DREAM now includes support for boron as an impurity species. Generation of the associated data is handled through existing scripts in the DREAM/tools directory, which also enable straightforward addition of other elements.

This feature was added in pull request #488 and is now available on master.

ii. Arithmetic operations for all quantities in DREAMOutput

by Ola Embreus

Adds support for arithmetic operations on all quantities in the python output interface.

Previously, only fluid quantities and distribution functions supported arithmetic operations.

Examples of valid operations:

do.eqsys.f_hot / 10
do.eqsys.n_re / do.eqsys.n_tot

but no OtherQuantity or KineticQuantity would support it (for example do.other.fluid.pCrit / do.other.fluid.pStar would be invalid). The reason was that arithmetic operations are implemented in UnknownQuantity._operate which calls the operand’s constructor assuming the same signature as that of UnknownQuantity; this breaks because OtherQuantity has a different signature, and KineticQuantity wants a momentumgrid.

In this pull request, this is changed so that UnknownQuantity._operate calls a copy constructor qty.new_like if one of the operands implements it. Then new_like is implemented in all classes that have a deviating constructor.

This feature was added in pull request #497 and is now available on master.

iii. Export SOFT equilibrium from eqview

by Mathias Hoppe

An option to export an equilibrium in the format required SOFT was added to the eqview tool.

This feature was added in pull request #511 and is now available on master.

iv. Add support for grid object to pyface

by Mathias Hoppe

The pyface Python interface (DREAM compiled as a Python library) now allows the user to extract a complete grid object, with the same structure as in the DREAMOutput class, during a simulation. The grid object can now be retrieved during a running simulation with

grid = sim.getGrid()
print('r = ', grid.r)

This feature was added in pull request #510 and is now available on master.

v. Sheath-limited heat flux boundary condition

by Ida Ekmark

During a vertical displacement event, heat losses from the plasma to the wall should be mediated through the halo region surrounding the plasma. In this region, the heat flux is set by the free streaming of particles along the field lines. Several models for this heat flux have been derived, and specifically the model presented in Kiramov et al, 43rd EPS Conference (2016) has now been implemented in the code as the option BC_KIRAMOV.

The boundary condition can be applied in the following way:

import DREAM.Settings.TransportSettings as Transport

...
ds.eqsys.T_cold.setBoundaryCondition(Transport.BC_KIRAMOV)

This feature was added in pull request #427 and is now available on master.

II. Interface changes

i. Dedicated class for the safety factor

by Mathias Hoppe

A dedicated class SafetyFactor was added to the output interface, which is now used for the safety factor profile instead of a regular OtherFluidQuantity. This allows the safety factor to be plotted directly, instead of only as the compound quantity q*R0. To plot the safety factor directly, it is now possible to call

do.other.qR0.plotq()

This update was added in pull request #484 and is now available on master.

III. Bug fixes

i. Fix array deprecation warning

by Ola Embreus and Mathias Hoppe

In numpy >= 2.0, when doing np.array(quantity.data) a DeprecationWarning is raised because the __array__ dunder should include keyword arguments dtype and copy. To address this, copy=None (numpy-default) was added to the DataObject class in the DREAM output Python interface if version 2.0.0 or later of numpy is used, so that this warning is no longer raised.

This bug was fixed in pull requests #492 and #507 and is now available on master.

ii. Fix bug in saving of other quantity “S_tritium”

by Ola Embreus

The runaway/S_tritium other quantity was saved, assuming the same size as the hot-tail grid. This could lead to incorrect and/or garbled output of this quantity. This fix addresses this bug and ensures that the quantity is saved with the correct dimensions.

This bug was fixed in pull request #499 and is now available on master.

iii. Fix GammaAva time-index renormalization and weighted profile plotting

by Ola Embreus

This pull request fixes GammaAva.plotRunawayRate() and GammaAva.plotNormalized() for t=... / r=... selections by correcting time-index renormalization for OtherFluidQuantity (unknowns include one extra initial time point). It also updates FluidQuantity profile plotting to apply time-/radius-dependent weight arrays correctly when multiple slices are plotted, and enables the weight labels to be user-chosen.

Also fixes a bug where GammaAva.plotNormalized() multiplied with E-E_c instead of dividing by it.

This bug was fixed in pull request #504 and is now available on master.

iv. Incorrect extrapolation of shaping profiles in AnalyticB

by Mathias Hoppe

It was discovered that shaping profiles in the analytical toroidal magnetic field module were incorrectly extrapolated from the given input data. Instead of being set with the actual profile data, the method returned the corresponding values for r if asked to evaluate the profile outside of the given radial grid.

Shaping profiles which span the entire plasma were not affected by this bug.

This bug was fixed in pull request #486 and is now available on master.

v. Correct calculation of current moment of f_hot / f_re

by Ola Embreus

The current density moment (DistributionFunction.currentDensity()) was previously calculated using an incorrect parallel velocity definition, which did not use the appropriate bounce averaged expression. In this pull request this problem is fixed, and DistributionFunction.currentDensity() now yields the same current density as in the C++ kernel.

This bug was fixed in pull request #513 and is now available on master.

vi. Fix bug in line-integration of FluidQuantity

by Linn Ekman

It was found that the previously implemented lineIntegrated() method used SPI coordinates, which are shifted relative to the Cartesian coordinate system. This method has therefore been renamed to lineIntegrated_SPI(). A new lineIntegrated() method has been implemented using Cartesian coordinates, based on the LIDc implementation found here: LIDc. In addition, a new plot flag has been added. When plot=True, the line-integrated quantity is visualized.

This bug was fixed in pull request #514 and is now available on master.

vii. Fix bug in Compton source jacobian

by Ida Ekmark

A bug was discovered in the calculation of the jacobian for the kinetic Compton RE source term. Previously the fluid version of this source term would incorrectly use the same jacobian as kinetic version.

This bug was fixed in pull request #520 and is now available on master.

viii. Enable restart without hot-tail generation

by Ida Ekmark

If a first simulation is run including the fluid hot-tail simulation, and then a subsequent simulation is initialized from the output of the first, but the second simulation disables the hot-tail source term, the second simulation would refuse to save the settings with a complaint that tau_coll does not exist in the equation system. The fact that tau_coll does not exist in the second simulation should however not be a problem, since it is only used by the hot-tail source term.

In this pull request, a fix was implemented so that the hot-tail fluid source could be disabled between subsequent simulations.

This bug was fixed in pull request #521 and is now available on master.

ix. Restore behaviour of edge ion source term

by Linn Ekman

In a recent pull request, a volumetric ion source term was added. This source term utilized the existing interface for ion sources, which so far only provided an edge source term. In the implementation of the volumetric source, the interface was changed so that also the edge source term required a specification of that source in both space and time.

This fix restores the original functionality of the edge ion source term such that the user now only has to prescribe the source function in time.

This bug was fixed in pull request #522 and is now available on master.

IV. Recent publications