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.

Note

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().

Example

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()
...
ds.eqsys.n_cold.setPrescribedData(density=2e19)

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.

Example

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()
...
ds.eqsys.n_cold.setType(ColdElectrons.TYPE_SELFCONSISTENT)

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)

Constructor.

fromdict(data)

Set all options from a dictionary.

Parameters

data (dict) – List of settings to load.

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

Prescribe the cold electron density in time and space.

Parameters
  • 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.

setType(ttype)

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

Parameters

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

todict()

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

verifySettings()

Verify that the settings of this unknown are correctly set.

verifySettingsPrescribedData()

Verify that the prescribed has a valid format.