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
| Name | Description |
|---|---|
ESCAPE_MODELS | No description. |
Classes
| Name | Description |
|---|---|
Conditions | Plasma conditions, SI with temperatures in eV. |
RadiationTrapping | The 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
| Name | Type | Description |
|---|---|---|
electron_temperature | float | kT_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_density | float | None | n_e in m^-3, or None for quasi-neutrality,
n_e = sum z_i n_i over every charged state (evolving and
prescribed). |
eedf | Any | The electron energy distribution (an
opencr.kinetics.eedf.EEDF), or None for a Maxwellian at
electron_temperature. |
densities | Mapping[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). |
totals | Mapping[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_temperature | float | None | kT_i in eV; the gas temperature if None. |
gas_temperature | float | kT of the neutral gas in eV (0.026 eV is 300 K). |
escape | Mapping[str, float] | Escape factors in [0, 1] by reaction name, overriding the
reactions’ own and anything trapping computes. |
trapping | RadiationTrapping | None | Compute 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 = Noneelectron_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 = Noneheavy_temperatureproperty#
heavy_temperature: dict[str, float]The temperature of each kind of rate dependence (see opencr.core.rates).
quasi_neutralproperty#
quasi_neutral: boolWhether n_e follows from quasi-neutrality.
from_eedfmethodclassmethod#
def from_eedf(eedf: Any, **kwargs: Any) -> ConditionsReturn conditions with eedf and its effective temperature 2/3 <eps>.
replacemethod#
def replace(**changes: Any) -> ConditionsReturn 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
| Name | Type | Description |
|---|---|---|
length | float | The absorption length L in m (the distance to the wall). |
model | str | One of ESCAPE_MODELS. |
lines | tuple[str, ...] | None | The names of the spontaneous_emission reactions to trap, or
None for all of them. |
tolerance | float | The self-consistent iteration stops when no escape factor changes by more than this. |
max_iterations | int | The limit of that iteration. |
lengthattributeclass attributeinstance attribute#
length: float = unit_field('m')linesattributeclass attributeinstance attribute#
lines: tuple[str, ...] | None = Nonemax_iterationsattributeclass attributeinstance attribute#
max_iterations: int = 100modelattributeclass attributeinstance attribute#
model: str = 'mewe'toleranceattributeclass attributeinstance attribute#
tolerance: float = 1e-06