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

#include <collisionLES.h>

+ Collaboration diagram for olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >:

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>
computeEffectiveOmega (CELL &cell, PARAMETERS &parameters) any_platform
 
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Detailed Description

template<typename COLLISION, typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM>
struct olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >

Definition at line 166 of file collisionLES.h.

Member Typedef Documentation

◆ CollisionO

template<typename COLLISION , typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::CollisionO = typename COLLISION::template type<DESCRIPTOR, MOMENTA, EQUILIBRIUM>

Definition at line 168 of file collisionLES.h.

◆ MomentaF

template<typename COLLISION , typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
using olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 167 of file collisionLES.h.

Member Function Documentation

◆ apply()

template<typename COLLISION , typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 225 of file collisionLES.h.

225 {
226 parameters.template set<descriptors::OMEGA>(
227 computeEffectiveOmega(cell, parameters));
228 return CollisionO().apply(cell, parameters);
229 }
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
V computeEffectiveOmega(CELL &cell, PARAMETERS &parameters) any_platform

References olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::computeEffectiveOmega().

+ Here is the call graph for this function:

◆ computeEffectiveOmega()

template<typename COLLISION , typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
V olb::collision::detail::ConSmagorinskyEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::computeEffectiveOmega ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 171 of file collisionLES.h.

171 {
173 MomentaF().computeStress(cell, pi);
174 V piNeqNormSqr { };
175 MomentaF().computePiNeqNormSqr(cell, piNeqNormSqr);
176 const V rho = MomentaF().computeRho(cell);
177 const V omega = parameters.template get<descriptors::OMEGA>();
178 const V smagorinsky = parameters.template get<collision::LES::Smagorinsky>();
180 V conSmagoR[DESCRIPTOR::q];
182 V tauMol = V{1} / omega;
183 V cs2 = V{1} / descriptors::invCs2<V,DESCRIPTOR>();
184 V piNeqNorm = util::sqrt(2*piNeqNormSqr);
185 V Phi = (-0.5*(-rho*tauMol*cs2+util::sqrt(rho*rho*tauMol*tauMol*cs2*cs2+V{2}*(smagorinsky*smagorinsky)*rho*piNeqNorm))/(smagorinsky*smagorinsky*rho*piNeqNorm));
186 for (int n=0; n < util::TensorVal<DESCRIPTOR>::n; ++n) {
187 S[n] = Phi*pi[n];
188 }
189 //Strain rate Tensor Norm
190 V SNormSqr = S[0]*S[0] + 2.0*S[1]*S[1] + S[2]*S[2];
191 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
192 SNormSqr += S[2]*S[2] + S[3]*S[3] + 2.0*S[4]*S[4] + S[5]*S[5];
193 }
194 V SNorm = util::sqrt(2*SNormSqr);
195 V preFactor = smagorinsky*smagorinsky
196 * descriptors::invCs2<V,DESCRIPTOR>()*descriptors::invCs2<V,DESCRIPTOR>()
197 * 2 * util::sqrt(2);
198 //consistent Samagorinsky additional R term
199 //for (int q=0; q < DESCRIPTOR::q; ++q) {
200 {
201 unsigned q = 0;
202 V t = descriptors::t<V,DESCRIPTOR>(q);
203 //Hermite-Polynom H = c*c-cs^2*kronDelta
204 H[0] = descriptors::c<DESCRIPTOR>(q,0)*descriptors::c<DESCRIPTOR>(q,0)-cs2;
205 H[1] = descriptors::c<DESCRIPTOR>(q,0)*descriptors::c<DESCRIPTOR>(q,1);
206 H[2] = descriptors::c<DESCRIPTOR>(q,1)*descriptors::c<DESCRIPTOR>(q,1)-cs2;
207 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
208 H[2] = descriptors::c<DESCRIPTOR>(q,0)*descriptors::c<DESCRIPTOR>(q,2);
209 H[3] = descriptors::c<DESCRIPTOR>(q,1)*descriptors::c<DESCRIPTOR>(q,1)-cs2;
210 H[4] = descriptors::c<DESCRIPTOR>(q,1)*descriptors::c<DESCRIPTOR>(q,2);
211 H[5] = descriptors::c<DESCRIPTOR>(q,2)*descriptors::c<DESCRIPTOR>(q,2)-cs2;
212 }
213 //contraction or scalar product H*S
214 V contractHS = H[0]*S[0] + 2.0*H[1]*S[1] + H[2]*S[2];
215 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
216 contractHS += H[2]*S[2] + H[3]*S[3] + 2.0*H[4]*S[4] + H[5]*S[5];
217 }
218 //additional term
219 conSmagoR[q] = t*preFactor*SNorm*contractHS;
220 }
221 return conSmagoR[0];
222 }
platform_constant Fraction cs2
platform_constant Fraction t[Q]
constexpr int q() any_platform
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static constexpr int n
result stored in n
Definition util.h:211

References olb::util::sqrt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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