OpenLB 1.7
Loading...
Searching...
No Matches
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 110 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 113 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 112 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 111 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 133 of file porousBGKdynamics.h.

133 {
134 V rho, u[DESCRIPTOR::d];
135 MomentaF().computeRhoU(cell, rho, u);
136
137 auto statistic = CollisionO().apply(cell, parameters);
138
139 V velDenominator = cell.template getFieldComponent<descriptors::VELOCITY_DENOMINATOR>(0);
140
141 // use Kuperstokh forcing by default
142 V uPlus[DESCRIPTOR::d]{ };
143 V diff[DESCRIPTOR::q]{ };
144 V fEqPlus[DESCRIPTOR::q]{ };
145 V fEq[DESCRIPTOR::q]{ };
146
147 if (velDenominator > std::numeric_limits<V>::epsilon()) {
148 for (int iDim=0; iDim<DESCRIPTOR::d; ++iDim) {
149 uPlus[iDim] = u[iDim];
150 }
151 calculate(cell, uPlus);
152 if constexpr (!isStatic) {
154 }
155
156 EquilibriumF().compute(cell, rho, uPlus, fEqPlus);
157 EquilibriumF().compute(cell, rho, u, fEq);
158 for (int tmp_iPop=0; tmp_iPop < DESCRIPTOR::q; tmp_iPop++) {
159 diff[tmp_iPop] += fEqPlus[tmp_iPop] - fEq[tmp_iPop];
160 cell[tmp_iPop] += diff[tmp_iPop];
161 }
162 }
163
165
166 return statistic;
167 }
void resetParticleRelatedFields(CELL &cell) noexcept
void resetParticleContactRelatedFields(CELL &cell) noexcept
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(), olb::particles::resetParticleContactRelatedFields(), and olb::particles::resetParticleRelatedFields().

+ 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 118 of file porousBGKdynamics.h.

118 {
119 if constexpr (isStatic) {
120 for (int i=0; i<DESCRIPTOR::d; i++) {
121 pVelocity[i] -= (1.-(cell.template getField<descriptors::POROSITY>())) * pVelocity[i];
122 }
123 } else {
124 for (int i=0; i<DESCRIPTOR::d; i++) {
125 pVelocity[i] += (1.-cell.template getField<descriptors::POROSITY>())
126 * (cell.template getFieldComponent<descriptors::VELOCITY_NUMERATOR>(i)
127 / cell.template getField<descriptors::VELOCITY_DENOMINATOR>() - pVelocity[i]);
128 }
129 }
130 }
+ 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 >
bool olb::collision::PorousParticle< COLLISION, isStatic >::type< DESCRIPTOR, MOMENTA, EQUILIBRIUM >::is_vectorizable = false
staticconstexpr

Definition at line 115 of file porousBGKdynamics.h.


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