35#include "../Models/Phase.h"
36#include "../Maths/Coord.h"
37#include "../Maths/Tensor.h"
38#include "../Transport/Transport.h"
39#include "../Transport/GradTransport.h"
43#include "../Models/Mixture.h"
44#include "../AdditionalPhysics/QuantitiesAddPhys.h"
46#include "../Models/Model.h"
47#include "../Gradients/Gradient.h"
48#include "../Models/Flux.h"
49#include "../Meshes/Element.h"
50#include "../Geometries/GeometricalDomain.h"
51#include "../Symmetries/Symmetry.h"
81 virtual void allocate(
const std::vector<AddPhys*>& addPhys);
85 void fill(std::vector<GeometricalDomain*>& domains,
const int& );
117 void setGradTk(
int& numPhase,
int& numAddPhys,
double* buffer,
int& counter);
128 void computeGradients(std::vector<Coord>& grads, std::vector<Variable>& nameVariables, std::vector<int>& numPhases);
179 double& ,
double& ,
double& ,
220 void chooseRefine(
const double& xiSplit,
const int& nbCellsY,
const int& nbCellsZ,
221 const std::vector<AddPhys*>& addPhys,
int& nbCellsTotalAMR);
223 void refineCellAndCellInterfaces(
const int& nbCellsY,
const int& nbCellsZ,
const std::vector<AddPhys*>& addPhys,
const bool& refineExternalCellInterfaces);
233 void setXi(
double value);
247 void fillBufferVector(
double* buffer,
int& counter,
const int& lvl,
const int& neighbour,
const int& dim,
Variable nameVector,
int num = 0,
int index = -1)
const;
248 void getBufferVector(
double* buffer,
int& counter,
const int& lvl,
const int& dim,
Variable nameVector,
int num = 0,
int index = -1);
249 void fillBufferTransports(
double* buffer,
int& counter,
const int& lvl,
const int& neighbour)
const;
262 void chooseRefineDeraffineGhost(
const int& nbCellsY,
const int& nbCellsZ,
const std::vector<AddPhys*>& addPhys, std::vector<Cell*>* cellsLvlGhost);
265 void fillBufferXi(
double* buffer,
int& counter,
const int& lvl,
const int& neighbour)
const;
266 void getBufferXi(
double* buffer,
int& counter,
const int& lvl);
267 void fillBufferSplit(
bool* buffer,
int& counter,
const int& lvl,
const int& neighbour)
const;
269 void fillNumberElementsToSendToNeighbour(
int& numberElementsToSendToNeighbor,
int& numberSlopesToSendToNeighbor,
const int& lvl,
const int& neighbour,
int numberNeighboursOfCPUneighbour);
270 void fillDataToSend(std::vector<double>& dataToSend, std::vector<int>& dataSplitToSend,
const int& lvl)
const;
271 void getDataToReceiveAndRefine(std::vector<double>& dataToReceive, std::vector<int>& dataSplitToReceive,
const int& lvl,
Eos** eos,
int& counter,
int& counterSplit,
272 const int& nbCellsY,
const int& nbCellsZ,
const std::vector<AddPhys*>& addPhys);
303extern std::vector<Coord>
gradRho;
std::vector< Variable > variableDensity
Definition Cell.cpp:38
std::vector< int > numeratorDefault
Definition Cell.cpp:39
Model * model
Definition CellInterface.cpp:33
std::vector< Coord > gradRho
Definition Cell.cpp:37
Gradient * gradient
Definition Cell.cpp:36
General class for additional physics.
Definition AddPhys.h:46
Definition CellInterface.h:52
Base class for a mesh cell.
Definition Cell.h:59
virtual void computeGradientsO2()
Compute gradients for 2nd-order scheme on unstructured mesh.
Definition Cell.h:172
void setToZeroConsGlobal()
Definition Cell.cpp:269
bool getWall() const
Definition Cell.h:160
double getDensityGradient()
Definition Cell.cpp:627
void addCellInterface(CellInterface *cellInterface)
Add a cell interface to current cell.
Definition Cell.cpp:89
virtual void saveCons()
Definition Cell.h:186
void addFluxXi(double value)
Definition Cell.cpp:1478
void correctionEnergy()
Definition Cell.cpp:327
std::vector< Cell * > m_childrenCells
Definition Cell.h:295
void timeEvolution(const double &dt, Symmetry *symmetry)
Definition Cell.cpp:286
Flux * getCons() const
Definition Cell.cpp:543
Transport * m_vecTransports
Definition Cell.h:283
void getDataToReceiveAndRefine(std::vector< double > &dataToReceive, std::vector< int > &dataSplitToReceive, const int &lvl, Eos **eos, int &counter, int &counterSplit, const int &nbCellsY, const int &nbCellsZ, const std::vector< AddPhys * > &addPhys)
Definition Cell.cpp:2056
void setConsTransport(double value, const int &numTransport)
Definition Cell.cpp:600
Transport * m_consTransports
Definition Cell.h:285
void sourceTermIntegration(const double &)
Definition Cell.h:95
Element * m_element
Definition Cell.h:286
Cell * getCellChild(const int &num)
Definition Cell.cpp:1492
const double & getSizeZ() const
Definition Cell.h:144
void refineCellAndCellInterfacesGhost(const int &nbCellsY, const int &nbCellsZ, const std::vector< AddPhys * > &addPhys)
Definition Cell.cpp:1694
void refineCellAndCellInterfaces(const int &nbCellsY, const int &nbCellsZ, const std::vector< AddPhys * > &addPhys, const bool &refineExternalCellInterfaces)
Definition Cell.cpp:984
void printPhasesMixture(std::ofstream &fileStream) const
Definition Cell.cpp:335
int m_lvl
Definition Cell.h:291
double distance(Cell *c)
Definition Cell.cpp:672
void chooseUnrefine(const double &xiJoin, int &nbCellsTotalAMR)
Definition Cell.cpp:961
void setGradTk(int &numPhase, int &numAddPhys, double *buffer, int &counter)
Definition Cell.cpp:464
void fillBufferXi(double *buffer, int &counter, const int &lvl, const int &neighbour) const
Definition Cell.cpp:1956
Element * getElement() const
Definition Cell.cpp:565
void computeMass(double &mass, double &alphaRef)
Definition Cell.cpp:847
int numberOfNeighboringGhostCellsOfCPUneighbour(const int &neighbour) const
Definition Cell.cpp:1649
double m_xi
Definition Cell.h:292
void fulfillStateRestart()
Definition Cell.cpp:372
Mixture * m_mixture
Definition Cell.h:282
void computeVolumePhaseK(double &integration, const int &numPhase)
Definition Cell.cpp:792
void lookForPmax(double *pMax, double *pMaxWall)
Definition Cell.cpp:897
void fillBufferPrimitives(double *buffer, int &counter, const int &lvl, const int &neighbour, Prim type=vecPhases) const
Definition Cell.cpp:1508
virtual void computeLocalSlopesLimite(CellInterface &, Limiter &, Limiter &, Limiter &, Limiter &, double &)
Definition Cell.h:181
void setToZeroConsXi()
Definition Cell.cpp:931
virtual Phase * getSlopes() const
Definition Cell.h:184
Cell()
Basic Cell constructor for a non AMR cell.
Definition Cell.cpp:43
const Coord & getSize() const
Definition Cell.h:141
void fillBufferTransports(double *buffer, int &counter, const int &lvl, const int &neighbour) const
Definition Cell.cpp:1587
void updatePointersInternalCellInterfaces()
Definition Cell.cpp:2208
const double & getSizeY() const
Definition Cell.h:143
Phase ** m_vecPhases
Definition Cell.h:281
void setCons(Flux *cons)
Definition Cell.cpp:550
virtual Mixture * getMixture(Prim=vecPhases) const
Definition Cell.cpp:536
void buildLvlCellsAndLvlInternalCellInterfacesArrays(std::vector< Cell * > *cellsLvl, std::vector< CellInterface * > *cellInterfacesLvl)
Definition Cell.cpp:1459
std::vector< Cell * > * getChildVector()
Definition Cell.cpp:1499
virtual void copyPhase(const int &phaseNumber, Phase *phase)
Definition Cell.cpp:245
virtual void popBackSlope()
Definition Cell.h:242
const int & getLvl() const
Definition Cell.h:230
bool m_split
Definition Cell.h:294
void computeTotalMass(double &mass)
Definition Cell.cpp:863
double selectScalar(Variable nameVariable, int num=0) const
Select a specific scalar variable.
Definition Cell.cpp:663
void fillBufferVector(double *buffer, int &counter, const int &lvl, const int &neighbour, const int &dim, Variable nameVector, int num=0, int index=-1) const
Definition Cell.cpp:1551
std::vector< CellInterface * > m_cellInterfaces
Definition Cell.h:287
virtual void getBufferSlopes(double *, int &, const int &)
Definition Cell.h:252
void fillNumberElementsToSendToNeighbour(int &numberElementsToSendToNeighbor, int &numberSlopesToSendToNeighbor, const int &lvl, const int &neighbour, int numberNeighboursOfCPUneighbour)
Definition Cell.cpp:2016
void setCellInterface(const int &b, CellInterface *cellInterface)
Definition Cell.cpp:515
Flux * m_cons
Definition Cell.h:284
void setXi(double value)
Definition Cell.cpp:1471
bool lvlNeighborTooLow()
Definition Cell.cpp:1429
void addNonConsAddPhys(AddPhys &addPhys, Symmetry *symmetry)
Definition Cell.cpp:475
bool hasNeighboringGhostCellOfCPUneighbour(const int &neighbour) const
Definition Cell.cpp:1621
void associateExtVar(Model *mod, Gradient *grad)
Associate external variables.
Definition Cell.cpp:105
void timeEvolutionAddPhys(const double &dt)
Definition Cell.cpp:303
void getBufferTransports(double *buffer, int &counter, const int &lvl)
Definition Cell.cpp:1605
void fillBufferSplit(bool *buffer, int &counter, const int &lvl, const int &neighbour) const
Definition Cell.cpp:1986
void fillDataToSend(std::vector< double > &dataToSend, std::vector< int > &dataSplitToSend, const int &lvl) const
Definition Cell.cpp:2034
virtual void fulfillState(Prim=vecPhases)
Definition Cell.cpp:357
bool m_wall
Definition Cell.h:280
void prepareAddPhys()
Definition Cell.cpp:424
bool traverseObjet(const GeometricObject &objet) const
Definition Cell.cpp:728
virtual GradTransport * getGradTransport(const int &) const
Definition Cell.h:258
const double & getSizeX() const
Definition Cell.h:142
virtual Transport * getSlopesTransport() const
Definition Cell.h:185
virtual Transport * getTransports(Prim=vecPhases) const
Definition Cell.cpp:586
void getBufferXi(double *buffer, int &counter, const int &lvl)
Definition Cell.cpp:1972
virtual void allocateSecondOrderBuffersAndGradientVectors(Phase **, Mixture *)
Compute global variable buffers (min, max, etc.) and initialize speficic gradient vectors for 2nd-ord...
Definition Cell.h:169
std::vector< CellInterface * > m_childrenInternalCellInterfaces
Definition Cell.h:296
double distanceY(Cell *c)
Definition Cell.cpp:686
void chooseRefine(const double &xiSplit, const int &nbCellsY, const int &nbCellsZ, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR)
Definition Cell.cpp:945
void localProjection(const Coord &normal, const Coord &tangent, const Coord &binormal, Prim=vecPhases)
Definition Cell.cpp:380
Transport * getConsTransport(const int &numTransport) const
Definition Cell.cpp:593
void getBufferSplit(bool *buffer, int &counter, const int &lvl)
Definition Cell.cpp:2002
double m_consXi
Definition Cell.h:293
virtual void copyInCell(Cell &) const
Definition Cell.h:102
virtual void reverseProjection(const Coord &normal, const Coord &tangent, const Coord &binormal)
Definition Cell.cpp:390
double getPsat()
Compute saturation pressure for a liquid/vapor fluid mixture (first phase is considered predominant -...
Definition Cell.cpp:737
virtual void setRankOfNeighborCPU(int)
Definition Cell.h:244
Coord & getVelocity()
Definition Cell.cpp:606
void getBufferVector(double *buffer, int &counter, const int &lvl, const int &dim, Variable nameVector, int num=0, int index=-1)
Definition Cell.cpp:1569
bool lvlNeighborTooHigh()
Definition Cell.cpp:1411
virtual void limitGradientsO2(Limiter &)
Definition Cell.h:173
virtual Phase ** getPhases(Prim=vecPhases) const
Definition Cell.cpp:529
virtual void computeLocalSlopes(CellInterface &, Limiter &, Limiter &, Limiter &, Limiter &, double &, double &, double &, double &)
Definition Cell.h:177
const Coord & getPosition() const
Definition Cell.h:140
virtual ~Cell()
Definition Cell.cpp:63
void computeLoad(double &load, int lvl) const
Definition Cell.cpp:2087
void buildCons()
Definition Cell.cpp:320
const double & getXi() const
Definition Cell.h:232
CellInterface * getCellInterface(const int &b)
Definition Cell.cpp:508
void chooseRefineDeraffineGhost(const int &nbCellsY, const int &nbCellsZ, const std::vector< AddPhys * > &addPhys, std::vector< Cell * > *cellsLvlGhost)
Definition Cell.cpp:1679
int getNumberCellsChildren()
Definition Cell.cpp:1485
void copyMixture(Mixture *mixture)
Definition Cell.cpp:252
void unrefineCellAndCellInterfaces()
Definition Cell.cpp:1333
virtual void completeFulfillState()
Definition Cell.cpp:344
virtual GradMixture * getGradMixture() const
Definition Cell.h:257
virtual void getBackCons()
Definition Cell.h:187
Model * getModel()
Definition Cell.cpp:635
void averageChildrenInParent()
Definition Cell.cpp:1373
virtual void allocate(const std::vector< AddPhys * > &addPhys)
Memory allocation of cell attributes.
Definition Cell.cpp:118
virtual int getRankOfNeighborCPU() const
Definition Cell.h:243
const bool & getSplit() const
Definition Cell.h:231
const Coord & getGradTk(int &numPhase, int &numAddPhys) const
Allow to recover an additional physical quantity.
Definition Cell.cpp:457
void setWall(bool wall)
Definition Cell.cpp:620
virtual Transport & getTransport(const int &numTransport, Prim=vecPhases) const
Definition Cell.cpp:579
void setToZeroCons()
Definition Cell.cpp:259
void timeEvolutionXi()
Definition Cell.cpp:938
int getCellInterfacesSize() const
Definition Cell.cpp:501
void printInfo() const
Definition Cell.cpp:747
const QuantitiesAddPhys * getQPA(int &numQPA) const
Definition Cell.h:114
void copyVec(Phase **vecPhases, Mixture *mixture, Transport *vecTransports)
Definition Cell.cpp:400
void fill(std::vector< GeometricalDomain * > &domains, const int &)
Filling cell properties using a physical domain.
Definition Cell.cpp:147
void setVector(Variable nameVector, const Coord &value, int num=0, int subscript=-1)
Definition Cell.cpp:445
virtual void pushBackSlope()
Definition Cell.h:241
void unrefineCellAndCellInterfacesGhost()
Definition Cell.cpp:1933
void clearExternalCellInterfaces(const int &nbCellsY, const int &nbCellsZ)
Definition Cell.cpp:2116
void setElement(Element *element, const int &numCell)
Definition Cell.cpp:557
virtual bool isCellGhost() const
Definition Cell.h:253
double distanceX(Cell *c)
Definition Cell.cpp:679
double distanceZ(Cell *c)
Definition Cell.cpp:693
bool printGnuplotAMR(std::ofstream &fileStream, const int &dim, GeometricObject *objet=0, bool recordPsat=false)
Definition Cell.cpp:754
virtual void createChildCell(const int &lvl)
Definition Cell.cpp:1326
virtual void fillBufferSlopes(double *, int &, const int &, const int &) const
Definition Cell.h:251
Coord selectVector(Variable nameVector, int num=0, int subscript=-1) const
Definition Cell.cpp:433
void computeLvlMax(int &lvlMax) const
Definition Cell.cpp:2102
const int & getNumberTransports() const
Definition Cell.cpp:656
std::vector< QuantitiesAddPhys * > & getVecQuantitiesAddPhys()
Definition Cell.cpp:642
void buildPrim()
Definition Cell.cpp:313
virtual void predictionOrdre2(const double &, Symmetry *)
Definition Cell.h:188
virtual void computeLocalSlopes(CellInterface &)
Compute slopes for 2nd-order scheme on unstructured mesh.
Definition Cell.h:176
void computeTotalEnergy(double &totalEnergy)
Definition Cell.cpp:880
void deleteInterface(const int &b)
Definition Cell.cpp:413
void deleteCellInterface(CellInterface *cellInterface)
Delete the cell interface of current cell.
Definition Cell.cpp:96
virtual GradPhase * getGradPhase(const int &) const
Definition Cell.h:256
void setToZeroXi()
Definition Cell.cpp:924
void reinitializeColorFunction(const int &numTransport, const int &numPhase)
Re-initialize the color function (transport) with alpha.
Definition Cell.cpp:483
virtual void setTransport(double value, int &numTransport, Prim=vecPhases)
Definition Cell.cpp:572
void updateNbCellsTotalAMR(int &nbCellsTotalAMR)
Definition Cell.cpp:2218
virtual Phase * getPhase(const int &phaseNumber, Prim=vecPhases) const
Definition Cell.cpp:522
void computeGradients(std::vector< Coord > &grads, std::vector< Variable > &nameVariables, std::vector< int > &numPhases)
Compute gradients (temperature, velocity, density) of a cell.
Definition Cell.cpp:492
const int & getNumberPhases() const
Definition Cell.cpp:649
void allocateEos()
Definition Cell.cpp:140
std::vector< QuantitiesAddPhys * > m_vecQuantitiesAddPhys
Definition Cell.h:288
void getBufferPrimitives(double *buffer, int &counter, const int &lvl, Eos **eos, Prim type=vecPhases)
Definition Cell.cpp:1530
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
virtual const double & getSizeY()
Definition Element.h:88
virtual const Coord & getSize()
Definition Element.h:90
virtual const double & getSizeX()
Definition Element.h:87
virtual const double & getSizeZ()
Definition Element.h:89
const Coord & getPosition() const
Definition Element.h:54
General class for Equation of State (EOS).
Definition Eos.h:54
static void errorMessage(const std::string &message)
Definition Errors.cpp:56
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
Abstract class for geometric object.
Definition GeometricObject.h:41
Mixture variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS)
Definition GradMixture.h:45
Phase variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS)
Definition GradPhase.h:44
Transport variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS)
Definition GradTransport.h:43
Base class for the gradient method.
Definition Gradient.h:43
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
General class for additional-physics quantities.
Definition QuantitiesAddPhys.h:42
General class for axial symmetries.
Definition Symmetry.h:45
Class for additional transport equations.
Definition Transport.h:41