OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
olb::momenta::GuoZhaoForcedStress< STRESS > Struct Template Reference

#include <elements.h>

+ Collaboration diagram for olb::momenta::GuoZhaoForcedStress< STRESS >:

Public Member Functions

template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void compute (CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
 

Static Public Member Functions

static std::string getName ()
 

Detailed Description

template<typename STRESS>
struct olb::momenta::GuoZhaoForcedStress< STRESS >

Definition at line 1401 of file elements.h.

Member Function Documentation

◆ compute()

template<typename STRESS >
template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::GuoZhaoForcedStress< STRESS >::compute ( CELL & cell,
const RHO & rho,
const U & u,
PI & pi )
inline

Definition at line 1403 of file elements.h.

1404 {
1405 V uNew[DESCRIPTOR::d] { };
1406 const V epsilon = cell.template getField<descriptors::EPSILON>();
1407 const V nu = cell.template getField<descriptors::NU>();
1408 const V k = cell.template getField<descriptors::K>();
1409 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1410
1411 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1412 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1413 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1414 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1415
1416 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1417 uNew[iD] = u[iD] * (c_0 + util::sqrt(c_0*c_0 + c_1*uMag)) - V{0.5} * bodyF[iD] * epsilon;
1418 }
1419 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1420 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1421 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
1422 int iPi = 0;
1423 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1424 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1425 forceTensor[iPi] = V{0.5} * rho * (bodyF[iAlpha]*uNew[iBeta] + uNew[iAlpha]*bodyF[iBeta]);
1426 ++iPi;
1427 }
1428 }
1429 // Creation of second-order moment off-equilibrium tensor
1430 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1431 pi[iPi] += forceTensor[iPi];
1432 }
1433 }
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
static constexpr int n
result stored in n
Definition util.h:211

References olb::util::sqrt().

+ Here is the call graph for this function:

◆ getName()

template<typename STRESS >
static std::string olb::momenta::GuoZhaoForcedStress< STRESS >::getName ( )
inlinestatic

Definition at line 1435 of file elements.h.

1435 {
1436 return "GuoZhaoForcedStress<" + STRESS().getName() + ">";
1437 }

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