MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn > Class Template Reference

LB sponge source term : sponge towards const target f_eq(rho_trg, u_trg) More...

Inheritance diagram for maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >:
[legend]
Collaboration diagram for maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >:
[legend]

Public Types

using Base = LbSrcTerm_sponge< nDim, nDist, SysEqn >
 
- Public Types inherited from maia::lb::LbSrcTerm< nDim, nDist, SysEqn >
using SysEqn = SysEqn
 

Public Member Functions

 LbSrcTerm_spongeEqConst (LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
 
void init () override
 
void apply_preCollision () override
 
void apply_postCollision () override
 
void apply_postPropagation () override
 
- Public Member Functions inherited from maia::lb::LbSrcTerm_sponge< nDim, nDist, SysEqn >
 LbSrcTerm_sponge (LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
 
void init () override
 Initialize properties common by all lb sponge terms. More...
 
- Public Member Functions inherited from maia::lb::LbSrcTerm< nDim, nDist, SysEqn >
virtual void init ()=0
 
virtual void apply_preCollision ()=0
 
virtual void apply_postCollision ()=0
 
virtual void apply_postPropagation ()=0
 
virtual ~LbSrcTerm ()=default
 

Private Attributes

std::array< MFloat, nDistm_trgEq {}
 

Additional Inherited Members

- Static Public Attributes inherited from maia::lb::LbSrcTerm< nDim, nDist, SysEqn >
static constexpr MInt nDim
 
static constexpr MInt nDist
 
- Protected Member Functions inherited from maia::lb::LbSrcTerm_sponge< nDim, nDist, SysEqn >
MInt a_spongeCellId (const MInt cellId)
 Get index of cellId in m_spongeCells, returns -1 if unavailable. More...
 
void readProperties () override
 Reading basics properties common for all lb sponge terms. More...
 
virtual void readProperties ()=0
 
- Protected Attributes inherited from maia::lb::LbSrcTerm_sponge< nDim, nDist, SysEqn >
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
 
MBool m_isActive = false
 
std::vector< SpongeCellm_spongeCells
 
std::unordered_map< MInt, MIntm_mapCellId2SpongeCellId
 
MFloat m_spongeLayerThickness = 0.0
 
std::array< MFloat, 2 *nDimm_spongeThicknessFactor {}
 
MFloat m_spongeSigma = 0.0
 
MFloat m_spongeBeta = 2.0
 
MFloat m_trgRho = 1.0
 
std::array< MFloat, nDimm_trgU {}
 

Detailed Description

template<MInt nDim, MInt nDist, class SysEqn>
class maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >
Author
Miro Gondrum
Date
04.01.2024 The PPDF f is damped towards a predefined equilibrium state f_a following: f -= sigma *(f_eq - f_a) , with f_a = f_eq(rho_trg, u_trg) Here, rho_trg and u_trg are user defined input and for this sponge are constant in space and time.

Reference:

Definition at line 73 of file lbsrctermsponge.cpp.

Member Typedef Documentation

◆ Base

template<MInt nDim, MInt nDist, class SysEqn >
using maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::Base = LbSrcTerm_sponge<nDim, nDist, SysEqn>

Definition at line 75 of file lbsrctermsponge.cpp.

Constructor & Destructor Documentation

◆ LbSrcTerm_spongeEqConst()

template<MInt nDim, MInt nDist, class SysEqn >
maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::LbSrcTerm_spongeEqConst ( LbSolverDxQy< nDim, nDist, SysEqn > *  p_solver)
inline

Definition at line 76 of file lbsrctermsponge.cpp.

76: Base(p_solver){};
LbSrcTerm_sponge< nDim, nDist, SysEqn > Base

Member Function Documentation

◆ apply_postCollision()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::apply_postCollision
overridevirtual

Implements maia::lb::LbSrcTerm< nDim, nDist, SysEqn >.

Definition at line 94 of file lbsrctermsponge.cpp.

94 {
95 TRACE();
96 LbSolverDxQy<nDim, nDist, SysEqn>* const s = this->m_solver; // alias for readability
97
98 const MInt timeStep = s->getCurrentTimeStep();
99 const MUint noSpongeCells = this->m_spongeCells.size();
100 maia::parallelFor<true>(0, noSpongeCells, [=](MInt spongeCellId) {
101 auto& cell = this->m_spongeCells[spongeCellId];
102 const MInt cellId = cell.cellId;
103 if((timeStep - 1) % IPOW2(s->maxLevel() - s->a_level(cellId)) != 0) return;
104 std::array<MFloat, nDim> u{};
105 for(MInt d = 0; d < nDim; d++) {
106 u[d] = s->a_variable(cellId, d);
107 }
108 std::array<MFloat, nDist> eqDist = s->getEqDists(s->a_variable(cellId, s->PV->RHO), u.data());
109 for(MInt i = 0; i < nDist; i++) {
110 s->a_distribution(cellId, i) -= cell.spongeFactor * (eqDist[i] - m_trgEq[i]);
111 }
112 });
113}
This class represents all LB models.
Definition: lbsolverdxqy.h:29
std::array< MFloat, nDist > getEqDists(const MFloat rho, const MFloat *const velocity)
Calls function to return the equilibrium distribution.
Definition: lbsolverdxqy.h:668
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
std::vector< SpongeCell > m_spongeCells
constexpr MLong IPOW2(MInt x)
int32_t MInt
Definition: maiatypes.h:62
uint32_t MUint
Definition: maiatypes.h:63
void const MInt cellId
Definition: collector.h:239

◆ apply_postPropagation()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::apply_postPropagation ( )
inlineoverridevirtual

Implements maia::lb::LbSrcTerm< nDim, nDist, SysEqn >.

Definition at line 80 of file lbsrctermsponge.cpp.

80{};

◆ apply_preCollision()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::apply_preCollision ( )
inlineoverridevirtual

Implements maia::lb::LbSrcTerm< nDim, nDist, SysEqn >.

Definition at line 78 of file lbsrctermsponge.cpp.

78{};

◆ init()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::init
overridevirtual

Implements maia::lb::LbSrcTerm< nDim, nDist, SysEqn >.

Definition at line 87 of file lbsrctermsponge.cpp.

87 {
88 LbSolverDxQy<nDim, nDist, SysEqn>& s = *(this->m_solver); // alias for readability
89 Base::init();
90 m_trgEq = s.getEqDists(this->m_trgRho, this->m_trgU.data());
91}
std::array< MFloat, nDist > m_trgEq
std::array< MFloat, nDim > m_trgU
void init() override
Initialize properties common by all lb sponge terms.

Member Data Documentation

◆ m_trgEq

template<MInt nDim, MInt nDist, class SysEqn >
std::array<MFloat, nDist> maia::lb::LbSrcTerm_spongeEqConst< nDim, nDist, SysEqn >::m_trgEq {}
private

Definition at line 83 of file lbsrctermsponge.cpp.


The documentation for this class was generated from the following file: