The velocity is stored in the external field U, except for the component "direction", which is computed by means of the population and the pressure.
More...
|
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 > |
void | define (CELL &cell, const U &u) any_platform |
|
template<typename TYPE , typename CELL , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t> |
void | initialize (CELL &cell) any_platform |
|
template<typename TYPE , typename CELL , typename U > |
void | inverseShift (CELL &cell, U &u) any_platform |
|
template<int direction, int orientation>
struct olb::momenta::FixedPressureMomentum< direction, orientation >
The velocity is stored in the external field U, except for the component "direction", which is computed by means of the population and the pressure.
Definition at line 463 of file elements.h.
template<int direction, int orientation>
template<typename TYPE , typename CELL , typename J , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
Definition at line 468 of file elements.h.
469 {
470 computeU<TYPE>(cell, j);
471 const V rho = TYPE().computeRho(cell);
472 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
473 j[iD] *= rho;
474 }
475 }
template<int direction, int orientation>
template<typename TYPE , typename CELL , typename U , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
Definition at line 479 of file elements.h.
480 {
481 auto values = cell.template getField<VELOCITY>();
482 for (int iD=0; iD<DESCRIPTOR::d; ++iD) {
483 u[iD] = values[iD];
484 }
485 const V rho = TYPE().computeRho(cell);
486
487 constexpr auto onWallIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,0>();
488 constexpr auto normalIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,orientation>();
489
490 V rhoOnWall = V{};
491 for (auto e : onWallIndices) {
492 rhoOnWall += cell[e];
493 }
494
495 V rhoNormal = V{};
496 for (auto e : normalIndices) {
497 rhoNormal += cell[e];
498 }
499
500 u[direction] = orientation * ((V{2}*rhoNormal+rhoOnWall+V{1}) / rho-V{1});
501 }