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

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

Inheritance diagram for maia::lb::LbSrcTerm_spongeRhoConst< nDim, nDist, SysEqn >:
[legend]
Collaboration diagram for maia::lb::LbSrcTerm_spongeRhoConst< 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_spongeRhoConst (LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
 
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
 

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_spongeRhoConst< nDim, nDist, SysEqn >
Author
Miro Gondrum
Date
04.01.2024 The PPDF f is damped towards an equilibrium state f_a following: f -= sigma *(f_eq - f_a) , with f_a = f_eq(rho_trg, u) Here, rho_trg is a user defined input and for this sponge are constant in space and time and u is the local velocity

Definition at line 25 of file lbsrctermsponge.cpp.

Member Typedef Documentation

◆ Base

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

Definition at line 27 of file lbsrctermsponge.cpp.

Constructor & Destructor Documentation

◆ LbSrcTerm_spongeRhoConst()

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

Definition at line 28 of file lbsrctermsponge.cpp.

28: 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_spongeRhoConst< nDim, nDist, SysEqn >::apply_postCollision
overridevirtual

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

Definition at line 37 of file lbsrctermsponge.cpp.

37 {
38 TRACE();
39 LbSolverDxQy<nDim, nDist, SysEqn>* const s = this->m_solver; // alias for readability
41
42 const MInt timeStep = s->getCurrentTimeStep();
43 const MUint noSpongeCells = this->m_spongeCells.size();
44 maia::parallelFor<true>(0, noSpongeCells, [=](MInt spongeCellId) {
45 auto& cell = this->m_spongeCells[spongeCellId];
46 const MInt cellId = cell.cellId;
47 if((timeStep - 1) % IPOW2(s->maxLevel() - s->a_level(cellId)) != 0) return;
48 // compute the forcing term for the density
49 const MFloat deltaRho = s->a_variable(cellId, s->PV->RHO) - this->m_trgRho;
50 s->a_variable(cellId, s->PV->RHO) -= cell.spongeFactor * deltaRho;
51
52 // prescribe new density
53 s->a_distribution(cellId, Ld::lastId()) = s->a_variable(cellId, s->PV->RHO);
54 for(MInt dist = 0; dist < nDist - 1; dist++) {
55 s->a_distribution(cellId, nDist - 1) -= s->a_distribution(cellId, dist);
56 }
57 });
58}
This class represents all LB models.
Definition: lbsolverdxqy.h:29
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
double MFloat
Definition: maiatypes.h:52
void const MInt cellId
Definition: collector.h:239
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54
LB lattice descriptor for arrays depending on D and Q.

◆ apply_postPropagation()

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

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

Definition at line 31 of file lbsrctermsponge.cpp.

31{};

◆ apply_preCollision()

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

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

Definition at line 29 of file lbsrctermsponge.cpp.

29{};

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