OpenLB 1.7
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
olb::lbm< DESCRIPTOR > Struct Template Reference

Collection of common computations for LBM. More...

#include <lbm.h>

+ Collaboration diagram for olb::lbm< DESCRIPTOR >:

Static Public Member Functions

template<typename CELL , typename V = typename CELL::value_t>
static V computeRho (CELL &cell) any_platform
 Computation of density.
 
template<typename CELL , typename J , typename V = typename CELL::value_t>
static void computeJ (CELL &cell, J &j) any_platform
 Computation of momentum.
 
template<typename CELL , typename RHO , typename J , typename V = typename CELL::value_t>
static void computeRhoJ (CELL &cell, RHO &rho, J &j) any_platform
 Computation of hydrodynamic variables.
 
template<typename CELL , typename RHO , typename U , typename V = typename CELL::value_t>
static void computeRhoU (CELL &cell, RHO &rho, U &u) any_platform
 Computation of hydrodynamic variables.
 
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void computeStress (CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
 Computation of stress tensor.
 
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void computeAllMomenta (CELL &cell, RHO &rho, U &u, PI &pi) any_platform
 Computation of all hydrodynamic variables.
 
template<typename CELL , typename FEQ , typename V = typename CELL::value_t>
static void computeFeq (CELL &cell, FEQ &fEq) any_platform
 
template<typename CELL , typename FNEQ , typename RHO , typename U , typename V = typename CELL::value_t>
static void computeFneq (CELL &cell, FNEQ &fNeq, const RHO &rho, const U &u) any_platform
 Computation of non-equilibrium distribution.
 
template<typename CELL , typename FNEQ , typename V = typename CELL::value_t>
static void computeFneq (CELL &cell, FNEQ &fNeq) any_platform
 
template<typename CELL , typename RHO , typename VELOCITY , typename OMEGA , typename V = typename CELL::value_t>
static V bgkCollision (CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
 BGK collision step.
 
template<typename CELL , typename RHO , typename VELOCITY , typename OMEGA , typename V = typename CELL::value_t>
static V adeBgkCollision (CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
 Advection diffusion BGK collision step.
 
template<typename CELL , typename PRESSURE , typename J , typename OMEGA , typename V = typename CELL::value_t>
static V incBgkCollision (CELL &cell, const PRESSURE &pressure, const J &j, const OMEGA &omega) any_platform
 Incompressible BGK collision step.
 
template<typename CELL , typename RHO , typename U , typename RATIORHO , typename OMEGA , typename V = typename CELL::value_t>
static V constRhoBgkCollision (CELL &cell, const RHO &rho, const U &u, const RATIORHO &ratioRho, const OMEGA &omega) any_platform
 BGK collision step with density correction.
 
template<typename CELL , typename RHO , typename U , typename OMEGA , typename V = typename CELL::value_t>
static V rlbCollision (CELL &cell, const RHO &rho, const U &u, const OMEGA &omega) any_platform
 RLB advection diffusion collision step.
 
template<typename CELL , typename RHO , typename U , typename PI , typename OMEGA , typename V = typename CELL::value_t>
static V rlbCollision (CELL &cell, const RHO &rho, const U &u, const PI &pi, const OMEGA &omega) any_platform
 Renormalized DESCRIPTOR Boltzmann collision operator, fIn --> fOut.
 
template<typename CELL , typename NEWRHO , typename NEWU , typename V = typename CELL::value_t>
static void defineEqFirstOrder (CELL &cell, const NEWRHO &newRho, const NEWU &newU) any_platform
 
template<typename CELL , typename OLDRHO , typename OLDU , typename NEWRHO , typename NEWU , typename V = typename CELL::value_t>
static void defineNEq (CELL &cell, const OLDRHO &oldRho, const OLDU &oldU, const NEWRHO &newRho, const NEWU &newU) any_platform
 
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void defineNEqFromPi (CELL &cell, const RHO &rho, const U &u, const PI &pi) any_platform
 
template<typename CELL , typename FORCE , typename V = typename CELL::value_t>
static V computePiNeqNormSqr (CELL &cell, const FORCE &force) any_platform
 Computes squared norm of non-equilibrium part of 2nd momentum for forced dynamics.
 
template<typename CELL , typename V = typename CELL::value_t>
static V computePiNeqNormSqr (CELL &cell) any_platform
 Computes squared norm of non-equilibrium part of 2nd momentum for standard (non-forced) dynamics.
 
template<typename CELL , typename RHO , typename U , typename OMEGA , typename FORCE , typename V = typename CELL::value_t>
static void addExternalForce (CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
 Add a force term after BGK collision.
 

Detailed Description

template<typename DESCRIPTOR>
struct olb::lbm< DESCRIPTOR >

Collection of common computations for LBM.

Definition at line 182 of file lbm.h.

Member Function Documentation

◆ addExternalForce()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename OMEGA , typename FORCE , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::addExternalForce ( CELL & cell,
const RHO & rho,
const U & u,
const OMEGA & omega,
const FORCE & force )
inlinestatic

Add a force term after BGK collision.

Definition at line 463 of file lbm.h.

464 {
465 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
466 V c_u{};
467 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
468 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
469 }
470 c_u *= descriptors::invCs2<V,DESCRIPTOR>() * descriptors::invCs2<V,DESCRIPTOR>();
471 V forceTerm{};
472 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
473 forceTerm +=
474 ( (descriptors::c<DESCRIPTOR>(iPop,iD) - u[iD]) * descriptors::invCs2<V,DESCRIPTOR>()
475 + c_u * descriptors::c<DESCRIPTOR>(iPop,iD)
476 )
477 * force[iD];
478 }
479 forceTerm *= descriptors::t<V,DESCRIPTOR>(iPop);
480 forceTerm *= V{1} - omega * V{0.5};
481 forceTerm *= rho;
482 cell[iPop] += forceTerm;
483 }
484 }
+ Here is the caller graph for this function:

◆ adeBgkCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename VELOCITY , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::adeBgkCollision ( CELL & cell,
const RHO & rho,
const VELOCITY & u,
const OMEGA & omega )
inlinestatic

Advection diffusion BGK collision step.

Definition at line 302 of file lbm.h.

303 {
304 const V uSqr = util::normSqr<VELOCITY,DESCRIPTOR::d>(u);
305 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
306 cell[iPop] *= V{1} - omega;
307 cell[iPop] += omega * equilibrium<DESCRIPTOR>::firstOrder(iPop, rho, u);
308 }
309 return uSqr;
310 }
static V firstOrder(int iPop, const RHO &rho, const U &u) any_platform
Computation of equilibrium distribution, first order in u.
Definition lbm.h:37

