scine_puffin.utilities.rms_input_file_creator

Functions

create_arrhenius_reaction_entry(...[, type_str])

Create a reaction entry in the RMS format assuming that the rate constant is given by the Arrhenius equation: k = a / T^n exp(-e_a/(k_B T)).

create_rms_phase_entry(aggregate_str_ids, ...)

Create all entries for the species in the RMS input dictionary (this is the 'Phase' dictionary in RMS).

create_rms_reaction_entry(prefactors, ...)

Create the reaction entries for the RMS input dictionary assuming Arrhenius kinetics and that all reactions are Elementary Reactions (according to the RMS definition): k = a / T^n exp(-e_a/(k_B T))

create_rms_units_entry([units])

Create the 'units' entry in the RMS input dictionary.

create_rms_yml_file(aggregate_str_ids, ...)

Write the yml file input for RMS.

create_single_species_entry(name, h, s)

Get an entry for a species in the RMS format.

create_solvent_entry(solvent, ...)

Create the entry for the solvent.

get_default_viscosity(solvent_name)

Getter for tabulated solvent viscosity (in Pa s).

get_ideal_dilute_solution(rms_species, ...)

Getter for the ideal dilute solution phase object of RMS.

get_ideal_surface(rms_species, ...)

Getter for the ideal surface RMS phase object.

resolve_rms_phase(phase_name, rms_species, ...)

Resolve the RMS phase model by string.

resolve_rms_solver(solver_name, reactor)

Resolve the solver for the ODE system by string.

scine_puffin.utilities.rms_input_file_creator.create_arrhenius_reaction_entry(reactant_names: List[str], product_names: List[str], e_a: float, n: float, a: float, type_str: str = 'ElementaryReaction') Dict[str, Any][source]

Create a reaction entry in the RMS format assuming that the rate constant is given by the Arrhenius equation: k = a / T^n exp(-e_a/(k_B T)).

Parameters:
reactant_namesList[str]

Species names of the reactions LHS (the names must correspond to an entry in the RMS phase dictionary).

product_namesList[str]

Species names of the reactions RHS (the names must correspond to an entry in the RMS phase dictionary).

e_afloat

Activation energy in J/mol.

nfloat

Temperature exponent.

afloat

Arrhenius prefactor.

type_strstr (default ‘ElementaryReaction’)

Type of the reaction entry (see the RMS documentation for other options).

Returns:
Dict[str, Any]

The reaction entry.

scine_puffin.utilities.rms_input_file_creator.create_rms_phase_entry(aggregate_str_ids: List[str], enthalpies: List[float], entropies: List[float], solvent_name: str | None = None) List[Dict][source]

Create all entries for the species in the RMS input dictionary (this is the ‘Phase’ dictionary in RMS).

Parameters:
aggregate_str_idsList[str]

The aggregate IDs as strings.

enthalpiesList[float]

The aggregate enthalpies (same ordering as for the aggregate_str_ids) in J/mol.

entropiesList[float]

The aggregate entropies (note the ordering) in J/mol/K.

solvent_nameOptional[str] (default None)

The name of an additional solvent species that is added to the species if provided.

Returns:
The species a list of one dictionary.
scine_puffin.utilities.rms_input_file_creator.create_rms_reaction_entry(prefactors: List[float], temperature_exponents: List[float], activation_energies: List[float] | ndarray, reactant_list: List[Tuple[List[str], List[str]]]) List[Dict[str, Any]][source]

Create the reaction entries for the RMS input dictionary assuming Arrhenius kinetics and that all reactions are Elementary Reactions (according to the RMS definition): k = a / T^n exp(-e_a/(k_B T))

The parameters are given as lists. The ordering in all lists must be the same.

Parameters:
prefactorsList[float]

Arrhenius prefactors (a in the equation above).

temperature_exponentsList[float]

Temperature exonents (n in the equation above).

activation_energiesUnion[List[float], np.ndarray]

Activation energies (e_a in the equation above).

reactant_listList[Tuple[List[str], List[str]]]

LHS (tuple[0]) and RHS (tuple[1]) of all reactions.

Returns:
List[Dict[str, Any]]

All reaction entries as a list of dictionaries.

scine_puffin.utilities.rms_input_file_creator.create_rms_units_entry(units: Dict | None = None) Dict[source]

Create the ‘units’ entry in the RMS input dictionary. See the RMS documentation for supported units.

Parameters:
unitsOptional[Dict] (default None)

The units as a dictionary.

Returns:
Dict

If no units were provided, an empty dictionary is returned.

scine_puffin.utilities.rms_input_file_creator.create_rms_yml_file(aggregate_str_ids: List[str], enthalpies: List[float], entropies: List[float], prefactors: List[float], temperature_exponents: List[float], activation_energies: List[float] | ndarray, reactants: List[Tuple[List[str], List[str]]], file_name: str, solvent_name: str | None = None, solvent_viscosity: float | None = None, solvent_aggregate_index: int | None = None) None[source]

