OpenLB 1.8.1
Loading...
Searching...
No Matches
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 1879 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 1881 of file elements.h.

1882 {
1883 V uNew[DESCRIPTOR::d] { };
1884 const V epsilon = cell.template getField<descriptors::EPSILON>();
1885 const V nu = cell.template getField<descriptors::NU>();
1886 const V k = cell.template getField<descriptors::K>();
1887 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1888
1889 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1890 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1891 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1892 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1893
1894 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1895 uNew[iD] = u[iD] * (c_0 + util::sqrt(c_0*c_0 + c_1*uMag)) - V{0.5} * bodyF[iD] * epsilon;
1896 }
1897 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1898 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1899 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
1900 int iPi = 0;
1901 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1902 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1903 forceTensor[iPi] = V{0.5} * rho * (bodyF[iAlpha]*uNew[iBeta] + uNew[iAlpha]*bodyF[iBeta]);
1904 ++iPi;
1905 }
1906 }
1907 // Creation of second-order moment off-equilibrium tensor
1908 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1909 pi[iPi] += forceTensor[iPi];
1910 }
1911 }
Expr sqrt(Expr x)
Definition expr.cpp:225
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
void compute(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
Definition elements.h:1881
static constexpr int n
result stored in n
Definition util.h:217

References olb::momenta::GuoZhaoForcedStress< STRESS >::compute(), olb::util::normSqr(), and olb::util::sqrt().

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

◆ getName()

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

Definition at line 1913 of file elements.h.

1913 {
1914 return "GuoZhaoForcedStress<" + STRESS().getName() + ">";
1915 }

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