References olb::equilibrium< DESCRIPTOR >::firstOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bgkCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename VELOCITY , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::bgkCollision ( CELL & cell,
const RHO & rho,
const VELOCITY & u,
const OMEGA & omega )
inlinestatic

BGK collision step.

Definition at line 290 of file lbm.h.

291 {
292 const V uSqr = util::normSqr<VELOCITY,DESCRIPTOR::d>(u);
293 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
294 cell[iPop] *= V{1} - omega;
295 cell[iPop] += omega * equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
296 }
297 return uSqr;
298 }
static V secondOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, second order in u.
Definition lbm.h:51

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeAllMomenta()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeAllMomenta ( CELL & cell,
RHO & rho,
U & u,
PI & pi )
inlinestatic

Computation of all hydrodynamic variables.

Definition at line 251 of file lbm.h.

252 {
253 computeRhoU(cell, rho, u);
254 computeStress(cell, rho, u, pi);
255 }
static void computeStress(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
Computation of stress tensor.
Definition lbm.h:229
static void computeRhoU(CELL &cell, RHO &rho, U &u) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:219

References olb::lbm< DESCRIPTOR >::computeRhoU(), and olb::lbm< DESCRIPTOR >::computeStress().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeFeq()

template<typename DESCRIPTOR >
template<typename CELL , typename FEQ , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeFeq ( CELL & cell,
FEQ & fEq )
inlinestatic

Definition at line 258 of file lbm.h.

259 {
260 V rho {};
261 V u[DESCRIPTOR::d] {};
262 computeRhoU(cell, rho, u);
263 const V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
264 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
265 fEq[iPop] = equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
266 }
267 }

References olb::lbm< DESCRIPTOR >::computeRhoU(), and olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:

◆ computeFneq() [1/2]

