rizer.pipeline.run_nrp_simulation#
Helper functions for running simulations.
Attributes#
Classes#
Parsed |
Functions#
Build a |
|
|
Create a folder for the case, named |
|
Create the case folder and save its provenance files (log, inputs, mechanism, versions). |
|
Parse and validate the |
|
Resolve the |
|
Raise unless plasma's composition has seed electrons and is charge-neutral. |
|
Set plasma to |
|
Parse, validate and log the common |
Yield the (mechanism_path, phase_name) the native |
|
Build a constant-mass two-temperature plasma reactor, ready for a |
|
|
Configure a |
|
Compute the per-output-step diagnostics recorded alongside the plasma state. |
|
Run a full 2T0D constant-mass NRP discharge simulation. |
Module Contents#
- rizer.pipeline.run_nrp_simulation.logger#
- rizer.pipeline.run_nrp_simulation.build_collision_frequencies(plasma: cantera.Solution, momentum_transfer_collision_frequencies_list: list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel], n_points: int = 2000) rizer.transport.mixture_law.MixtureCollisionFrequencies#
Build a
MixtureCollisionFrequencieswrapping plasma.Also enables its collision-frequency and reverse-rate caches.
Wraps the setup every 2T0D constant-mass run script needs before running a simulation: construct the wrapper, precompute its tabulated cross-section grids (
precompute_collision_frequency_tables()), and enable the reverse-two-temperature-plasma rate grid cache (enable_reverse_two_temperature_grid_cache()) – all with the same n_points, and in the order required (both caches must be set up before the first integration step).- Parameters:
plasma (
cantera.Solution) – Cantera plasma object to wrap. Only plasma itself needs to be specific to a single run/case – see the Notes section for why momentum_transfer_collision_frequencies_list doesn’t.momentum_transfer_collision_frequencies_list (
listofMomentumTransferCollisionFrequencyModel) – Per-species momentum-transfer collision-frequency models, as built byget_momentum_transfer_collision_frequencies_list().n_points (
int, optional) – Number of grid points for both caches. Default 2000.
- Return type:
Notes
enable_reverse_two_temperature_grid_cachesets process-wide configuration, independent of plasma; calling this function once per case in a sweep (e.g.run_2T0D_sensitivity_analysis_electron_density.py) re-applies the same configuration redundantly but harmlessly. momentum_transfer_collision_frequencies_list’s models are stateless with respect to any specific plasma object (they take temperature and density as call parameters, not stored state), so the same list – computed once viaget_momentum_transfer_collision_frequencies_list()– can safely be reused across many calls to this function for different plasma objects built from the same mechanism (e.g. a sweep that only perturbs reaction-rate multipliers between cases), instead of rebuilding it (re-parsing cross-section data from disk) on every call.
- rizer.pipeline.run_nrp_simulation.create_case_folder(base_folder: str, case_name: str) pathlib.Path#
Create a folder for the case, named
{case_name}_{date}_{run_number}.date is today’s date (
YYYY-MM-DD) and run_number starts at 0 and increments to the next free integer, so multiple runs with the same case_name on the same day get their own folder automatically instead of colliding.- Parameters:
- Returns:
The path to the created case folder.
- Return type:
- rizer.pipeline.run_nrp_simulation.prepare_case_output(base_folder: str, case_name: str, input_yaml_file: str | pathlib.Path, plasma: cantera.Solution, previous_log_handler: logging.FileHandler | None = None, logger: logging.Logger | logging.LoggerAdapter | None = None) tuple[pathlib.Path, logging.FileHandler]#
Create the case folder and save its provenance files (log, inputs, mechanism, versions).
Wraps the setup every 2T0D constant-mass run script needs before calling
run_constant_mass_nrp_simulation(): create the case folder (seecreate_case_folder()), attach itsrun.logfile handler (seeadd_log_file_handler()), copy input_yaml_file and plasma’s mechanism into the case’sinputssubfolder, and record the versions of the main libraries used.- Parameters:
base_folder (
str) – Passed straight tocreate_case_folder().case_name (
str) – Passed straight tocreate_case_folder().input_yaml_file (
strorpathlib.Path) – Simulation input YAML to copy into the case’sinputssubfolder.plasma (
cantera.Solution) – Plasma object (with any reaction-rate multipliers already applied) whose mechanism is saved to the case’sinputssubfolder.previous_log_handler (
logging.FileHandlerorNone, optional) – A previous call’s returned handler to remove and close first, so a loop over many cases (e.g. the sensitivity-analysis sweep) doesn’t accumulate handlers on the root logger. Default None (nothing to remove – the common case for a single-case script).logger (
logging.Loggerorlogging.LoggerAdapterorNone, optional) – Logger used to announce therun.logpath. Default None, which uses this module’s own logger.
- Returns:
The case folder path, and the newly-added
run.loghandler (pass it back in as previous_log_handler on the next call in a loop).- Return type:
tupleofpathlib.Pathandlogging.FileHandler
- rizer.pipeline.run_nrp_simulation.get_radius_change_events(radius_changes_input: list[dict[str, float]] | None, simulation_time: float) list[tuple[float, float]]#
Parse and validate the
radius_changessection of a simulation input YAML.- Parameters:
radius_changes_input (
listofdictofstrtofloat, orNone) – Parsedradius_changesYAML section: a list of mappings, each with a"time"(in s) and a"radius"(in m) key, describing a change of the plasma radius at the given time.Noneor an empty list means the radius stays constant for the whole simulation.simulation_time (
float) – Total simulation time, in s (thesimulation.t_endthisradius_changessection is paired with). Every event’s"time"must be strictly less than this value – see the Notes section.
- Returns:
(time_of_change, new_radius)pairs, sorted by increasing time.- Return type:
- Raises:
KeyError – If an event is missing its
"time"or"radius"key.ValueError – If any
"time"or"radius"value is not strictly positive, if two events share the same"time", or if any event’s"time"is not strictly less than simulation_time.
Notes
run_constant_mass_nrp_simulationbuilds its integration segments as[0, *change_times, simulation_time]; an event whose"time"is not strictly less than simulation_time (e.g. copy-pasted from a longer-duration case) would silently make that boundary list non-monotonic, either extending the simulation past the requested duration or turning a later segment into a no-op with zero recorded output – with no error raised. Requiringtime < simulation_timehere catches that misconfiguration up front, at parse time, rather than downstream as a silent behavior change.
- class rizer.pipeline.run_nrp_simulation.CommonSimulationSetup#
Bases:
NamedTupleParsed
plasma/electric_circuit/simulationYAML sections.Bundles the fields every 2T0D constant-mass run script needs regardless of the reactor backend or any per-case reaction-rate perturbation (see
parse_common_simulation_setup()).- plasma: cantera.Solution#
Cantera plasma object (with any reaction-rate multipliers already applied).
- mechanism_path: str | pathlib.Path | None#
Cantera mechanism (YAML) path plasma was loaded from, or None if it was built dynamically (e.g. by
load_goutier2025_mechanism_with_options()) and so matches no single on-disk phase – seeresolved_cpp_mechanism().
- plasma_phase_name: str#
Cantera mechanism (YAML) phase name plasma was loaded from. Meaningless when mechanism_path is None.
- additional_number_density: str | dict[str, float] | None#
Species number densities [m^-3] added on top of mole_fractions, or None.
- pulse_duration: float | None#
Reference pulse duration, in s (Maxwellian Eq VIII-3.10 check), or None to skip that diagnostic (it is then recorded as NaN).
- circuit_input: dict[str, Any]#
electric_circuitYAML section, passed whole tobuild_circuit_from_input()(validated there).
- solver_backend: str#
cpp or python; see
build_isomass_2T_volume_reactor().
- rizer.pipeline.run_nrp_simulation.resolve_plasma_mechanism(mechanism_input: dict[str, Any]) tuple[cantera.Solution, pathlib.Path | None, str]#
Resolve the
plasma.mechanismYAML section to a Cantera plasma object.- Parameters:
mechanism_input (
dictofstrtoAny) – Theplasma.mechanismsection (option: "CH4_to_C2H2"oroption: "file", plus the matching sub-section).- Returns:
plasma (
cantera.Solution) – The loaded plasma object.mechanism_path (
pathlib.PathorNone) – On-disk mechanism path, or None if plasma was built dynamically (CH4_to_C2H2) and so matches no single on-disk phase – seeresolved_cpp_mechanism().plasma_phase_name (
str) – Cantera mechanism (YAML) phase name plasma was loaded from. Meaningless when mechanism_path is None.
- rizer.pipeline.run_nrp_simulation.check_charge_neutrality(plasma: cantera.Solution) None#
Raise unless plasma’s composition has seed electrons and is charge-neutral.
Positive charge (cations) and negative charge (electrons and anions) are compared per molecule of mixture,
sum(X_k * q_k)over each sign; they must agree to one part in 1e6 of the negative charge.- Parameters:
plasma (
cantera.Solution) – Plasma phase in the state to check.- Raises:
ValueError – No electrons in the composition, or a net charge.
- rizer.pipeline.run_nrp_simulation.apply_initial_composition(plasma: cantera.Solution, T_g: float, T_e: float, P: float, mole_fractions: str | dict[str, Any], additional_number_density: str | dict[str, Any] | None = None) None#
Set plasma to
(T_g, T_e, P)with the requested composition.mole_fractionsis the base composition (Cantera syntax).additional_number_densityadds species at absolute number densities [m^-3] on top of it, which is how a seed electron density is measured:mole_fractions: "CH4: 1.0" additional_number_density: "e-: 1.0e19, CH4+: 1.0e19" # m^-3
The base composition is scaled to \(1 - \sum_k x_k\) and each added species contributes \(x_k = n_k / N\), with \(N\) the total number density of the mixture. \(N\) itself depends on the composition through the mean molar mass and, for a two-temperature phase, through the mean temperature, so the mole fractions are found by fixed-point iteration on the phase itself: on return,
plasma.concentrationsreproduces every requested density.- Parameters:
plasma (
cantera.Solution) – Plasma phase, set in place.T_g (
float) – Heavy-species and electron temperature, in K.T_e (
float) – Heavy-species and electron temperature, in K.P (
float) – Total pressure, in Pa.mole_fractions (
strordictofstrtoAny) – Base composition, Cantera syntax.additional_number_density (
strordictofstrtoAny, optional) – Species number densities [m^-3] added on top of the base composition.
- Raises:
ValueError – Unknown or non-positive species density, additions that do not leave room for the base composition, or a fixed point that does not converge.
- rizer.pipeline.run_nrp_simulation.parse_common_simulation_setup(parsed_input: dict[str, Any], logger: logging.Logger | logging.LoggerAdapter | None = None) CommonSimulationSetup#
Parse, validate and log the common
plasma/electric_circuit/simulationsections.Every 2T0D constant-mass run script (single-case or a sensitivity sweep) needs these same fields, independently of the reactor backend or any per-case reaction-rate perturbation; this factors out that shared parsing/validation/logging so scripts don’t duplicate it.
plasma.initial_conditions.mole_fractionsis a Cantera composition (string or mapping) that already contains the seed electrons and their counter-ions, e.g."CH4: 1.0, e-: 1.4e-6, CH4+: 1.4e-6". The caller is still responsible for actually setting plasma’s state (plasma.Te,plasma.TPX = T_g_0, P_0, mole_fractions), since that differs by script (e.g. the sensitivity-analysis sweep recreates plasma once per case).- Parameters:
parsed_input (
dictofstrtoAny) – Full parsed simulation input YAML (seeparse_convert_yaml()).logger (
logging.Loggerorlogging.LoggerAdapterorNone, optional) – Logger for the parsed values. Default None, which uses this module’s own logger.
- Return type:
- rizer.pipeline.run_nrp_simulation.resolved_cpp_mechanism(plasma: cantera.Solution, mechanism_path: str | pathlib.Path | None, plasma_phase_name: str) collections.abc.Generator[tuple[str, str]]#
Yield the (mechanism_path, phase_name) the native
Reactor0Dshould load from.Reactor0Dreloads the mechanism from a YAML file path, independently of plasma’s in-memory state, so a reaction-rate multiplier applied viaplasma.set_multiplier(...)(e.g. by a sensitivity-analysis sweep) would otherwise be silently lost. If mechanism_path is not None and plasma currently has no multiplier in effect, yields (mechanism_path, plasma_phase_name) unchanged – no I/O. Otherwise writes plasma’s current state (species, reactions, and multipliers) to a temporary mechanism file and yields that instead, deleting it on exit.Pass mechanism_path=None when plasma was not loaded from a single on-disk mechanism file/phase in the first place (e.g. built by
load_goutier2025_mechanism_with_options(), which can filter/reassemble species and reactions in memory into a combination that matches no single phase in the source YAML) – there is then no valid on-disk fallback to trust, multiplier or not, so this unconditionally takes the temporary-mechanism-file path below.Used by
build_isomass_2T_volume_reactor()(resolved once per call) and byrun_constant_mass_nrp_simulation()(resolved once for the whole run and reused across every radius-change segment, since plasma’s multiplier state never changes between segments of the same run – avoiding a redundant mechanism write/parse per segment).- Parameters:
plasma (
cantera.Solution) – Cantera plasma object, whose reaction-rate multipliers (if any) must be reflected in the yielded mechanism.mechanism_path (
str,pathlib.Path, orNone) – Cantera mechanism (YAML) path to fall back to when plasma has no multiplier in effect. None if plasma has no such on-disk fallback (see above), forcing the temporary-mechanism-file path.plasma_phase_name (
str) – Cantera mechanism (YAML) phase name to fall back to when mechanism_path is not None and plasma has no multiplier in effect. Unused otherwise (the temporary-mechanism-file path uses plasma.name instead).
- Yields:
tupleofstrandstr–(mechanism_path, phase_name)to load the native reactor from.
- rizer.pipeline.run_nrp_simulation.build_isomass_2T_volume_reactor(plasma: cantera.Solution, momentum_transfer_collision_frequencies_list: list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel], mechanism_path: str | pathlib.Path | None, plasma_phase_name: str, mass: float, initial_radius: float, gap: float, electric_circuit: rizer.electrical_model.circuit.base_circuit.PlasmaVoltageCircuit, polytropic_index: float | str, p_ext: float | str, solver_backend: str = 'cpp', cpp_mechanism: tuple[str, str] | None = None, compute_chemistry: bool = True) rizer.models.nrp.isomass_2T_volume_reactor.Isomass2TVolumeReactor | rizer.models.nrp.isomass_2T_volume_reactor_cpp.Isomass2TVolumeReactor#
Build a constant-mass two-temperature plasma reactor, ready for a
cantera.ReactorNet.Thin factory choosing between the pure-Python reference reactor and the native C++-backed one, so callers (e.g.
run_constant_mass_nrp_simulation()) do not need to branch onsolver_backendthemselves.- Parameters:
plasma (
cantera.Solution) – Cantera plasma object, already set to the state the reactor should start from. Passed withclone=Falseby both reactor classes, so plasma’s state stays live and mutable for the caller throughout integration (the pure-Python reactor mutates it directly; the native reactor only reads it once, at construction, to seed its initial condition).momentum_transfer_collision_frequencies_list (
listofMomentumTransferCollisionFrequencyModel) – Per-species momentum-transfer collision-frequency models, as built byget_momentum_transfer_collision_frequencies_list().mechanism_path (
str,pathlib.Path, orNone) – Cantera mechanism (YAML) path. Only used whensolver_backend="cpp", and only as a fallback: if plasma has any reaction-rate multiplier in effect (set_multiplier(), e.g. from a sensitivity-analysis sweep), plasma’s current state is written to a temporary mechanism file and used instead – see the Notes section. Pass None if plasma was not loaded from a single on-disk mechanism file/phase in the first place (e.g. built byload_goutier2025_mechanism_with_options()); this then always takes the temporary-mechanism-file path.plasma_phase_name (
str) – Cantera mechanism (YAML) phase name. Only used whensolver_backend="cpp".mass (
float) – Mass of the plasma, in kg. Assumed constant.initial_radius (
float) – Initial radius of the plasma, in m. Only used whensolver_backend="python"– the native reactor derives its own initial volume frommass / plasma.densityinstead.gap (
float) – Gap between the two electrodes, in m.electric_circuit (
PlasmaVoltageCircuit) – Electric circuit object – any of TransmissionLineResistiveCircuit, TransmissionLineRCLoadCircuit, DirectResistiveCircuit, DirectRCLoadCircuit, GeneratorVoltageCircuit (seePlasmaVoltageCircuit).polytropic_index (
floatorstr) – Polytropic index of the plasma expansion."gamma"is only supported whensolver_backend="python".p_ext (
floatorstr) – External pressure, in Pa. If “atmospheric” or “atm”, the atmospheric pressure is used.solver_backend (
{"cpp", "python"}, optional) – Which reactor implementation to build."cpp"(the default) evaluates chemistry / two-temperature energy / Joule / conductivity natively (~50-300x faster);"python"is the pure-Python reference. Seerizer.models.nrp.isomass_2T_volume_reactor_cpp.cpp_mechanism (
tupleofstrandstr, orNone, optional) – Pre-resolved(mechanism_path, phase_name)to load the native reactor from – seeresolved_cpp_mechanism(). Only used whensolver_backend="cpp". Default None, which resolves it fresh from plasma’s current multiplier state on every call (fine for a single build, but wasteful if called once per segment of the same run with an unchanging multiplier – seerun_constant_mass_nrp_simulation(), which resolves it once and passes it here for every segment).compute_chemistry (
bool, optional) – Include finite-rate chemistry in the reactor’s RHS (the Python reactor’scompute_chemistry, the native one’sreacting). Default True.
- Returns:
The reactor (Python- or C++-backed, per solver_backend), ready to be driven by
cantera.ReactorNet.- Return type:
- Raises:
ValueError – If
solver_backendis not “python” or “cpp”. Whensolver_backend="cpp", also propagatesIsomass2TVolumeReactor’s own validation of polytropic_index (rejects"gamma") and p_ext (must be"atmospheric"/"atm"or a strictly positive float).
Notes
Unlike the pure-Python reactor (built directly on the passed-in plasma object), the native
Reactor0Dreloads the mechanism itself from a YAML file path and is otherwise independent of plasma’s in-memory state. So a reaction-rate multiplier applied viaplasma.set_multiplier(...)(e.g. by a sensitivity-analysis sweep) would silently have no effect on the C++ reactor if it were simply pointed at mechanism_path. Seeresolved_cpp_mechanism()for how this is worked around (and reused across calls via cpp_mechanism).
- rizer.pipeline.run_nrp_simulation.configure_reactor_net(net: cantera.ReactorNet, solver_input: dict[str, Any]) None#
Configure a
cantera.ReactorNet’s CVODE tolerances/limits from the input YAML.- Parameters:
net (
cantera.ReactorNet) – Reactor network to configure.solver_input (
dictofstrtoAny) – Thesimulation.solversection of the input YAML. Expected keys: “rtol”, “atol”, “max_step” (maps tonet.max_time_step), “nsteps” (maps tonet.max_steps), “max_order”.cantera.ReactorNetalways integrates with CVODE/BDF, so the formerscipy.integrate.odekeys “name”, “method”, “with_jacobian” and “first_step” have no equivalent here and are ignored if present.
- rizer.pipeline.run_nrp_simulation.compute_reactor_diagnostics(plasma: cantera.Solution, collision_freq: rizer.transport.mixture_law.MixtureCollisionFrequencies, reactor: rizer.models.nrp.isomass_2T_volume_reactor.Isomass2TVolumeReactor | rizer.models.nrp.isomass_2T_volume_reactor_cpp.Isomass2TVolumeReactor, polytropic_index: float | str) dict[str, float]#
Compute the per-output-step diagnostics recorded alongside the plasma state.
Must be called right after
plasma.Te/plasma.TDYhave been set to the state being recorded: every returned quantity is a pure function of that state (plus the electric field carried by reactor), so the result is identical whether reactor is the pure-Python reactor (Isomass2TVolumeReactor) or the native one (Isomass2TVolumeReactor).plasma_voltage/plasma_resistance/plasma_radius/P_elastic/P_inelastic/P_chemical/P_chemical_e/P_Jouleare read directly off reactor (both backends define all of them identically).k,n_e, and the collision-frequency diagnostics (nu_eH,nu_ee,nu_eI,nu_eH_mass_weighted) are instead computed here directly from plasma/collision_freq, independent of which reactor backend advanced the state. Both reactors now exposenu_eH/nu_ee/nu_eInatively (the C++ one asReactor0Dproperties backed byReactorRHS::Diagnostics), but neither storesnu_eH_mass_weightedas its own attribute, so there is still no single uniform 4-attribute set to read off both backends – this function keeps deriving all four uniformly from collision_freq rather than reading a mix of native and derived values per backend.- Parameters:
plasma (
cantera.Solution) – Plasma object, already set to the state to record.collision_freq (
MixtureCollisionFrequencies) – Collision-frequency wrapper around plasma (seebuild_collision_frequencies()).reactor (
Isomass2TVolumeReactororIsomass2TVolumeReactor) – Reactor that advanced plasma to its current state; used for itsplasma_voltage,plasma_resistance,plasma_radius,P_elastic,P_inelastic,P_chemical,P_chemical_e, andP_Jouleattributes (both classes define all of them).polytropic_index (
floatorstr) – Polytropic index of the plasma expansion (seeIsomass2TVolumeReactor).
- Returns:
Keys: “n_e”, “V_p”, “R_p”, “radius”, “k”, “P_elastic”, “P_inelastic”, “P_chemical”, “P_chemical_e”, “P_Joule”, “nu_eH”, “nu_ee”, “nu_eI”, “nu_eH_mass_weighted”.
- Return type:
- rizer.pipeline.run_nrp_simulation.run_constant_mass_nrp_simulation(plasma: cantera.Solution, collision_freq: rizer.transport.mixture_law.MixtureCollisionFrequencies, momentum_transfer_collision_frequencies_list: list[rizer.transport.collision_frequency.MomentumTransferCollisionFrequencyModel], mechanism_path: str | pathlib.Path | None, plasma_phase_name: str, mass: float, initial_radius: float, gap: float, pulse_duration: float | None, electric_circuit: rizer.electrical_model.circuit.base_circuit.PlasmaVoltageCircuit, polytropic_index: float | str, p_ext: float | str, solver_input: dict[str, Any], simulation_time: float, output_interval: float, radius_changes: list[tuple[float, float]], solver_backend: str = 'cpp', print_every: int = 100, logger: logging.Logger | logging.LoggerAdapter | None = None, show_progress: bool = True) cantera.SolutionArray#
Run a full 2T0D constant-mass NRP discharge simulation.
Integrates
build_isomass_2T_volume_reactor()’s reactor, viacantera.ReactorNet, fromt=0to simulation_time, recording the plasma state and diagnostics (seecompute_reactor_diagnostics()) every output_interval. The plasma radius (and, since the mass is constant, the density) can be reset at one or more times via radius_changes: each change ends the current integration segment and starts a new one from the same (continuous) Tg, Te and species mass fractions, but a new volume/mass consistent with the new radius (density is preserved across the change).- Parameters:
plasma (
cantera.Solution) – Cantera plasma object, already set to the initial state (composition, Tg, Te) the simulation starts from.collision_freq (
MixtureCollisionFrequencies) – Collision-frequency wrapper around plasma (seebuild_collision_frequencies()).momentum_transfer_collision_frequencies_list (
listofMomentumTransferCollisionFrequencyModel) – Per-species momentum-transfer collision-frequency models, as built byget_momentum_transfer_collision_frequencies_list().mechanism_path (
str,pathlib.Path, orNone) – Cantera mechanism (YAML) path, or None if plasma was not loaded from a single on-disk mechanism file/phase in the first place – seeresolved_cpp_mechanism().plasma_phase_name (
str) – Cantera mechanism (YAML) phase name.mass (
float) – Initial mass of the plasma, in kg.initial_radius (
float) – Initial radius of the plasma, in m.gap (
float) – Gap between the two electrodes, in m. Assumed constant.pulse_duration (
floatorNone) – Reference pulse duration, in s – recorded as the tau column, used by the Maxwellian Eq VIII-3.10 post-process check (1 / (nu_ee * tau)). None records tau as NaN, so that diagnostic comes out NaN too instead of being computed.electric_circuit (
PlasmaVoltageCircuit) – Electric circuit object – any of TransmissionLineResistiveCircuit, TransmissionLineRCLoadCircuit, DirectResistiveCircuit, DirectRCLoadCircuit, GeneratorVoltageCircuit (seePlasmaVoltageCircuit). Mutated in place (its recorded plasma-voltage history is trimmed at each radius change).polytropic_index (
floatorstr) – Polytropic index of the plasma expansion (seeIsomass2TVolumeReactor).p_ext (
floatorstr) – External pressure, in Pa. If “atmospheric” or “atm”, the atmospheric pressure is used.solver_input (
dictofstrtoAny) – Thesimulation.solversection of the input YAML; seeconfigure_reactor_net().simulation_time (
float) – Total simulation time, in s.output_interval (
float) – Time step between two recorded states, in s.radius_changes (
listoftupleoffloat) –(time_of_change, new_radius)pairs, as returned byget_radius_change_events(). An empty list means the radius stays constant for the whole simulation.solver_backend (
{"cpp", "python"}, optional) – Which reactor implementation to use; seebuild_isomass_2T_volume_reactor(). Default “cpp”.print_every (
int, optional) – Log a progress line (at INFO level) every print_every recorded steps. Default 100.logger (
logging.Loggerorlogging.LoggerAdapterorNone, optional) – Logger to use for this run’s progress/status messages. Default None, which uses this module’s own logger. Pass a per-case logger (seeget_case_logger()) when running many cases in one process (e.g. a sensitivity-analysis sweep) so every line can be attributed to its case.show_progress (
bool, optional) – Show a livetqdmprogress bar tracking simulated time, in addition to (not instead of) the print_every log line: the bar is for interactive feedback and isn’t persisted, while the log line is what ends up in a log file (seeadd_log_file_handler()). Default True.tqdmthrottles itself sensibly when stdout isn’t a terminal (e.g. output redirected to a file), so this is normally safe to leave on even for batch runs.
- Returns:
The recorded plasma states, with extra columns “t”, “T_e”, “n_e”, “V_p”, “R_p”, “V_g”, “radius”, “gap”, “tau”, “k”, “P_elastic”, “P_inelastic”, “P_chemical”, “P_chemical_e”, “P_Joule”, “nu_eH”, “nu_ee”, “nu_eI”, “nu_eH_mass_weighted”.
- Return type: