ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ModEuler.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 MODEULER_H
32#define MODEULER_H
33
34#include "../Model.h"
35#include "../../Order1/Cell.h"
36#include "FluxEuler.h"
37#include "MixEuler.h"
38#include "PhaseEuler.h"
39#include "GradPhaseEuler.h"
40#include "GradMixEuler.h"
41
44class ModEuler : public Model
45{
46 public:
49 ModEuler(const int& numbTransports);
50 ~ModEuler() override;
51
52 void allocateCons(Flux** cons) override;
53 void allocatePhase(Phase** phase) override;
54 void allocateMixture(Mixture** mixture) override;
55 void allocatePhaseGradient(GradPhase** phase) override;
56 void allocateMixtureGradient(GradMixture** mixture) override;
57
59 void fulfillState(Phase** phases, Mixture* /*mixture*/) override;
60
62 void fulfillStateResume(Phase** /*phases*/, Mixture* /*mixture*/) override {};
63
65 void initializeAugmentedVariables(Cell* /*cell*/) override {};
66
67 //Fluid-flow Riemann solvers
68 //--------------------------
69 void solveRiemannIntern(Cell& cellLeft,
70 Cell& cellRight,
71 const double& dxLeft,
72 const double& dxRight,
73 double& dtMax,
74 std::vector<double>& boundData = DEFAULT_VEC_INTERFACE_DATA) const override;
75 void solveRiemannInternMRF(Cell& cellLeft,
76 Cell& cellRight,
77 const double& dxLeft,
78 const double& dxRight,
79 double& dtMax,
80 const Coord& omega,
81 const Coord& normal,
82 const Coord& tangent,
83 const Coord& binormal,
84 const Coord& position) const override;
85 void solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMax, std::vector<double>& boundData) const override;
86 void
87 solveRiemannMovingWall(Cell& cellLeft, const double& dxLeft, double& dtMax, double wallVelocity, std::vector<double>& boundData) const override;
88 void solveRiemannInletTank(Cell& cellLeft,
89 const double& dxLeft,
90 double& dtMax,
91 const double* /*ak0*/,
92 const double* rhok0,
93 const double& p0,
94 const double& /*T0*/,
95 std::vector<double>& boundData) const override;
97 const double& dxLeft,
98 double& dtMax,
99 const double m0,
100 const double* /*ak0*/,
101 const double* rhok0,
102 const double* pk0,
103 std::vector<double>& boundData) const override;
104 void solveRiemannInletInjTemp(Cell& cellLeft,
105 const double& dxLeft,
106 double& dtMax,
107 const double m0,
108 const double* Tk0,
109 const double* /*ak0*/,
110 std::vector<double>& boundData) const override;
111 void
112 solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector<double>& boundData) const override;
113 void
114 solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector<double>& boundData) const override;
115 void solveRiemannNullFlux() const override;
116
117 //Transports Riemann solvers
118 //--------------------------
119 void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight) override;
120 void solveRiemannTransportWall() override;
121 void solveRiemannTransportMovingWall(Cell& cellLeft, double wallVelocity) override;
122 void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports) override;
123 void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports) override;
124 void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport) override;
125
126 void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override;
127
128 //low-Mach preconditioning
129 //------------------------
131 double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const override;
132
133 //Moving Reference Frame
134 //----------------------
135 void addNonConsMrfFlux(Phase** phases) override;
136 void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const override;
137
138 //Accessors
139 //---------
146 double selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num = 0) const override;
147 const double& getSM() override;
148 const Coord& getVelocity(const Cell* cell) const override { return cell->getPhase(0)->getVelocity(); };
149 Coord& getVelocity(Cell* cell) override { return cell->getPhase(0)->getVelocity(); };
150
151 const std::string& whoAmI() const override { return m_name; };
152
153 void setSmoothCrossSection1d(const bool& applySmooth) override { m_smoothCrossSection1d = applySmooth; };
154
155 protected:
156 private:
157 static const std::string NAME;
158};
159
160#endif // MODEULER_H
static std::vector< double > DEFAULT_VEC_INTERFACE_DATA(VarBoundary::SIZE, 0.)
Variable
Enumeration for the flow variables.
Definition Tools.h:163
Base class for a mesh cell.
Definition Cell.h:59
virtual Phase * getPhase(const int &phaseNumber, Prim=vecPhases) const
Definition Cell.cpp:898
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static constexpr double defaultDouble
Definition Errors.h:99
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
Mixture variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS).
Definition GradMixture.h:45
Phase variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS).
Definition GradPhase.h:44
Abstract class for mixture variables.
Definition Mixture.h:43
void solveRiemannOutletMassflow(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, std::vector< double > &boundData) const override
Outlet at imposed massflow half Riemann solver.
Definition ModEuler.cpp:985
void initializeAugmentedVariables(Cell *) override
Definition ModEuler.h:65
void solveRiemannTransportOutletPressure(Cell &cellLeft, double *valueTransport) override
Outlet at imposed pressure half Riemann solver for transport equations.
Definition ModEuler.cpp:1153
void solveRiemannInternMRF(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, const Coord &omega, const Coord &normal, const Coord &tangent, const Coord &binormal, const Coord &position) const override
Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface.
Definition ModEuler.cpp:215
void solveRiemannTransportWall() override
Wall half Riemann solver for transport equations.
Definition ModEuler.cpp:1115
Coord & getVelocity(Cell *cell) override
Definition ModEuler.h:149
void fulfillStateResume(Phase **, Mixture *) override
Definition ModEuler.h:62
static const std::string NAME
Definition ModEuler.h:157
void solveRiemannWall(Cell &cellLeft, const double &dxLeft, double &dtMax, std::vector< double > &boundData) const override
Wall half Riemann solver.
Definition ModEuler.cpp:377
void allocateCons(Flux **cons) override
Allocate conservative variable arrays.
Definition ModEuler.cpp:60
void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const override
Definition ModEuler.cpp:1256
void fulfillState(Phase **phases, Mixture *) override
Definition ModEuler.cpp:80
void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override
Flux reverse projection in the absolute Cartesian coordinate system.
Definition ModEuler.cpp:1208
void solveRiemannInletTank(Cell &cellLeft, const double &dxLeft, double &dtMax, const double *, const double *rhok0, const double &p0, const double &, std::vector< double > &boundData) const override
Inlet tank half Riemann solver.
Definition ModEuler.cpp:535
void solveRiemannTransportInletTank(Cell &cellLeft, double *valueTransports) override
Inlet tank half Riemann solver for transport equations.
Definition ModEuler.cpp:1133
void solveRiemannTransportInletInjStagState(Cell &cellLeft, double *valueTransports) override
Inlet injection using stagnation state half Riemann solver for transport equations.
Definition ModEuler.cpp:1142
const double & getSM() override
Return the local fluid velocity.
Definition ModEuler.cpp:1202
void allocatePhase(Phase **phase) override
Instanciate fluid phase variable.
Definition ModEuler.cpp:64
void solveRiemannIntern(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, std::vector< double > &boundData=DEFAULT_VEC_INTERFACE_DATA) const override
Cell to cell Riemann solver.
Definition ModEuler.cpp:86
void solveRiemannInletInjStagState(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, const double *, const double *rhok0, const double *pk0, std::vector< double > &boundData) const override
Inlet injection using stagnation state half Riemann solver.
Definition ModEuler.cpp:687
void solveRiemannTransportMovingWall(Cell &cellLeft, double wallVelocity) override
Moving wall half Riemann solver for transport equations.
Definition ModEuler.cpp:1124
void solveRiemannNullFlux() const override
No flux half Riemann solver (return null flux to use with 1D geometry with smooth varying cross secti...
Definition ModEuler.cpp:1091
~ModEuler() override
Definition ModEuler.cpp:48
const std::string & whoAmI() const override
Definition ModEuler.h:151
void solveRiemannTransportIntern(Cell &cellLeft, Cell &cellRight) override
Cell to cell Riemann solver for transport equations.
Definition ModEuler.cpp:1104
void allocateMixtureGradient(GradMixture **mixture) override
Instanciate gradient mixture variable.
Definition ModEuler.cpp:76
void setSmoothCrossSection1d(const bool &applySmooth) override
Definition ModEuler.h:153
void solveRiemannOutletPressure(Cell &cellLeft, const double &dxLeft, double &dtMax, const double p0, std::vector< double > &boundData) const override
Outlet at imposed pressure half Riemann solver.
Definition ModEuler.cpp:904
void addNonConsMrfFlux(Phase **phases) override
Definition ModEuler.cpp:1252
void lowMachSoundSpeed(double &machRef, const double &uL, double &cL, const double &uR=Errors::defaultDouble, double &cR=Tools::uselessDouble) const override
Definition ModEuler.cpp:1215
void allocateMixture(Mixture **mixture) override
Instanciate mixture variable.
Definition ModEuler.cpp:68
ModEuler(const int &numbTransports)
Euler model constructor.
Definition ModEuler.cpp:37
void solveRiemannInletInjTemp(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, const double *Tk0, const double *, std::vector< double > &boundData) const override
Inlet injection using temperature half Riemann solver.
Definition ModEuler.cpp:812
double selectScalar(Phase **phases, Mixture *, Transport *transports, Variable nameVariable, int num=0) const override
Select a specific scalar variable.
Definition ModEuler.cpp:1166
void allocatePhaseGradient(GradPhase **phase) override
Instanciate gradient phase variable.
Definition ModEuler.cpp:72
void solveRiemannMovingWall(Cell &cellLeft, const double &dxLeft, double &dtMax, double wallVelocity, std::vector< double > &boundData) const override
Moving wall half Riemann solver.
Definition ModEuler.cpp:422
const Coord & getVelocity(const Cell *cell) const override
Return the fluid velocity of the corresponding cell.
Definition ModEuler.h:148
std::string m_name
Name of the required model.
Definition Model.h:576
bool m_smoothCrossSection1d
1D geometry with smooth cross section variation (default: false)
Definition Model.h:581
Model(const std::string &name, const int &numbTransports)
Generic model constructor.
Definition Model.cpp:35
Abstract class for a phase.
Definition Phase.h:47
virtual Coord & getVelocity()
Definition Phase.h:261
static double uselessDouble
Definition Tools.h:306
Class for additional transport equations.
Definition Transport.h:41