ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Run.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef RUN_H
32#define RUN_H
33
34class Run;
35
36#include <fstream>
37#include <ctime>
38#include <sstream>
39#include "Tools.h"
40#include "Order1/Cell.h"
41#include "Models/HeaderPhase.h"
43#include "Parallel/Parallel.h"
44#include "Meshes/HeaderMesh.h"
47#include "Models/HeaderModel.h"
53
54#include "InputOutput/Input.h"
55#include "InputOutput/Output.h"
56#include "timeStats.h"
57
59
62class Run
63{
64 public:
65 Run(std::string nameCasTest, const int& number);
66 ~Run();
67
69 void initialize();
72 void solver();
75 void finalize();
76
77 void resumeSimulation();
78 void restartSimulationMeshMapping(std::vector<GeometricalDomain*>& domains, Mesh* mesh);
79
80 //Accessors
81 const int& getNumberPhases() const { return m_numberPhases; };
82
83 private:
84 //Specific solvers
85 void integrationProcedure(double& dt, int lvl, double& dtMax, int& nbCellsTotalAMR);
86 void advancingProcedure(double& dt, int& lvl, double& dtMax);
87 void solveHyperbolic(double& dt, int& lvl, double& dtMax);
88 void solveHyperbolicO2(double& dt, int& lvl, double& dtMax);
89 void solveAdditionalPhysics(double& dt, int& lvl);
90 void solveSourceTerms(double& dt, int& lvl);
91 void solveRelaxations(double& dt, int& lvl);
92 void verifyErrors();
93 void saveInfosLES(std::vector<Cell*>* cellsLvl);
94
95 // clang-format off
97
98 //Input attributes
99 std::string m_simulationName;
103 double m_cfl;
111 int m_MRF;
115 std::vector<GeometricalDomain*> m_solidDomains;
116
117 //Specific to AMR method
120 //Geometrical attributes
123
124 //Calcul attributes
133 std::vector<AddPhys*> m_addPhys;
135 std::vector<Source*> m_sources;
142 std::vector<std::string> m_nameGTR;
143 std::vector<std::string> m_nameQPA;
144 std::vector<std::string> m_nameGPH;
145 double m_dt;
146 double m_dtNext;
151
152 //Input/Output attributes
155 std::vector<Output*> m_cuts;
156 std::vector<Output*> m_probes;
157 std::vector<Output*> m_globalQuantities;
158 std::vector<Output*> m_recordBoundaries;
160 double* m_pMax;
161 double* m_pMaxWall;
166
167 //Mesh mapping restart
170 std::string m_meshFileMapped;
171
172 //LES statistics (used by Output::saveInfos)
176 double m_globalTT;
177 double m_globalT;
179 double m_meanTemp;
180
181 //Print message in case of warning
182 bool m_warn;
183
184 // clang-format on
185
186 friend class Input;
187 friend class Output;
188 friend class OutputVTK;
189#ifdef ENABLE_HDF5
190 friend class OutputVTKHDF;
191#endif
192 friend class OutputGNU;
193 friend class OutputProbeGNU;
194 friend class OutputCutGNU;
195 friend class OutputGlobalGNU;
196 friend class OutputBoundaryGNU;
199 friend class Mesh;
200};
201
202#endif // RUN_H
std::vector< Type > TypeMeshContainer
Template for the type of the mesh container (std::list for now, but may change to something else if w...
Definition Tools.h:194
General class for Equation of State (EOS).
Definition Eos.h:62
Base class for the gradient method.
Definition Gradient.h:43
Definition Limiter.h:38
Abstract class for mathematical flow models.
Definition Model.h:50
Definition OutputVTKHDF.h:39
Class regrouping all information for a simulation.
Definition Run.h:63
int m_resumeAMRsaveFreq
Frequency at which a save to resume a simulation is done (usefull only for AMR).
Definition Run.h:150
std::vector< std::string > m_nameQPA
Vector of names of the quantities of additional physics.
Definition Run.h:143
friend class Output
Definition Run.h:187
friend class OutputGNU
Definition Run.h:192
TypeMeshContainer< CellInterface * > * m_cellInterfacesLvl
Definition Run.h:130
std::string m_simulationName
Name of the simulation.
Definition Run.h:99
bool m_StrangSplitting
Splitting boolean for secondOrder scheme (Godunov splitting or Strang splitting).
Definition Run.h:113
Gradient * m_gradient
Gradient type object: contains the gradient method.
Definition Run.h:127
std::vector< std::string > m_nameGPH
Vector of phasic variables name.
Definition Run.h:144
int m_resumeSimulation
File number for resuming a simulation.
Definition Run.h:149
int m_lvlMax
Maximum AMR level (if 0, then no AMR).
Definition Run.h:118
int m_nbIte
Definition Run.h:101
void solveAdditionalPhysics(double &dt, int &lvl)
Definition Run.cpp:1018
void saveInfosLES(std::vector< Cell * > *cellsLvl)
Definition Run.cpp:1273
Input * m_input
Input object.
Definition Run.h:153
std::vector< AddPhys * > m_addPhys
Vector of Additional physics.
Definition Run.h:133
bool m_parallelPreTreatment
Choice for mesh parallel pre-treatment (needed for first simulation on a new parallel unstructured ge...
Definition Run.h:121
int m_numberEos
Number of equations of states.
Definition Run.h:106
TypeMeshContainer< Cell * > * m_cellsLvlGhost
Array of vectors (one per level) of ghost cell objects.
Definition Run.h:129
int m_numTest
Number of the simulation.
Definition Run.h:96
void advancingProcedure(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:752
int m_freq
Requested number of final time iteration and frequency.
Definition Run.h:101
bool m_timeControlIterations
Choice for time control mode (iteration or physical time).
Definition Run.h:100
double * m_pMax
Maximal pressure found between each written output (only for few test cases).
Definition Run.h:160
double m_globalTT
Volume-weighted of temperature squared (numerator only).
Definition Run.h:176
timeStats m_stat
Object linked to computational time statistics.
Definition Run.h:159
Run(std::string nameCasTest, const int &number)
Definition Run.cpp:38
friend class OutputGlobalGNU
Definition Run.h:195
bool m_smoothCrossSection1d
1D with smooth cross section variation scheme if active
Definition Run.h:122
void finalize()
Cleaning simulation.
Definition Run.cpp:1145
double m_timeFreq
Requested final physical time of the simulation and time frequency for output printing.
Definition Run.h:102
double m_globalUiui
Volume-weighted uiui (numerator only).
Definition Run.h:174
bool m_warn
1 if at least one MPI process writes a warning file
Definition Run.h:182
double m_cfl
CFL criteria (between 0 and 1).
Definition Run.h:103
int m_numberAddPhys
Number of additional physical effects.
Definition Run.h:108
bool m_restartMeshMapping
Option to set the mesh mapping restart option.
Definition Run.h:168
Symmetry * m_symmetry
Specific object for symmetry (cylindrical or spherical) if active.
Definition Run.h:134
int m_iteration
time iteration number
Definition Run.h:148
bool m_extractRefLength
Option to extract cells' reference length.
Definition Run.h:114
bool m_recordPsat
Definition Run.h:164
double m_globalVolume
Volume of the entire domain.
Definition Run.h:173
double m_dtNext
Next time step.
Definition Run.h:146
Eos ** m_eos
Array of Equations of states: Contains fluid EOS parameters.
Definition Run.h:132
void solveHyperbolicO2(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:890
double m_dt
Explicit time step.
Definition Run.h:145
void solveRelaxations(double &dt, int &lvl)
Definition Run.cpp:1083
friend class OutputBoundaryGNU
Definition Run.h:196
int m_numberSources
Number of additional source terms.
Definition Run.h:109
std::vector< std::string > m_nameGTR
Vector of transport variable names.
Definition Run.h:142
void integrationProcedure(double &dt, int lvl, double &dtMax, int &nbCellsTotalAMR)
Definition Run.cpp:651
Limiter * m_interfaceLimiter
Slope limiter type object for second order in space specific to interface location.
Definition Run.h:137
Model * m_model
Model type object: contains the flow model methods.
Definition Run.h:126
~Run()
Definition Run.cpp:89
bool m_viscous
Viscous flow additionnal physic option required to set proper wall boundary condition (false by defau...
Definition Run.h:112
const int & getNumberPhases() const
Definition Run.h:81
int m_nbCellsTotalAMR
Number of total cells during the simulation.
Definition Run.h:119
int m_dimension
dimension 1, 2 or 3
Definition Run.h:110
friend class OutputBoundaryFluxGNU
Definition Run.h:197
std::string m_meshFileMapped
Filename of the mesh to be mapped.
Definition Run.h:170
void solveSourceTerms(double &dt, int &lvl)
Definition Run.cpp:1069
double m_globalEnstrophy
Volume-weighted enstrophy (numerator only).
Definition Run.h:175
friend class Input
Definition Run.h:186
void solver()
Hyperbolic resolution + Relaxations + Source terms integration.
Definition Run.cpp:499
friend class OutputProbeGNU
Definition Run.h:193
double m_massWanted
Definition Run.h:163
friend class Mesh
Definition Run.h:199
double * m_pMaxWall
Coordinate of the maximal pressure found between each written output (only for few test cases).
Definition Run.h:161
int m_numberPhases
Number of phases.
Definition Run.h:104
std::vector< Output * > m_recordBoundaries
Vector of output object for boundaries data recording.
Definition Run.h:158
void solveHyperbolic(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:993
Limiter * m_globalVolumeFractionLimiter
Definition Run.h:138
int m_MRF
source term for Moving Reference Frame computation index(in the list of source term)
Definition Run.h:111
friend class OutputVTK
Definition Run.h:188
double m_physicalTime
Physical time.
Definition Run.h:147
double m_finalPhysicalTime
Definition Run.h:102
std::vector< Source * > m_sources
Vector of source terms.
Definition Run.h:135
std::vector< Output * > m_probes
Vector of output objects for probes.
Definition Run.h:156
int m_numberSolids
Number of solid phases.
Definition Run.h:105
Output * m_outputMeshMapping
Output object containing info from simulation to be mapped (usually the rough mesh).
Definition Run.h:169
friend class OutputBoundaryAllGNU
Definition Run.h:198
void verifyErrors()
Definition Run.cpp:1126
Mesh * m_mesh
Mesh type object: contains all geometrical properties of the simulation.
Definition Run.h:125
std::vector< GeometricalDomain * > m_solidDomains
Solid domains (immersed boundaries).
Definition Run.h:115
double m_meanTemp
Volume-weighted temperature of the domain.
Definition Run.h:179
double m_globalT
Volume-weighted temperature (numerator only).
Definition Run.h:177
Limiter * m_interfaceVolumeFractionLimiter
Definition Run.h:140
void initialize()
Initialization of the simulation.
Definition Run.cpp:93
TypeMeshContainer< Cell * > * m_cellsLvl
Array of vectors (one per level) of computational cell objects: Contains physical fluid states.
Definition Run.h:128
double m_globalThetaTheta
Volume-weighted dilatation (numerator only).
Definition Run.h:178
Limiter * m_globalLimiter
Slope limiter type object for second order in space.
Definition Run.h:136
void resumeSimulation()
Definition Run.cpp:445
int m_numberTransports
Number of additional transport variables.
Definition Run.h:107
double m_alphaWanted
Mass and corresponding volume fraction for special output (only for few test cases).
Definition Run.h:163
Output * m_outPut
Main output object.
Definition Run.h:154
std::vector< Output * > m_cuts
Vector of output objects for cuts.
Definition Run.h:155
std::vector< Output * > m_globalQuantities
Vector of output objects for global quantities (mass or total energy).
Definition Run.h:157
friend class OutputCutGNU
Definition Run.h:194
void restartSimulationMeshMapping(std::vector< GeometricalDomain * > &domains, Mesh *mesh)
Definition Run.cpp:347
double m_volumePhaseK
Volume of phase k. Output with purpose to track the radius of a bubble over time.
Definition Run.h:162
General class for axial symmetries.
Definition Symmetry.h:45
Definition timeStats.h:40