Incident shock waves with ionization effects#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_I_IONIZATION
 3%
 4% Compute pre-shock and post-shock state for a planar incident shock wave
 5% at standard conditions (T1 = 300 K, p1 = 1 atm), and a set of pre-shock
 6% Mach numbers (M1) contained in (1, 40)
 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', 'CO2'}, [78.084, 20.9476, 0.9365, 0.0319] / 20.9476);
33
34% Define properties
35mixArray1 = setProperties(mix, 'temperature', 300, 'pressure', 1.01325, 'M1', 1:0.1:40);
36
37% Initialize solver
38solver = ShockSolver('problemType', 'SHOCK_I');
39
40% Solve problem
41[mixArray1, mixArray2] = solver.solveArray(mixArray1);
42
43% Generate report
44report(solver, mixArray1, mixArray2);