Chemical equilibrium at constant enthalpy and pressure for LH2/LOX propellants#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: HP PROPELLANTS
 3%
 4% Compute adiabatic temperature and equilibrium composition at constant
 5% pressure (p = 1.01325 bar) for lean to rich LH2-LOX mixtures at T = 300 K,
 6% and a set of equivalence ratios phi contained in (0.5, 5) [-]
 7%
 8% See wiki or setListspecies method from ChemicalSystem class for predefined
 9% sets of species
10%
11% @author: Alberto Cuadra Lara
12%                 
13% Last update October 06 2025
14% -------------------------------------------------------------------------
15
16% Import packages
17import combustiontoolbox.databases.NasaDatabase
18import combustiontoolbox.core.*
19import combustiontoolbox.equilibrium.*
20
21% Get Nasa database
22DB = NasaDatabase();
23
24% Define chemical system
25system = ChemicalSystem(DB);
26
27% Initialize mixture
28mix = Mixture(system);
29
30% Define chemical state
31set(mix, {'H2bLb'}, 'fuel', 1);
32set(mix, {'O2bLb'}, 'oxidizer', 1);
33
34% Define properties
35mixArray = setProperties(mix, 'temperature', 300, 'pressure', 1 * 1.01325, 'equivalenceRatio', 0.2:0.05:5);
36
37% Initialize solver
38solver = EquilibriumSolver('problemType', 'HP');
39
40% Solve problem
41solver.solveArray(mixArray);
42
43% Generate report
44report(solver, mixArray);