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

#include <forcing.h>

+ Collaboration diagram for olb::forcing::Wagner::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) any_platform
 

Detailed Description

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

Definition at line 401 of file forcing.h.

Member Typedef Documentation

◆ CollisionO

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

Definition at line 403 of file forcing.h.

◆ MomentaF

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

Definition at line 402 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::Wagner::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 409 of file forcing.h.

409 {
410 V rho, u[DESCRIPTOR::d];
411 MomentaF().computeRhoU(cell, rho, u);
412 CollisionO().apply(cell, parameters);
413 const V omega = cell.template getField<descriptors::OMEGA>();
414 const auto force = cell.template getField<descriptors::FORCE>();
415 const V d2_rho = cell.template getField<descriptors::SCALAR>();
417
418 // Forcing scheme
419 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
420 V c_u{};
421 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
422 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
423 }
425 V forceTerm{};
426 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
427 forceTerm +=
429 + c_u * descriptors::c<DESCRIPTOR>(iPop,iD)
430 ) * force[iD];
431 }
432
433 V delta_ij = 0;
434 for (int n = 0; n < DESCRIPTOR::d; ++n) {
435 for (int m = 0; m < DESCRIPTOR::d; ++m) {
436 int ind = n*DESCRIPTOR::d + m;
437
438 delta_ij = (n == m) ? 1 : 0;
439
440 psi_w[ind] = (V(1.)-omega/V(4.))*force[n]*force[m] + omega/V(12.)*( d2_rho )/rho*delta_ij;
441
442 // Computing the source term
443 forceTerm += V(9.) * ( descriptors::c<DESCRIPTOR>(iPop)[n]
444 * descriptors::c<DESCRIPTOR>(iPop)[m] - V(1./3.)*delta_ij ) / V(2.)
445 * psi_w[ind];
446 }
447 }
448
449 forceTerm *= descriptors::t<V,DESCRIPTOR>(iPop);
450 forceTerm *= rho;
451 cell[iPop] += forceTerm;
452 }
453
454 return {rho, util::normSqr<V,DESCRIPTOR::d>(u)};
455 };
constexpr T m(unsigned iPop, unsigned jPop, tag::MRT)
Definition mrt.h:386
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
Definition forcing.h:403
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition forcing.h:402

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::normSqr(), and olb::descriptors::t().

+ Here is the call graph for this function:

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