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

#include <porousForcedBGKDynamics.h>

+ Collaboration diagram for olb::forcing::PorousParticleKupershtokh< isStatic >::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 VELOCITY , typename V = typename CELL::value_t>
void calculate (CELL &cell, VELOCITY &u)
 
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Static Public Attributes

static constexpr bool is_vectorizable = false
 

Detailed Description

template<bool isStatic = false>
template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
struct olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 108 of file porousForcedBGKDynamics.h.

Member Typedef Documentation

◆ CollisionO

template<bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 111 of file porousForcedBGKDynamics.h.

◆ EquilibriumF

template<bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::EquilibriumF = combined_equilibrium<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 110 of file porousForcedBGKDynamics.h.

◆ MomentaF

template<bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 109 of file porousForcedBGKDynamics.h.

Member Function Documentation

◆ apply()

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

Definition at line 131 of file porousForcedBGKDynamics.h.

131 {
132 V u[DESCRIPTOR::d];
133 MomentaF().computeU(cell, u);
134 const auto velDenominator = cell.template getField<descriptors::VELOCITY_DENOMINATOR>();
135 const auto statistic = CollisionO().apply(cell, parameters);
136 const auto force = cell.template getField<descriptors::FORCE>();
137 V uPlusDeltaU[DESCRIPTOR::d];
138 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
139 uPlusDeltaU[iVel] = u[iVel] + force[iVel];
140 }
141 if (velDenominator > std::numeric_limits<V>::epsilon()) {
142 calculate(cell, uPlusDeltaU);
143 if constexpr (!isStatic) {
144 // reset external field for next timestep
145 cell.template setField<descriptors::POROSITY>(1.);
146 cell.template setField<descriptors::VELOCITY_DENOMINATOR>(0.);
147 cell.template setField<descriptors::VELOCITY_NUMERATOR>({0.,0.,0.});
148 }
149 }
150 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
151 cell[iPop] += EquilibriumF().compute(iPop, statistic.rho, uPlusDeltaU)
152 - EquilibriumF().compute(iPop, statistic.rho, u);
153 }
154
155 // Reset contact helper if utilized
156 if constexpr (DESCRIPTOR::template provides<descriptors::CONTACT_DETECTION>()) {
157 cell.template setField<descriptors::CONTACT_DETECTION>(0);
158 }
159
160 return statistic;
161 };
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
combined_equilibrium< DESCRIPTOR, MOMENTA, EQUILIBRIUM > EquilibriumF

References olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::calculate().

+ Here is the call graph for this function:

◆ calculate()

template<bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
template<typename CELL , typename VELOCITY , typename V = typename CELL::value_t>
void olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::calculate ( CELL & cell,
VELOCITY & u )
inline

Definition at line 116 of file porousForcedBGKDynamics.h.

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

Member Data Documentation

◆ is_vectorizable

template<bool isStatic = false>
template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
constexpr bool olb::forcing::PorousParticleKupershtokh< isStatic >::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::is_vectorizable = false
staticconstexpr

Definition at line 113 of file porousForcedBGKDynamics.h.


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