ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
MixUEqTotEnergy.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 MIXUEQTOTENERGY_H
32#define MIXUEQTOTENERGY_H
33
34#include <vector>
35#include "../Mixture.h"
36
40{
41 public:
50 MixUEqTotEnergy(tinyxml2::XMLElement* state, std::string fileName);
51 ~MixUEqTotEnergy() override;
52
53 void allocateAndCopyMixture(Mixture** mixture) override;
54 void copyMixture(Mixture& mixture) override;
55 double computeDensity(const double* alphak, const double* rhok) override;
56 double computePressure(const double* alphak, const double* pk) override;
57 double computeInternalEnergy(const double* Yk, const double* ek) override;
58 double computeFrozenSoundSpeed(const double* Yk, const double* ck) override;
59
60 void computeMixtureVariables(Phase** vecPhase) override;
61 void computeTotalEnergy(std::vector<QuantitiesAddPhys*>& /*vecGPA*/) override {};
62 void totalEnergyToInternalEnergy(std::vector<QuantitiesAddPhys*>& /*vecGPA*/) override {};
63
64 void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) override;
65 void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) override;
66
67 //Data printing
68 int getNumberScalars() const override { return numberScalarsMixture; };
69 int getNumberVectors() const override { return 1; };
70 double returnScalar(const int& numVar) const override;
71 Coord returnVector(const int& numVar) const override;
72 std::string returnNameScalar(const int& numVar) const override;
73 std::string returnNameVector(const int& numVar) const override;
74
75 //Data reading
76 void setScalar(const int& numVar, const double& value) override;
77 void setVector(const int& numVar, const Coord& value) override;
78
79 //Parallel
80 int numberOfTransmittedVariables() const override;
81 void fillBuffer(double* buffer, int& counter) const override;
82 void fillBuffer(std::vector<double>& dataToSend) const override;
83 void getBuffer(double* buffer, int& counter) override;
84 void getBuffer(std::vector<double>& dataToReceive, int& counter) override;
85
86 //Second order
87 void computeSlopesMixture(const Mixture& sLeft, const Mixture& sRight, const double& distance) override;
88 void setToZero() override;
89 void extrapolate(const Mixture& slope, const double& distance) override;
90 void limitSlopes(const Mixture& slopeGauche, const Mixture& slopeDroite, Limiter& globalLimiter) override;
91
92 //Parallel second order
93 int numberOfTransmittedSlopes() const override;
94 void fillBufferSlopes(double* buffer, int& counter) const override;
95 void getBufferSlopes(double* buffer, int& counter) override;
96
97 //Accessors
98 const double& getDensity() const override { return m_density; };
99 const double& getPressure() const override { return m_pressure; };
100 const double& getU() const override { return m_velocity.getX(); };
101 const double& getV() const override { return m_velocity.getY(); };
102 const double& getW() const override { return m_velocity.getZ(); };
103 const Coord& getVelocity() const override { return m_velocity; };
104 Coord& getVelocity() override { return m_velocity; };
105 const double& getFrozenSoundSpeed() const override { return m_frozenSoundSpeed; };
106 const double& getWoodSoundSpeed() const override { return m_woodSoundSpeed; };
107
108 void setPressure(const double& p) override;
109 void setVelocity(const double& u, const double& v, const double& w) override;
110 void setVelocity(const Coord& vit) override;
111 void setU(const double& u) override;
112 void setV(const double& v) override;
113 void setW(const double& w) override;
114
115 //Operators
116 void changeSign() override;
117 void multiplyAndAdd(const Mixture& slopesMixtureTemp, const double& coeff) override;
118 void divide(const double& coeff) override;
119
120 protected:
121 double m_density;
122 double m_pressure;
126};
127
128#endif // MIXUEQTOTENERGY_H
int numberScalarsMixture
Definition Mixture.cpp:33
@ p
Definition Tools.h:107
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
Definition Limiter.h:38
void getBufferSlopes(double *buffer, int &counter) override
Definition MixUEqTotEnergy.cpp:365
double computeDensity(const double *alphak, const double *rhok) override
Compute mixture density.
Definition MixUEqTotEnergy.cpp:84
int getNumberVectors() const override
Definition MixUEqTotEnergy.h:69
void fillBuffer(double *buffer, int &counter) const override
Definition MixUEqTotEnergy.cpp:276
int getNumberScalars() const override
Definition MixUEqTotEnergy.h:68
void setScalar(const int &numVar, const double &value) override
Definition MixUEqTotEnergy.cpp:235
const double & getV() const override
Definition MixUEqTotEnergy.h:101
const double & getFrozenSoundSpeed() const override
Definition MixUEqTotEnergy.h:105
void getBuffer(double *buffer, int &counter) override
Definition MixUEqTotEnergy.cpp:294
void setW(const double &w) override
Definition MixUEqTotEnergy.cpp:396
double m_density
mixture density
Definition MixUEqTotEnergy.h:121
double m_frozenSoundSpeed
frozen sound speed
Definition MixUEqTotEnergy.h:124
Coord & getVelocity() override
Definition MixUEqTotEnergy.h:104
int numberOfTransmittedVariables() const override
Definition MixUEqTotEnergy.cpp:268
void changeSign() override
Definition MixUEqTotEnergy.cpp:402
void setToZero() override
Definition MixUEqTotEnergy.cpp:323
const double & getU() const override
Definition MixUEqTotEnergy.h:100
const double & getWoodSoundSpeed() const override
Definition MixUEqTotEnergy.h:106
const double & getDensity() const override
Definition MixUEqTotEnergy.h:98
std::string returnNameScalar(const int &numVar) const override
Definition MixUEqTotEnergy.cpp:202
~MixUEqTotEnergy() override
Definition MixUEqTotEnergy.cpp:65
void setV(const double &v) override
Definition MixUEqTotEnergy.cpp:392
void divide(const double &coeff) override
Definition MixUEqTotEnergy.cpp:420
double computeInternalEnergy(const double *Yk, const double *ek) override
Compute mixture specific internal energy.
Definition MixUEqTotEnergy.cpp:106
void setPressure(const double &p) override
Definition MixUEqTotEnergy.cpp:376
void limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroite, Limiter &globalLimiter) override
Definition MixUEqTotEnergy.cpp:341
double computePressure(const double *alphak, const double *pk) override
Compute mixture pressure.
Definition MixUEqTotEnergy.cpp:95
double m_pressure
mixture pressure
Definition MixUEqTotEnergy.h:122
const double & getW() const override
Definition MixUEqTotEnergy.h:102
Coord m_velocity
mixture velocity
Definition MixUEqTotEnergy.h:123
void computeTotalEnergy(std::vector< QuantitiesAddPhys * > &) override
Compute mixture total specific energy from internal one taking account for energies associated to ext...
Definition MixUEqTotEnergy.h:61
int numberOfTransmittedSlopes() const override
Definition MixUEqTotEnergy.cpp:352
void localProjection(const Coord &normal, const Coord &tangent, const Coord &binormal) override
velocity vector projection in a local Cartesian coordinate system
Definition MixUEqTotEnergy.cpp:155
void reverseProjection(const Coord &normal, const Coord &tangent, const Coord &binormal) override
velocity vector reverse projection in the absolute Cartesian coordinate system
Definition MixUEqTotEnergy.cpp:162
void setVelocity(const double &u, const double &v, const double &w) override
Definition MixUEqTotEnergy.cpp:380
const Coord & getVelocity() const override
Definition MixUEqTotEnergy.h:103
MixUEqTotEnergy()
Definition MixUEqTotEnergy.cpp:38
void setU(const double &u) override
Definition MixUEqTotEnergy.cpp:388
void totalEnergyToInternalEnergy(std::vector< QuantitiesAddPhys * > &) override
Compute mixture internal specific energy from total one taking account for energies associated to ext...
Definition MixUEqTotEnergy.h:62
void multiplyAndAdd(const Mixture &slopesMixtureTemp, const double &coeff) override
Definition MixUEqTotEnergy.cpp:411
void computeSlopesMixture(const Mixture &sLeft, const Mixture &sRight, const double &distance) override
Definition MixUEqTotEnergy.cpp:314
double returnScalar(const int &numVar) const override
Definition MixUEqTotEnergy.cpp:171
void extrapolate(const Mixture &slope, const double &distance) override
Definition MixUEqTotEnergy.cpp:332
void copyMixture(Mixture &mixture) override
Copy mixture in mixture attributes.
Definition MixUEqTotEnergy.cpp:73
void setVector(const int &numVar, const Coord &value) override
Definition MixUEqTotEnergy.cpp:252
void allocateAndCopyMixture(Mixture **mixture) override
Copy mixture attributes in mixture.
Definition MixUEqTotEnergy.cpp:69
const double & getPressure() const override
Definition MixUEqTotEnergy.h:99
double m_woodSoundSpeed
wood sound speed
Definition MixUEqTotEnergy.h:125
std::string returnNameVector(const int &numVar) const override
Definition MixUEqTotEnergy.cpp:219
Coord returnVector(const int &numVar) const override
Definition MixUEqTotEnergy.cpp:188
void computeMixtureVariables(Phase **vecPhase) override
Fills some mixture attributes from a phase array.
Definition MixUEqTotEnergy.cpp:128
double computeFrozenSoundSpeed(const double *Yk, const double *ck) override
Compute mixture frozen speed of sound.
Definition MixUEqTotEnergy.cpp:117
void fillBufferSlopes(double *buffer, int &counter) const override
Definition MixUEqTotEnergy.cpp:356
Abstract class for mixture variables.
Definition Mixture.h:43
Mixture()
Definition Mixture.cpp:37
Abstract class for a phase.
Definition Phase.h:47
Definition tinyxml2.h:1148