ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
PhasePTUEq.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 PHASEPTUEQ_H
32#define PHASEPTUEQ_H
33
34#include "../Phase.h"
35#include "../../Eos/Eos.h"
36#include <fstream>
37
40class PhasePTUEq : public Phase
41{
42 public:
43 PhasePTUEq();
49 PhasePTUEq(tinyxml2::XMLElement* material, Eos* eos, std::string fileName);
50 ~PhasePTUEq() override;
51
52 void allocateAndCopyPhase(Phase** vecPhase) override;
53 void copyPhase(Phase& vecPhase) override;
54 void extendedCalculusPhase(const Coord& velocity) override;
55
56 void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) override {};
57 void reverseProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) override {};
58
59 //Specific methods for data printing
60 //----------------------------------
61 int getNumberScalars() const override { return 2; };
62 int getNumberVectors() const override { return 0; };
63 double returnScalar(const int& numVar) const override;
64 Coord returnVector(const int& /*numVar*/) const override { return 0; };
65 std::string returnNameScalar(const int& numVar) const override;
66 std::string returnNameVector(const int& /*numVar*/) const override { return Errors::defaultString; };
67
68 //Specific method for reading from file
69 //-------------------------------------
70 void setScalar(const int& numVar, const double& value) override;
71
72 //Specific methods for parallel computing
73 //---------------------------------------
74 int numberOfTransmittedVariables() const override;
75 void fillBuffer(double* buffer, int& counter) const override;
76 void fillBuffer(std::vector<double>& dataToSend) const override;
77 void getBuffer(double* buffer, int& counter, Eos** eos) override;
78 void getBuffer(std::vector<double>& dataToReceive, int& counter, Eos** eos) override;
79
80 //Specific methods for second order
81 //---------------------------------
82 void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance) override;
83 void setToZero() override;
84 void setToMax() override;
85 void extrapolate(const Phase& slope, const double& distance) override;
86 void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& /*globalLimiter*/, Limiter& volumeFractionLimiter) override;
87 void setMin(const Phase& phase1, const Phase& phase2) override;
88 void setMax(const Phase& phase1, const Phase& phase2) override;
90 const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) override;
91
92 //Specific methods for parallele computing at second order
93 //--------------------------------------------------------
94 int numberOfTransmittedSlopes() const override;
95 void fillBufferSlopes(double* buffer, int& counter) const override;
96 void getBufferSlopes(double* buffer, int& counter) override;
97
98 //Verifications
99 //-------------
100 void verifyPhase(const std::string& message = "") const override;
101 void verifyAndCorrectPhase() override;
102 void verifyAndCorrectDensityMax(const double& mass) override;
103 void verifyAndCorrectDensityMax() override;
104
105 //Accessors
106 //---------
107 const double& getAlpha() const override { return m_alpha; };
108 const double& getMassFraction() const override { return Errors::defaultDouble; };
109 const double& getDensity() const override { return m_density; };
110 const double& getPressure() const override { return m_pressure; };
111 const double& getU() const override { return Errors::defaultDouble; };
112 const double& getV() const override { return Errors::defaultDouble; };
113 const double& getW() const override { return Errors::defaultDouble; };
115 const Coord& getVelocity() const override { return Coord::defaultCoord; };
116 Eos* getEos() const override { return m_eos; };
117 const double& getEnergy() const override { return m_energy; };
118 const double& getSoundSpeed() const override { return m_soundSpeed; };
119 const double& getTotalEnergy() const override { return m_totalEnergy; };
120 double getTemperature() const override { return m_eos->computeTemperature(m_density, m_pressure); };
121
122 void setAlpha(double alpha) override;
123 void setDensity(double density) override;
124 void setPressure(double pressure) override;
125 void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/) override {};
126 void setVelocity(const Coord& /*vit*/) override {};
127 void setU(const double& /*u*/) override {};
128 void setV(const double& /*v*/) override {};
129 void setW(const double& /*w*/) override {};
130 void setEos(Eos* eos) override;
131 void setEnergy(double energy) override;
132 void setSoundSpeed(double soundSpeed) override;
133 void setTotalEnergy(double totalEnergy) 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;
146 double m_energy;
149};
150
151#endif // PHASEPTUEQ_H
Coord velocity
Definition Coord.cpp:34
@ 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
void extrapolate(const Phase &slope, const double &distance) override
Definition PhasePTUEq.cpp:200
double m_pressure
phase pressure
Definition PhasePTUEq.h:144
double returnScalar(const int &numVar) const override
Definition PhasePTUEq.cpp:88
int getNumberVectors() const override
Definition PhasePTUEq.h:62
void setW(const double &) override
Definition PhasePTUEq.h:129
void verifyAndCorrectPhase() override
Definition PhasePTUEq.cpp:252
void reverseProjection(const Coord &, const Coord &, const Coord &) override
Definition PhasePTUEq.h:57
std::string returnNameScalar(const int &numVar) const override
Definition PhasePTUEq.cpp:105
int numberOfTransmittedVariables() const override
Definition PhasePTUEq.cpp:143
void setAlpha(double alpha) override
Definition PhasePTUEq.cpp:272
const double & getEnergy() const override
Definition PhasePTUEq.h:117
Coord returnVector(const int &) const override
Definition PhasePTUEq.h:64
const double & getPressure() const override
Definition PhasePTUEq.h:110
double m_alpha
phase volume fraction
Definition PhasePTUEq.h:142
void computeGradientLimiter(const Limiter &globalLimiter, const Phase &phase, const Phase &phaseMin, const Phase &phaseMax, const Phase &slope) override
Definition PhasePTUEq.cpp:219
void divide(const double &coeff) override
Definition PhasePTUEq.cpp:310
void verifyPhase(const std::string &message="") const override
Definition PhasePTUEq.cpp:243
const Coord & getVelocity() const override
Definition PhasePTUEq.h:115
const double & getMassFraction() const override
Definition PhasePTUEq.h:108
void getBuffer(double *buffer, int &counter, Eos **eos) override
Definition PhasePTUEq.cpp:167
void setDensity(double density) override
Definition PhasePTUEq.cpp:276
void setU(const double &) override
Definition PhasePTUEq.h:127
double m_soundSpeed
phase speed of sound
Definition PhasePTUEq.h:148
const double & getU() const override
Definition PhasePTUEq.h:111
void setVelocity(const Coord &) override
Definition PhasePTUEq.h:126
void setTotalEnergy(double totalEnergy) override
Definition PhasePTUEq.cpp:296
~PhasePTUEq() override
Definition PhasePTUEq.cpp:56
void fillBuffer(double *buffer, int &counter) const override
Definition PhasePTUEq.cpp:151
Eos * m_eos
pointer to phase equation of state
Definition PhasePTUEq.h:145
void verifyAndCorrectDensityMax() override
Definition PhasePTUEq.cpp:266
void setV(const double &) override
Definition PhasePTUEq.h:128
void setSoundSpeed(double soundSpeed) override
Definition PhasePTUEq.cpp:292
void getBufferSlopes(double *buffer, int &counter) override
Definition PhasePTUEq.cpp:237
std::string returnNameVector(const int &) const override
Definition PhasePTUEq.h:66
const double & getSoundSpeed() const override
Definition PhasePTUEq.h:118
void extendedCalculusPhase(const Coord &velocity) override
Compute extra thermodynammical variables.
Definition PhasePTUEq.cpp:77
void setScalar(const int &numVar, const double &value) override
Definition PhasePTUEq.cpp:124
void setToMax() override
Definition PhasePTUEq.cpp:196
double getTemperature() const override
Definition PhasePTUEq.h:120
PhasePTUEq()
Definition PhasePTUEq.cpp:38
void multiplyAndAdd(const Phase &slopesPhasesTemp, const double &coeff) override
Definition PhasePTUEq.cpp:306
void localProjection(const Coord &, const Coord &, const Coord &) override
Definition PhasePTUEq.h:56
void changeSign() override
Definition PhasePTUEq.cpp:302
void copyPhase(Phase &vecPhase) override
Copy phase in phase attributes.
Definition PhasePTUEq.cpp:64
const double & getDensity() const override
Definition PhasePTUEq.h:109
void computeSlopesPhase(const Phase &sLeft, const Phase &sRight, const double &distance) override
Definition PhasePTUEq.cpp:185
int getNumberScalars() const override
Definition PhasePTUEq.h:61
void setVelocity(const double &, const double &, const double &) override
Definition PhasePTUEq.h:125
void allocateAndCopyPhase(Phase **vecPhase) override
Copy phase attributes in phase.
Definition PhasePTUEq.cpp:60
void setMax(const Phase &phase1, const Phase &phase2) override
Definition PhasePTUEq.cpp:215
const double & getV() const override
Definition PhasePTUEq.h:112
const double & getW() const override
Definition PhasePTUEq.h:113
const double & getTotalEnergy() const override
Definition PhasePTUEq.h:119
void setEos(Eos *eos) override
Definition PhasePTUEq.cpp:284
void setEnergy(double energy) override
Definition PhasePTUEq.cpp:288
void setMin(const Phase &phase1, const Phase &phase2) override
Definition PhasePTUEq.cpp:211
void limitSlopes(const Phase &slopeGauche, const Phase &slopeDroite, Limiter &, Limiter &volumeFractionLimiter) override
Definition PhasePTUEq.cpp:204
double m_energy
phase internal energy
Definition PhasePTUEq.h:146
double m_totalEnergy
phase total energy
Definition PhasePTUEq.h:147
void setToZero() override
Definition PhasePTUEq.cpp:192
const double & getAlpha() const override
Definition PhasePTUEq.h:107
double m_density
phase specific mass
Definition PhasePTUEq.h:143
void fillBufferSlopes(double *buffer, int &counter) const override
Definition PhasePTUEq.cpp:233
void setPressure(double pressure) override
Definition PhasePTUEq.cpp:280
Coord & getVelocity() override
Definition PhasePTUEq.h:114
Eos * getEos() const override
Definition PhasePTUEq.h:116
int numberOfTransmittedSlopes() const override
Definition PhasePTUEq.cpp:229
Abstract class for a phase.
Definition Phase.h:47
Phase()
Definition Phase.cpp:37
Definition tinyxml2.h:1148