template<typename DESCRIPTOR >
template<typename CELL , typename FNEQ , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeFneq ( CELL & cell,
FNEQ & fNeq )
inlinestatic

Definition at line 280 of file lbm.h.

281 {
282 V rho{};
283 V u[DESCRIPTOR::d] {};
284 computeRhoU(cell, rho, u);
285 computeFneq(cell, fNeq, rho, u);
286 }
static void computeFneq(CELL &cell, FNEQ &fNeq, const RHO &rho, const U &u) any_platform
Computation of non-equilibrium distribution.
Definition lbm.h:271

References olb::lbm< DESCRIPTOR >::computeFneq(), and olb::lbm< DESCRIPTOR >::computeRhoU().

+ Here is the call graph for this function:

◆ computeFneq() [2/2]

template<typename DESCRIPTOR >
template<typename CELL , typename FNEQ , typename RHO , typename U , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeFneq ( CELL & cell,
FNEQ & fNeq,
const RHO & rho,
const U & u )
inlinestatic

Computation of non-equilibrium distribution.

Definition at line 271 of file lbm.h.

272 {
273 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
274 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
275 fNeq[iPop] = cell[iPop] - equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
276 }
277 }

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeJ()

template<typename DESCRIPTOR >
template<typename CELL , typename J , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeJ ( CELL & cell,
J & j )
inlinestatic

Computation of momentum.

Definition at line 197 of file lbm.h.

198 {
199 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
200 j[iD] = V();
201 }
202 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
203 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
204 j[iD] += cell[iPop]*descriptors::c<DESCRIPTOR>(iPop,iD);
205 }
206 }
207 }
+ Here is the caller graph for this function:

◆ computePiNeqNormSqr() [1/2]

template<typename DESCRIPTOR >
template<typename CELL , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::computePiNeqNormSqr ( CELL & cell)
inlinestatic

Computes squared norm of non-equilibrium part of 2nd momentum for standard (non-forced) dynamics.

Definition at line 450 of file lbm.h.

451 {
452 V rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR>::n];
453 computeAllMomenta(cell, rho, u, pi);
454 V PiNeqNormSqr = pi[0]*pi[0] + 2.*pi[1]*pi[1] + pi[2]*pi[2];
455 if constexpr (util::TensorVal<DESCRIPTOR >::n == 6) {
456 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2.*pi[4]*pi[4] +pi[5]*pi[5];
457 }
458 return PiNeqNormSqr;
459 }
static void computeAllMomenta(CELL &cell, RHO &rho, U &u, PI &pi) any_platform
Computation of all hydrodynamic variables.
Definition lbm.h:251
static constexpr int n
result stored in n
Definition util.h:211

References olb::lbm< DESCRIPTOR >::computeAllMomenta().

+ Here is the call graph for this function:

◆ computePiNeqNormSqr() [2/2]

template<typename DESCRIPTOR >
template<typename CELL , typename FORCE , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::computePiNeqNormSqr ( CELL & cell,
const FORCE & force )
inlinestatic

Computes squared norm of non-equilibrium part of 2nd momentum for forced dynamics.

Definition at line 424 of file lbm.h.

425 {
426 V rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR>::n];
427 computeAllMomenta(cell, rho, u, pi);
428 V ForceTensor[util::TensorVal<DESCRIPTOR>::n];
429 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
430 int iPi = 0;
431 for (int Alpha=0; Alpha<DESCRIPTOR::d; ++Alpha) {
432 for (int Beta=Alpha; Beta<DESCRIPTOR::d; ++Beta) {
433 ForceTensor[iPi] = rho/2.*(force[Alpha]*u[Beta] + u[Alpha]*force[Beta]);
434 ++iPi;
435 }
436 }
437 // Creation of second-order moment off-equilibrium tensor
438 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR >::n; ++iPi) {
439 pi[iPi] += ForceTensor[iPi];
440 }
441 V PiNeqNormSqr = pi[0]*pi[0] + 2.*pi[1]*pi[1] + pi[2]*pi[2];
442 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
443 PiNeqNormSqr += pi[2]*pi[2] + pi[3]*pi[3] + 2.*pi[4]*pi[4] +pi[5]*pi[5];
444 }
445 return PiNeqNormSqr;
446 }

References olb::lbm< DESCRIPTOR >::computeAllMomenta().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeRho()

