ECOGEN 4.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 restartSimulation();
78 void restartSimulationMeshMapping(std::vector<GeometricalDomain*> &domains, Mesh* mesh);
79
80 //Accessors
81 const int& getNumberPhases() const { return m_numberPhases; };
82
83 private:
84
85 //Specific solvers
86 void integrationProcedure(double& dt, int lvl, double& dtMax, int& nbCellsTotalAMR);
87 void advancingProcedure(double& dt, int& lvl, double& dtMax);
88 void solveHyperbolic(double& dt, int& lvl, double& dtMax);
89 void solveHyperbolicO2(double& dt, int& lvl, double& dtMax);
90 void solveAdditionalPhysics(double& dt, int& lvl);
91 void solveSourceTerms(double& dt, int& lvl);
92 void solveRelaxations(double& dt, int& lvl);
93 void verifyErrors() const;
94
96
97 //Input attributes
98 std::string m_simulationName;
102 double m_cfl;
110 int m_MRF;
112 std::string m_order;
114 std::vector<GeometricalDomain*> m_solidDomains;
115
116 //Specific to AMR method
119
120 //Geometrical attributes
123
124 //Calcul attributes
132 std::vector<AddPhys*> m_addPhys;
134 std::vector<Source*> m_sources;
139 std::vector<std::string> m_nameGTR;
140 std::vector<std::string> m_nameQPA;
141 std::vector<std::string> m_nameGPH;
142 double m_dt;
143 double m_dtNext;
148
149 //Input/Output attributes
152 std::vector<Output*> m_cuts;
153 std::vector<Output*> m_probes;
154 std::vector<Output*> m_globalQuantities;
155 std::vector<Output*> m_recordBoundaries;
157 double* m_pMax;
158 double* m_pMaxWall;
162
163 //Mesh mapping restart
166 std::string m_meshFileMapped;
167
168 friend class Input;
169 friend class Output;
170 friend class OutputXML;
171 friend class OutputGNU;
172 friend class OutputProbeGNU;
173 friend class OutputGlobalGNU;
174 friend class OutputBoundaryGNU;
177 friend class Mesh;
178};
179
180#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:83
General class for Equation of State (EOS).
Definition Eos.h:54
Base class for the gradient method.
Definition Gradient.h:43
Definition Input.h:55
Definition Limiter.h:38
Abstract class for a mesh.
Definition Mesh.h:53
Abstract class for mathematical flow models.
Definition Model.h:50
Definition OutputBoundaryAllGNU.h:37
Definition OutputBoundaryFluxGNU.h:39
Definition OutputBoundaryGNU.h:37
Definition OutputGNU.h:36
Definition OutputGlobalGNU.h:37
Printing results for a probe in flow.
Definition OutputProbeGNU.h:42
Definition OutputXML.h:37
Definition Output.h:54
Class regrouping all information for a simulation.
Definition Run.h:63
std::vector< std::string > m_nameQPA
Vector of names of the quantities of additional physics.
Definition Run.h:140
TypeMeshContainer< CellInterface * > * m_cellInterfacesLvl
Array of vectors (one per level) of interface objects between cells (or between a cell and a physical...
Definition Run.h:130
std::string m_simulationName
Name of the simulation.
Definition Run.h:98
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:141
int m_lvlMax
Maximum AMR level (if 0, then no AMR)
Definition Run.h:117
int m_nbIte
Definition Run.h:100
void solveAdditionalPhysics(double &dt, int &lvl)
Definition Run.cpp:720
Input * m_input
Input object.
Definition Run.h:150
std::vector< AddPhys * > m_addPhys
Vector of Additional physics.
Definition Run.h:132
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_restartAMRsaveFreq
Frequency at which a save to restart a simulation is done (usefull only for AMR)
Definition Run.h:147
int m_numberEos
Number of equations of states.
Definition Run.h:105
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:95
void advancingProcedure(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:583
int m_freq
Requested number of final time iteration and frequency.
Definition Run.h:100
bool m_timeControlIterations
Choice for time control mode (iteration or physical time)
Definition Run.h:99
double * m_pMax
Maximal pressure found between each written output (only for few test cases)
Definition Run.h:157
timeStats m_stat
Object linked to computational time statistics.
Definition Run.h:156
bool m_smoothCrossSection1d
1D with smooth cross section variation scheme if active
Definition Run.h:122
void finalize()
Cleaning simulation.
Definition Run.cpp:846
double m_timeFreq
Requested final physical time of the simulation and time frequency for output printing.
Definition Run.h:101
double m_cfl
CFL criteria (between 0 and 1)
Definition Run.h:102
int m_numberAddPhys
Number of additional physical effects.
Definition Run.h:107
bool m_restartMeshMapping
Option to set the mesh mapping restart option.
Definition Run.h:164
Symmetry * m_symmetry
Specific object for symmetry (cylindrical or spherical) if active.
Definition Run.h:133
int m_iteration
time iteration number
Definition Run.h:145
bool m_extractRefLength
Option to extract cells' reference length.
Definition Run.h:113
bool m_recordPsat
Add recording of saturation pressure (valid for a liquid/vapor couple and predominant phase should be...
Definition Run.h:161
double m_dtNext
Next time step.
Definition Run.h:143
Eos ** m_eos
Array of Equations of states: Contains fluid EOS parameters.
Definition Run.h:131
void solveHyperbolicO2(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:627
double m_dt
Explicit time step.
Definition Run.h:142
void solveRelaxations(double &dt, int &lvl)
Definition Run.cpp:771
int m_numberSources
Number of additional source terms.
Definition Run.h:108
std::vector< std::string > m_nameGTR
Vector of transport variable names.
Definition Run.h:139
void integrationProcedure(double &dt, int lvl, double &dtMax, int &nbCellsTotalAMR)
Definition Run.cpp:502
Limiter * m_interfaceLimiter
Slope limiter type object for second order in space specific to interface location.
Definition Run.h:136
Model * m_model
Model type object: contains the flow model methods.
Definition Run.h:126
~Run()
Definition Run.cpp:65
bool m_viscous
Viscous flow additionnal physic option required to set proper wall boundary condition (false by defau...
Definition Run.h:111
const int & getNumberPhases() const
Definition Run.h:81
int m_nbCellsTotalAMR
Number of total cells during the simulation.
Definition Run.h:118
int m_dimension
dimension 1, 2 or 3
Definition Run.h:109
std::string m_order
Precision scheme order (firstorder or secondOrder)
Definition Run.h:112
std::string m_meshFileMapped
Filename of the mesh to be mapped.
Definition Run.h:166
void solveSourceTerms(double &dt, int &lvl)
Definition Run.cpp:757
void solver()
Hyperbolic resolution + Relaxations + Source terms integration.
Definition Run.cpp:385
double m_massWanted
Definition Run.h:160
double * m_pMaxWall
Coordinate of the maximal pressure found between each written output (only for few test cases)
Definition Run.h:158
int m_numberPhases
Number of phases.
Definition Run.h:103
std::vector< Output * > m_recordBoundaries
Vector of output object for boundaries data recording.
Definition Run.h:155
void solveHyperbolic(double &dt, int &lvl, double &dtMax)
Definition Run.cpp:696
Limiter * m_globalVolumeFractionLimiter
Slope limiter type object for second order in space specific to interface advected variables (alpha,...
Definition Run.h:137
int m_MRF
source term for Moving Reference Frame computation index(in the list of source term)
Definition Run.h:110
double m_physicalTime
Physical time.
Definition Run.h:144
double m_finalPhysicalTime
Definition Run.h:101
std::vector< Source * > m_sources
Vector of source terms.
Definition Run.h:134
std::vector< Output * > m_probes
Vector of output objects for probes.
Definition Run.h:153
int m_numberSolids
Number of solid phases.
Definition Run.h:104
void restartSimulation()
Definition Run.cpp:345
int m_restartSimulation
File number for restarting a simulation.
Definition Run.h:146
Output * m_outputMeshMapping
Output object containing info from simulation to be mapped (usually the rough mesh)
Definition Run.h:165
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:114
void verifyErrors() const
Definition Run.cpp:808
Limiter * m_interfaceVolumeFractionLimiter
Slope limiter type object for second order in space specific to interface advected variables (alpha,...
Definition Run.h:138
void initialize()
Initialization of the simulation.
Definition Run.cpp:69
TypeMeshContainer< Cell * > * m_cellsLvl
Array of vectors (one per level) of computational cell objects: Contains physical fluid states.
Definition Run.h:128
Limiter * m_globalLimiter
Slope limiter type object for second order in space.
Definition Run.h:135
int m_numberTransports
Number of additional transport variables.
Definition Run.h:106
double m_alphaWanted
Mass and corresponding volume fraction for special output (only for few test cases)
Definition Run.h:160
Output * m_outPut
Main output object.
Definition Run.h:151
std::vector< Output * > m_cuts
Vector of output objects for cuts.
Definition Run.h:152
std::vector< Output * > m_globalQuantities
Vector of output objects for global quantities (mass or total energy)
Definition Run.h:154
void restartSimulationMeshMapping(std::vector< GeometricalDomain * > &domains, Mesh *mesh)
Definition Run.cpp:250
double m_volumePhaseK
Volume of phase k. Output with purpose to track the radius of a bubble over time.
Definition Run.h:159
General class for axial symmetries.
Definition Symmetry.h:45
Definition timeStats.h:40