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

#include <collisionLES.h>

+ Collaboration diagram for olb::collision::detail::KrauseEffectiveOmega< 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::KrauseEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >

Definition at line 319 of file collisionLES.h.

Member Typedef Documentation

◆ CollisionO

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

Definition at line 321 of file collisionLES.h.

◆ MomentaF

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

Definition at line 320 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::KrauseEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 348 of file collisionLES.h.

348 {
349 V rho, u[DESCRIPTOR::d], fNeq[DESCRIPTOR::q] { };
350 MomentaF().computeRhoU(cell, rho, u);
351 lbm<DESCRIPTOR>::computeFneq(cell, fNeq, rho, u); // TODO: Use EQUILIBRIUM instead of 2nd order
352 const V omega = parameters.template get<descriptors::OMEGA>();
353 const V smagorinsky = parameters.template get<collision::LES::Smagorinsky>();
354 const V preFactor = smagorinsky*smagorinsky
355 * 3*descriptors::invCs2<V,DESCRIPTOR>()*descriptors::invCs2<V,DESCRIPTOR>()
356 * 2*util::sqrt(2);
357 FieldD<V,DESCRIPTOR,typename COLLISION::OMEGA> omegaEff;
358 const V tauMol = V{1} / omega;
359 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
360 V tauTurb = V{0.5}*(util::sqrt(tauMol*tauMol + preFactor/rho * util::fabs(fNeq[iPop])) - tauMol);
361 omegaEff[iPop] = V{1} / (tauMol + tauTurb);
362 }
363 parameters.template set<typename COLLISION::OMEGA>(omegaEff);
364 return CollisionO().apply(cell, parameters);
365 }
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > fabs(cpu::simd::Pack< T > value)
Definition pack.h:106
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static void computeFneq(CELL &cell, FNEQ &fNeq, const RHO &rho, const U &u) any_platform
Computation of non-equilibrium distribution.
Definition lbm.h:271

References olb::lbm< DESCRIPTOR >::computeFneq(), olb::util::fabs(), and olb::util::sqrt().

+ 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::KrauseEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::computeEffectiveOmega ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 324 of file collisionLES.h.

324 {
325 V rho, u[DESCRIPTOR::d], fNeq[DESCRIPTOR::q] { };
326 MomentaF().computeRhoU(cell, rho, u);
327 lbm<DESCRIPTOR>::computeFneq(cell, fNeq, rho, u);
328 const V omega = parameters.template get<descriptors::OMEGA>();
329 const V smagorinsky = parameters.template get<collision::LES::Smagorinsky>();
330 const V preFactor = smagorinsky*smagorinsky
331 * 3*descriptors::invCs2<V,DESCRIPTOR>()*descriptors::invCs2<V,DESCRIPTOR>()
332 * 2*util::sqrt(2);
333 FieldD<V,DESCRIPTOR,typename COLLISION::OMEGA> omegaEff;
334 const V tauMol = V{1} / omega;
335 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
336 V tauTurb = V{0.5}*(util::sqrt(tauMol*tauMol + preFactor/rho * util::fabs(fNeq[iPop])) - tauMol);
337 omegaEff[iPop] = V{1} / (tauMol + tauTurb);
338 }
339 V avgOmegaEff = 0.;
340 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
341 avgOmegaEff += omegaEff[iPop];
342 }
343 avgOmegaEff /= DESCRIPTOR::q;
344 return avgOmegaEff;
345 }

References olb::lbm< DESCRIPTOR >::computeFneq(), olb::util::fabs(), and olb::util::sqrt().

+ Here is the call graph for this function:

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