OpenLB 1.8.1
Loading...
Searching...
No Matches
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<concepts::Cell CELL, concepts::Parameters PARAMETERS, typename V = typename CELL::value_t>
V 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::KrauseEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >

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

Definition at line 474 of file collisionLES.h.

474 {
475 V rho, u[DESCRIPTOR::d], fNeq[DESCRIPTOR::q] { };
476 MomentaF().computeRhoU(cell, rho, u);
477 lbm<DESCRIPTOR>::computeFneq(cell, fNeq, rho, u); // TODO: Use EQUILIBRIUM instead of 2nd order
478 const V omega = parameters.template get<descriptors::OMEGA>();
479 const V smagorinsky = parameters.template get<collision::LES::SMAGORINSKY>();
480 const V preFactor = smagorinsky*smagorinsky
482 * 2*util::sqrt(2);
484 const V tauMol = V{1} / omega;
485 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
486 V tauTurb = V{0.5}*(util::sqrt(tauMol*tauMol + preFactor/rho * util::fabs(fNeq[iPop])) - tauMol);
487 omegaEff[iPop] = V{1} / (tauMol + tauTurb);
488 }
489 parameters.template set<typename COLLISION::OMEGA>(omegaEff);
490 return CollisionO().apply(cell, parameters);
491 }
constexpr T invCs2() any_platform
Definition functions.h:107
Expr sqrt(Expr x)
Definition expr.cpp:225
Expr fabs(Expr x)
Definition expr.cpp:230
Vector< typename FIELD::template value_type< T >, DESCRIPTOR::template size< FIELD >() > FieldD
Vector storing a single field instance.
Definition vector.h:480
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:353

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

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

Definition at line 450 of file collisionLES.h.

450 {
451 V rho, u[DESCRIPTOR::d], fNeq[DESCRIPTOR::q] { };
452 MomentaF().computeRhoU(cell, rho, u);
453 lbm<DESCRIPTOR>::computeFneq(cell, fNeq, rho, u);
454 const V omega = parameters.template get<descriptors::OMEGA>();
455 const V smagorinsky = parameters.template get<collision::LES::SMAGORINSKY>();
456 const V preFactor = smagorinsky*smagorinsky
458 * 2*util::sqrt(2);
460 const V tauMol = V{1} / omega;
461 for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
462 V tauTurb = V{0.5}*(util::sqrt(tauMol*tauMol + preFactor/rho * util::fabs(fNeq[iPop])) - tauMol);
463 omegaEff[iPop] = V{1} / (tauMol + tauTurb);
464 }
465 V avgOmegaEff = 0.;
466 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
467 avgOmegaEff += omegaEff[iPop];
468 }
469 avgOmegaEff /= DESCRIPTOR::q;
470 return avgOmegaEff;
471 }

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

+ Here is the call graph for this function:

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