Write the yml file input for RMS.

Parameters:
aggregate_str_idsList[str]

The list of aggregate string ids to be added as RMS species.

enthalpiesList[float]

The list of enthalpies for the aggregates (in J/mol).

entropiesList[float]

The list of the aggregates entropies (in J/mol/K).

prefactorsList[float]

The list of the Arrhenius prefactors.

temperature_exponentsList[float]

The list of the temperature exponents.

activation_energiesUnion[List[float], np.ndarray]

The activation energies in J/mol.

reactantsList[Tuple[List[str], List[str]]]

LHS (tuple[0]) and RHS (tuple[1]) of all reactions.

file_namestr

The filename for the yml file.

solvent_nameOptional[str] (default None)

The solvent name.

solvent_viscosityOptional[float] (default None)

The solvent’s viscosity in Pa s.

solvent_aggregate_indexOptional[int] (default None)

The index of the solvent in the aggregte id list. This is only required if the solvent is a reacting species.

scine_puffin.utilities.rms_input_file_creator.create_single_species_entry(name: str, h: float, s: float)[source]

Get an entry for a species in the RMS format.

We could extend this function to use the heat capacity of the species or directly insert the NASA polynomials. This would be interesting for non-constant temperature simulations.

Parameters:
namestr

The species name (unique identifier).

hfloat

The species enthalpy in J/mol.

sfloat

The species entropy in J/mol/K.

Returns:
The species entry.
scine_puffin.utilities.rms_input_file_creator.create_solvent_entry(solvent: str, solvent_viscosity: float | None, solvent_id_str: str | None) Dict[source]

Create the entry for the solvent.

Parameters:
solventstr

The solvent name (e.g., water) to extract tabulated viscosity values.

solvent_viscosityOptional[float]

The solvent’s viscosity in Pa s.

solvent_id_strOptional[str]

The string id of the solvent compound. Only required if the solvent is a reacting species.

Returns:
Dict

The solvent entry as a dictionary.

scine_puffin.utilities.rms_input_file_creator.get_default_viscosity(solvent_name: str) float[source]

Getter for tabulated solvent viscosity (in Pa s). Tabulated values are at 25 celsius.

Source: https://hbcp.chemnetbase.com/faces/contents/InteractiveTable.xhtml Accessed on 23.01.2023, 14:00

Parameters:
solvent_namestr

The solvent’s name.

Returns:
float

The solvent’s viscosity (in Pa s).

scine_puffin.utilities.rms_input_file_creator.get_ideal_dilute_solution(rms_species: Any, rms_reactions: Any, rms_solvent: Any, diffusion_limited: bool) Any[source]

Getter for the ideal dilute solution phase object of RMS.

Parameters:
rms_speciesRMS species object

The RMS species.

rms_reactionsRMS Reaction list

The RMS reactions.

rms_solventRMS solvent object

The RMS solvetn object.

diffusion_limitedbool

If true, diffusion limitations are enforced.

Returns:
Any

The rms.IdealDiluteSolution object.

scine_puffin.utilities.rms_input_file_creator.get_ideal_surface(rms_species, rms_reactions, diffusion_limited: bool, site_density: float | None)[source]

Getter for the ideal surface RMS phase object.

Parameters:
rms_speciesRMS species object

The RMS species.

rms_reactionsRMS Reaction list object

The RMS reactions.

diffusion_limitedbool

If true, diffusion limitations are enforced.

site_densityfloat

The site density for surface reactions.

Returns:
The rms.IdealSurface object.
scine_puffin.utilities.rms_input_file_creator.resolve_rms_phase(phase_name: str, rms_species: Any, rms_reactions: Any, rms_solvent: Any, diffusion_limited: bool, site_density: float | None) Any[source]

Resolve the RMS phase model by string.

Parameters:
phase_namestr

The name of the phase. Options are ‘ideal_gas’ and ‘ideal_dilute_solution’.

rms_speciesRMS species object

The RMS species.

rms_reactionsRMS Reaction list

The RMS reactions.

rms_solventRMS solvent object

The RMS solvetn object.

diffusion_limitedbool

If true, diffusion limitations are enforced.

site_densityOptional[float]

The site density for surface reactions.

Returns:
Any

Returns the RMS phase object.

scine_puffin.utilities.rms_input_file_creator.resolve_rms_solver(solver_name: str, reactor: Any)[source]

Resolve the solver for the ODE system by string.

Parameters:
solver_namestr

The solver name.

reactorrms.Reactor

The julia RMS reactor object.

Returns:
Returns the selected ODE solver as a julia Differential Equation object.