ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
PhaseUEqTotEnergy.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 PHASEUEQTOTENERGY_H
32#define PHASEUEQTOTENERGY_H
33
34#include "../Phase.h"
35#include "../../Eos/Eos.h"
36#include <fstream>
37
41{
42 public:
50 PhaseUEqTotEnergy(tinyxml2::XMLElement* material, Eos* eos, std::string fileName);
51 ~PhaseUEqTotEnergy() override;
52
53 void allocateAndCopyPhase(Phase** vecPhase) override;
54 void copyPhase(Phase& phase) override;
55 void extendedCalculusPhase(const Coord& velocity) override;
56 void computeMassFraction(const double& density) override;
57
58 void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) override {};
59 void reverseProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) override {};
60
61 //Specific methods for data printing
62 //----------------------------------
63 int getNumberScalars() const override { return 5; };
64 int getNumberVectors() const override { return 0; };
65 double returnScalar(const int& numVar) const override;
66 Coord returnVector(const int& /*numVar*/) const override { return 0; };
67 std::string returnNameScalar(const int& numVar) const override;
68 std::string returnNameVector(const int& /*numVar*/) const override { return Errors::defaultString; };
69
70 //Specific method for reading from file
71 //-------------------------------------
72 void setScalar(const int& numVar, const double& 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 extrapolate(const Phase& slope, const double& distance) override;
87 void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& globalLimiter, Limiter& volumeFractionLimiter) override;
88
89 //Specific methods for parallele computing at second order
90 //--------------------------------------------------------
91 int numberOfTransmittedSlopes() const override;
92 void fillBufferSlopes(double* buffer, int& counter) const override;
93 void getBufferSlopes(double* buffer, int& counter) override;
94
95 //Verifications
96 //-------------
97 void verifyPhase(const std::string& message = "") const override;
98 void verifyAndCorrectPhase() override;
99 void verifyAndCorrectDensityMax(const double& mass) override;
100 void verifyAndCorrectDensityMax() override;
101
102 //Accessors
103 //---------
104 const double& getAlpha() const override { return m_alpha; };
105 const double& getDensity() const override { return m_density; };
106 const double& getPressure() const override { return m_pressure; };
107 const double& getY() const override { return m_Y; };
108 const double& getU() const override { return Errors::defaultDouble; };
109 const double& getV() const override { return Errors::defaultDouble; };
110 const double& getW() const override { return Errors::defaultDouble; };
112 const Coord& getVelocity() const override { return Coord::defaultCoord; };
113 Eos* getEos() const override { return m_eos; };
114 const double& getTotalEnergy() const override { return m_totEnergy; };
115 const double& getSoundSpeed() const override { return m_soundSpeed; };
116 double getTemperature() const override { return m_temperature; };
117
118 void setAlpha(double alpha) override;
119 void setDensity(double density) override;
120 void setPressure(double pressure) override;
121 void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/) override {};
122 void setVelocity(const Coord& /*vit*/) override {};
123 void setU(const double& /*u*/) override {};
124 void setV(const double& /*v*/) override {};
125 void setW(const double& /*w*/) override {};
126 void setEos(Eos* eos) override;
127 void setTotalEnergy(double totalEnergy) override;
128 void setTotalEnergy(const double& energy, const Coord& vel) override;
129 void setSoundSpeed(double soundSpeed) override;
130
131 //Operators
132 //---------
133 void changeSign() override;
134 void multiplyAndAdd(const Phase& slopesPhasesTemp, const double& coeff) override;
135 void divide(const double& coeff) override;
136
137 protected:
138 double m_alpha;
139 double m_density;
140 double m_pressure;
141 double m_Y;
144 double m_totEnergy;
146};
147
148#endif // PHASEUEQTOTENERGY_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 setToZero() override
Definition PhaseUEqTotEnergy.cpp:269
double returnScalar(const int &numVar) const override
Definition PhaseUEqTotEnergy.cpp:108
void setVelocity(const Coord &) override
Definition PhaseUEqTotEnergy.h:122
void verifyPhase(const std::string &message="") const override
Definition PhaseUEqTotEnergy.cpp:322
int getNumberScalars() const override
Definition PhaseUEqTotEnergy.h:63
std::string returnNameVector(const int &) const override
Definition PhaseUEqTotEnergy.h:68
const double & getY() const override
Definition PhaseUEqTotEnergy.h:107
std::string returnNameScalar(const int &numVar) const override
Definition PhaseUEqTotEnergy.cpp:154
void computeSlopesPhase(const Phase &sLeft, const Phase &sRight, const double &distance) override
Definition PhaseUEqTotEnergy.cpp:260
Eos * m_eos
pointer to phase equation of state
Definition PhaseUEqTotEnergy.h:143
PhaseUEqTotEnergy()
Definition PhaseUEqTotEnergy.cpp:38
void setSoundSpeed(double soundSpeed) override
Definition PhaseUEqTotEnergy.cpp:390
const double & getTotalEnergy() const override
Definition PhaseUEqTotEnergy.h:114
const double & getV() const override
Definition PhaseUEqTotEnergy.h:109
const double & getW() const override
Definition PhaseUEqTotEnergy.h:110
int getNumberVectors() const override
Definition PhaseUEqTotEnergy.h:64
const double & getDensity() const override
Definition PhaseUEqTotEnergy.h:105
const double & getPressure() const override
Definition PhaseUEqTotEnergy.h:106
void computeMassFraction(const double &density) override
Definition PhaseUEqTotEnergy.cpp:102
void getBufferSlopes(double *buffer, int &counter) override
Definition PhaseUEqTotEnergy.cpp:311
void multiplyAndAdd(const Phase &slopesPhasesTemp, const double &coeff) override
Definition PhaseUEqTotEnergy.cpp:405
void fillBufferSlopes(double *buffer, int &counter) const override
Definition PhaseUEqTotEnergy.cpp:302
void extendedCalculusPhase(const Coord &velocity) override
Compute extra thermodynammical variables.
Definition PhaseUEqTotEnergy.cpp:93
void setPressure(double pressure) override
Definition PhaseUEqTotEnergy.cpp:374
int numberOfTransmittedSlopes() const override
Definition PhaseUEqTotEnergy.cpp:298
void verifyAndCorrectPhase() override
Definition PhaseUEqTotEnergy.cpp:339
const Coord & getVelocity() const override
Definition PhaseUEqTotEnergy.h:112
const double & getSoundSpeed() const override
Definition PhaseUEqTotEnergy.h:115
void setDensity(double density) override
Definition PhaseUEqTotEnergy.cpp:370
void copyPhase(Phase &phase) override
Copy phase in phase attributes.
Definition PhaseUEqTotEnergy.cpp:81
void verifyAndCorrectDensityMax() override
Definition PhaseUEqTotEnergy.cpp:360
double m_temperature
phase temperature
Definition PhaseUEqTotEnergy.h:142
~PhaseUEqTotEnergy() override
Definition PhaseUEqTotEnergy.cpp:73
void setW(const double &) override
Definition PhaseUEqTotEnergy.h:125
Eos * getEos() const override
Definition PhaseUEqTotEnergy.h:113
void reverseProjection(const Coord &, const Coord &, const Coord &) override
Definition PhaseUEqTotEnergy.h:59
void setTotalEnergy(double totalEnergy) override
Definition PhaseUEqTotEnergy.cpp:382
const double & getAlpha() const override
Definition PhaseUEqTotEnergy.h:104
int numberOfTransmittedVariables() const override
Definition PhaseUEqTotEnergy.cpp:210
void setAlpha(double alpha) override
Definition PhaseUEqTotEnergy.cpp:366
void setScalar(const int &numVar, const double &value) override
Definition PhaseUEqTotEnergy.cpp:182
double m_pressure
phase pressure
Definition PhaseUEqTotEnergy.h:140
void setEos(Eos *eos) override
Definition PhaseUEqTotEnergy.cpp:378
void setU(const double &) override
Definition PhaseUEqTotEnergy.h:123
Coord returnVector(const int &) const override
Definition PhaseUEqTotEnergy.h:66
double m_Y
phase mass fraction
Definition PhaseUEqTotEnergy.h:141
void changeSign() override
Definition PhaseUEqTotEnergy.cpp:396
Coord & getVelocity() override
Definition PhaseUEqTotEnergy.h:111
void getBuffer(double *buffer, int &counter, Eos **eos) override
Definition PhaseUEqTotEnergy.cpp:238
double getTemperature() const override
Definition PhaseUEqTotEnergy.h:116
void setV(const double &) override
Definition PhaseUEqTotEnergy.h:124
double m_totEnergy
phase specific total energy
Definition PhaseUEqTotEnergy.h:144
double m_soundSpeed
phase speed of sound
Definition PhaseUEqTotEnergy.h:145
void setVelocity(const double &, const double &, const double &) override
Definition PhaseUEqTotEnergy.h:121
void limitSlopes(const Phase &slopeGauche, const Phase &slopeDroite, Limiter &globalLimiter, Limiter &volumeFractionLimiter) override
Definition PhaseUEqTotEnergy.cpp:287
void localProjection(const Coord &, const Coord &, const Coord &) override
Definition PhaseUEqTotEnergy.h:58
double m_alpha
phase volume fraction
Definition PhaseUEqTotEnergy.h:138
void allocateAndCopyPhase(Phase **vecPhase) override
Copy phase attributes in phase.
Definition PhaseUEqTotEnergy.cpp:77
const double & getU() const override
Definition PhaseUEqTotEnergy.h:108
double m_density
phase specific mass
Definition PhaseUEqTotEnergy.h:139
void extrapolate(const Phase &slope, const double &distance) override
Definition PhaseUEqTotEnergy.cpp:278
void fillBuffer(double *buffer, int &counter) const override
Definition PhaseUEqTotEnergy.cpp:218
void divide(const double &coeff) override
Definition PhaseUEqTotEnergy.cpp:414
Abstract class for a phase.
Definition Phase.h:47
Phase()
Definition Phase.cpp:37
Definition tinyxml2.h:1148