ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
PhaseNEq.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 PHASENEQ_H
32#define PHASENEQ_H
33
34#include "../Phase.h"
35#include "../../Eos/Eos.h"
36
39class PhaseNEq : public Phase
40{
41 public:
42 PhaseNEq();
49 PhaseNEq(tinyxml2::XMLElement* material, Eos* eos, std::string fileName);
50 ~PhaseNEq() override;
51
52 void allocateAndCopyPhase(Phase** vecPhase) override;
53 void copyPhase(Phase& phase) override;
54 void extendedCalculusPhase(const Coord& /*velocity*/ = Errors::defaultDouble) override;
55 void computeMassFraction(const double& density) override;
56
57 void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) override;
58 void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) override;
59
60 //Specific methods for data printing
61 //----------------------------------
62 int getNumberScalars() const override { return numberScalarsPhase; };
63 int getNumberVectors() const override { return 1; };
64 double returnScalar(const int& numVar) const override;
65 Coord returnVector(const int& numVar) const override;
66 std::string returnNameScalar(const int& numVar) const override;
67 std::string returnNameVector(const int& numVar) const override;
68
69 //Specific method for reading from file
70 //-------------------------------------
71 void setScalar(const int& numVar, const double& value) override;
72 void setVector(const int& numVar, const Coord& value) override;
73
74 //Specific methods for parallel computing
75 //---------------------------------------
76 int numberOfTransmittedVariables() const override;
77 void fillBuffer(double* buffer, int& counter) const override;
78 void fillBuffer(std::vector<double>& dataToSend) const override;
79 void getBuffer(double* buffer, int& counter, Eos** eos) override;
80 void getBuffer(std::vector<double>& dataToReceive, int& counter, Eos** eos) override;
81
82 //Specific methods for second order
83 //---------------------------------
84 void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance) override;
85 void setToZero() override;
86 void setToMax() override;
87 void extrapolate(const Phase& slope, const double& distance) override;
88 void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& globalLimiter, Limiter& volumeFractionLimiter) override;
89 void setMin(const Phase& phase1, const Phase& phase2) override;
90 void setMax(const Phase& phase1, const Phase& phase2) override;
92 const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) override;
93
94 //Specific methods for parallele computing at second order
95 //--------------------------------------------------------
96 int numberOfTransmittedSlopes() const override;
97 void fillBufferSlopes(double* buffer, int& counter) const override;
98 void getBufferSlopes(double* buffer, int& counter) override;
99
100 //Verifications
101 //-------------
102 void verifyPhase(const std::string& message = "") const override;
103 void verifyAndCorrectPhase() override;
104 void verifyAndCorrectDensityMax(const double& mass) override;
105 void verifyAndCorrectDensityMax() override;
106
107 //Accessors
108 //---------
109 const double& getAlpha() const override { return m_alpha; };
110 const double& getMassFraction() const override { return m_Y; };
111 const double& getDensity() const override { return m_density; };
112 const double& getPressure() const override { return m_pressure; };
113 const double& getY() const override { return m_Y; };
114 const double& getU() const override { return m_velocity.getX(); };
115 const double& getV() const override { return m_velocity.getY(); };
116 const double& getW() const override { return m_velocity.getZ(); };
117 Coord& getVelocity() override { return m_velocity; };
118 const Coord& getVelocity() const override { return m_velocity; };
119 Eos* getEos() const override { return m_eos; };
120 const double& getEnergy() const override { return m_energy; };
121 const double& getSoundSpeed() const override { return m_soundSpeed; };
122 const double& getTotalEnergy() const override { return m_totalEnergy; };
123 double getTemperature() const override { return m_temperature; };
124
125 void setAlpha(double alpha) override;
126 void setDensity(double density) override;
127 void setPressure(double pressure) override;
128 void setVelocity(const double& u, const double& v, const double& w) override;
129 void setVelocity(const Coord& vit) override;
130 void setU(const double& u) override { m_velocity.setX(u); };
131 void setV(const double& v) override { m_velocity.setY(v); };
132 void setW(const double& w) override { m_velocity.setZ(w); };
133 void setEos(Eos* eos) override;
134 void setEnergy(double energy) override;
135 void setSoundSpeed(double soundSpeed) override;
136
137 //Operators
138 //---------
139 void changeSign() override;
140 void multiplyAndAdd(const Phase& slopesPhasesTemp, const double& coeff) override;
141 void divide(const double& coeff) override;
142
143 protected:
144 double m_alpha;
145 double m_density;
146 double m_pressure;
148 double m_Y;
151 double m_energy;
154};
155
156#endif // PHASENEQ_H
int numberScalarsPhase
Definition Phase.cpp:33
@ alpha
Definition Tools.h:167
@ density
Definition Tools.h:166
@ pressure
Definition Tools.h:165
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
General class for Equation of State (EOS).
Definition Eos.h:62
static constexpr double defaultDouble
Definition Errors.h:99
Definition Limiter.h:38
void reverseProjection(const Coord &normal, const Coord &tangent, const Coord &binormal) override
Definition PhaseNEq.cpp:134
void setMax(const Phase &phase1, const Phase &phase2) override
Definition PhaseNEq.cpp:422
PhaseNEq()
Definition PhaseNEq.cpp:37
void verifyAndCorrectPhase() override
Definition PhaseNEq.cpp:506
void setVelocity(const double &u, const double &v, const double &w) override
Definition PhaseNEq.cpp:545
Eos * getEos() const override
Definition PhaseNEq.h:119
double m_soundSpeed
phase speed of sound
Definition PhaseNEq.h:153
const double & getPressure() const override
Definition PhaseNEq.h:112
const double & getEnergy() const override
Definition PhaseNEq.h:120
Eos * m_eos
pointer to phase equation of state
Definition PhaseNEq.h:150
const double & getU() const override
Definition PhaseNEq.h:114
void setW(const double &w) override
Definition PhaseNEq.h:132
void fillBufferSlopes(double *buffer, int &counter) const override
Definition PhaseNEq.cpp:463
void setPressure(double pressure) override
Definition PhaseNEq.cpp:541
double returnScalar(const int &numVar) const override
Definition PhaseNEq.cpp:143
void setToMax() override
Definition PhaseNEq.cpp:373
const double & getAlpha() const override
Definition PhaseNEq.h:109
void computeSlopesPhase(const Phase &sLeft, const Phase &sRight, const double &distance) override
Definition PhaseNEq.cpp:349
void getBuffer(double *buffer, int &counter, Eos **eos) override
Definition PhaseNEq.cpp:321
double m_totalEnergy
total energy
Definition PhaseNEq.h:152
const double & getSoundSpeed() const override
Definition PhaseNEq.h:121
int getNumberScalars() const override
Definition PhaseNEq.h:62
void setEnergy(double energy) override
Definition PhaseNEq.cpp:562
void setU(const double &u) override
Definition PhaseNEq.h:130
double m_energy
phase internal energy
Definition PhaseNEq.h:151
void setDensity(double density) override
Definition PhaseNEq.cpp:537
void setSoundSpeed(double soundSpeed) override
Definition PhaseNEq.cpp:566
double m_Y
phase mass fraction
Definition PhaseNEq.h:148
void changeSign() override
Definition PhaseNEq.cpp:572
int numberOfTransmittedSlopes() const override
Definition PhaseNEq.cpp:459
void extendedCalculusPhase(const Coord &=Errors::defaultDouble) override
Compute extra thermodynammical variables.
Definition PhaseNEq.cpp:113
std::string returnNameVector(const int &numVar) const override
Definition PhaseNEq.cpp:229
const double & getW() const override
Definition PhaseNEq.h:116
std::string returnNameScalar(const int &numVar) const override
Definition PhaseNEq.cpp:203
int getNumberVectors() const override
Definition PhaseNEq.h:63
void setVector(const int &numVar, const Coord &value) override
Definition PhaseNEq.cpp:271
const double & getY() const override
Definition PhaseNEq.h:113
void verifyPhase(const std::string &message="") const override
Definition PhaseNEq.cpp:489
double m_temperature
phase temperature
Definition PhaseNEq.h:149
void divide(const double &coeff) override
Definition PhaseNEq.cpp:592
void localProjection(const Coord &normal, const Coord &tangent, const Coord &binormal) override
Definition PhaseNEq.cpp:127
void setMin(const Phase &phase1, const Phase &phase2) override
Definition PhaseNEq.cpp:409
void limitSlopes(const Phase &slopeGauche, const Phase &slopeDroite, Limiter &globalLimiter, Limiter &volumeFractionLimiter) override
Definition PhaseNEq.cpp:397
void setEos(Eos *eos) override
Definition PhaseNEq.cpp:558
void computeMassFraction(const double &density) override
Definition PhaseNEq.cpp:123
void setToZero() override
Definition PhaseNEq.cpp:361
double getTemperature() const override
Definition PhaseNEq.h:123
Coord returnVector(const int &numVar) const override
Definition PhaseNEq.cpp:189
void extrapolate(const Phase &slope, const double &distance) override
Definition PhaseNEq.cpp:385
void getBufferSlopes(double *buffer, int &counter) override
Definition PhaseNEq.cpp:475
double m_density
phase specific mass
Definition PhaseNEq.h:145
const double & getV() const override
Definition PhaseNEq.h:115
Coord & getVelocity() override
Definition PhaseNEq.h:117
~PhaseNEq() override
Definition PhaseNEq.cpp:89
void verifyAndCorrectDensityMax() override
Definition PhaseNEq.cpp:527
Coord m_velocity
phase velocity
Definition PhaseNEq.h:147
void multiplyAndAdd(const Phase &slopesPhasesTemp, const double &coeff) override
Definition PhaseNEq.cpp:582
void copyPhase(Phase &phase) override
Copy phase in phase attributes.
Definition PhaseNEq.cpp:97
void computeGradientLimiter(const Limiter &globalLimiter, const Phase &phase, const Phase &phaseMin, const Phase &phaseMax, const Phase &slope) override
Definition PhaseNEq.cpp:435
void allocateAndCopyPhase(Phase **vecPhase) override
Copy phase attributes in phase.
Definition PhaseNEq.cpp:93
void setV(const double &v) override
Definition PhaseNEq.h:131
const double & getMassFraction() const override
Definition PhaseNEq.h:110
int numberOfTransmittedVariables() const override
Definition PhaseNEq.cpp:287
const Coord & getVelocity() const override
Definition PhaseNEq.h:118
void setScalar(const int &numVar, const double &value) override
Definition PhaseNEq.cpp:245
void setAlpha(double alpha) override
Definition PhaseNEq.cpp:533
const double & getDensity() const override
Definition PhaseNEq.h:111
const double & getTotalEnergy() const override
Definition PhaseNEq.h:122
void fillBuffer(double *buffer, int &counter) const override
Definition PhaseNEq.cpp:295
double m_pressure
phase pressure
Definition PhaseNEq.h:146
double m_alpha
phase volume fraction
Definition PhaseNEq.h:144
Abstract class for a phase.
Definition Phase.h:47
Phase()
Definition Phase.cpp:37
Definition tinyxml2.h:1148