opencr.analysis.results
The result of a steady-state solve, and what can be read from it.
A Result keeps the model, the conditions, the rate coefficients, the
population equations and the densities of every state, with the solver’s
report. From it: the reaction fluxes and the dominant gains and losses of a
state, the lines and their photon emissivity coefficients, a synthetic
spectrum, and everything as an xarray dataset (Result.to_dataset) or a
NetCDF file with the model’s manifest (Result.export).
Classes
| Name | Description |
|---|---|
Result | A steady state. |
Resultclass#
class Result(model: Model, conditions: Conditions, rates: np.ndarray, system: PopulationSystem, evolving: np.ndarray, report: SolverReport)A steady state.
Attributes
| Name | Description |
|---|---|
model | The model solved. |
conditions | The conditions. |
rates | The rate coefficient of every reaction (SI), in network order. |
system | The population equations. |
evolving | The steady densities of the evolving states (m^-3). |
report | The solver’s report. |
conditionsattributeinstance attribute#
conditions = conditionsevolvingattributeinstance attribute#
evolving = np.asarray(evolving, dtype=float)modelattributeinstance attribute#
model = modelratesattributeinstance attribute#
rates = ratesreportattributeinstance attribute#
report = reportsystemattributeinstance attribute#
system = systemelectron_densityproperty#
electron_density: floatn_e in m^-3.
fluxespropertycached#
fluxes: dict[str, float]The rate of every reaction in m^-3 s^-1, by name.
modeproperty#
mode: strThe solve: "quasi-static" or "full".
populationspropertycached#
populations: dict[str, float]The density of every state in m^-3, by name, in network order.
reductionpropertycached#
reduction: QuasiStaticThe quasi-static reduction at these conditions (population and effective coefficients).
dominant_processesmethod#
def dominant_processes(state: str, number: int = 5) -> list[dict[str, Any]]Return the largest gains and losses of state.
Each entry has the reaction name, its equation, the rate of
change of the state (m^-3 s^-1; negative for a loss) and its fraction
of the state’s total gain or total loss. Sorted by |rate|.
emissionmethod#
def emission(air: bool = False) -> xr.DatasetReturn the lines: wavelength, emissivity and power (line_table).
emission_spectrummethod#
def emission_spectrum(wavelength: np.ndarray | None = None, fwhm: float = 0.0, air: bool = False, quantity: str = 'power') -> xr.DataArrayReturn a synthetic spectrum: the lines Doppler broadened at the gas temperature.
exportmethod#
def export(path: str | Path) -> PathWrite to_dataset to a NetCDF file and return its path.
photon_emissivity_coefficientsmethod#
def photon_emissivity_coefficients() -> xr.DataArrayReturn PEC_d of every line per driver in m^3/s (quasi-static only).
emissivity = n_e sum_d PEC_d n_d; for atomic hydrogen the H(n=1)
part is the excitation component and the H+ part the recombination one.
Numerics
pec
Assumptions:
- a quasi-static solve: ; zero for a line whose upper state is a driver
- for atomic hydrogen the H(n=1) part is the excitation component, the H part the recombination one
References:
Built from:
opencr.kinetics.effective.quasi_staticopencr.analysis.emission.line_table
populationmethod#
def population(state: str) -> floatReturn the density of state in m^-3.
to_datasetmethod#
def to_dataset() -> xr.DatasetReturn the populations, rates, fluxes and lines as one xarray dataset.
The conditions, the solver report and the model’s manifest are in the attributes, as JSON.