53 {
54 TRACE();
56
57 s->m_nu = s->m_Ma * LBCS / s->m_Re * s->m_referenceLength;
58 maia::parallelFor<false>(0, s->m_currentMaxNoCells, [=](
MInt index) {
59 const MInt pCellId = s->m_activeCellList[index];
60 const MInt lvlDiff = s->maxLevel() - s->a_level(pCellId);
61 if((globalTimeStep - 1) % IPOW2(lvlDiff) != 0) return;
62
63
64 s->a_nu(pCellId) = s->m_nu;
65
66
67 constexpr MInt nDimSqr = nDim * nDim;
68 MFloat c[nDimSqr]{};
69 const MFloat rho = s->a_variable(pCellId, s->PV->RHO);
70#ifndef WAR_NVHPC_PSTL
71 const MFloat*
const u = &s->a_variable(pCellId, s->PV->U);
72 const MFloat*
const dist = &s->a_oldDistribution(pCellId, 0);
74#else
78 u[d] = s->a_variable(pCellId, d);
79 }
81 dist[d] = s->a_oldDistribution(pCellId, d);
82 }
84#endif
85 const MFloat Q = sqrt(2.0 * std::inner_product(&c[0], &c[nDimSqr], &c[0], .0));
87 if constexpr(bubble) {
88 if(s->m_isEELiquid) {
89
90 const MFloat u_d = sqrt(
POW2(s->a_uOtherPhase(pCellId, 0) - u[0]) +
POW2(s->a_uOtherPhase(pCellId, 1) - u[1])
91 +
POW2(s->a_uOtherPhase(pCellId, 2) - u[2]));
92 nu_BIT =
m_Cs * s->a_alphaGasLim(pCellId) * u_d;
93 }
94 }
95
96
97 MFloat tauBase = F1B2 + 3.0 * (s->m_nu + nu_BIT) *
FFPOW2(s->maxLevel() - s->a_level(pCellId));
99 * (tauBase
100 + sqrt(tauBase * tauBase
102 *
FPOW2(s->maxLevel() - s->a_level(pCellId))));
103
104
105 if constexpr(bubble) {
106 if(s->m_cells.saveOldNu()) {
107 s->a_oldNu(pCellId) = s->a_nu(pCellId);
108 }
109 }
110 s->a_nu(pCellId) = (2.0 * tau - 1.0) * CSsq *
FPOW2(s->maxLevel() - s->a_level(pCellId)) / 2.0;
111 if constexpr(bubble) {
112 if(s->m_isEELiquid) {
113 if(s->m_cells.saveOldNu()) {
114 s->a_oldNuT(pCellId) = s->a_nuT(pCellId);
115 }
116 s->a_nuT(pCellId) = s->a_nu(pCellId) - s->m_nu - nu_BIT;
117 }
118 }
119 });
120}
This class represents all LB models.
constexpr SysEqn sysEqn() const
MFloat m_Cs
Smagorinsky constant.
const MFloat m_deltaX
Filter width.
static constexpr MInt nDist
static constexpr MInt nDim
constexpr Real POW2(const Real x)
constexpr MFloat FPOW2(MInt x)
constexpr MFloat FFPOW2(MInt x)
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)