Example_DET_OVERDRIVEN_AND_UNDERDRIVEN.m#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: DET_OVERDRIVEN_AND_UNDERDRIVEN
 3%
 4% Compute pre-shock and post-shock state for a planar underdriven to 
 5% overdriven detonation considering Chapman-Jouguet (CJ) theory for a
 6% stoichiometric CH4-air mixture at standard conditions, a set of 24
 7% species considered and a set of overdrives contained in (1,10) [-].
 8%   
 9% Soot formation == {'CO2','CO','H2O','H2','O2','N2','Ar','Cbgrb',...
10%                    'C2','C2H4','CH','CH3','CH4','CN','H',...
11%                    'HCN','HCO','N','NH','NH2','NH3','NO','O','OH'}
12%   
13% See wiki or list_species() for more predefined sets of species
14%
15% @author: Alberto Cuadra Lara
16%          PhD Candidate - Group Fluid Mechanics
17%          Universidad Carlos III de Madrid
18%                 
19% Last update Oct 12 2022
20% -------------------------------------------------------------------------
21
22%% INITIALIZE
23self = App('Soot Formation');
24%% INITIAL CONDITIONS
25self = set_prop(self, 'TR', 300, 'pR', 1 * 1.01325, 'phi', 1);
26self.PD.S_Fuel     = {'CH4'};
27self.PD.S_Oxidizer = {'N2', 'O2', 'Ar', 'CO2'};
28self.PD.ratio_oxidizers_O2 = [78.084, 20.9476, 0.9365, 0.0319] ./ 20.9476;
29%% ADDITIONAL INPUTS (DEPENDS OF THE PROBLEM SELECTED)
30drive_factor = 1:0.1:10;
31self = set_prop(self, 'drive_factor', drive_factor);
32%% SOLVE PROBLEMS
33self = solve_problem(self, 'DET_OVERDRIVEN');
34self_under = solve_problem(self, 'DET_UNDERDRIVEN');
35%% APPEND RESULTS
36self.PS.strR = append_cells(flip(self_under.PS.strR), self.PS.strR);
37self.PS.strP = append_cells(flip(self_under.PS.strP), self.PS.strP);
38%% DISPLAY RESULTS (PLOTS)
39post_results(self);