OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY > Struct Template Reference

Compute and update cell-wise OMEGA using Oswald-de-waele model. More...

#include <powerLawBGKdynamics.h>

+ Collaboration diagram for olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY >:

Classes

struct  type
 

Public Types

using parameters
 

Static Public Member Functions

static std::string getName ()
 
template<typename CELL , typename PARAMETERS , typename OMEGA , typename RHO , typename PI , typename V = typename CELL::value_t>
static V computeOmega (CELL &cell, PARAMETERS &parameters, OMEGA &omega0, RHO &rho, PI &pi) any_platform
 

Detailed Description

template<typename COLLISION, bool HERSCHELBULKLEY = false>
struct olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY >

Compute and update cell-wise OMEGA using Oswald-de-waele model.

Definition at line 77 of file powerLawBGKdynamics.h.

Member Typedef Documentation

◆ parameters

template<typename COLLISION , bool HERSCHELBULKLEY = false>
using olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY >::parameters
Initial value:
typename COLLISION::parameters::template include<
descriptors::OMEGA, OMEGA_MIN, OMEGA_MAX, M, N, YIELD_STRESS, SHEAR_RATE_MIN
>

Definition at line 78 of file powerLawBGKdynamics.h.

Member Function Documentation

◆ computeOmega()

template<typename COLLISION , bool HERSCHELBULKLEY = false>
template<typename CELL , typename PARAMETERS , typename OMEGA , typename RHO , typename PI , typename V = typename CELL::value_t>
static V olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY >::computeOmega ( CELL & cell,
PARAMETERS & parameters,
OMEGA & omega0,
RHO & rho,
PI & pi )
inlinestatic

Definition at line 88 of file powerLawBGKdynamics.h.

89 {
90 using DESCRIPTOR = typename CELL::descriptor_t;
91 V pre2 = V{0.5} * descriptors::invCs2<V,DESCRIPTOR>() * omega0 / rho; // strain rate tensor prefactor
92 pre2 *= pre2;
93 V gamma{};
94 if constexpr (DESCRIPTOR::template provides<descriptors::SHEAR_RATE_MAGNITUDE>()) {
95 gamma = cell.template getField<descriptors::SHEAR_RATE_MAGNITUDE>();
96 }
97 else {
98 if constexpr (DESCRIPTOR::template provides<descriptors::FORCE>()) {
99 // Cannot be done in just one line, it gives error - I don't know why. Davide Dapelo
100 const auto force = cell.template getField<descriptors::FORCE>();
101 gamma = util::sqrt(V{2}*pre2*lbm<DESCRIPTOR>::computePiNeqNormSqr(cell, force));
102 }
103 else {
104 gamma = util::sqrt(V{2}*pre2*lbm<DESCRIPTOR>::computePiNeqNormSqr(cell));
105 }
106 }
107 if constexpr(HERSCHELBULKLEY) {
108 gamma = util::max(parameters.template get<SHEAR_RATE_MIN>(), gamma);
109 }
110 V m = parameters.template get<M>();
111 V n = parameters.template get<N>();
112 V nuNew = m * util::pow(gamma, n-V{1}); // Ostwald-de Waele relation
113 if constexpr(HERSCHELBULKLEY) {
114 // Second term necessary for Herschel-Bulkley relation
115 nuNew += parameters.template get<YIELD_STRESS>() / gamma;
116 }
117 V newOmega = V{1} / (nuNew*descriptors::invCs2<V,DESCRIPTOR>() + V{0.5});
118 V omegaMax = parameters.template get<OMEGA_MAX>();
119 newOmega = util::min(newOmega, omegaMax);
120 V omegaMin = parameters.template get<OMEGA_MIN>();
121 newOmega = util::max(newOmega, omegaMin);
122 return newOmega;
123 }
constexpr T m(unsigned iPop, unsigned jPop, tag::MRT)
Definition mrt.h:386
constexpr T invCs2() any_platform
Definition functions.h:107
Expr sqrt(Expr x)
Definition expr.cpp:225
Expr min(Expr a, Expr b)
Definition expr.cpp:249
Expr max(Expr a, Expr b)
Definition expr.cpp:245
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
static V computePiNeqNormSqr(CELL &cell, const FORCE &force) any_platform
Computes squared norm of non-equilibrium part of 2nd momentum for forced dynamics.
Definition lbm.h:506
typename COLLISION::parameters::template include< descriptors::OMEGA, OMEGA_MIN, OMEGA_MAX, M, N, YIELD_STRESS, SHEAR_RATE_MIN > parameters

References olb::lbm< DESCRIPTOR >::computePiNeqNormSqr(), olb::descriptors::invCs2(), olb::util::max(), olb::util::min(), olb::util::pow(), and olb::util::sqrt().

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

◆ getName()

template<typename COLLISION , bool HERSCHELBULKLEY = false>
static std::string olb::powerlaw::OmegaFromCell< COLLISION, HERSCHELBULKLEY >::getName ( )
inlinestatic

Definition at line 82 of file powerLawBGKdynamics.h.

83 {
84 return "powerlaw::OmegaFromCell<" + COLLISION::getName() + ">";
85 }

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