DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
dbpp_SrcNumericalTreatment.h
Go to the documentation of this file.
1#pragma once
2
3//C++ includes
4#include <ranges>
5// C++ include
6#include <valarray>
7
8namespace Sfx {
9 class scalarField1D;
10 class StateVectorField;
11}
12namespace dbpp {
13 class ListSectionsFlow;
15}
16
17// DESIGN NOTE: under construction (base class should be abstract)
18// Need to do some refactoring and clean-up
19namespace dbpp
20{
31 {
32 public:
41
49 //enum class eSfSbAlgo {
50 // // ????
51 //};
52 public:
60 virtual std::valarray<double> TraitementTermeSource0( const Sfx::scalarField1D& aA,
61 const ListSectionsFlow* aListSectF, const PhysicalBoundaryCnd& aBC);
69 virtual std::valarray<double> TraitementTermeSource2( const Sfx::StateVectorField& aStateVec,
70 const ListSectionsFlow& aListSectF, const PhysicalBoundaryCnd& aBC);
75 void setManningRoughnessCoeff(float64 aN) noexcept { m_roughns = aN; }
80 float64 getManningRoughnessCoeff() const noexcept { return m_roughns; }
85 void setHAverage( bool useHavrg) noexcept { m_useHavrg = useHavrg; }
90 void setSfSbNumericalTreatment( std::string aSfSbTreamnent = "Nujic(1995)") noexcept { m_sfsb = aSfSbTreamnent; }
95 void setHderivativeType( const eDerivativeType& aDxType) noexcept { m_dxType = aDxType; }
100 void setSpatialDerivativeOrder( uint32 aDxOrdr) noexcept { m_dxOrder = aDxOrdr; } //bottom term d_xZ
101 // getters
102 virtual std::string getSfSbNumericalTreatment() const noexcept { return m_sfsb; }
103 const eDerivativeType& getHderivativeType() const noexcept { return m_dxType; }
108 uint32 getSpatialDerivativeOrder() const noexcept { return m_dxOrder; } //bottom term d_xZ
113 virtual bool useFriction() const noexcept { return false; }
118 virtual bool isUnitWidth() const noexcept { return true; }
123 virtual bool useManningFormula() const noexcept { return true; }
124 protected:
137
138 private:
139 uint32 m_dxOrder{2};
141 bool m_useHavrg{true};
142 std::string m_sfsb{ "Nujic(1995)" };
144 // ManningFormula m_Nformula{0.}; /**< Manning formula */
145 };
146} // End of namespace
List of cross-section flow (itereable)
Definition dbpp_ListSectionsFlow.h:15
Physical boundary condition (computational domain) based on characteristic equation ....
Definition dbpp_PhysicalBoundaryCnd.h:22
Basic algorithm to evaluate source terms (bed slope and energy slope) The Manning formula can be read...
Definition dbpp_SrcNumericalTreatment.h:31
virtual bool isUnitWidth() const noexcept
Section flow geometry.
Definition dbpp_SrcNumericalTreatment.h:118
SrcNumericalTreatment & operator=(const SrcNumericalTreatment &)=delete
disable copy assignment operator (due to the problem of slicing)
virtual std::string getSfSbNumericalTreatment() const noexcept
Definition dbpp_SrcNumericalTreatment.h:102
virtual std::valarray< double > TraitementTermeSource0(const Sfx::scalarField1D &aA, const ListSectionsFlow *aListSectF, const PhysicalBoundaryCnd &aBC)
Bed Source term evaluation according to Nujic paper (1995)
Definition dbpp_SrcNumericalTreatment.cpp:23
virtual std::valarray< double > TraitementTermeSource2(const Sfx::StateVectorField &aStateVec, const ListSectionsFlow &aListSectF, const PhysicalBoundaryCnd &aBC)
Compute energy slope (part of the algorithm)
Definition dbpp_SrcNumericalTreatment.cpp:109
float64 m_roughns
Definition dbpp_SrcNumericalTreatment.h:140
virtual bool useFriction() const noexcept
Fiction coefficient in use.
Definition dbpp_SrcNumericalTreatment.h:113
void setManningRoughnessCoeff(float64 aN) noexcept
Set roughness coefficient @paramaN roughness coefficient.
Definition dbpp_SrcNumericalTreatment.h:75
const eDerivativeType & getHderivativeType() const noexcept
Definition dbpp_SrcNumericalTreatment.h:103
uint32 getSpatialDerivativeOrder() const noexcept
Getter.
Definition dbpp_SrcNumericalTreatment.h:108
eDerivativeType
Definition dbpp_SrcNumericalTreatment.h:37
@ noncentered
Definition dbpp_SrcNumericalTreatment.h:39
@ centered_2nd
Definition dbpp_SrcNumericalTreatment.h:38
void setSpatialDerivativeOrder(uint32 aDxOrdr) noexcept
finite difference order
Definition dbpp_SrcNumericalTreatment.h:100
void setHAverage(bool useHavrg) noexcept
Validate H average algo.
Definition dbpp_SrcNumericalTreatment.h:85
eDerivativeBCType
Definition dbpp_SrcNumericalTreatment.h:45
@ periodic
Definition dbpp_SrcNumericalTreatment.h:46
std::string m_sfsb
Definition dbpp_SrcNumericalTreatment.h:142
float64 getManningRoughnessCoeff() const noexcept
Get roughness coefficient.
Definition dbpp_SrcNumericalTreatment.h:80
eDerivativeType m_dxType
Definition dbpp_SrcNumericalTreatment.h:143
void setHderivativeType(const eDerivativeType &aDxType) noexcept
H derivative type (finite difference)
Definition dbpp_SrcNumericalTreatment.h:95
void setSfSbNumericalTreatment(std::string aSfSbTreamnent="Nujic(1995)") noexcept
Bed slope numericla discretization.
Definition dbpp_SrcNumericalTreatment.h:90
uint32 m_dxOrder
Definition dbpp_SrcNumericalTreatment.h:139
virtual bool useManningFormula() const noexcept
Manning formala (friction)
Definition dbpp_SrcNumericalTreatment.h:123
bool m_useHavrg
Definition dbpp_SrcNumericalTreatment.h:141
Definition HydUtils.h:15
Definition DamBreakProb.h:15
double float64
Definition dbpp_LDeltaOperator.h:12