Incident and reflected shock waves for different pre-shock velocities#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_R
 3%
 4% Compute pre-shock and post-shock state for a planar reflected shock wave
 5% at standard conditions (T = 300 K, p = 1 atm), and a set of initial shock
 6% front velocities (u1) contained in (360, 9000) [m/s]
 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);
26
27% Initialize mixture
28mix = Mixture(system);
29
30% Define chemical state
31set(mix, {'N2', 'O2', 'Ar', 'CO2'}, [78.084, 20.9476, 0.9365, 0.0319] / 20.9476);
32
33% Define properties
34u1 = logspace(2, 5, 500); u1 = u1(u1<9000); u1 = u1(u1>=360);
35mixArray1 = setProperties(mix, 'temperature', 300, 'pressure', 1.01325, 'u1', u1);
36
37% Initialize solver
38solver = ShockSolver('problemType', 'SHOCK_R');
39
40% Solve problem
41[mixArray1, mixArray2, mixArray3] = solver.solveArray(mixArray1);
42
43% Generate report
44report(solver, mixArray1, mixArray2, mixArray3);