ECOGEN 4.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*/){ Errors::errorMessage("subtractFluxRotatingRegion not available for required model"); };
67 virtual void multiply(double /*scalar*/){ Errors::errorMessage("multiply not available for required model"); };
71 virtual void setBufferFlux(Cell& /*cell*/){ Errors::errorMessage("setBufferFlux not available for required model"); };
75 virtual void buildCons(Phase** /*phases*/, Mixture* /*mixture*/) { Errors::errorMessage("buildCons not available for required model"); };
79 virtual void buildPrim(Phase** /*phases*/, Mixture* /*mixture*/) { Errors::errorMessage("buildPrim not available for required model"); };
81 virtual void setToZero(){ Errors::errorMessage("setToZero not available for required model"); };
82
89 virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("addNonCons not available for required model"); };
96 virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("subtractNonCons not available for required model"); };
100 virtual void correctionEnergy(Cell* /*cell*/, Prim /*type*/ = vecPhases) const {};
101
102 virtual void schemeCorrection(Cell& /*cell*/) const {};
103
107 virtual void addSymmetricTerms(Phase** /*phases*/, Mixture* /*mixture*/, const double& /*r*/, const double& /*v*/) { Errors::errorMessage("addSymmetricTerms not implemented for used model"); };
108
110 virtual void prepSourceTermsGravity(const Coord& /*g*/) { Errors::errorMessage("prepSourceTermsGravity not available for required model"); };
112 virtual void prepSourceTermsHeating(const double& /*q*/) { Errors::errorMessage("prepSourceTermsHeating not available for required model"); };
114 virtual void prepSourceTermsMRF(Cell* /*cell*/, const Coord& /*omega*/) { Errors::errorMessage("prepSourceTermsMRF not available for required model"); };
115
117 virtual void addFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/) { Errors::errorMessage("addFluxSmooth1D not available for required model"); };
119 virtual void substractFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/) { Errors::errorMessage("substractFluxSmooth1D not available for required model"); };
120
121 //Moving Reference Frame
122 virtual void addNonConsMrfFlux(Phase** /*phases*/) { Errors::errorMessage("addNonConsMrfFlux not available for required model"); };
123
124 // Accessors
125 //----------
126 virtual const double& getAlpha(const int& /*numPhase*/) const { Errors::errorMessage("getAlpha not available for required model"); return Errors::defaultDouble; };
127 virtual const double& getMass(const int& /*numPhase*/) const { Errors::errorMessage("getMass not available for required model"); return Errors::defaultDouble; };
128 virtual const double& getEnergyMix() const { Errors::errorMessage("getEnergyMix not available for required model"); return Errors::defaultDouble; };
129 virtual const double& getMassMix() const { Errors::errorMessage("getMassMix not available for required model"); return Errors::defaultDouble; };
130 virtual const double& getEqOmega() const { Errors::errorMessage("getEqOmega not available for required model"); return Errors::defaultDouble; };
131 virtual const double& getEqEta() const { Errors::errorMessage("getEqEta not available for required model"); return Errors::defaultDouble; };
132 virtual const double& getEnergy(const int& /*numPhase*/) const { Errors::errorMessage("getEnergy not available for required model"); return Errors::defaultDouble; };
133 virtual const double& getTotEnergy(const int& /*numPhase*/) const { Errors::errorMessage("getTotEnergy not available for required model"); return Errors::defaultDouble; };
134 virtual const double& getLambda(const int& /*numPhase*/) const { Errors::errorMessage("getLambda not available for required model"); return Errors::defaultDouble; };
135 virtual const Tensor& getCobase(const int& /*numPhase*/) const { Errors::errorMessage("getCobase not available for required model"); return Tensor::defaultTensor; };
136 virtual const Coord& getMomentum() const { Errors::errorMessage("getMomentum not available for required model"); return Coord::defaultCoord; };
137 virtual const Coord& getEqVectorP() const { Errors::errorMessage("getEqVectorP not available for required model"); return Coord::defaultCoord; };
138
139 virtual void setCons(const Flux* /*cons*/) { Errors::errorMessage("setCons not available for required model"); };
140
141 protected:
142 double m_sM;
143 double m_uStar;
144 private:
145};
146
147extern std::vector<Flux*> sourceCons;
148extern Flux* fluxBuff;
149extern Flux* fluxBuffMRF;
150
151#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:39
@ vecPhases
Definition Tools.h:39
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:93
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
virtual const Coord & getMomentum() const
Definition Flux.h:136
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:79
double m_uStar
Velocity solution of the Riemann problem !VERY IMPORTANT! DO NOT ERASE!
Definition Flux.h:143
Flux()
Definition Flux.cpp:39
virtual void addNonConsMrfFlux(Phase **)
Definition Flux.h:122
virtual const double & getEqOmega() const
Definition Flux.h:130
virtual void addFlux(double)
Add flux to the corresponding model flux.
Definition Flux.h:55
virtual const double & getEnergyMix() const
Definition Flux.h:128
virtual void subtractNonCons(double, const Cell *, const Coord &, const Coord &, const Coord &)
Subtract non conservative term to the flux.
Definition Flux.h:96
virtual const double & getMassMix() const
Definition Flux.h:129
virtual void setBufferFlux(Cell &)
Temporary store the conservative variables of a given cell.
Definition Flux.h:71
virtual const double & getLambda(const int &) const
Definition Flux.h:134
virtual void addSymmetricTerms(Phase **, Mixture *, const double &, const double &)
Add symetric terms.
Definition Flux.h:107
virtual const Coord & getEqVectorP() const
Definition Flux.h:137
virtual void prepSourceTermsGravity(const Coord &)
Gravity source term.
Definition Flux.h:110
virtual void addNonCons(double, const Cell *, const Coord &, const Coord &, const Coord &)
Add non conservative term to the flux.
Definition Flux.h:89
virtual void multiply(double)
multiply the flux of the corresponding model by a constant
Definition Flux.h:67
virtual void setToZero()
set each attribute of the flux to zero
Definition Flux.h:81
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:112
virtual const double & getEnergy(const int &) const
Definition Flux.h:132
virtual void buildCons(Phase **, Mixture *)
Build the conservative variables for a given cell from primitive one.
Definition Flux.h:75
virtual const double & getMass(const int &) const
Definition Flux.h:127
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:117
virtual const double & getTotEnergy(const int &) const
Definition Flux.h:133
virtual void setCons(const Flux *)
Definition Flux.h:139
virtual const double & getAlpha(const int &) const
Definition Flux.h:126
double m_sM
Fluid velocity for intercell interfaces.
Definition Flux.h:142
virtual ~Flux()
Definition Flux.cpp:43
virtual void printFlux() const
Definition Flux.h:48
virtual const Tensor & getCobase(const int &) const
Definition Flux.h:135
virtual void substractFluxSmooth1D(double, const Coord &, Cell *)
Compute additionnal flux for 1D geometry with smooth varying cross section.
Definition Flux.h:119
virtual const double & getEqEta() const
Definition Flux.h:131
virtual void schemeCorrection(Cell &) const
Definition Flux.h:102
virtual void prepSourceTermsMRF(Cell *, const Coord &)
MRF source term.
Definition Flux.h:114
virtual void correctionEnergy(Cell *, Prim=vecPhases) const
Method to correct energy in non conservative models using total energy conservation.
Definition Flux.h:100
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:46
static const Tensor defaultTensor
Default Tensor object (const version)
Definition Tensor.h:56