ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
CellInterface.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 CELLINTERFACE_H
32#define CELLINTERFACE_H
33
34class CellInterface; //Predeclaration de la classe CellInterface pour pouvoir inclure Cell.h
35
36#include "Cell.h"
37#include "../Models/Model.h"
38#include "../Models/Flux.h"
39#include "../Maths/Coord.h"
40#include "../Meshes/Face.h"
43
44class Source; //Predeclaration to include following file
45#include "../Sources/Source.h"
46
48{
49 public:
52 CellInterface(const int& lvl); //Pour AMR
54 virtual ~CellInterface();
55
56 void setFace(Face* face);
57
58 virtual void computeFlux(double& dtMax,
59 Limiter& globalLimiter,
60 Limiter& interfaceLimiter,
61 Limiter& globalVolumeFractionLimiter,
62 Limiter& interfaceVolumeFractionLimiter,
63 Prim type = vecPhases);
64 virtual void computeFluxAddPhys(AddPhys& addPhys);
65 virtual void solveRiemann(double& dtMax,
66 Limiter& /*globalLimiter*/,
67 Limiter& /*interfaceLimiter*/,
68 Limiter& /*globalVolumeFractionLimiter*/,
69 Limiter& /*interfaceVolumeFractionLimiter*/,
70 Prim /*type*/ = vecPhases);
71 virtual void initialize(Cell* cellLeft, Cell* cellRight);
72 void initializeGauche(Cell* cellLeft);
73 virtual void initializeDroite(Cell* cellRight);
74 virtual void addFlux(const double& coefAMR);
75 void subtractFlux(const double& coefAMR);
78 double distance(Cell* c);
79
80 virtual int whoAmI() const { return 0; };
81 virtual int whoAmIHeat() const { return ADIABATIC; };
82 virtual bool isMRFWall() const { return false; }
83
84 virtual void checkMrfInterface(Source* sourceMRF);
85 void solveRiemannMRF(double& dtMax);
86
87 //Inutilise pour cell interfaces ordre 1
88 virtual void allocateSlopes(int& /*allocateSlopeLocal*/) {};
89 virtual void computeSlopes(Prim /*type*/ = vecPhases){};
90 virtual Phase* getSlopesPhase(const int& /*phaseNumber*/) const { return 0; };
91 virtual Mixture* getSlopesMixture() const { return 0; };
92 virtual Transport* getSlopesTransport(const int& /*numberTransport*/) const { return 0; };
93 //virtual Cell* getB(BO2 B) const { return 0; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
94 //virtual double getBeta(betaO2 beta) const { return 0.; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
95 //virtual double getDistanceH(distanceHO2 dist) const { return 0.; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
96 //virtual void setB(BO2 B, Cell* cell) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
97 //virtual void setBeta(betaO2 beta, double& value) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
98 //virtual void setDistanceH(distanceHO2 dist, double& value) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
99
100 //Accessors
101 Face* getFace();
102 Model* getMod() const;
103 Cell* getCellLeft() const;
104 Cell* getCellRight() const;
105 virtual const int& getNumPhys() const { return Errors::defaultIntNeg; };
106 virtual double getBoundData(VarBoundary /*var*/) const
107 {
108 Errors::errorMessage("getBoundData not available for CellInterface");
109 return 0.;
110 }
111 virtual double getBoundaryHeatQuantity() const
112 {
114 };
117 virtual double getWallVelocity()
118 {
119 Errors::errorMessage("getWallVelocity not available for CellInterface");
121 };
122
123 //For AMR method
124 virtual void computeXi(const double& criteriaVar,
125 const bool& varRho,
126 const bool& varP,
127 const bool& varU,
128 const bool& varAlpha);
129 void computeCritereAMR(const double& criteriaVar, Variable nameVariable, int num = 0);
130 virtual void computeFluxXi();
131 virtual void creerCellInterfaceChild();
133 const int& lvl, std::vector<CellInterface*>* childrenInternalCellInterfaces);
134 void creerFaceChild(CellInterface* cellInterfaceParent);
135 virtual void raffineCellInterfaceExterne(
136 const int& nbCellsY,
137 const int& nbCellsZ,
138 const double& dXParent,
139 const double& dYParent,
140 const double& dZParent,
141 Cell* cellRef,
142 const int& dim);
143 virtual void deraffineCellInterfaceExterne(Cell* cellRef);
147 std::vector<CellInterface*>* cellInterfacesLvl);
149 bool getSplit() const;
150 const int& getLvl() const { return m_lvl; };
152 CellInterface* getCellInterfaceChild(const int& numChild);
155
156 protected:
160
161 //Attributs pour methode AMR
162 int m_lvl;
163 std::vector<CellInterface*> m_cellInterfacesChildren;
164
165 //Atributes MRF
169
170 private:
171};
172
173//Utile pour la resolution des problemes de Riemann
174extern Cell* bufferCellLeft;
175extern Cell* bufferCellRight;
176
177#endif // CELLINTERFACE_H
Cell * bufferCellLeft
Definition CellInterface.cpp:35
Cell * bufferCellRight
Definition CellInterface.cpp:36
Prim
Enumeration for the primitive-variable type (usefull for second order, slopes, etc....
Definition Tools.h:40
@ vecPhases
Definition Tools.h:41
VarBoundary
Enumeration for the variable to extract on a boundary.
Definition Tools.h:106
Variable
Enumeration for the flow variables.
Definition Tools.h:163
@ ADIABATIC
Definition Tools.h:118
General class for additional physics.
Definition AddPhys.h:46
Definition CellInterface.h:48
void setFace(Face *face)
Definition CellInterface.cpp:79
Face * m_face
Definition CellInterface.h:159
virtual const int & getNumPhys() const
Definition CellInterface.h:105
virtual Transport * getSlopesTransport(const int &) const
Definition CellInterface.h:92
Cell * getCellLeft() const
Definition CellInterface.cpp:324
virtual void solveRiemann(double &dtMax, Limiter &, Limiter &, Limiter &, Limiter &, Prim=vecPhases)
Definition CellInterface.cpp:146
virtual void computeXi(const double &criteriaVar, const bool &varRho, const bool &varP, const bool &varU, const bool &varAlpha)
Definition CellInterface.cpp:334
virtual Coord & getWallRotationalVelocityMRF()
Returns imposed heat quantity on the wall, could be temperature or flux density (see BounCondWall....
Definition CellInterface.h:115
Coord m_omega
Definition CellInterface.h:168
void subtractFlux(const double &coefAMR)
Definition CellInterface.cpp:275
Model * getMod() const
Definition CellInterface.cpp:320
void addFluxRotatingRegion()
Definition CellInterface.cpp:294
virtual void computeSlopes(Prim=vecPhases)
Definition CellInterface.h:89
Face * getFace()
Definition CellInterface.cpp:316
virtual void creerCellInterfaceChild()
Definition CellInterface.cpp:412
void solveRiemannMRF(double &dtMax)
Definition CellInterface.cpp:176
virtual int whoAmI() const
Definition CellInterface.h:80
double distance(Cell *c)
Definition CellInterface.cpp:312
const int & getLvl() const
Definition CellInterface.h:150
virtual Phase * getSlopesPhase(const int &) const
Definition CellInterface.h:90
int m_lvl
Definition CellInterface.h:162
virtual void initialize(Cell *cellLeft, Cell *cellRight)
Definition CellInterface.cpp:63
virtual Mixture * getSlopesMixture() const
Definition CellInterface.h:91
void constructionArrayExternalCellInterfacesLvl(std::vector< CellInterface * > *cellInterfacesLvl)
Definition CellInterface.cpp:1263
virtual void raffineCellInterfaceExterne(const int &nbCellsY, const int &nbCellsZ, const double &dXParent, const double &dYParent, const double &dZParent, Cell *cellRef, const int &dim)
Definition CellInterface.cpp:427
void initializeGauche(Cell *cellLeft)
Definition CellInterface.cpp:71
CellInterface * getCellInterfaceChildBack()
Definition CellInterface.cpp:1291
void computeCritereAMR(const double &criteriaVar, Variable nameVariable, int num=0)
Definition CellInterface.cpp:360
virtual double getWallVelocity()
Returns the wall velocity of a moving wall boundary condition.
Definition CellInterface.h:117
virtual void addFlux(const double &coefAMR)
Definition CellInterface.cpp:256
CellInterface()
Definition CellInterface.cpp:40
Cell * m_cellRight
Definition CellInterface.h:158
virtual ~CellInterface()
Definition CellInterface.cpp:52
virtual void initializeDroite(Cell *cellRight)
Definition CellInterface.cpp:75
virtual bool isMRFWall() const
Returns heat boundary type for wall (see BoundCondWall.h).
Definition CellInterface.h:82
virtual double getBoundData(VarBoundary) const
Definition CellInterface.h:106
bool m_mrfStaticRegionIsLeft
Definition CellInterface.h:167
void updatePointersInternalCellInterfaces()
Definition CellInterface.cpp:1295
virtual int whoAmIHeat() const
Definition CellInterface.h:81
virtual void allocateSlopes(int &)
Definition CellInterface.h:88
void creerFaceChild(CellInterface *cellInterfaceParent)
Definition CellInterface.cpp:423
void substractFluxRotatingRegion()
Definition CellInterface.cpp:303
virtual void computeFlux(double &dtMax, Limiter &globalLimiter, Limiter &interfaceLimiter, Limiter &globalVolumeFractionLimiter, Limiter &interfaceVolumeFractionLimiter, Prim type=vecPhases)
Definition CellInterface.cpp:105
int getNumberCellInterfacesChildren() const
Definition CellInterface.cpp:1283
std::vector< CellInterface * > m_cellInterfacesChildren
Definition CellInterface.h:163
bool m_mrfInterface
Definition CellInterface.h:166
Cell * m_cellLeft
Definition CellInterface.h:157
virtual double getBoundaryHeatQuantity() const
Definition CellInterface.h:111
virtual void deraffineCellInterfaceExterne(Cell *cellRef)
Definition CellInterface.cpp:1189
bool getSplit() const
Definition CellInterface.cpp:1272
virtual void computeFluxXi()
Definition CellInterface.cpp:388
virtual void creerCellInterfaceChildInterne(const int &lvl, std::vector< CellInterface * > *childrenInternalCellInterfaces)
Definition CellInterface.cpp:416
void deraffineCellInterfacesChildren()
Definition CellInterface.cpp:1253
CellInterface * getCellInterfaceChild(const int &numChild)
Definition CellInterface.cpp:1287
Cell * getCellRight() const
Definition CellInterface.cpp:328
virtual void computeFluxAddPhys(AddPhys &addPhys)
Definition CellInterface.cpp:142
virtual void checkMrfInterface(Source *sourceMRF)
Definition CellInterface.cpp:83
Base class for a mesh cell.
Definition Cell.h:59
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static Coord defaultCoordNonConst
Default Coord object (non-const version).
Definition Coord.h:58
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
static constexpr int defaultIntNeg
Definition Errors.h:98
static constexpr double defaultDouble
Definition Errors.h:99
Definition Face.h:42
Definition Limiter.h:38
Abstract class for mixture variables.
Definition Mixture.h:43
Abstract class for mathematical flow models.
Definition Model.h:50
Abstract class for a phase.
Definition Phase.h:47
Abstract class for source terms.
Definition Source.h:43
Class for additional transport equations.
Definition Transport.h:41