ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
PhaseUEq.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 PHASEUEQ_H
32#define PHASEUEQ_H
33
34#include "../Phase.h"
35#include "../../Eos/Eos.h"
36
39class PhaseUEq : public Phase
40{
41 public:
42 PhaseUEq();
49 PhaseUEq(tinyxml2::XMLElement* material, Eos* eos, std::string fileName);
50 ~PhaseUEq() override;
51
52 void allocateAndCopyPhase(Phase** vecPhase) override;
53 void copyPhase(Phase& phase) override;
54 void extendedCalculusPhase(const Coord& /*velocity*/) 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 0; };
64 double returnScalar(const int& numVar) const override;
65 Coord returnVector(const int& /*numVar*/) const override { return 0; };
66 std::string returnNameScalar(const int& numVar) const override;
67 std::string returnNameVector(const int& /*numVar*/) const override { return Errors::defaultString; };
68
69 //Specific method for reading from file
70 //-------------------------------------
71 void setScalar(const int& numVar, const double& value) override;
72
73 //Specific methods for parallel computing
74 //---------------------------------------
75 int numberOfTransmittedVariables() const override;
76 void fillBuffer(double* buffer, int& counter) const override;
77 void fillBuffer(std::vector<double>& dataToSend) const override;
78 void getBuffer(double* buffer, int& counter, Eos** eos) override;
79 void getBuffer(std::vector<double>& dataToReceive, int& counter, Eos** eos) override;
80
81 //Specific methods for second order
82 //---------------------------------
83 void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance) override;
84 void setToZero() override;
85 void setToMax() override;
86 void extrapolate(const Phase& slope, const double& distance) override;
87 void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& globalLimiter, Limiter& volumeFractionLimiter) override;
88 void setMin(const Phase& phase1, const Phase& phase2) override;
89 void setMax(const Phase& phase1, const Phase& phase2) override;
91 const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) override;
92
93 //Specific methods for parallele computing at second order
94 //--------------------------------------------------------
95 int numberOfTransmittedSlopes() const override;
96 void fillBufferSlopes(double* buffer, int& counter) const override;
97 void getBufferSlopes(double* buffer, int& counter) override;
98
99 //Verifications
100 //-------------
101 void verifyPhase(const std::string& message = "") const override;
102 void verifyAndCorrectPhase() override;
103 void verifyAndCorrectDensityMax(const double& mass) override;
104 void verifyAndCorrectDensityMax() override;
105
106 //Accessors
107 //---------
108 const double& getAlpha() const override { return m_alpha; };
109 const double& getMassFraction() const override { return m_Y; };
110 const double& getDensity() const override { return m_density; };
111 const double& getPressure() const override { return m_pressure; };
112 const double& getY() const override { return m_Y; };
113 const double& getU() const override { return Errors::defaultDouble; };
114 const double& getV() const override { return Errors::defaultDouble; };
115 const double& getW() const override { return Errors::defaultDouble; };
117 const Coord& getVelocity() const override { return Coord::defaultCoord; };
118 Eos* getEos() const override { return m_eos; };
119 const double& getEnergy() const override { return m_energy; };
120 const double& getSoundSpeed() const override { return m_soundSpeed; };
121 double getTemperature() const override { return m_temperature; };
122
123 void setAlpha(double alpha) override;
124 void setDensity(double density) override;
125 void setPressure(double pressure) override;
126 void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/) override {};
127 void setVelocity(const Coord& /*vit*/) override {};
128 void setU(const double& /*u*/) override {};
129 void setV(const double& /*v*/) override {};
130 void setW(const double& /*w*/) override {};
131 void setEos(Eos* eos) override;
132 void setEnergy(double energy) override;
133 void setSoundSpeed(double soundSpeed) override;
134
135 //Operators
136 //---------
137 void changeSign() override;
138 void multiplyAndAdd(const Phase& slopesPhasesTemp, const double& coeff) override;
139 void divide(const double& coeff) override;
140
141 protected:
142 double m_alpha;
143 double m_density;
144 double m_pressure;
145 double m_Y;
148 double m_energy;
150};
151
152#endif // PHASEUEQ_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
static Coord defaultCoordNonConst
Default Coord object (non-const version).
Definition Coord.h:58
static const Coord defaultCoord
Default Coord object (const version).
Definition Coord.h:55
General class for Equation of State (EOS).
Definition Eos.h:62
static const std::string defaultString
Definition Errors.h:100
static constexpr double defaultDouble
Definition Errors.h:99
Definition Limiter.h:38
~PhaseUEq() override
Definition PhaseUEq.cpp:75
const double & getV() const override
Definition PhaseUEq.h:114
const double & getAlpha() const override
Definition PhaseUEq.h:108
void setSoundSpeed(double soundSpeed) override
Definition PhaseUEq.cpp:429
void computeMassFraction(const double &density) override
Definition PhaseUEq.cpp:106
const double & getDensity() const override
Definition PhaseUEq.h:110
int numberOfTransmittedVariables() const override
Definition PhaseUEq.cpp:214
void fillBufferSlopes(double *buffer, int &counter) const override
Definition PhaseUEq.cpp:345
void verifyAndCorrectPhase() override
Definition PhaseUEq.cpp:382
const double & getSoundSpeed() const override
Definition PhaseUEq.h:120
const double & getPressure() const override
Definition PhaseUEq.h:111
std::string returnNameVector(const int &) const override
Definition PhaseUEq.h:67
void verifyPhase(const std::string &message="") const override
Definition PhaseUEq.cpp:365
void setEos(Eos *eos) override
Definition PhaseUEq.cpp:421
Coord returnVector(const int &) const override
Definition PhaseUEq.h:65
void fillBuffer(double *buffer, int &counter) const override
Definition PhaseUEq.cpp:222
void changeSign() override
Definition PhaseUEq.cpp:435
double m_Y
phase mass fraction
Definition PhaseUEq.h:145
const double & getMassFraction() const override
Definition PhaseUEq.h:109
void setV(const double &) override
Definition PhaseUEq.h:129
double getTemperature() const override
Definition PhaseUEq.h:121
const double & getU() const override
Definition PhaseUEq.h:113
void allocateAndCopyPhase(Phase **vecPhase) override
Copy phase attributes in phase.
Definition PhaseUEq.cpp:79
double m_energy
phase internal energy
Definition PhaseUEq.h:148
const double & getEnergy() const override
Definition PhaseUEq.h:119
void localProjection(const Coord &, const Coord &, const Coord &) override
Definition PhaseUEq.h:57
void setMax(const Phase &phase1, const Phase &phase2) override
Definition PhaseUEq.cpp:318
double m_temperature
phase temperature
Definition PhaseUEq.h:146
std::string returnNameScalar(const int &numVar) const override
Definition PhaseUEq.cpp:158
double m_density
phase specific mass
Definition PhaseUEq.h:143
double m_soundSpeed
phase speed of sound
Definition PhaseUEq.h:149
double m_pressure
phase pressure
Definition PhaseUEq.h:144
const double & getY() const override
Definition PhaseUEq.h:112
int getNumberScalars() const override
Definition PhaseUEq.h:62
void limitSlopes(const Phase &slopeGauche, const Phase &slopeDroite, Limiter &globalLimiter, Limiter &volumeFractionLimiter) override
Definition PhaseUEq.cpp:300
void setU(const double &) override
Definition PhaseUEq.h:128
void divide(const double &coeff) override
Definition PhaseUEq.cpp:453
void computeSlopesPhase(const Phase &sLeft, const Phase &sRight, const double &distance) override
Definition PhaseUEq.cpp:264
void setMin(const Phase &phase1, const Phase &phase2) override
Definition PhaseUEq.cpp:309
void copyPhase(Phase &phase) override
Copy phase in phase attributes.
Definition PhaseUEq.cpp:83
double m_alpha
phase volume fraction
Definition PhaseUEq.h:142
const double & getW() const override
Definition PhaseUEq.h:115
void getBuffer(double *buffer, int &counter, Eos **eos) override
Definition PhaseUEq.cpp:242
void verifyAndCorrectDensityMax() override
Definition PhaseUEq.cpp:403
Eos * getEos() const override
Definition PhaseUEq.h:118
Eos * m_eos
pointer to phase equation of state
Definition PhaseUEq.h:147
void setVelocity(const double &, const double &, const double &) override
Definition PhaseUEq.h:126
void setPressure(double pressure) override
Definition PhaseUEq.cpp:417
void multiplyAndAdd(const Phase &slopesPhasesTemp, const double &coeff) override
Definition PhaseUEq.cpp:444
void setDensity(double density) override
Definition PhaseUEq.cpp:413
Coord & getVelocity() override
Definition PhaseUEq.h:116
void setToZero() override
Definition PhaseUEq.cpp:273
void setVelocity(const Coord &) override
Definition PhaseUEq.h:127
void setScalar(const int &numVar, const double &value) override
Definition PhaseUEq.cpp:186
void extendedCalculusPhase(const Coord &) override
Compute extra thermodynammical variables.
Definition PhaseUEq.cpp:97
void setToMax() override
Definition PhaseUEq.cpp:282
int getNumberVectors() const override
Definition PhaseUEq.h:63
void getBufferSlopes(double *buffer, int &counter) override
Definition PhaseUEq.cpp:354
void extrapolate(const Phase &slope, const double &distance) override
Definition PhaseUEq.cpp:291
void setAlpha(double alpha) override
Definition PhaseUEq.cpp:409
void computeGradientLimiter(const Limiter &globalLimiter, const Phase &phase, const Phase &phaseMin, const Phase &phaseMax, const Phase &slope) override
Definition PhaseUEq.cpp:327
const Coord & getVelocity() const override
Definition PhaseUEq.h:117
void setEnergy(double energy) override
Definition PhaseUEq.cpp:425
double returnScalar(const int &numVar) const override
Definition PhaseUEq.cpp:112
PhaseUEq()
Definition PhaseUEq.cpp:37
void reverseProjection(const Coord &, const Coord &, const Coord &) override
Definition PhaseUEq.h:58
int numberOfTransmittedSlopes() const override
Definition PhaseUEq.cpp:341
void setW(const double &) override
Definition PhaseUEq.h:130
Abstract class for a phase.
Definition Phase.h:47
Phase()
Definition Phase.cpp:37
Definition tinyxml2.h:1148