ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ModNEq.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 MODNEQ_H
32#define MODNEQ_H
33
34#include "../../Model.h"
36#include "../MixNEq.h"
37#include "../PhaseNEq.h"
38#include "../GradPhaseNEq.h"
39#include "../GradMixNEq.h"
40
41class ModNEq;
42
43#include "../FluxNEq/FluxNEq.h"
44
47class ModNEq : public Model
48{
49 public:
54 ModNEq(const int& numbTransports, const int& numbPhases);
59 ModNEq(const std::string& name, const int& numbTransports);
60 ~ModNEq() override;
61
62 void allocateCons(Flux** cons) override;
63 void allocatePhase(Phase** phase) override;
64 void allocateMixture(Mixture** mixture) override;
65 void allocatePhaseGradient(GradPhase** phase) override;
66 void allocateMixtureGradient(GradMixture** mixture) override;
67
69 void fulfillState(Phase** phases, Mixture* mixture) override;
70
72 void fulfillStateResume(Phase** /*phases*/, Mixture* /*mixture*/) override {};
73
75 void initializeAugmentedVariables(Cell* /*cell*/) override {};
76
77 //Fluid-flow Riemann solvers
78 //--------------------------
79 void solveRiemannIntern(Cell& cellLeft,
80 Cell& cellRight,
81 const double& dxLeft,
82 const double& dxRight,
83 double& dtMax,
84 std::vector<double>& /*boundData*/ = DEFAULT_VEC_INTERFACE_DATA) const override; // Riemann between two computed cells
85
86 //Riemann solvers from litterature
87 //--------------------------------
89 virtual void solver(Cell& /*cellLeft*/,
90 Cell& /*cellRight*/,
91 const double& /*dxLeft*/,
92 const double& /*dxRight*/,
93 double& /*dtMax*/,
94 std::vector<double>& /*boundData*/ = DEFAULT_VEC_INTERFACE_DATA) const
95 {
96 Errors::errorMessage("RiemannSolver not available");
97 };
98
99 //Transports Riemann solvers
100 //--------------------------
101 // virtual void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight);
102 // virtual void solveRiemannTransportWall();
103 // virtual void solveRiemannTransportMovingWall(Cell& cellLeft, double wallVelocity);
104 // virtual void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports);
105 // virtual void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports);
106 // virtual void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport);
107
108 void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override;
109
110 //Low-Mach preconditioning
111 //------------------------
112 // virtual void lowMachSoundSpeed(double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const;
113
114 //Moving Reference Frame
115 //----------------------
116 // virtual void addNonConsMrfFlux(Phase** phases);
117 // virtual void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const;
118
119 //Accessors
120 //---------
127 double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const override;
128 const double& getSM() override;
129 const Coord& getVelocity(const Cell* cell) const override { return cell->getMixture()->getVelocity(); };
130 Coord& getVelocity(Cell* cell) override { return cell->getMixture()->getVelocity(); };
131
132 const std::string& whoAmI() const override { return m_name; };
133 // virtual void setSmoothCrossSection1d(const bool& applySmooth) { m_smoothCrossSection1d = applySmooth; };
134
135 friend class FluxNEq;
136
137 private:
138 static const std::string NAME;
139};
140
141#endif // MODNEQ_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 Mixture * getMixture(Prim=vecPhases) const
Definition Cell.cpp:906
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static void errorMessage(const std::string &message_)
Definition Errors.cpp:56
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
virtual const Coord & getVelocity() const
Definition Mixture.h:364
Model class for the non-equilibrium system of equations.
Definition ModNEq.h:48
friend class FluxNEq
Definition ModNEq.h:135
ModNEq(const int &numbTransports, const int &numbPhases)
NEq model constructor.
Definition ModNEq.cpp:37
void allocateCons(Flux **cons) override
Allocate conservative variable arrays.
Definition ModNEq.cpp:64
void initializeAugmentedVariables(Cell *) override
Definition ModNEq.h:75
const double & getSM() override
Return the local fluid velocity.
Definition ModNEq.cpp:192
void allocatePhase(Phase **phase) override
Instanciate fluid phase variable.
Definition ModNEq.cpp:68
void allocateMixtureGradient(GradMixture **mixture) override
Instanciate gradient mixture variable.
Definition ModNEq.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 ModNEq.cpp:198
static const std::string NAME
Definition ModNEq.h:138
void allocatePhaseGradient(GradPhase **phase) override
Instanciate gradient phase variable.
Definition ModNEq.cpp:76
Coord & getVelocity(Cell *cell) override
Definition ModNEq.h:130
void fulfillState(Phase **phases, Mixture *mixture) override
Definition ModNEq.cpp:84
const Coord & getVelocity(const Cell *cell) const override
Return the fluid velocity of the corresponding cell.
Definition ModNEq.h:129
void solveRiemannIntern(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, std::vector< double > &=DEFAULT_VEC_INTERFACE_DATA) const override
Cell to cell Riemann solver.
Definition ModNEq.cpp:98
double selectScalar(Phase **phases, Mixture *mixture, Transport *transports, Variable nameVariable, int num=0) const override
Select a specific scalar variable.
Definition ModNEq.cpp:128
~ModNEq() override
Definition ModNEq.cpp:52
const std::string & whoAmI() const override
Definition ModNEq.h:132
void allocateMixture(Mixture **mixture) override
Instanciate mixture variable.
Definition ModNEq.cpp:72
void fulfillStateResume(Phase **, Mixture *) override
Definition ModNEq.h:72
virtual void solver(Cell &, Cell &, const double &, const double &, double &, std::vector< double > &=DEFAULT_VEC_INTERFACE_DATA) const
Call appropriate solver.
Definition ModNEq.h:89
std::string m_name
Name of the required model.
Definition Model.h:576
Model(const std::string &name, const int &numbTransports)
Generic model constructor.
Definition Model.cpp:35
Abstract class for a phase.
Definition Phase.h:47
Class for additional transport equations.
Definition Transport.h:41