OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
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 56 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 57 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 67 of file powerLawBGKdynamics.h.

68 {
69 using DESCRIPTOR = typename CELL::descriptor_t;
70 V pre2 = V{0.5} * descriptors::invCs2<V,DESCRIPTOR>() * omega0 / rho; // strain rate tensor prefactor
71 pre2 *= pre2;
72 V gamma{};
73 if constexpr (DESCRIPTOR::template provides<descriptors::SHEAR_RATE_MAGNITUDE>()) {
74 gamma = cell.template getField<descriptors::SHEAR_RATE_MAGNITUDE>();
75 }
76 else {
77 if constexpr (DESCRIPTOR::template provides<descriptors::FORCE>()) {
78 // Cannot be done in just one line, it gives error - I don't know why. Davide Dapelo
79 const auto force = cell.template getField<descriptors::FORCE>();
80 gamma = util::sqrt(V{2}*pre2*lbm<DESCRIPTOR>::computePiNeqNormSqr(cell, force));
81 }
82 else {
83 gamma = util::sqrt(V{2}*pre2*lbm<DESCRIPTOR>::computePiNeqNormSqr(cell));
84 }
85 }
86 if constexpr(HERSCHELBULKLEY) {
87 gamma = util::max(parameters.template get<SHEAR_RATE_MIN>(), gamma);
88 }
89 V m = parameters.template get<M>();
90 V n = parameters.template get<N>();
91 V nuNew = m * util::pow(gamma, n-V{1}); // Ostwald-de Waele relation
92 if constexpr(HERSCHELBULKLEY) {
93 // Second term necessary for Herschel-Bulkley relation
94 nuNew += parameters.template get<YIELD_STRESS>() / gamma;
95 }
96 V newOmega = V{1} / (nuNew*descriptors::invCs2<V,DESCRIPTOR>() + V{0.5});
97 V omegaMax = parameters.template get<OMEGA_MAX>();
98 newOmega = util::min(newOmega, omegaMax);
99 V omegaMin = parameters.template get<OMEGA_MIN>();
100 newOmega = util::max(newOmega, omegaMin);
101 return newOmega;
102 }
constexpr T m(unsigned iPop, unsigned jPop, tag::MRT)
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > min(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:124
cpu::simd::Pack< T > max(cpu::simd::Pack< T > rhs, cpu::simd::Pack< T > lhs)
Definition pack.h:130
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
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:424
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::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 61 of file powerLawBGKdynamics.h.

62 {
63 return "powerlaw::OmegaFromCell<" + COLLISION::getName() + ">";
64 }

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