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

#include <elements.h>

+ Collaboration diagram for olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >:

Public Member Functions

template<typename TYPE , typename CELL , typename J , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void compute (CELL &cell, J &j) any_platform
 
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void computeU (CELL &cell, U &u) any_platform
 
template<typename TYPE , typename CELL , typename U , typename DESCRIPTOR = typename CELL::descriptor_t>
void define (CELL &cell, const U &u) any_platform
 
template<typename TYPE , typename CELL >
void initialize (CELL &cell) any_platform
 
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void inverseShift (CELL &cell, U &u) any_platform
 

Static Public Member Functions

static std::string getName ()
 

Detailed Description

template<typename MOMENTUM>
struct olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >

Definition at line 1125 of file elements.h.

Member Function Documentation

◆ compute()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename J , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::compute ( CELL & cell,
J & j )
inline

Definition at line 1127 of file elements.h.

1128 {
1129 MOMENTUM().template compute<TYPE>(cell, j);
1130 }

◆ computeU()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::computeU ( CELL & cell,
U & u )
inline

Definition at line 1133 of file elements.h.

1134 {
1135 MOMENTUM().template computeU<TYPE>(cell, u);
1136 const V epsilon = cell.template getField<descriptors::EPSILON>();
1137 const V nu = cell.template getField<descriptors::NU>();
1138 const V k = cell.template getField<descriptors::K>();
1139 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1140
1141 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1142 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1143 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1144 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1145
1146 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
1147 u[iVel] += bodyF[iVel] * V(0.5) * epsilon;
1148 u[iVel] /= (c_0 + util::sqrt(c_0*c_0 + c_1*uMag));
1149 }
1150 }
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::util::sqrt().

+ Here is the call graph for this function:

◆ define()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename U , typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::define ( CELL & cell,
const U & u )
inline

Definition at line 1153 of file elements.h.

1154 {
1155 MOMENTUM().template define<TYPE>(cell, u);
1156 }

◆ getName()

template<typename MOMENTUM >
static std::string olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::getName ( )
inlinestatic

Definition at line 1182 of file elements.h.

1182 {
1183 return "GuoZhaoForcedMomentum<" + MOMENTUM().getName() + ">";
1184 }

◆ initialize()

template<typename MOMENTUM >
template<typename TYPE , typename CELL >
void olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::initialize ( CELL & cell)
inline

Definition at line 1159 of file elements.h.

1160 {
1161 MOMENTUM().template initialize<TYPE>(cell);
1162 }

◆ inverseShift()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::inverseShift ( CELL & cell,
U & u )
inline

Definition at line 1165 of file elements.h.

1165 {
1166 const V epsilon = cell.template getField<descriptors::EPSILON>();
1167 const V nu = cell.template getField<descriptors::NU>();
1168 const V k = cell.template getField<descriptors::K>();
1169 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1170
1171 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1172 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1173 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1174 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1175
1176 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
1177 u[iVel] *= (c_0 + util::sqrt(c_0*c_0 + c_1*uMag));
1178 u[iVel] -= bodyF[iVel] * V(0.5) * epsilon;
1179 }
1180 }

References olb::util::sqrt().

+ Here is the call graph for this function:

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