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

1521 {
1522 MOMENTUM().template compute<TYPE>(cell, j);
1523 }
void compute(CELL &cell, J &j) any_platform
Definition elements.h:1520

References olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::compute().

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

◆ 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 1526 of file elements.h.

1527 {
1528 MOMENTUM().template computeU<TYPE>(cell, u);
1529 const V epsilon = cell.template getField<descriptors::EPSILON>();
1530 const V nu = cell.template getField<descriptors::NU>();
1531 const V k = cell.template getField<descriptors::K>();
1532 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1533
1534 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1535 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1536 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1537 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1538
1539 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
1540 u[iVel] += bodyF[iVel] * V(0.5) * epsilon;
1541 u[iVel] /= (c_0 + util::sqrt(c_0*c_0 + c_1*uMag));
1542 }
1543 }
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 computeU(CELL &cell, U &u) any_platform
Definition elements.h:1526

References olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::computeU(), olb::util::normSqr(), and olb::util::sqrt().

+ Here is the call graph for this function:
+ Here is the caller 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 1546 of file elements.h.

1547 {
1548 MOMENTUM().template define<TYPE>(cell, u);
1549 }
void define(CELL &cell, const U &u) any_platform
Definition elements.h:1546

References olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::define().

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

◆ getName()

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

Definition at line 1575 of file elements.h.

1575 {
1576 return "GuoZhaoForcedMomentum<" + MOMENTUM().getName() + ">";
1577 }

◆ initialize()

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

Definition at line 1552 of file elements.h.

1553 {
1554 MOMENTUM().template initialize<TYPE>(cell);
1555 }
void initialize(CELL &cell) any_platform
Definition elements.h:1552

References olb::momenta::GuoZhaoForcedMomentum< MOMENTUM >::initialize().

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

◆ 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 1558 of file elements.h.

1558 {
1559 const V epsilon = cell.template getField<descriptors::EPSILON>();
1560 const V nu = cell.template getField<descriptors::NU>();
1561 const V k = cell.template getField<descriptors::K>();
1562 const auto bodyF = cell.template getFieldPointer<descriptors::BODY_FORCE>();
1563
1564 const V uMag = util::sqrt( util::normSqr<V,DESCRIPTOR::d>(u) );
1565 const V Fe = 0.;//1.75/util::sqrt(150.*util::pow(epsilon,3));
1566 const V c_0 = 0.5*(1 + 0.5*epsilon*nu/k);
1567 const V c_1 = 0.5*epsilon*Fe/util::sqrt(k);
1568
1569 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
1570 u[iVel] *= (c_0 + util::sqrt(c_0*c_0 + c_1*uMag));
1571 u[iVel] -= bodyF[iVel] * V(0.5) * epsilon;
1572 }
1573 }

References olb::util::normSqr(), and olb::util::sqrt().

+ Here is the call graph for this function:

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