DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_HLLParametersAlgo.h
Go to the documentation of this file.
1#pragma once
2
3// SfxBase19 includes
4#include "include/Sfx_UniversalConstants.h"
5#include "include/Sfx_DefineTypes.h"
6#include "include/Sfx_StateVector.h"
7// DamBreak include
8//#include "../../Nov_VS2019/dbpp_HLLParameterStruct.h"
9
10namespace dbpp
11{
16 {
17 float64 uL;
18 float64 uR;
19 float64 CL;
20 float64 CR;
21 };
29 HLLParameterStruct computeHLLParameters( const Sfx::StateVector& aUL,
30 const Sfx::StateVector& aUR, float64 aSectionWidth = 1.)
31 {
32 // celerity wave on the left and right (unit width (=1))
33 // In the case of a flat bed A=H (water level) but when Z!=0
34 // A = ?? water depth (not sure but need to think about that)
35 auto CR = std::sqrt(Sfx::cGravity<float64>*aUR.A())/aSectionWidth;
36 auto CL = std::sqrt(Sfx::cGravity<float64>*aUL.A())/aSectionWidth;
37
38 // uL and uR are velocities on the left and right states
39 auto uL = aUL.Q() / aUL.A();
40 auto uR = aUR.Q() / aUR.A();
41
42 return HLLParameterStruct{uL,uR,CL,CR};
43 }
44
49 std::pair<float64, float64> computeHLLShockSpeed( HLLParameterStruct aPrmStruct)
50 {
51 // IMPORTANT sign error in these formula below (need to be fix!!!)
52 // see article (J. Belanger Technical Report 2008)
53 // "Validating Shock Capturing Schemes On The DamBreak Problem")
54 // Also other references:
55 // Alcrudo F. "Advanced Mathematical Modeling Techniques
56 // For FloodPropagation in Natural Topographies", pp. 15
57 // Xinya Y., Sam S. Y. Wang
58 // "Improved HLL Scheme for 1D Dam-Break Flows Over Complex Topography" pp. 34
59 // E. McNeil Note (original code)
60 // Une attention particulière devra être ici portée sur
61 // les signes (+/-) relativement au produit scalaire avec Si+1/2
62 auto CS = 0.5*( aPrmStruct.CL + aPrmStruct.CR) - 0.25*(aPrmStruct.uL - aPrmStruct.uR); // sign error to be fix (... '+' 0.25*())
63 auto uS = 0.5*( aPrmStruct.uL - aPrmStruct.uR) + aPrmStruct.CL - aPrmStruct.CR; // sign error to be fix 0.5*(uL '+' uR) + ...
64 // shock speed at left/right face
65 auto SL = std::min( aPrmStruct.uL - aPrmStruct.CL, uS - CS);
66 auto SR = std::max( aPrmStruct.uR + aPrmStruct.CR, uS + CS);
67
68 return{ SL, SR };
69 }
70 void computeHLLPhysicalFlux(const Sfx::StateVector& aUL,
71 const Sfx::StateVector& aUR, float64 aSectionWidth = 1.)
72 {
73 // retrieve conservative system
74 // Factory to create math equation
75 // const auto w_stVen1D = aRprob.getMthEquations();
76// StVenant1D w_stVen1D;
77
78 // compute state variables physical flux at cell face
79 //const auto FL1 = aRprob.getUL().Q();
80 //const auto FR1 = aRprob.getUR().Q();
81
82 // physical flux (math model in use)
83 //const auto FL2 = w_stVen1D->flux(Sfx::StateVector{ aRprob.getUL().A(), aRprob.getUL().Q() }); //FL2
84 //const auto FR2 = w_stVen1D->flux(Sfx::StateVector{ aRprob.getUR().A(), aRprob.getUR().Q() }); //FR2
85 }
86} //End of namespace
Definition DamBreakProb.h:15
double float64
Definition dbpp_LDeltaOperator.h:12
std::pair< float64, float64 > computeHLLShockSpeed(HLLParameterStruct aPrmStruct)
Definition dbpp_HLLParametersAlgo.h:49
HLLParameterStruct computeHLLParameters(const Sfx::StateVector &aUL, const Sfx::StateVector &aUR, float64 aSectionWidth=1.)
Parameters to compute the interface flux HLL.
Definition dbpp_HLLParametersAlgo.h:29
void computeHLLPhysicalFlux(const Sfx::StateVector &aUL, const Sfx::StateVector &aUR, float64 aSectionWidth=1.)
Definition dbpp_HLLParametersAlgo.h:70
Algorithm parameters HLL Algorithm.
Definition dbpp_HLLParameterStruct.h:11
float64 uL
Definition dbpp_HLLParameterStruct.h:15
float64 CL
Definition dbpp_HLLParameterStruct.h:12
float64 uR
Definition dbpp_HLLParameterStruct.h:16
float64 CR
Definition dbpp_HLLParameterStruct.h:13