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

#include <lbsrctermgravity.h>

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

Public Member Functions

 LbSrcTermGravity (LbSolverDxQy< nDim, nDist, SysEqn > *p_solver)
 
void readProperties () override
 
void init () override
 
void apply_preCollision () override
 
void apply_postCollision () override
 
void apply_postPropagation () override
 
- 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 Types

enum struct  Mode { DIRECT , GALILEO }
 

Private Attributes

LbSolverDxQy< nDim, nDist, SysEqn > * m_solver
 
enum maia::lb::LbSrcTermGravity::Mode m_mode
 
std::array< MFloat, nDimm_Ga {}
 
std::array< MFloat, nDimm_acceleration {}
 
std::array< MFloat, nDistm_forcing {}
 

Additional Inherited Members

- Public Types inherited from maia::lb::LbSrcTerm< nDim, nDist, SysEqn >
using SysEqn = SysEqn
 
- Static Public Attributes inherited from maia::lb::LbSrcTerm< nDim, nDist, SysEqn >
static constexpr MInt nDim
 
static constexpr MInt nDist
 
virtual void readProperties ()=0
 

Detailed Description

template<MInt nDim, MInt nDist, class SysEqn>
class maia::lb::LbSrcTermGravity< nDim, nDist, SysEqn >

Definition at line 13 of file lbsrctermgravity.h.

Member Enumeration Documentation

◆ Mode

template<MInt nDim, MInt nDist, class SysEqn >
enum struct maia::lb::LbSrcTermGravity::Mode
strongprivate
Enumerator
DIRECT 
GALILEO 

Definition at line 27 of file lbsrctermgravity.h.

Constructor & Destructor Documentation

◆ LbSrcTermGravity()

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

Definition at line 15 of file lbsrctermgravity.h.

15: m_solver(p_solver) { readProperties(); };
void readProperties() override
LbSolverDxQy< nDim, nDist, SysEqn > * m_solver

Member Function Documentation

◆ apply_postCollision()

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

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

Definition at line 21 of file lbsrctermgravity.h.

21{};

◆ apply_postPropagation()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermGravity< nDim, nDist, SysEqn >::apply_postPropagation
overridevirtual

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

Definition at line 81 of file lbsrctermgravity.cpp.

81 {
82 TRACE();
83 const auto& s = m_solver; // alias for readability
84
85 const MInt timeStep = s->getCurrentTimeStep();
86 maia::parallelFor<true>(0, s->m_currentMaxNoCells, [=](MInt index) {
87 const MInt cellId = s->m_activeCellList[index];
88 const MInt lvlDiff = s->maxLevel() - s->a_level(cellId);
89 if((timeStep) % IPOW2(lvlDiff) != 0) return;
90 for(MInt j = 0; j < nDist - 1; j++) {
91 s->a_oldDistribution(cellId, j) += FPOW2(lvlDiff) * m_forcing[j];
92 }
93 });
94}
int32_t MInt
Definition: maiatypes.h:62

◆ apply_preCollision()

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

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

Definition at line 20 of file lbsrctermgravity.h.

20{};

◆ init()

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

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

Definition at line 59 of file lbsrctermgravity.cpp.

59 {
61
62 std::array<MFloat, nDim> densityGradient{};
63 for(MInt n = 0; n < nDim; n++) {
64 densityGradient[n] = m_acceleration[n] * F1BCSsq;
65 }
66
67 for(MInt dir = 0; dir < nDim; dir++) {
68 for(MInt mi = 0; mi < Ld::dxQyFld(); mi++) {
69 m_forcing[Ld::nFld(dir, mi)] += Ld::tp(Ld::distType(Ld::nFld(dir, mi))) * -1.0 * densityGradient[dir];
70 m_forcing[Ld::pFld(dir, mi)] += Ld::tp(Ld::distType(Ld::pFld(dir, mi))) * 1.0 * densityGradient[dir];
71 }
72 }
73
74 // Save forcing for BC and interface
75 for(MInt j = 0; j < nDist; j++) {
76 m_solver->m_Fext[j] = m_forcing[j];
77 }
78}
std::array< MFloat, nDim > m_acceleration
std::array< MFloat, nDist > m_forcing
LB lattice descriptor for arrays depending on D and Q.

◆ readProperties()

template<MInt nDim, MInt nDist, class SysEqn >
void maia::lb::LbSrcTermGravity< nDim, nDist, SysEqn >::readProperties ( )
overridevirtual

Member Data Documentation

◆ m_acceleration

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

Definition at line 31 of file lbsrctermgravity.h.

◆ m_forcing

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

Definition at line 32 of file lbsrctermgravity.h.

◆ m_Ga

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

Definition at line 29 of file lbsrctermgravity.h.

◆ m_mode

template<MInt nDim, MInt nDist, class SysEqn >
enum maia::lb::LbSrcTermGravity::Mode maia::lb::LbSrcTermGravity< nDim, nDist, SysEqn >::m_mode
private

◆ m_solver

template<MInt nDim, MInt nDist, class SysEqn >
LbSolverDxQy<nDim, nDist, SysEqn>* maia::lb::LbSrcTermGravity< nDim, nDist, SysEqn >::m_solver
private

Definition at line 25 of file lbsrctermgravity.h.


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