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

#include <forcing.h>

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

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using EquilibriumF = combined_equilibrium<DESCRIPTOR,MOMENTA,EQUILIBRIUM>
 
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::ForcedHLBM::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 649 of file forcing.h.

Member Typedef Documentation

◆ CollisionO

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

Definition at line 652 of file forcing.h.

◆ EquilibriumF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::ForcedHLBM::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::EquilibriumF = combined_equilibrium<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 651 of file forcing.h.

◆ MomentaF

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

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

Definition at line 655 of file forcing.h.

655 {
657 MomentaF().computeU(cell, u);
658
659 auto statistic = CollisionO().apply(cell, parameters);
660
661 const V porosity = cell.template getField<descriptors::POROSITY>();
662 const auto force = cell.template getField<descriptors::FORCE>();
663
664 auto fHLBM = (1 - porosity) * (cell.template getField<descriptors::VELOCITY>() - u);
665
666 // This is Kuperstokh forcing
667 Vector<V,DESCRIPTOR::d> uPlus = u + force + fHLBM;
668
669 V fEq[DESCRIPTOR::q] { };
670 V fEq2[DESCRIPTOR::q] { };
671 EquilibriumF().compute(cell, statistic.rho, u, fEq);
672 EquilibriumF().compute(cell, statistic.rho, uPlus, fEq2);
673 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
674 cell[iPop] += fEq2[iPop] - fEq[iPop];
675 }
676
677 if (porosity < 1) {
678 return {-1,-1};
679 } else {
680 V rho{};
681 MomentaF().computeRhoU(cell, rho, u);
682 return {rho, util::normSqr<V,DESCRIPTOR::d>(u)};
683 }
684 };
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 MOMENTA::template type< DESCRIPTOR > MomentaF
Definition forcing.h:650
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
Definition forcing.h:652
combined_equilibrium< DESCRIPTOR, MOMENTA, EQUILIBRIUM > EquilibriumF
Definition forcing.h:651

References olb::util::normSqr().

+ Here is the call graph for this function:

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