Example_SHOCK_I.m#

 1% -------------------------------------------------------------------------
 2% EXAMPLE: SHOCK_I
 3%
 4% Compute pre-shock and post-shock state for a planar incident shock wave
 5% at standard conditions, a set of 16 species considered and a set of
 6% initial shock front velocities (u1) contained in (sound velocity, 20000) [m/s]
 7%    
 8% Air == {'O2','N2','O','O3','N','NO','NO2','NO3','N2O','N2O3','N2O4',...
 9%         'N3','C','CO','CO2','Ar'}
10%   
11% See wiki or list_species() for more predefined sets of species
12%
13% @author: Alberto Cuadra Lara
14%          PhD Candidate - Group Fluid Mechanics
15%          Universidad Carlos III de Madrid
16%                 
17% Last update July 22 2022
18% -------------------------------------------------------------------------
19
20%% INITIALIZE
21self = App('Air');
22%% INITIAL CONDITIONS
23self = set_prop(self, 'TR', 300, 'pR', 1 * 1.01325);
24self.PD.S_Oxidizer = {'N2', 'O2', 'Ar', 'CO2'};
25self.PD.N_Oxidizer = [78.084, 20.9476, 0.9365, 0.0319] ./ 20.9476;
26sound_velocity = compute_sound(self.PD.TR.value, self.PD.pR.value, self.PD.S_Oxidizer, self.PD.N_Oxidizer, 'self', self);
27%% ADDITIONAL INPUTS (DEPENDS OF THE PROBLEM SELECTED)
28u1 = logspace(2, 5, 500); u1 = u1(u1 < 20000); u1 = u1(u1 >= 1 * sound_velocity);
29self = set_prop(self, 'u1', u1);
30%% SOLVE PROBLEM
31self = solve_problem(self, 'SHOCK_I');
32%% DISPLAY RESULTS (PLOTS)
33post_results(self);