Cold electron density

The density of (free) cold electrons is tracked with the unknown n_cold. This parameter can either be prescribed or calculated self-consistently.


Unless explicitly specified, the cold electron density is evolved self-consistently.

Prescribed evolution

The cold electron density can be prescribed in time and space using the method setPrescribedData().


The following example illustrates how to prescribe the cold electron density in a DREAM simulation:

ds = DREAMSettings()
r = np.linspace(r0, r1, nr)
t = np.linspace(t0, t1, nt)

# Generate density profiles
n = np.array([...])      # shape (nt, nr)

# Prescribe cold electron density
ds.eqsys.n_cold.setPrescribedData(density=n, radius=r, times=t)

A constant and uniform density can also be prescribed with the more compact syntax

ds = DREAMSettings()

Self-consistent evolution

When evolved self-consistently, the cold electron density is obtained from the electron conservation equation

\[n_{\rm cold} = n_{\rm free} - n_{\rm hot} - n_{\rm RE},\]

where \(n_{\rm free}\) is the density of free electrons, \(n_{\rm hot}\) is the density of electrons on the hot electron grid (if enabled) and \(n_{\rm RE}\) is the density of runaway electrons. To evolve the cold electrons self-consistently, use the option ColdElectrons.TYPE_SELFCONSISTENT.


The following example illustrates how to evolve the cold electron density self-consistently in a DREAM simulation:

import DREAM.Settings.Equations.ColdElectrons as ColdElectrons

ds = DREAMSettings()

Class documentation

class DREAM.Settings.Equations.ColdElectrons.ColdElectrons(settings, ttype=2, density=None, radius=None, times=None)

Bases: DREAM.Settings.Equations.UnknownQuantity.UnknownQuantity, DREAM.Settings.Equations.PrescribedParameter.PrescribedParameter, DREAM.Settings.Equations.PrescribedScalarParameter.PrescribedScalarParameter

__init__(settings, ttype=2, density=None, radius=None, times=None)



Set all options from a dictionary.


data (dict) – List of settings to load.

setPrescribedData(density, radius=0, times=0)

Prescribe the cold electron density in time and space.

  • density – Cold electron density (2D array (nt, nr) or scalar (=> constant and uniform in time and space))

  • radius – Radial grid on which the cold electron density is defined.

  • times – Time grid on which the cold electron density is defined.


Sets the type of equation to use for evolving the cold electron density.


ttype (int) – Flag indicating how to evolve the cold electron density.


Returns a Python dictionary containing all settings of this ColdElectrons object.


Verify that the settings of this unknown are correctly set.


Verify that the prescribed has a valid format.