-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOSCILOS_lite.m
More file actions
84 lines (70 loc) · 2.84 KB
/
OSCILOS_lite.m
File metadata and controls
84 lines (70 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% OSCILOS_lite
%
% This program is the 'lite' version of OSCILOS_long - without a
% Graphical User Interface. It runs much faster than OSCILOS_long and can
% be used to carry out parametric investigations.
%
% Please update the input files before running this script. More
% information about the required inputs is included in the User Guide.
%
% Last update : 08/01/2021
%
% Authors: R. Gaudron, A. MacLaren, and previous contributors (see full
% list on the OSCILOS website).
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% INITIALISATION
%
% This subroutine loads the 'Init.txt' file and initialises OSCILOS_lite
addpath('./SubFunctions')
run Init_subfc
%% GEOMETRY
%
% This subroutine loads the geometry from the file 'Geometry.txt', plots it
% and saves it in the output folder.
run Geometry_subfc
%% MEAN FLOW
%
% This subroutine loads the mean flow parameters at the inlet of the geometry
% from the file 'Mean_flow.txt'. The mean conservation equations are then
% solved and the mean flow variables are obtained throughout the geometry.
% The mean velocity and mean temperature across the geometry are then
% plotted and saved in the output folder.
run Mean_flow_subfc
%% FLAME MODEL
%
% This subroutine loads the flame model from the file 'Flame.txt'. The gain
% and phase of the corresponding Flame Model are then plotted and saved in
% the output folder. If heat perturbations are not present inside the
% domain, this step has no impact on the final result.
run Flame_subfc
%% BOUNDARY CONDITIONS
%
% This subroutine loads the acoustic boundary conditions at the inlet and
% outlet of the geometry from files 'Inlet.txt' and 'Outlet.txt'
% respectively. The acoustic reflection coefficient at the inlet and outlet
% are then plotted and saved in the output folder.
run BC_subfc
%% FREQUENCY-DOMAIN SOLVER
%
% This subroutine loads the scan range and number of initialisations - fed to
% the frequency-domain solver - from the file 'Scan_range.txt'. The solver
% then finds the eigenvalues of the system, and the corresponding
% eigenmodes. The eigenvalues are saved as an output file called
% 'Eigenvalues.txt'. A map of the eigenvalues in the range of interest is
% then plotted and saved in the output folder. A number of eigenmodes,
% represented as the modulus of the acoustic pressure and velocity, are
% also plotted and saved in the output folder.
run Solver_subfc
%% MESSAGE BOX
time=toc;
time_final=num2str(sprintf('%.2f',time));
text=['Calculation completed in ',time_final,' seconds'];
cltext = " Close Plots ";
f = questdlg(text,'OSCILOS_lite','OK', cltext, 'OK');
if f==cltext
close all
end
fprintf("\n OSCILOS_lite ran successfully in %s seconds.\n",time_final)