OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > Struct Template Reference

#include <porousBGKdynamics.h>

+ Collaboration diagram for olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >:

Public Types

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

Public Member Functions

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

Static Public Attributes

static constexpr bool is_vectorizable = false
 

Detailed Description

template<typename COLLISION, bool isStatic = false>
template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM>
struct olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >

Definition at line 109 of file porousBGKdynamics.h.

Member Typedef Documentation

◆ CollisionO

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 112 of file porousBGKdynamics.h.

◆ EquilibriumF

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::EquilibriumF = typename EQUILIBRIUM::template type<DESCRIPTOR,MOMENTA>

Definition at line 111 of file porousBGKdynamics.h.

◆ MomentaF

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 110 of file porousBGKdynamics.h.

Member Function Documentation

◆ apply()

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 132 of file porousBGKdynamics.h.

132 {
133 V rho, u[DESCRIPTOR::d];
134 MomentaF().computeRhoU(cell, rho, u);
135
136 auto statistic = CollisionO().apply(cell, parameters);
137
138 V velDenominator = cell.template getFieldComponent<descriptors::VELOCITY_DENOMINATOR>(0);
139
140 // use Kuperstokh forcing by default
141 V uPlus[DESCRIPTOR::d]{ };
142 V diff[DESCRIPTOR::q]{ };
143
144 if (velDenominator > std::numeric_limits<V>::epsilon()) {
145 for (int iDim=0; iDim<DESCRIPTOR::d; ++iDim) {
146 uPlus[iDim] = u[iDim];
147 }
148 calculate(cell, uPlus);
149 if constexpr (!isStatic) {
150 particles::resetParticleRelatedFields<DESCRIPTOR,CELL,V>(cell);
151 }
152
153 for (int tmp_iPop=0; tmp_iPop < DESCRIPTOR::q; tmp_iPop++) {
154 diff[tmp_iPop] += EquilibriumF().compute(tmp_iPop, rho, uPlus)
155 - EquilibriumF().compute(tmp_iPop, rho, u);
156 cell[tmp_iPop] += diff[tmp_iPop];
157 }
158 }
159
160 particles::resetParticleContactRelatedFields<DESCRIPTOR,CELL,V>(cell);
161
162 return statistic;
163 }
typename MOMENTA::template type< DESCRIPTOR > MomentaF
void calculate(CELL &cell, pVELOCITY &pVelocity)
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > EquilibriumF
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
typename meta::list< descriptors::OMEGA > parameters

References olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::calculate().

+ Here is the call graph for this function:

◆ calculate()

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<typename CELL , typename pVELOCITY , typename V = typename CELL::value_t>
void olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::calculate ( CELL & cell,
pVELOCITY & pVelocity )
inline

Definition at line 117 of file porousBGKdynamics.h.

117 {
118 if constexpr (isStatic) {
119 for (int i=0; i<DESCRIPTOR::d; i++) {
120 pVelocity[i] -= (1.-(cell.template getField<descriptors::POROSITY>())) * pVelocity[i];
121 }
122 } else {
123 for (int i=0; i<DESCRIPTOR::d; i++) {
124 pVelocity[i] += (1.-cell.template getField<descriptors::POROSITY>())
125 * (cell.template getFieldComponent<descriptors::VELOCITY_NUMERATOR>(i)
126 / cell.template getField<descriptors::VELOCITY_DENOMINATOR>() - pVelocity[i]);
127 }
128 }
129 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ is_vectorizable

template<typename COLLISION , bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
constexpr bool olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::is_vectorizable = false
staticconstexpr

Definition at line 114 of file porousBGKdynamics.h.


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