ECOGEN 4.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"
41#include "../Meshes/FaceCartesian.h"
42#include "../AdditionalPhysics/AddPhys.h"
43
44class Source; //Predeclaration to include following file
45#include "../Sources/Source.h"
46
50
52{
53 public:
56 CellInterface(const int& lvl); //Pour AMR
58 virtual ~CellInterface();
59
60 void setFace(Face* face);
61
62 virtual void computeFlux(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type = vecPhases);
63 virtual void computeFluxAddPhys(AddPhys& addPhys);
64 virtual void solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim /*type*/ = vecPhases);
65 virtual void initialize(Cell* cellLeft, Cell* cellRight);
66 void initializeGauche(Cell* cellLeft);
67 virtual void initializeDroite(Cell* cellRight);
68 virtual void addFlux(const double& coefAMR);
69 void subtractFlux(const double& coefAMR);
72 double distance(Cell* c);
73
74 virtual int whoAmI() const { return 0; };
75 virtual int whoAmIHeat() const { return ADIABATIC; };
76 virtual bool isMRFWall() const { return false; }
77
78 virtual void checkMrfInterface(Source* sourceMRF);
79 void solveRiemannMRF(double& dtMax);
80
81 //Inutilise pour cell interfaces ordre 1
82 virtual void allocateSlopes(int& /*allocateSlopeLocal*/) {};
83 virtual void computeSlopes(Prim /*type*/ = vecPhases) {};
84 virtual Phase* getSlopesPhase(const int& /*phaseNumber*/) const { return 0; };
85 virtual Mixture* getSlopesMixture() const { return 0; };
86 virtual Transport* getSlopesTransport(const int& /*numberTransport*/) const { return 0; };
87 //virtual Cell* getB(BO2 B) const { return 0; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
88 //virtual double getBeta(betaO2 beta) const { return 0.; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
89 //virtual double getDistanceH(distanceHO2 dist) const { return 0.; }; /*!< Ne fait rien pour des cell interfaces ordre 1 */
90 //virtual void setB(BO2 B, Cell* cell) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
91 //virtual void setBeta(betaO2 beta, double& value) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
92 //virtual void setDistanceH(distanceHO2 dist, double& value) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */
93
94
95 //Accesseurs
96 Face *getFace();
97 Model* getMod() const;
98 Cell* getCellLeft() const;
99 Cell* getCellRight() const;
100 virtual const int& getNumPhys() const { return Errors::defaultIntNeg; };
101 virtual double getBoundData(VarBoundary /*var*/) const { Errors::errorMessage("getBoundData not available for CellInterface"); return 0.; }
102 virtual double getBoundaryHeatQuantity() const { return Errors::defaultDouble; };
104
105 //Pour methode AMR
106 virtual void computeXi(const double& criteriaVar, const bool& varRho, const bool& varP, const bool& varU, const bool& varAlpha);
107 void computeCritereAMR(const double& criteriaVar, Variable nameVariable, int num = 0);
108 virtual void computeFluxXi();
109 virtual void creerCellInterfaceChild();
110 virtual void creerCellInterfaceChildInterne(const int& lvl, std::vector<CellInterface*>* childrenInternalCellInterfaces);
111 void creerFaceChild(CellInterface* cellInterfaceParent);
112 virtual void raffineCellInterfaceExterne(const int& nbCellsY, const int& nbCellsZ, const double& dXParent, const double& dYParent, const double& dZParent, Cell* cellRef, const int& dim);
113 virtual void deraffineCellInterfaceExterne(Cell* cellRef);
115 void constructionArrayExternalCellInterfacesLvl(std::vector<CellInterface*>* cellInterfacesLvl);
116 bool getSplit() const;
117 const int& getLvl() const { return m_lvl; };
119 CellInterface* getCellInterfaceChild(const int& numChild);
122
123 protected:
127
128 //Attributs pour methode AMR
129 int m_lvl;
130 std::vector<CellInterface*> m_cellInterfacesChildren;
132 //Atributes MRF
136
137 private:
138};
139
140//Utile pour la resolution des problemes de Riemann
141extern Cell* bufferCellLeft;
142extern Cell* bufferCellRight;
143
144#endif // CELLINTERFACE_H
Cell * bufferCellLeft
Definition CellInterface.cpp:35
betaO2
Definition CellInterface.h:48
@ betaG1M
Definition CellInterface.h:48
@ betaG3P
Definition CellInterface.h:48
@ betaG2M
Definition CellInterface.h:48
@ betaG1P
Definition CellInterface.h:48
@ betaD2M
Definition CellInterface.h:48
@ betaD2P
Definition CellInterface.h:48
@ betaG3M
Definition CellInterface.h:48
@ betaD3P
Definition CellInterface.h:48
@ betaD1P
Definition CellInterface.h:48
@ betaD1M
Definition CellInterface.h:48
@ betaG2P
Definition CellInterface.h:48
@ betaD3M
Definition CellInterface.h:48
BO2
Definition CellInterface.h:47
@ BG2P
Definition CellInterface.h:47
@ BG2M
Definition CellInterface.h:47
@ BD3M
Definition CellInterface.h:47
@ BG3M
Definition CellInterface.h:47
@ BG1M
Definition CellInterface.h:47
@ BD1M
Definition CellInterface.h:47
@ BD1P
Definition CellInterface.h:47
@ BG1P
Definition CellInterface.h:47
@ BD2M
Definition CellInterface.h:47
@ BD2P
Definition CellInterface.h:47
@ BD3P
Definition CellInterface.h:47
@ BG3P
Definition CellInterface.h:47
distanceHO2
Definition CellInterface.h:49
@ distanceHGM
Definition CellInterface.h:49
@ distanceHDP
Definition CellInterface.h:49
@ distanceHDM
Definition CellInterface.h:49
@ distanceHGP
Definition CellInterface.h:49
Cell * bufferCellRight
Definition CellInterface.cpp:36
Prim
Enumeration for the primitive-variable type (usefull for second order, slopes, etc....
Definition Tools.h:39
@ vecPhases
Definition Tools.h:39
VarBoundary
Enumeration for the variable to extract on a boundary.
Definition Tools.h:60
Variable
Enumeration for the flow variables.
Definition Tools.h:78
@ ADIABATIC
Definition Tools.h:63
General class for additional physics.
Definition AddPhys.h:46
Definition CellInterface.h:52
void setFace(Face *face)
Definition CellInterface.cpp:85
Face * m_face
Definition CellInterface.h:126
virtual const int & getNumPhys() const
Definition CellInterface.h:100
virtual Transport * getSlopesTransport(const int &) const
Definition CellInterface.h:86
Cell * getCellLeft() const
Definition CellInterface.cpp:340
virtual void solveRiemann(double &dtMax, Limiter &, Limiter &, Limiter &, Limiter &, Prim=vecPhases)
Definition CellInterface.cpp:154
virtual void computeXi(const double &criteriaVar, const bool &varRho, const bool &varP, const bool &varU, const bool &varAlpha)
Definition CellInterface.cpp:356
virtual Coord & getWallRotationalVelocityMRF()
Returns imposed heat quantity on the wall, could be temperature or flux density (see BounCondWall....
Definition CellInterface.h:103
Coord m_omega
Definition CellInterface.h:135
void subtractFlux(const double &coefAMR)
Definition CellInterface.cpp:284
Model * getMod() const
Definition CellInterface.cpp:333
void addFluxRotatingRegion()
Definition CellInterface.cpp:301
virtual void computeSlopes(Prim=vecPhases)
Definition CellInterface.h:83
Face * getFace()
Definition CellInterface.cpp:326
virtual void creerCellInterfaceChild()
Definition CellInterface.cpp:426
void solveRiemannMRF(double &dtMax)
Definition CellInterface.cpp:178
virtual int whoAmI() const
Definition CellInterface.h:74
double distance(Cell *c)
Definition CellInterface.cpp:319
const int & getLvl() const
Definition CellInterface.h:117
virtual Phase * getSlopesPhase(const int &) const
Definition CellInterface.h:84
int m_lvl
Definition CellInterface.h:129
virtual void initialize(Cell *cellLeft, Cell *cellRight)
Definition CellInterface.cpp:63
virtual Mixture * getSlopesMixture() const
Definition CellInterface.h:85
void constructionArrayExternalCellInterfacesLvl(std::vector< CellInterface * > *cellInterfacesLvl)
Definition CellInterface.cpp:1214
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:447
void initializeGauche(Cell *cellLeft)
Definition CellInterface.cpp:71
CellInterface * getCellInterfaceChildBack()
Definition CellInterface.cpp:1246
void computeCritereAMR(const double &criteriaVar, Variable nameVariable, int num=0)
Definition CellInterface.cpp:378
virtual void addFlux(const double &coefAMR)
Definition CellInterface.cpp:267
CellInterface()
Definition CellInterface.cpp:40
Cell * m_cellRight
Definition CellInterface.h:125
virtual ~CellInterface()
Definition CellInterface.cpp:52
virtual void initializeDroite(Cell *cellRight)
Definition CellInterface.cpp:78
virtual bool isMRFWall() const
Returns heat boundary type for wall (see BoundCondWall.h)
Definition CellInterface.h:76
virtual double getBoundData(VarBoundary) const
Definition CellInterface.h:101
bool m_mrfStaticRegionIsLeft
Definition CellInterface.h:134
void updatePointersInternalCellInterfaces()
Definition CellInterface.cpp:1253
virtual int whoAmIHeat() const
Definition CellInterface.h:75
virtual void allocateSlopes(int &)
Definition CellInterface.h:82
void creerFaceChild(CellInterface *cellInterfaceParent)
Definition CellInterface.cpp:440
void substractFluxRotatingRegion()
Definition CellInterface.cpp:310
virtual void computeFlux(double &dtMax, Limiter &globalLimiter, Limiter &interfaceLimiter, Limiter &globalVolumeFractionLimiter, Limiter &interfaceVolumeFractionLimiter, Prim type=vecPhases)
Definition CellInterface.cpp:114
int getNumberCellInterfacesChildren() const
Definition CellInterface.cpp:1232
std::vector< CellInterface * > m_cellInterfacesChildren
Definition CellInterface.h:130
bool m_mrfInterface
Definition CellInterface.h:133
Cell * m_cellLeft
Definition CellInterface.h:124
virtual double getBoundaryHeatQuantity() const
Definition CellInterface.h:102
virtual void deraffineCellInterfaceExterne(Cell *cellRef)
Definition CellInterface.cpp:1145
bool getSplit() const
Definition CellInterface.cpp:1223
virtual void computeFluxXi()
Definition CellInterface.cpp:402
virtual void creerCellInterfaceChildInterne(const int &lvl, std::vector< CellInterface * > *childrenInternalCellInterfaces)
Definition CellInterface.cpp:433
void deraffineCellInterfacesChildren()
Definition CellInterface.cpp:1204
CellInterface * getCellInterfaceChild(const int &numChild)
Definition CellInterface.cpp:1239
Cell * getCellRight() const
Definition CellInterface.cpp:347
virtual void computeFluxAddPhys(AddPhys &addPhys)
Definition CellInterface.cpp:147
virtual void checkMrfInterface(Source *sourceMRF)
Definition CellInterface.cpp:92
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:92
static constexpr double defaultDouble
Definition Errors.h:93
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