Incident and reflectect shock polar diagrams#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_POLAR_REFLECTED
 3%
 4% Compute shock polar plots at T1 = 226.65 K and p1 = 0.0117 bar
 5% (altitude 30 km), an initial shock front Mach number = 20, and
 6% deflection angle theta = 35
 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.shockdetonation.*
20
21% Get Nasa database
22DB = NasaDatabase();
23
24% Define chemical system
25system = ChemicalSystem(DB);
26system.FLAG_ION = true;
27
28% Initialize mixture
29mix = Mixture(system);
30
31% Define chemical state
32set(mix, {'N2', 'O2', 'Ar'}, [78, 21, 1] / 21);
33
34% Define properties
35mixArray1 = setProperties(mix, 'temperature', 226.65, 'pressure', 0.0117, 'M1', 20, 'theta', 35);
36
37% Initialize solver
38solver = ShockSolver('problemType', 'SHOCK_POLAR_R');
39
40% Solve problem
41[mixArray1, mixArray2, mixArray2_1, mixArray3, mixArray3_1, mixArray3_2] = solver.solveArray(mixArray1);
42
43% Generate report
44report(solver, mixArray1, mixArray2, mixArray2_1, mixArray3, mixArray3_1, mixArray3_2);