Rocket performance considering the finite-area-chamber approximation#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: ROCKET Propellants considering an Finite-Area-Chamber (FAC)
 3%
 4% Compute rocket propellant performance considering an Finite-Area-Chamber
 5% with an area ratio of the combustion chamber A_chamber/A_throat = 2
 6% for lean to rich LH2-LOX mixtures at 101.325 bar, a set of equivalence
 7% ratios phi contained in (2, 5) [-], and an exit area ratio A_exit/A_throat = 3 
 8%   
 9% See wiki or setListspecies method from ChemicalSystem class for predefined
10% sets of species
11%
12% @author: Alberto Cuadra Lara
13%                 
14% Last update October 06 2025
15% -------------------------------------------------------------------------
16
17% Import packages
18import combustiontoolbox.databases.NasaDatabase
19import combustiontoolbox.core.*
20import combustiontoolbox.rocket.*
21
22% Get Nasa database
23DB = NasaDatabase();
24
25% Define chemical system
26system = ChemicalSystem(DB);
27
28% Initialize mixture
29mix = Mixture(system);
30
31% Define chemical state
32set(mix, {'H2bLb'}, 'fuel', 1);
33set(mix, {'O2bLb'}, 'oxidizer', 1);
34
35% Define properties
36mixArray1 = setProperties(mix, 'temperature', 90, 'pressure', 100 * 1.01325, 'equivalenceRatio', 1:0.05:5, 'areaRatioChamber', 2, 'areaRatio', 3);
37
38% Initialize solver
39solver = RocketSolver('problemType', 'ROCKET_FAC');
40
41% Solve problem
42[mixArray1, mixArray2_inj, mixArray2_c, mixArray3, mixArray4] = solver.solveArray(mixArray1);
43
44% Generate report
45report(solver, mixArray1, mixArray2_inj, mixArray2_c, mixArray3, mixArray4);