template<typename DESCRIPTOR >
template<typename CELL , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::computeRho ( CELL & cell)
inlinestatic

Computation of density.

Definition at line 185 of file lbm.h.

186 {
187 V rho = V();
188 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
189 rho += cell[iPop];
190 }
191 rho += V{1};
192 return rho;
193 }
+ Here is the caller graph for this function:

◆ computeRhoJ()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename J , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeRhoJ ( CELL & cell,
RHO & rho,
J & j )
inlinestatic

Computation of hydrodynamic variables.

Definition at line 211 of file lbm.h.

212 {
213 rho = computeRho(cell);
214 computeJ(cell, j);
215 }
static void computeJ(CELL &cell, J &j) any_platform
Computation of momentum.
Definition lbm.h:197
static V computeRho(CELL &cell) any_platform
Computation of density.
Definition lbm.h:185

References olb::lbm< DESCRIPTOR >::computeJ(), and olb::lbm< DESCRIPTOR >::computeRho().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeRhoU()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeRhoU ( CELL & cell,
RHO & rho,
U & u )
inlinestatic

Computation of hydrodynamic variables.

Definition at line 219 of file lbm.h.

220 {
221 computeRhoJ(cell, rho, u);
222 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
223 u[iD] /= rho;
224 }
225 }
static void computeRhoJ(CELL &cell, RHO &rho, J &j) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:211

References olb::lbm< DESCRIPTOR >::computeRhoJ().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeStress()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::computeStress ( CELL & cell,
const RHO & rho,
const U & u,
PI & pi )
inlinestatic

Computation of stress tensor.

Definition at line 229 of file lbm.h.

230 {
231 int iPi = 0;
232 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
233 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
234 pi[iPi] = V();
235 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
236 pi[iPi] += descriptors::c<DESCRIPTOR>(iPop,iAlpha)*
237 descriptors::c<DESCRIPTOR>(iPop,iBeta) * cell[iPop];
238 }
239 // stripe off equilibrium contribution
240 pi[iPi] -= rho*u[iAlpha]*u[iBeta];
241 if (iAlpha==iBeta) {
242 pi[iPi] -= V{1} / descriptors::invCs2<V,DESCRIPTOR>()*(rho-V{1});
243 }
244 ++iPi;
245 }
246 }
247 }
+ Here is the caller graph for this function:

◆ constRhoBgkCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename RATIORHO , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::constRhoBgkCollision ( CELL & cell,
const RHO & rho,
const U & u,
const RATIORHO & ratioRho,
const OMEGA & omega )
inlinestatic

BGK collision step with density correction.

Definition at line 326 of file lbm.h.

328 {
329 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
330 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
331 V feq = equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
332 cell[iPop] =
333 ratioRho*(feq+descriptors::t<V,DESCRIPTOR>(iPop))-descriptors::t<V,DESCRIPTOR>(iPop) +
334 (V{1}-omega)*(cell[iPop]-feq);
335 }
336 return uSqr;
337 }

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:

◆ defineEqFirstOrder()

template<typename DESCRIPTOR >
template<typename CELL , typename NEWRHO , typename NEWU , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::defineEqFirstOrder ( CELL & cell,
const NEWRHO & newRho,
const NEWU & newU )
inlinestatic

Definition at line 389 of file lbm.h.

390 {
391 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
392 cell[iPop] = equilibrium<DESCRIPTOR>::firstOrder(iPop, newRho, newU);
393 }
394 }

References olb::equilibrium< DESCRIPTOR >::firstOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defineNEq()

template<typename DESCRIPTOR >
template<typename CELL , typename OLDRHO , typename OLDU , typename NEWRHO , typename NEWU , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::defineNEq ( CELL & cell,
const OLDRHO & oldRho,
const OLDU & oldU,
const NEWRHO & newRho,
const NEWU & newU )
inlinestatic

Definition at line 397 of file lbm.h.

