OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > Struct Template Reference

#include <forcing.h>

+ Collaboration diagram for olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>
 

Public Member Functions

template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters)
 

Detailed Description

template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
struct olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 539 of file forcing.h.

Member Typedef Documentation

◆ CollisionO

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 541 of file forcing.h.

◆ MomentaF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 540 of file forcing.h.

Member Function Documentation

◆ apply()

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::forcing::LinearVelocity::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 544 of file forcing.h.

544 {
545 V rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR >::n];
546 MomentaF().computeAllMomenta(cell, rho, u, pi);
547 auto force = cell.template getFieldPointer<descriptors::FORCE>();
548 constexpr int nDim = DESCRIPTOR::d;
549 V forceSave[nDim];
550 // adds a+Bu to force, where
551 // d=2: a1=v[0], a2=v[1], B11=v[2], B12=v[3], B21=v[4], B22=v[5]
552 // d=2: a1=v[0], a2=v[1], a3=v[2], B11=v[3], B12=v[4], B13=v[5], B21=v[6], B22=v[7], B23=v[8], B31=v[9], B32=v[10], B33=v[11]
553 auto v = cell.template getFieldPointer<descriptors::V12>();
554 for (int iDim=0; iDim<nDim; ++iDim) {
555 forceSave[iDim] = force[iDim];
556 force[iDim] += v[iDim];
557 for (int jDim=0; jDim<nDim; ++jDim) {
558 force[iDim] += v[jDim + iDim*nDim + nDim]*u[jDim];
559 }
560 }
561 for (int iVel=0; iVel<nDim; ++iVel) {
562 u[iVel] += force[iVel] / V{2.};
563 }
564
565 auto statistics = CollisionO().apply(cell, parameters);
566 V newOmega = parameters.template get<descriptors::OMEGA>();
567 lbm<DESCRIPTOR>::addExternalForce(cell, rho, u, newOmega, force);
568 // Writing back to froce fector
569 for (int iVel=0; iVel<nDim; ++iVel) {
570 force[iVel] = forceSave[iVel];
571 }
572 return statistics;
573 };
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
Definition forcing.h:541
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition forcing.h:540
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.
Definition lbm.h:545
static constexpr int n
result stored in n
Definition util.h:217

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

+ Here is the call graph for this function:

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