Skip to content
Projects

opencr.core.conditions

The plasma conditions of a solve.

Conditions holds everything a solve takes from outside the model: the electron temperature (and optionally a non-Maxwellian energy distribution), the electron density or quasi-neutrality, the densities of the prescribed states (the drivers and backgrounds), the element totals of a closed steady state, the heavy-particle temperatures and the radiation trapping (escape factors given per line, or a RadiationTrapping configuration they are computed from). See the guide “The CR model” for how a solve uses them.

Every physical setting takes an astropy Quantity (2 * u.eV, 1e12 * u.cm**-3), a string astropy reads ("300 K", as in a configuration file) or a bare number in its documented unit (SI, with temperatures as kT in eV), and is stored as a float in that unit; temperatures in K are converted to eV (see plasmacoll.units).

Attributes

NameDescription
ESCAPE_MODELSNo description.

Classes

NameDescription
ConditionsPlasma conditions, SI with temperatures in eV.
RadiationTrappingThe escape-factor configuration of a solve (see opencr.kinetics.radiation).

ESCAPE_MODELSattributemodule attribute#

ESCAPE_MODELS = ('mewe', 'holstein-slab', 'holstein-cylinder')

Conditionsclassdataclass#

class Conditions(electron_temperature: float = unit_field('eV'), electron_density: float | None = unit_field('m-3', None), eedf: Any = None, densities: Mapping[str, float] = unit_field('m-3', default_factory=dict), totals: Mapping[str, float] = unit_field('m-3', default_factory=dict), ion_temperature: float | None = unit_field('eV', None), gas_temperature: float = unit_field('eV', 0.026), escape: Mapping[str, float] = dict(), trapping: RadiationTrapping | None = None)

Plasma conditions, SI with temperatures in eV.

The temperatures and densities take quantities (see the module docstring): Conditions("300 K", 1e12 * u.cm**-3).

Attributes

NameTypeDescription
electron_temperaturefloatkT_e in eV. With a non-Maxwellian eedf it is the temperature of the rates that are not cross sections and of detailed balance; from_eedf sets it to 2/3 <eps>.
electron_densityfloat | Nonen_e in m^-3, or None for quasi-neutrality, n_e = sum z_i n_i over every charged state (evolving and prescribed).
eedfAnyThe electron energy distribution (an opencr.kinetics.eedf.EEDF), or None for a Maxwellian at electron_temperature.
densitiesMapping[str, float]Densities in m^-3 of the prescribed states, by name: the drivers of a quasi-static solve (e.g. H(n=1) and H+) and fixed backgrounds (e.g. H2 in an atomic model).
totalsMapping[str, float]For a closed steady state, the total density of each element in m^-3 over the evolving states, e.g. {"H": 1e19}.
ion_temperaturefloat | NonekT_i in eV; the gas temperature if None.
gas_temperaturefloatkT of the neutral gas in eV (0.026 eV is 300 K).
escapeMapping[str, float]Escape factors in [0, 1] by reaction name, overriding the reactions’ own and anything trapping computes.
trappingRadiationTrapping | NoneCompute the escape factors of the lines self-consistently from the populations (opencr.kinetics.radiation); None for an optically thin plasma (apart from escape).

densitiesattributeclass attributeinstance attribute#

densities: Mapping[str, float] = unit_field('m-3', default_factory=dict)

eedfattributeclass attributeinstance attribute#

eedf: Any = None

electron_densityattributeclass attributeinstance attribute#

electron_density: float | None = unit_field('m-3', None)

electron_temperatureattributeclass attributeinstance attribute#

electron_temperature: float = unit_field('eV')

escapeattributeclass attributeinstance attribute#

escape: Mapping[str, float] = field(default_factory=dict)

gas_temperatureattributeclass attributeinstance attribute#

gas_temperature: float = unit_field('eV', 0.026)

ion_temperatureattributeclass attributeinstance attribute#

ion_temperature: float | None = unit_field('eV', None)

totalsattributeclass attributeinstance attribute#

totals: Mapping[str, float] = unit_field('m-3', default_factory=dict)

trappingattributeclass attributeinstance attribute#

trapping: RadiationTrapping | None = None

heavy_temperatureproperty#

heavy_temperature: dict[str, float]

The temperature of each kind of rate dependence (see opencr.core.rates).

quasi_neutralproperty#

quasi_neutral: bool

Whether n_e follows from quasi-neutrality.

from_eedfmethodclassmethod#

def from_eedf(eedf: Any, **kwargs: Any) -> Conditions

Return conditions with eedf and its effective temperature 2/3 <eps>.

replacemethod#

def replace(**changes: Any) -> Conditions

Return a copy with changes applied.

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the conditions as plain data (the EEDF by its description).

RadiationTrappingclassdataclass#

class RadiationTrapping(length: float = unit_field('m'), model: str = 'mewe', lines: tuple[str, ...] | None = None, tolerance: float = 1e-06, max_iterations: int = 100)

The escape-factor configuration of a solve (see opencr.kinetics.radiation).

The length takes a quantity (see the module docstring).

Attributes

NameTypeDescription
lengthfloatThe absorption length L in m (the distance to the wall).
modelstrOne of ESCAPE_MODELS.
linestuple[str, ...] | NoneThe names of the spontaneous_emission reactions to trap, or None for all of them.
tolerancefloatThe self-consistent iteration stops when no escape factor changes by more than this.
max_iterationsintThe limit of that iteration.

lengthattributeclass attributeinstance attribute#

length: float = unit_field('m')

linesattributeclass attributeinstance attribute#

lines: tuple[str, ...] | None = None

max_iterationsattributeclass attributeinstance attribute#

max_iterations: int = 100

modelattributeclass attributeinstance attribute#

model: str = 'mewe'

toleranceattributeclass attributeinstance attribute#

tolerance: float = 1e-06

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the configuration as plain data.