400 {
401 const V oldUSqr = util::normSqr<OLDU,DESCRIPTOR::d>(oldU);
402 const V newUSqr = util::normSqr<NEWU,DESCRIPTOR::d>(newU);
403 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
404 cell[iPop] += equilibrium<DESCRIPTOR>::secondOrder(iPop, newRho, newU, newUSqr)
405 - equilibrium<DESCRIPTOR>::secondOrder(iPop, oldRho, oldU, oldUSqr);
406 }
407 }

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defineNEqFromPi()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t>
static void olb::lbm< DESCRIPTOR >::defineNEqFromPi ( CELL & cell,
const RHO & rho,
const U & u,
const PI & pi )
inlinestatic

Definition at line 410 of file lbm.h.

414 {
415 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
416 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
417 cell[iPop] = equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr)
418 + equilibrium<DESCRIPTOR>::template fromPiToFneq<V>(iPop, pi);
419 }
420 }

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ incBgkCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename PRESSURE , typename J , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::incBgkCollision ( CELL & cell,
const PRESSURE & pressure,
const J & j,
const OMEGA & omega )
inlinestatic

Incompressible BGK collision step.

Definition at line 314 of file lbm.h.

315 {
316 const V jSqr = util::normSqr<J,DESCRIPTOR::d>(j);
317 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
318 cell[iPop] *= V{1} - omega;
319 cell[iPop] += omega * equilibrium<DESCRIPTOR>::template incompressible<J,V,V>(iPop, j, jSqr, pressure);
320 }
321 return jSqr;
322 }

◆ rlbCollision() [1/2]

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::rlbCollision ( CELL & cell,
const RHO & rho,
const U & u,
const OMEGA & omega )
inlinestatic

RLB advection diffusion collision step.

Definition at line 341 of file lbm.h.

342 {
343 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
344 // First-order moment for the regularization
345 V j1[DESCRIPTOR::d];
346 for ( int iD = 0; iD < DESCRIPTOR::d; ++iD ) {
347 j1[iD] = V();
348 }
349
350 V fEq[DESCRIPTOR::q];
351 for ( int iPop = 0; iPop < DESCRIPTOR::q; ++iPop ) {
352 fEq[iPop] = equilibrium<DESCRIPTOR>::firstOrder( iPop, rho, u );
353 for ( int iD = 0; iD < DESCRIPTOR::d; ++iD ) {
354 j1[iD] += descriptors::c<DESCRIPTOR>(iPop,iD) * ( cell[iPop] - fEq[iPop] );
355 }
356 }
357
358 // Collision step
359 for ( int iPop = 0; iPop < DESCRIPTOR::q; ++iPop ) {
360 V fNeq = V();
361 for ( int iD = 0; iD < DESCRIPTOR::d; ++iD ) {
362 fNeq += descriptors::c<DESCRIPTOR>(iPop,iD) * j1[iD];
363 }
364 fNeq *= descriptors::t<V,DESCRIPTOR>(iPop) * descriptors::invCs2<V,DESCRIPTOR>();
365 cell[iPop] = fEq[iPop] + ( V{1} - omega ) * fNeq;
366 }
367 return uSqr;
368 }

References olb::equilibrium< DESCRIPTOR >::firstOrder().

+ Here is the call graph for this function:

◆ rlbCollision() [2/2]

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename PI , typename OMEGA , typename V = typename CELL::value_t>
static V olb::lbm< DESCRIPTOR >::rlbCollision ( CELL & cell,
const RHO & rho,
const U & u,
const PI & pi,
const OMEGA & omega )
inlinestatic

Renormalized DESCRIPTOR Boltzmann collision operator, fIn --> fOut.

Definition at line 372 of file lbm.h.

373 {
374 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
375 cell[0] = equilibrium<DESCRIPTOR>::secondOrder(0, rho, u, uSqr)
376 + (V{1}-omega) * equilibrium<DESCRIPTOR>::template fromPiToFneq<V>(0, pi);
377 for (int iPop=1; iPop <= DESCRIPTOR::q/2; ++iPop) {
378 cell[iPop] = equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
379 cell[iPop+DESCRIPTOR::q/2] = equilibrium<DESCRIPTOR>::secondOrder(iPop+DESCRIPTOR::q/2, rho, u, uSqr);
380
381 V fNeq = (V{1}-omega) * equilibrium<DESCRIPTOR>::template fromPiToFneq<V>(iPop, pi);
382 cell[iPop] += fNeq;
383 cell[iPop+DESCRIPTOR::q/2] += fNeq;
384 }
385 return uSqr;
386 }

References olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:

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