Example_SHOCK_POLAR.m#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_POLAR
 3%
 4% Compute shock polar plots at standard conditions, a set of 39 species
 5% considered, and a set of initial shock front velocities u1/a1 = [2:2:14]
 6%    
 7% Air_ions == {'O2','N2','O','O3','N','NO','NO2','NO3','N2O','N2O3',...
 8%              'N2O4','N3','eminus','Nminus','Nplus','NOplus','NO2minus',...
 9%              'NO3minus','N2plus','N2minus','N2Oplus','Oplus','Ominus',...
10%              'O2plus', 'O2minus,'CO2','CO','COplus','C','Cplus',...
11%              'Cminus','CN','CNplus','CNminus','CNN','NCO','NCN','Ar',...
12%              'Arplus'}
13%   
14% See wiki or ListSpecies() for more predefined sets of species
15%
16% @author: Alberto Cuadra Lara
17%          PhD Candidate - Group Fluid Mechanics
18%          Universidad Carlos III de Madrid
19%                 
20% Last update March 21 2021
21% -------------------------------------------------------------------------
22
23%% INITIALIZE
24% self = App('Air_ions');
25self = App({'O2', 'N2', 'Ar', 'CO2'}); % Frozen
26% self = App({'O2', 'N2'}); % Frozen
27% self = App({'O2'}); % Frozen
28%% INITIAL CONDITIONS
29self = set_prop(self, 'TR', 300, 'pR', 1 * 1.01325);
30self.PD.S_Oxidizer = {'O2'};
31% self.PD.S_Inert    = {'N2'};
32% self.PD.proportion_inerts_O2 = 79/21;
33self.PD.S_Inert    = {'N2', 'Ar', 'CO2'};
34self.PD.proportion_inerts_O2 = [78.084, 0.9365, 0.0319] ./ 20.9476;
35%% ADDITIONAL INPUTS (DEPENDS OF THE PROBLEM SELECTED)
36% range1 = logspace(0, 1, 300); range1 = range1(range1 < 5);
37% overdriven = [range1, linspace(5, 14, 30)]; overdriven = overdriven(overdriven > 1);
38overdriven = 2:2:14;
39% overdriven = [2, 3, 5, 10];
40% overdriven = 2.85;
41self = set_prop(self, 'u1', 3.472107491008314e+02 * overdriven);
42%% SOLVE PROBLEM
43self = SolveProblem(self, 'SHOCK_POLAR');
44%% DISPLAY RESULTS (PLOTS)
45postResults(self);