OpenLB 1.7
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
olb::BoundaryHelpers< T, DESCRIPTOR, direction, orientation > Struct Template Reference

All boundary helper functions are inside this structure. More...

#include <helper.h>

+ Collaboration diagram for olb::BoundaryHelpers< T, DESCRIPTOR, direction, orientation >:

Static Public Member Functions

template<typename CELL >
static void computeStress (CELL &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) any_platform
 

Detailed Description

template<typename T, typename DESCRIPTOR, int direction, int orientation>
struct olb::BoundaryHelpers< T, DESCRIPTOR, direction, orientation >

All boundary helper functions are inside this structure.

Definition at line 34 of file helper.h.

Member Function Documentation

◆ computeStress()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
template<typename CELL >
static void olb::BoundaryHelpers< T, DESCRIPTOR, direction, orientation >::computeStress ( CELL & cell,
T rho,
const T u[DESCRIPTOR::d],
T pi[util::TensorVal< DESCRIPTOR >::n] )
inlinestatic

Definition at line 36 of file helper.h.

39 {
40 const T uSqr = util::normSqr<T,DESCRIPTOR::d>(u);
41
42 constexpr auto onWallIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,0>();
43 constexpr auto normalIndices = util::populationsContributingToVelocity<DESCRIPTOR,direction,orientation>();
44
45 T fNeq[DESCRIPTOR::q];
46 for (unsigned fIndex=0; fIndex<onWallIndices.size(); ++fIndex) {
47 int iPop = onWallIndices[fIndex];
48 if (iPop == 0) {
49 fNeq[0] = T(); // fNeq[0] will not be used anyway
50 }
51 else {
52 fNeq[iPop] =
53 cell[iPop] -
54 equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
55 }
56 }
57 for (unsigned fIndex=0; fIndex<normalIndices.size(); ++fIndex) {
58 int iPop = normalIndices[fIndex];
59 fNeq[iPop] =
60 cell[iPop] -
61 equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u, uSqr);
62 }
63
64 int iPi = 0;
65 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
66 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
67 pi[iPi] = T();
68 for (unsigned fIndex=0; fIndex < onWallIndices.size(); ++fIndex) {
69 const int iPop = onWallIndices[fIndex];
70 pi[iPi] += descriptors::c<DESCRIPTOR>(iPop,iAlpha)
71 * descriptors::c<DESCRIPTOR>(iPop,iBeta)
72 * fNeq[iPop];
73 }
74 for (unsigned fIndex=0; fIndex < normalIndices.size(); ++fIndex) {
75 const int iPop = normalIndices[fIndex];
76 pi[iPi] += T{2}
77 * descriptors::c<DESCRIPTOR>(iPop,iAlpha)
78 * descriptors::c<DESCRIPTOR>(iPop,iBeta)
79 * fNeq[iPop];
80 }
81 ++iPi;
82 }
83 }
84 }
static V secondOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, second order in u.
Definition lbm.h:51

References olb::equilibrium< DESCRIPTOR >::secondOrder().

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

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