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.
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()
...
ds.eqsys.n_cold.setPrescribedData(density=2e19)
When evolved self-consistently, the cold electron density is obtained from the electron conservation equation
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
.
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.
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.
setType
(ttype)¶Sets the type of equation to use for evolving the cold electron density.
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.