scine_puffin.utilities.rms_kinetic_model¶
Classes
|
This class provides an interface to the ReactionMechanismSimulator (RMS) for kinetic modeling. |
- class scine_puffin.utilities.rms_kinetic_model.RMSKineticModel(settings: Dict, manager: db.Manager, model: db.Model, rms_path: str, rms_file_name: str)[source]¶
This class provides an interface to the ReactionMechanismSimulator (RMS) for kinetic modeling.
- calculate_adjoined_sensitivities(simulation, reactor, absolute_vertex_flux: ndarray, n_params: int) ndarray [source]¶
Run an adjoined sensitivity analysis for the microkinetic model.
- calculate_fluxes_and_concentrations(rms_file_name: str | None = None, time_points: List[float] | None = None) Tuple[ndarray, ndarray, ndarray, ndarray, ndarray | None, ndarray] [source]¶
Run the microkinetic modeling simulation and analyse the resulting concentration trajectories. A set of time points may be provided at which the concentrations for each aggregate is extracted. Default values for enthalpies, entropies, activation energies etc. are assumed (see class members).
- static concentrations(simulation, volume, time_points: List[float] | None = None) Tuple[ndarray, ndarray, ndarray | None] [source]¶
Getter for the concentrations, max concentrations, and final concentrations from a finished simulation run. Note that this functions assumes that Julia was imported previously.
- create_yml_file(file_name: str | None, h: List[float] | None = None, s: List[float] | None = None, a: List[float] | None = None, n: List[float] | None = None, ea: List[float] | ndarray | None = None)[source]¶
Create a RMS input file with the given enthalpies (h), entropies (s), prefactors (a), temperature exponents (n), and activation energies (ea). Arguments not provided upon function call are set to their default values in saved upon class construction.
All values musst be provided in SI units (e.g., J/mol for the enthalpies).
- ensure_non_negative_barriers(ea: ndarray, h: List[float] | ndarray, s: List[float] | ndarray) ndarray [source]¶
Ensure that a change in the enthalpies or activation energies did not lead to negative reverse reaction barriers for any reaction.
- Parameters:
- eanp.ndarray
The activation energies (in J/mol).
- hUnion[List[float], np.ndarray]
The enthalpies.
- sUnion[List[float], np.ndarray]
The entropies.
- Returns:
- np.ndarray
Returns the updated activation energies.
- get_aggregate_to_reaction_map()[source]¶
Getter for the aggregate string id to reaction string id map.
- get_n_aggregates(with_solvent: bool = True)[source]¶
Get the number of aggregates in the RMS kinetic modeling. Note that this number may be larger than the number of input aggregates if a solvent species was added to the kinetic modeling. This additional species can be excluded by with_solvent=False
- integrate_results(simulation, volume, times: List[float] | None = None, solution=None)[source]¶
Integrate the absolute reaction rates to get vertex and edge fluxes and calculate final and maximum concentrations.
- run_kinetic_modeling(rms_file_name: str | None = None, h: List[float] | None = None, s: List[float] | None = None, a: List[float] | None = None, n: List[float] | None = None, ea: List[float] | ndarray | None = None)[source]¶
Run the kinetic modeling. If no values for the enthalpies (h), entropies (s), activation energies (ea), Arrhenius prefactors (a), temperature exponents (n) etc. are provided, the values stored in this class are used.
- translate_minimum_change_to_barriers(ea: ndarray, h: List[float] | ndarray, s: List[float] | ndarray, a_str_id: str) ndarray [source]¶
Ensure that changing the enthalpy of the aggregate with string id a_str_id did not lead to a negative reverse reaction barrier. If this is the case, the reaction barrier is increased to make the reverse reaction barrier zero.
- Parameters:
- eanp.ndarray
The activation energies (in J/mol).
- hUnion[List[float], np.ndarray]
The enthalpies.
- sUnion[List[float], np.ndarray]
The entropies.
- a_str_idstr
The aggregate for which the enthalpy is changed.
- Returns:
- np.ndarray
Returns the updated activation energies.