OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::collision::detail::WaleEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM > Struct Template Reference

#include <collisionLES.h>

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

Definition at line 359 of file collisionLES.h.

Member Typedef Documentation

◆ CollisionO

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

Definition at line 361 of file collisionLES.h.

◆ MomentaF

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

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

Definition at line 437 of file collisionLES.h.

437 {
438 parameters.template set<descriptors::OMEGA>(
439 computeEffectiveOmega(cell, parameters));
440 return CollisionO().apply(cell, parameters);
441 }
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
V computeEffectiveOmega(CELL &cell, PARAMETERS &parameters) any_platform

References olb::collision::detail::WaleEffectiveOmega< 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::WaleEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >::computeEffectiveOmega ( CELL & cell,
PARAMETERS & parameters )
inline

Molecular relaxation time

Effective relaxation time

Definition at line 364 of file collisionLES.h.

364 {
365 V piNeqNormSqr { };
366 MomentaF().computePiNeqNormSqr(cell, piNeqNormSqr);
367 const V omega = parameters.template get<descriptors::OMEGA>();
368 const V smagorinsky = parameters.template get<collision::LES::SMAGORINSKY>();
369 const auto velocityGradient = cell.template getField<descriptors::VELO_GRAD>();
370 V preFactor = smagorinsky*smagorinsky;
371 // velocity gradient tensor
372 V g[3][3];
373 for (unsigned i=0; i < 3; i++) {
374 for (unsigned j=0; j < 3; j++) {
375 g[i][j] = velocityGradient[i*3 + j];
376 }
377 }
378 // strain rate tensor
379 V s[3][3];
380 for (unsigned i = 0; i < 3; i++) {
381 for (unsigned j = 0; j < 3; j++) {
382 s[i][j] = (g[i][j] + g[j][i]) / V{2};
383 }
384 }
385 // traceless symmetric part of the square of the velocity gradient tensor
386 V G[3][3];
387 for (unsigned i = 0; i < 3; i++) {
388 for (unsigned j = 0; j < 3; j++) {
389 G[i][j] = V{0};
390 }
391 }
392 for (unsigned i = 0; i < 3; i++) {
393 for (unsigned j = 0; j < 3; j++) {
394 for (unsigned k = 0; k < 3; k++) {
395 G[i][j] += (g[i][k]*g[k][j] + g[j][k]*g[k][i]) / V{2};
396 }
397 }
398 }
399 V trace{};
400 for (unsigned i = 0; i < 3; i++) {
401 trace += V{1}/V{3} * g[i][i] * g[i][i];
402 }
403 for (unsigned i = 0; i < 3; i++) {
404 G[i][i] -= trace;
405 }
406 // inner product of the traceless symmetric part of the square of the velocity gradient tensor
407 V G_ip{};
408 for (unsigned i = 0; i < 3; i++) {
409 for (unsigned j = 0; j < 3; j++) {
410 G_ip = G[i][j] * G[i][j];
411 }
412 }
413 // inner product of the strain rate
414 V s_ip{};
415 for (unsigned i = 0; i < 3; i++) {
416 for (unsigned j = 0; j < 3; j++) {
417 s_ip = s[i][j] * s[i][j];
418 }
419 }
420 // Turbulent relaxation time
421 V tauTurb = V{3} * preFactor * (util::pow(G_ip,1.5) / (util::pow(s_ip,2.5) + util::pow(G_ip,1.25)));
422 if ((util::pow(s_ip,2.5) + util::pow(G_ip,1.25)) == 0) {
423 tauTurb = 0;
424 }
425 // Physical turbulent viscosity must be equal or higher that zero
426 if (tauTurb < 0) {
427 tauTurb = 0;
428 }
430 V tauMol = V{1} / omega;
432 V tauEff = tauMol + tauTurb;
433 return V{1} / tauEff;
434 }
platform_constant Fraction s[Q]
Definition mrt.h:65
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
typename MOMENTA::template type< DESCRIPTOR > MomentaF

References olb::util::pow().

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