Code GenerationΒΆ
Python code generationΒΆ
- pyrometheus.codegen.python.gen_thermochem_code(sol: Solution) str ΒΆ
For the mechanism given by sol, return Python source code for a class conforming to a module containing a class called
Thermochemistry
adhering to theThermochemistry
interface.
- pyrometheus.codegen.python.get_thermochem_class(sol: Solution)ΒΆ
For the mechanism given by sol, return a class conforming to the
Thermochemistry
interface.
C++ code generationΒΆ
- pyrometheus.codegen.cpp.gen_thermochem_code(sol: Solution, namespace='pyrometheus') str ΒΆ
For the mechanism given by sol, return Python source code for a class conforming to a module containing a class called
Thermochemistry
adhering to theThermochemistry
interface.
Fortran code generationΒΆ
Interface of the Generated Per-Mechanism CodeΒΆ
- class pyrometheus.thermochem_example.Thermochemistry(usr_np=<module 'numpy' from '/opt/homebrew/lib/python3.13/site-packages/numpy/__init__.py'>)ΒΆ
- model_nameΒΆ
- num_elementsΒΆ
- num_speciesΒΆ
- num_reactionsΒΆ
- num_falloffΒΆ
- one_atmΒΆ
Returns 1 atm in SI units of pressure (Pa).
- gas_constantΒΆ
- species_namesΒΆ
- species_indicesΒΆ
- get_specific_gas_constant(mass_fractions)ΒΆ
- get_density(p, temperature, mass_fractions)ΒΆ
- get_pressure(rho, temperature, mass_fractions)ΒΆ
- get_mix_molecular_weight(mass_fractions)ΒΆ
- get_concentrations(rho, mass_fractions)ΒΆ
- get_mixture_specific_heat_cp_mass(temperature, mass_fractions)ΒΆ
- get_mixture_specific_heat_cv_mass(temperature, mass_fractions)ΒΆ
- get_mixture_enthalpy_mass(temperature, mass_fractions)ΒΆ
- get_mixture_internal_energy_mass(temperature, mass_fractions)ΒΆ
- get_species_specific_heats_r(temperature)ΒΆ
- get_species_enthalpies_rt(temperature)ΒΆ
- get_species_entropies_r(temperature)ΒΆ
- get_species_gibbs_rt(temperature)ΒΆ
- get_equilibrium_constants(temperature)ΒΆ
- get_temperature(enthalpy_or_energy, t_guess, y, do_energy=False)ΒΆ
- __init__(usr_np=<module 'numpy' from '/opt/homebrew/lib/python3.13/site-packages/numpy/__init__.py'>)ΒΆ
Initialize thermochemistry object for a mechanism.
- Parameters:
usr_np β
numpy
-like namespace providing at least the following functions, for any arrayX
of the bulk array type:usr_np.log(X)
(likenumpy.log
)usr_np.log10(X)
(likenumpy.log10
)usr_np.exp(X)
(likenumpy.exp
)usr_np.where(X > 0, X_yes, X_no)
(likenumpy.where()
)usr_np.linalg.norm(X, np.inf)
(likenumpy.linalg.norm()
)
where the βbulk array typeβ is a type that offers arithmetic analogous to
numpy.ndarray
and is used to hold all types of (potentialy volumetric) βbulk dataβ, such as temperature, pressure, mass fractions, etc. This parameter defaults to actual numpy, so it can be ignored unless it is needed by the user (e.g. for purposes of GPU processing or automatic differentiation).
Canonical NamesΒΆ
- class cantera.composite.SolutionΒΆ
See
cantera.Solution
.
- class cantera._cantera.ReactionΒΆ
See
cantera.Reaction
.
- class cantera._cantera.ArrheniusΒΆ
See
cantera.Arrhenius
.