prometheus_equilibrium.equilibrium
Prometheus.equilibrium — Chemical equilibrium solver infrastructure.
This package provides the data structures and abstract interfaces needed to solve chemical equilibrium problems by Gibbs free energy minimisation.
The algorithm follows the modified Lagrange multiplier method described in:
Gordon, S. and McBride, B.J. (1994). Computer Program for Calculation of Complex Chemical Equilibrium Compositions and Applications. NASA Reference Publication 1311.
Six thermodynamic problem types are supported (matching NASA CEA nomenclature):
TP — fixed temperature and pressure HP — fixed enthalpy and pressure (e.g. adiabatic combustion) SP — fixed entropy and pressure (e.g. isentropic nozzle flow) TV — fixed temperature and volume UV — fixed internal energy and volume (e.g. constant-volume explosion) SV — fixed entropy and volume
Quick-start example:
from prometheus_equilibrium.equilibrium import (
SpeciesDatabase, EquilibriumProblem, GordonMcBrideSolver, ProblemType
)
db = SpeciesDatabase(nasa7_path, nasa9_path, janaf_path)
db.load()
h2, o2 = db["H2_G"], db["O2_G"]
products = db.get_species({"H", "O"})
H0 = h2.enthalpy(298.15) * 2.0 + o2.enthalpy(298.15) * 1.0
problem = EquilibriumProblem(
reactants={h2: 2.0, o2: 1.0},
products=products,
problem_type=ProblemType.HP,
constraint1=H0, # total enthalpy (J)
constraint2=30e5, # pressure (Pa)
)
solution = GordonMcBrideSolver().solve(problem)
print(solution.summary())
Modules
- prometheus_equilibrium.equilibrium.element_matrix
- prometheus_equilibrium.equilibrium.mixture
- prometheus_equilibrium.equilibrium.performance
- prometheus_equilibrium.equilibrium.problem
- prometheus_equilibrium.equilibrium.solution
- prometheus_equilibrium.equilibrium.solver
- prometheus_equilibrium.equilibrium.species