ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Flux.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 FLUX_H
32#define FLUX_H
33
34class Flux; //Predeclaration of class Flux to include Cell.h
35
36#include "Phase.h"
37#include "../Order1/Cell.h"
38#include "../Tools.h"
39
42class Flux
43{
44 public:
45 Flux();
46 virtual ~Flux();
47
48 virtual void printFlux() const { Errors::errorMessage("printFlux not available for required model"); };
49
52 virtual void addFlux(Flux* /*flux*/) { Errors::errorMessage("addFlux not available for required model"); };
55 virtual void addFlux(double /*coefA*/) { Errors::errorMessage("addFlux not available for required model"); };
58 virtual void subtractFlux(double /*coefA*/) { Errors::errorMessage("subtractFlux not available for required model"); };
61 virtual void addFluxRotatingRegion(double /*coefA*/) { Errors::errorMessage("addFluxRotatingRegion not available for required model"); };
64 virtual void subtractFluxRotatingRegion(double /*coefA*/)
65 {
66 Errors::errorMessage("subtractFluxRotatingRegion not available for required model");
67 };
68
70 virtual void multiply(double /*scalar*/) { Errors::errorMessage("multiply not available for required model"); };
74 virtual void setBufferFlux(Cell& /*cell*/) { Errors::errorMessage("setBufferFlux not available for required model"); };
78 virtual void buildCons(Phase** /*phases*/, Mixture* /*mixture*/) { Errors::errorMessage("buildCons not available for required model"); };
82 virtual void buildPrim(Phase** /*phases*/, Mixture* /*mixture*/) { Errors::errorMessage("buildPrim not available for required model"); };
84 virtual void setToZero() { Errors::errorMessage("setToZero not available for required model"); };
85
92 virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/)
93 {
94 Errors::errorMessage("addNonCons not available for required model");
95 };
96
102 virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/)
103 {
104 Errors::errorMessage("subtractNonCons not available for required model");
105 };
106
109 virtual void correctionEnergy(Cell* /*cell*/, Prim /*type*/ = vecPhases) const {};
110
111 virtual void schemeCorrection(Cell& /*cell*/) const {};
112
116 virtual void addSymmetricTerms(Phase** /*phases*/, Mixture* /*mixture*/, const double& /*r*/, const double& /*v*/)
117 {
118 Errors::errorMessage("addSymmetricTerms not implemented for used model");
119 };
120
122 virtual void prepSourceTermsGravity(const Coord& /*g*/) { Errors::errorMessage("prepSourceTermsGravity not available for required model"); };
124 virtual void prepSourceTermsHeating(const double& /*q*/) { Errors::errorMessage("prepSourceTermsHeating not available for required model"); };
126 virtual void prepSourceTermsMRF(Cell* /*cell*/, const Coord& /*omega*/)
127 {
128 Errors::errorMessage("prepSourceTermsMRF not available for required model");
129 };
130
131 virtual void prepSourceTermsPlaneWave(const Cell* /*cell*/, const double& /*sourceMomentum*/, const Coord& /*pulseDirection*/)
132 {
133 Errors::errorMessage("prepSourceTermsPlaneWave not available for required model");
134 };
135
137 virtual void addFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/)
138 {
139 Errors::errorMessage("addFluxSmooth1D not available for required model");
140 };
141
142 virtual void substractFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/)
143 {
144 Errors::errorMessage("substractFluxSmooth1D not available for required model");
145 };
146
147 //Moving Reference Frame
148 virtual void addNonConsMrfFlux(Phase** /*phases*/) { Errors::errorMessage("addNonConsMrfFlux not available for required model"); };
149
150 // Accessors
151 //----------
152 virtual const double& getAlpha(const int& /*numPhase*/) const
153 {
154 Errors::errorMessage("getAlpha not available for required model");
156 };
157 virtual const double& getMass(const int& /*numPhase*/) const
158 {
159 Errors::errorMessage("getMass not available for required model");
161 };
162 virtual const double& getEnergyMix() const
163 {
164 Errors::errorMessage("getEnergyMix not available for required model");
166 };
167 virtual const double& getMassMix() const
168 {
169 Errors::errorMessage("getMassMix not available for required model");
171 };
172 virtual const double& getEqOmega() const
173 {
174 Errors::errorMessage("getEqOmega not available for required model");
176 };
177 virtual const double& getEqDensitySurEta() const
178 {
179 Errors::errorMessage("getEqDensitySurEta not available for required model");
181 };
182 virtual const double& getEnergy(const int& /*numPhase*/) const
183 {
184 Errors::errorMessage("getEnergy not available for required model");
186 };
187 virtual const double& getTotEnergy(const int& /*numPhase*/) const
188 {
189 Errors::errorMessage("getTotEnergy not available for required model");
191 };
192 virtual const double& getLambda(const int& /*numPhase*/) const
193 {
194 Errors::errorMessage("getLambda not available for required model");
196 };
197 virtual const Tensor& getCobase(const int& /*numPhase*/) const
198 {
199 Errors::errorMessage("getCobase not available for required model");
201 };
202 virtual const Coord& getMomentum() const
203 {
204 Errors::errorMessage("getMomentum not available for required model");
205 return Coord::defaultCoord;
206 };
207 virtual const Coord& getMomentum(const int& /*numPhase*/) const
208 {
209 Errors::errorMessage("getMomentum not available for required model");
210 return Coord::defaultCoord;
211 };
212 virtual const Coord& getEqVectorP() const
213 {
214 Errors::errorMessage("getEqVectorP not available for required model");
215 return Coord::defaultCoord;
216 };
217
218 virtual void setCons(const Flux* /*cons*/) { Errors::errorMessage("setCons not available for required model"); };
219
220 protected:
221 double m_sM;
222 double m_uStar;
223 private:
224};
225
226extern std::vector<Flux*> sourceCons;
227extern Flux* fluxBuff;
228extern Flux* fluxBuffMRF;
229
230#endif // FLUX_H
std::vector< Flux * > sourceCons
Definition Flux.cpp:33
Flux * fluxBuff
Definition Flux.cpp:34
Flux * fluxBuffMRF
Definition Flux.cpp:35
Prim
Enumeration for the primitive-variable type (usefull for second order, slopes, etc....
Definition Tools.h:40
@ vecPhases
Definition Tools.h:41
Base class for a mesh cell.
Definition Cell.h:59
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static const Coord defaultCoord
Default Coord object (const version).
Definition Coord.h:55
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
static constexpr double defaultDouble
Definition Errors.h:99
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
virtual const Coord & getMomentum() const
Definition Flux.h:202
virtual void addFluxRotatingRegion(double)
Add flux to the rotating region in MRF context.
Definition Flux.h:61
virtual void buildPrim(Phase **, Mixture *)
Build the primitive variables for a given cell from conservative one.
Definition Flux.h:82
double m_uStar
Velocity solution of the Riemann problem !VERY IMPORTANT! DO NOT ERASE!
Definition Flux.h:222
Flux()
Definition Flux.cpp:39
virtual void addNonConsMrfFlux(Phase **)
Definition Flux.h:148
virtual const double & getEqOmega() const
Definition Flux.h:172
virtual void addFlux(double)
Add flux to the corresponding model flux.
Definition Flux.h:55
virtual void prepSourceTermsPlaneWave(const Cell *, const double &, const Coord &)
This prepares Plane-Gaussian-pulse and Plane-Sinusoidal-pulse source terms.
Definition Flux.h:131
virtual const double & getEnergyMix() const
Definition Flux.h:162
virtual void subtractNonCons(double, const Cell *, const Coord &, const Coord &, const Coord &)
Subtract non conservative term to the flux.
Definition Flux.h:102
virtual const double & getMassMix() const
Definition Flux.h:167
virtual void setBufferFlux(Cell &)
Temporary store the conservative variables of a given cell.
Definition Flux.h:74
virtual const double & getLambda(const int &) const
Definition Flux.h:192
virtual void addSymmetricTerms(Phase **, Mixture *, const double &, const double &)
Add symetric terms.
Definition Flux.h:116
virtual const Coord & getEqVectorP() const
Definition Flux.h:212
virtual void prepSourceTermsGravity(const Coord &)
Gravity source term.
Definition Flux.h:122
virtual void addNonCons(double, const Cell *, const Coord &, const Coord &, const Coord &)
Add non conservative term to the flux.
Definition Flux.h:92
virtual void multiply(double)
multiply the flux of the corresponding model by a constant
Definition Flux.h:70
virtual void setToZero()
set each attribute of the flux to zero
Definition Flux.h:84
virtual void subtractFlux(double)
Subtract flux to the corresponding model buffer flux.
Definition Flux.h:58
virtual void prepSourceTermsHeating(const double &)
Heating source term.
Definition Flux.h:124
virtual const double & getEnergy(const int &) const
Definition Flux.h:182
virtual void buildCons(Phase **, Mixture *)
Build the conservative variables for a given cell from primitive one.
Definition Flux.h:78
virtual const double & getMass(const int &) const
Definition Flux.h:157
virtual void subtractFluxRotatingRegion(double)
Subtract flux to the rotating region in MRF context.
Definition Flux.h:64
virtual void addFlux(Flux *)
Add flux passed in parameter to the correspond model flux.
Definition Flux.h:52
virtual void addFluxSmooth1D(double, const Coord &, Cell *)
Compute additionnal flux for 1D geometry with smooth varying cross sectionFlux).
Definition Flux.h:137
virtual const double & getTotEnergy(const int &) const
Definition Flux.h:187
virtual void setCons(const Flux *)
Definition Flux.h:218
virtual const double & getAlpha(const int &) const
Definition Flux.h:152
double m_sM
Fluid velocity for intercell interfaces.
Definition Flux.h:221
virtual ~Flux()
Definition Flux.cpp:43
virtual void printFlux() const
Definition Flux.h:48
virtual const Tensor & getCobase(const int &) const
Definition Flux.h:197
virtual void substractFluxSmooth1D(double, const Coord &, Cell *)
Compute additionnal flux for 1D geometry with smooth varying cross section.
Definition Flux.h:142
virtual const Coord & getMomentum(const int &) const
Definition Flux.h:207
virtual void schemeCorrection(Cell &) const
Definition Flux.h:111
virtual const double & getEqDensitySurEta() const
Definition Flux.h:177
virtual void prepSourceTermsMRF(Cell *, const Coord &)
MRF source term.
Definition Flux.h:126
virtual void correctionEnergy(Cell *, Prim=vecPhases) const
Method to correct energy in non conservative models using total energy conservation.
Definition Flux.h:109
Abstract class for mixture variables.
Definition Mixture.h:43
Abstract class for a phase.
Definition Phase.h:47
Class for a matrix 3x3 system object.
Definition Tensor.h:57
static const Tensor defaultTensor
Default Tensor object (const version).
Definition Tensor.h:75