OpenLB 1.8.1
Loading...
Searching...
No Matches
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<concepts::Cell CELL, concepts::Parameters PARAMETERS, typename V = typename CELL::value_t>
computeEffectiveOmega (CELL &cell, PARAMETERS &parameters) any_platform
 
template<concepts::Cell CELL, concepts::Parameters 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 292 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 294 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 293 of file collisionLES.h.

Member Function Documentation

◆ apply()

template<typename COLLISION , typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM >
template<concepts::Cell CELL, concepts::Parameters 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 351 of file collisionLES.h.

351 {
352 parameters.template set<descriptors::OMEGA>(
353 computeEffectiveOmega(cell, parameters));
354 return CollisionO().apply(cell, parameters);
355 }
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<concepts::Cell CELL, concepts::Parameters 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 297 of file collisionLES.h.

297 {
299 MomentaF().computeStress(cell, pi);
300 V piNeqNormSqr { };
301 MomentaF().computePiNeqNormSqr(cell, piNeqNormSqr);
302 const V rho = MomentaF().computeRho(cell);
303 const V omega = parameters.template get<descriptors::OMEGA>();
304 const V smagorinsky = parameters.template get<collision::LES::SMAGORINSKY>();
306 V conSmagoR[DESCRIPTOR::q];
308 V tauMol = V{1} / omega;
310 V piNeqNorm = util::sqrt(2*piNeqNormSqr);
311 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));
312 for (int n=0; n < util::TensorVal<DESCRIPTOR>::n; ++n) {
313 S[n] = Phi*pi[n];
314 }
315 //Strain rate Tensor Norm
316 V SNormSqr = S[0]*S[0] + 2.0*S[1]*S[1] + S[2]*S[2];
317 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
318 SNormSqr += S[2]*S[2] + S[3]*S[3] + 2.0*S[4]*S[4] + S[5]*S[5];
319 }
320 V SNorm = util::sqrt(2*SNormSqr);
321 V preFactor = smagorinsky*smagorinsky
323 * 2 * util::sqrt(2);
324 //consistent Samagorinsky additional R term
325 //for (int q=0; q < DESCRIPTOR::q; ++q) {
326 {
327 unsigned q = 0;
329 //Hermite-Polynom H = c*c-cs^2*kronDelta
333 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
338 }
339 //contraction or scalar product H*S
340 V contractHS = H[0]*S[0] + 2.0*H[1]*S[1] + H[2]*S[2];
341 if constexpr (util::TensorVal<DESCRIPTOR>::n == 6) {
342 contractHS += H[2]*S[2] + H[3]*S[3] + 2.0*H[4]*S[4] + H[5]*S[5];
343 }
344 //additional term
345 conSmagoR[q] = t*preFactor*SNorm*contractHS;
346 }
347 return conSmagoR[0];
348 }
platform_constant Fraction cs2
Definition functions.h:66
platform_constant Fraction t[Q]
Definition rtlbm.h:45
constexpr int q() any_platform
Definition functions.h:140
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
Expr sqrt(Expr x)
Definition expr.cpp:225
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static constexpr int n
result stored in n
Definition util.h:217

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::sqrt(), and olb::descriptors::t().

+ 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: