1% -------------------------------------------------------------------------
2% EXAMPLE: SHOCK_OBLIQUE_R
3%
4% Compute pre-shock and post-shock state (incident and reflected) for a
5% oblique incident shock wave at standard conditions, a set of 51 species
6% considered, a pre-shock Mach number = 10, and a deflection angle
7% theta = 20 [deg]
8%
9% Air_ions == {'eminus', 'Ar', 'Arplus', 'C', 'Cplus', 'Cminus', ...
10% 'CN', 'CNplus', 'CNminus', 'CNN', 'CO', 'COplus', ...
11% 'CO2', 'CO2plus', 'C2', 'C2plus', 'C2minus', 'CCN', ...
12% 'CNC', 'OCCN', 'C2N2', 'C2O', 'C3', 'C3O2', 'N', ...
13% 'Nplus', 'Nminus', 'NCO', 'NO', 'NOplus', 'NO2', ...
14% 'NO2minus', 'NO3', 'NO3minus', 'N2', 'N2plus', ...
15% 'N2minus', 'NCN', 'N2O', 'N2Oplus', 'N2O3', 'N2O4', ...
16% 'N2O5', 'N3', 'O', 'Oplus', 'Ominus', 'O2', 'O2plus', ...
17% 'O2minus', 'O3'}
18%
19% See wiki or setListspecies method from ChemicalSystem class for more
20% predefined sets of species
21%
22% @author: Alberto Cuadra Lara
23% Postdoctoral researcher - Group Fluid Mechanics
24% Universidad Carlos III de Madrid
25%
26% Last update Jun 11 2024
27% -------------------------------------------------------------------------
28
29% Import packages
30import combustiontoolbox.databases.NasaDatabase
31import combustiontoolbox.core.*
32import combustiontoolbox.shockdetonation.*
33import combustiontoolbox.utils.display.*
34
35% Get Nasa database
36DB = NasaDatabase();
37
38% Define chemical system
39system = ChemicalSystem(DB, 'air ions');
40
41% Initialize mixture
42mix = Mixture(system);
43
44% Define chemical state
45set(mix, {'N2', 'O2', 'Ar', 'CO2'}, [78.084, 20.9476, 0.9365, 0.0319] / 20.9476);
46
47% Define properties
48mixArray1 = setProperties(mix, 'temperature', 300, 'pressure', 1.01325, 'M1', 10, 'theta', 20);
49
50% Initialize solver
51solver = ShockSolver('problemType', 'SHOCK_OBLIQUE_R');
52
53% Solve problem
54[mixArray1, mixArray2, mixArray3_1, mixArray3_2] = solver.solveArray(mixArray1);