OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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<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::WaleEffectiveOmega< COLLISION, DESCRIPTOR, MOMENTA, EQUILIBRIUM >

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

Definition at line 311 of file collisionLES.h.

311 {
312 parameters.template set<descriptors::OMEGA>(
313 computeEffectiveOmega(cell, parameters));
314 return CollisionO().apply(cell, parameters);
315 }
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<typename CELL , typename 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 238 of file collisionLES.h.

238 {
239 V piNeqNormSqr { };
240 MomentaF().computePiNeqNormSqr(cell, piNeqNormSqr);
241 const V omega = parameters.template get<descriptors::OMEGA>();
242 const V smagorinsky = parameters.template get<collision::LES::Smagorinsky>();
243 const auto velocityGradient = cell.template getField<descriptors::VELO_GRAD>();
244 V preFactor = smagorinsky*smagorinsky;
245 // velocity gradient tensor
246 V g[3][3];
247 for (unsigned i=0; i < 3; i++) {
248 for (unsigned j=0; j < 3; j++) {
249 g[i][j] = velocityGradient[i*3 + j];
250 }
251 }
252 // strain rate tensor
253 V s[3][3];
254 for (unsigned i = 0; i < 3; i++) {
255 for (unsigned j = 0; j < 3; j++) {
256 s[i][j] = (g[i][j] + g[j][i]) / V{2};
257 }
258 }
259 // traceless symmetric part of the square of the velocity gradient tensor
260 V G[3][3];
261 for (unsigned i = 0; i < 3; i++) {
262 for (unsigned j = 0; j < 3; j++) {
263 G[i][j] = V{0};
264 }
265 }
266 for (unsigned i = 0; i < 3; i++) {
267 for (unsigned j = 0; j < 3; j++) {
268 for (unsigned k = 0; k < 3; k++) {
269 G[i][j] += (g[i][k]*g[k][j] + g[j][k]*g[k][i]) / V{2};
270 }
271 }
272 }
273 V trace{};
274 for (unsigned i = 0; i < 3; i++) {
275 trace += V{1}/V{3} * g[i][i] * g[i][i];
276 }
277 for (unsigned i = 0; i < 3; i++) {
278 G[i][i] -= trace;
279 }
280 // inner product of the traceless symmetric part of the square of the velocity gradient tensor
281 V G_ip{};
282 for (unsigned i = 0; i < 3; i++) {
283 for (unsigned j = 0; j < 3; j++) {
284 G_ip = G[i][j] * G[i][j];
285 }
286 }
287 // inner product of the strain rate
288 V s_ip{};
289 for (unsigned i = 0; i < 3; i++) {
290 for (unsigned j = 0; j < 3; j++) {
291 s_ip = s[i][j] * s[i][j];
292 }
293 }
294 // Turbulent relaxation time
295 V tauTurb = V{3} * preFactor * (util::pow(G_ip,1.5) / (util::pow(s_ip,2.5) + util::pow(G_ip,1.25)));
296 if ((util::pow(s_ip,2.5) + util::pow(G_ip,1.25)) == 0) {
297 tauTurb = 0;
298 }
299 // Physical turbulent viscosity must be equal or higher that zero
300 if (tauTurb < 0) {
301 tauTurb = 0;
302 }
304 V tauMol = V{1} / omega;
306 V tauEff = tauMol + tauTurb;
307 return V{1} / tauEff;
308 }
platform_constant Fraction s[Q]
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
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: