Prandtl-Meyer expansion waves#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_PRANDTL_MEYER
 3%
 4% Compute pre-shock and post-shock state for a Prandtl-Meyer expansion wave
 5% at temperature T1 = 3000 K, pressure p1 = 1 atm, a free-stream Mach
 6% number M1 = 1, and a set of wave angles theta = [0:80] [deg]
 7%
 8% @author: Alberto Cuadra Lara
 9%                 
10% Last update October 16 2025
11% -------------------------------------------------------------------------
12
13% Import packages
14import combustiontoolbox.databases.NasaDatabase
15import combustiontoolbox.core.*
16import combustiontoolbox.shockdetonation.*
17import combustiontoolbox.utils.display.*
18
19% Define caloric gas model
20caloricGasModel = CaloricGasModel.imperfect;
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, {'N2', 'O2'}, [79, 21]/21);
33
34% Define properties
35mixArray1 = setProperties(mix, 'temperature', 3000, 'pressure', 1, 'M1', 1, 'theta', 80);
36
37% Initialize solver
38solver = ShockSolver('problemType', 'SHOCK_PRANDTL_MEYER', 'caloricGasModel', caloricGasModel, 'numPointsPrandtlMeyer', 300);
39
40% Solve problem
41[mixArray1, mixArray2] = solver.solveArray(mixArray1);
42
43% Generate report from mixArray
44report(solver, mixArray1, mixArray2)
45
46% Generate report from polar of last mixArray2
47mixArray2(end).polar(1).rangeName = 'theta';
48report(solver, mixArray2(end).polar, mixArray2(end).polar)