DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_NujicFluxAlgorithm.h
Go to the documentation of this file.
1#pragma once
2
3//C++ includes
4#include <map>
5#include <list>
6#include <valarray>
7// STL include
8#include <algorithm>
9// SfxBase19 includes
10#include "include/Sfx_StateVector.h"
11#include "include/Sfx_DefineTypes.h"
12#include "include/Sfx_UniversalConstants.h"
13// Numerical Types
14#include "Sfx/Sfx_scalarField1D.h"
15// Nov19 include
16//#include "dbpp_Reconstruction.hpp" // MUSCL
17#include "dbpp_FluxTensor.h"
18#include "dbpp_Enumerations.h"
19#include "dbpp_FluxAlgorithm.h"
21// App include
22//#include "../SfxBase/Sfx_StVenant1DTerms.h"
23
24// forward declarations
25namespace Sfx {
26 class StVenant1D;
27 class scalarField1D;
28 class cellFaceVariables;
29}
30
31namespace dbpp
32{
38 {
39 public:
43 //enum class eFluxType {
44 // complete = 0, /**< */
45 // incomplete = 1 /**< */
46 //};
48 using valr64 = std::valarray<float64>;
50 using pairf12 = std::pair<std::valarray<float64>, std::valarray<float64>>;
51 public:
57 NujicFluxAlgorithm( const dbpp::ePhysicalFluxType aFluxType, float64 aAlgoNujicPrm)
58 : m_fluxType{ aFluxType },
59 m_algoPrm{aAlgoNujicPrm}
60 {}
61
66 FluxTensor calculFF( const Sfx::cellFaceVariables& aFaceVariables) override final;
75 FluxTensorMap // FF1,FF2 flux tensor?? why virtual?
76 calculFF( const Sfx::scalarField1D& U1, const Sfx::scalarField1D& U2, //computational dommain
77 const Omega& aDomain, const PhysicalBoundaryCnd& aPhysbc) override final;
85 FluxTensor calculFF( const Sfx::StateVector& aUL, const Sfx::StateVector& aUR,
86 const cellFace& aCellFace) override final
87 {
88 return FluxTensor{};
89 }
90
98 calculFF( const Sfx::scalarField1D& aU1, const Sfx::scalarField1D& aU2, //computational dommain
99 const PhysicalBoundaryCnd& aPhysbc) override final
100 {
101#if 0
102 auto w_phySys = aPhysbc.getPhysicalSystem();
103 std::valarray<float64> w_H(aPhysbc.getPhysicalSystem()->size());
104 auto i = 0;
105 // retrieve section water level
106 for( const auto& w_sectFlowH :
107 w_phySys->getSectionList().getSectionsWaterLevel() | std::views::values)
108 {
109 w_H[i++] = w_sectFlowH;
110 }
111 // retrieve physical boundary condition (C++17 structured binding)
112 auto [Aleftbc, Qleftbc, Hleftbc] = aPhysbc.getLeftEnd();
113 auto [Arightbc, Qrightbc, Hrightbc] = aPhysbc.getRightEnd();
114
115 // allow space for global domain (computation domain + ghost node)
116 std::valarray<float64> w_Arrp1(aU1.asStdVector().data(),aU1.values().size() + 1);
117 std::valarray<float64> w_Qrrp1(aU2.asStdVector().data(),aU1.values().size() + 1);
118
119 // set b.c. upstream
120 w_Arrp1[aU1.grid().getBaseI()] = Aleftbc;
121 w_Qrrp1[aU1.grid().getBaseI()] = Qleftbc;
122 // set b.c. downstream
123 w_Arrp1[aU1.grid().getMaxI()] = Arightbc; // ghost node
124 w_Qrrp1[aU1.grid().getMaxI()] = Qrightbc; // ditto
125
126 // cell face numerical flux
127 return calculFF( std::move(w_Arrp1),std::move(w_Qrrp1),std::move(w_H));
128#endif
129 return FluxTensorMap{};
130 }
131
135 bool useReconstr() const noexcept override final { return false; }
140 bool usePhysicalCompleteFlux() const noexcept override final { return false; }
145 void setReconstrType(eReconstrType aRecnstrType) noexcept override final { m_reconstype = aRecnstrType; }
150 eReconstrType getReconstrType() const noexcept override final { return m_reconstype; }
151 protected:
159 std::tuple<valr64/*f1p*/, valr64/*f1m*/, valr64/*f2p*/, valr64/*f2p*/>
160 computePhysicalFlux(std::valarray<float64>&& aU1, std::valarray<float64>&& aU2,
161 std::valarray<float64>&& aH);
166 void setNujicAlgoPrm(float64 aNujicAlgoPrm) { m_algoPrm = aNujicAlgoPrm; }
172 std::tuple<valr64/*f1p*/, valr64/*f1m*/, valr64/*f2p*/, valr64/*f2p*/>
173 computePhysicalFlux( Sfx::StVenant1D* aSclEquation, const Uh& aUh);
180 valr64 computef12p( std::span<float64, Sfx::DIM::value>&& aRng, //f1p
181 std::span<float64, Sfx::DIM::value>&& adRng); //df1p
188 valr64 computef12m( std::span<float64, Sfx::DIM::value>&& aRng, //f1p
189 std::span<float64, Sfx::DIM::value>&& adRng); //df1p
190 private:
195 std::vector<float64> m_Hvec;
196 };
197} // End of namespace
Shallow-water (one-dimension) is a system of conservation laws. Conserved quantities (state variables...
Definition Sfx_StVenant1DEquations.h:36
Abstract base class for numerical flux algorithm.
Definition dbpp_FluxAlgorithm.h:24
FluxTensorMap calculFF(const Sfx::scalarField1D &aU1, const Sfx::scalarField1D &aU2, const PhysicalBoundaryCnd &aPhysbc) override final
compute numerical flux
Definition dbpp_NujicFluxAlgorithm.h:98
float64 m_algoPrm
Definition dbpp_NujicFluxAlgorithm.h:194
FluxTensor calculFF(const Sfx::StateVector &aUL, const Sfx::StateVector &aUR, const cellFace &aCellFace) override final
Numerical flux algorithm.
Definition dbpp_NujicFluxAlgorithm.h:85
NujicFluxAlgorithm(const dbpp::ePhysicalFluxType aFluxType, float64 aAlgoNujicPrm)
ctor from physical flux and constant
Definition dbpp_NujicFluxAlgorithm.h:57
valr64 computef12m(std::span< float64, Sfx::DIM::value > &&aRng, std::span< float64, Sfx::DIM::value > &&adRng)
negative component of physical flux
Definition dbpp_NujicFluxAlgorithm.cpp:360
FluxTensor calculFF(const Sfx::cellFaceVariables &aFaceVariables) override final
numerical flux at cell face
Definition dbpp_NujicFluxAlgorithm.cpp:19
bool usePhysicalCompleteFlux() const noexcept override final
(hydrostatic term is considered)
Definition dbpp_NujicFluxAlgorithm.h:140
eReconstrType m_reconstype
Definition dbpp_NujicFluxAlgorithm.h:192
ePhysicalFluxType m_fluxType
Definition dbpp_NujicFluxAlgorithm.h:191
float64 m_Alpha
Definition dbpp_NujicFluxAlgorithm.h:193
bool useReconstr() const noexcept override final
use variable reconstruction
Definition dbpp_NujicFluxAlgorithm.h:135
void setReconstrType(eReconstrType aRecnstrType) noexcept override final
Set type of extrapolation.
Definition dbpp_NujicFluxAlgorithm.h:145
void setNujicAlgoPrm(float64 aNujicAlgoPrm)
Definition dbpp_NujicFluxAlgorithm.h:166
std::valarray< float64 > valr64
Definition dbpp_NujicFluxAlgorithm.h:48
std::tuple< valr64, valr64, valr64, valr64 > computePhysicalFlux(std::valarray< float64 > &&aU1, std::valarray< float64 > &&aU2, std::valarray< float64 > &&aH)
compute face numerical flux
Definition dbpp_NujicFluxAlgorithm.cpp:114
eReconstrType getReconstrType() const noexcept override final
Getter.
Definition dbpp_NujicFluxAlgorithm.h:150
valr64 computef12p(std::span< float64, Sfx::DIM::value > &&aRng, std::span< float64, Sfx::DIM::value > &&adRng)
positive component of physical flux
Definition dbpp_NujicFluxAlgorithm.cpp:337
std::pair< std::valarray< float64 >, std::valarray< float64 > > pairf12
Definition dbpp_NujicFluxAlgorithm.h:50
std::vector< float64 > m_Hvec
Definition dbpp_NujicFluxAlgorithm.h:195
Global Domain (part of global discretization) list of elements and geomeric nodes used by numerical m...
Definition dbpp_Omega.h:19
Physical boundary condition (computational domain) based on characteristic equation ....
Definition dbpp_PhysicalBoundaryCnd.h:22
Container of nodal variables.
Definition dbpp_Uh.h:21
Cell face in the finite volume discretization Usage: caculFF(const cellFace& aFace) compute the numer...
Definition dbpp_CellFace.h:29
Definition HydUtils.h:15
Definition DamBreakProb.h:15
double float64
Definition dbpp_LDeltaOperator.h:12
ePhysicalFluxType
Definition dbpp_Enumerations.h:9
NujicFluxAlgorithm::valr64 valr64
Definition dbpp_NujicFluxAlgorithm.cpp:17
eReconstrType
Definition dbpp_Enumerations.h:33
Flux tensor field (aggregate initialization).
Definition dbpp_FluxTensor.h:21
Map cell face and flux values.
Definition dbpp_FluxTensor.h:52