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

#include <lbm.h>

+ Collaboration diagram for olb::equilibrium< DESCRIPTOR >:

Static Public Member Functions

template<typename RHO , typename U , typename V = RHO>
static V firstOrder (int iPop, const RHO &rho, const U &u) any_platform
 Computation of equilibrium distribution, first order in u.
 
template<typename RHO , typename U , typename USQR , typename V = RHO>
static V secondOrder (int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
 Computation of equilibrium distribution, second order in u.
 
template<typename RHO , typename U , typename V = RHO>
static V secondOrder (int iPop, const RHO &rho, const U &u) any_platform
 Computation of equilibrium distribution, second order in u.
 
template<typename RHO , typename U , typename V = RHO>
static V P1 (int iPop, const RHO &rho, const U &u) any_platform
 
template<typename J , typename JSQR , typename PRESSURE , typename V = PRESSURE>
static V incompressible (int iPop, const J &j, const JSQR &jSqr, const PRESSURE &pressure) any_platform
 
template<typename J , typename PRESSURE , typename V = PRESSURE>
static V incompressible (int iPop, const J &j, const PRESSURE &pressure) any_platform
 
template<typename V >
static V fromJgradToFneq (int iPop, const V Jgrad[DESCRIPTOR::d *DESCRIPTOR::d], V omega) any_platform
 compute off-equilibrium part of the populations from gradient of the flux for asymmetric regularization init to circumvent pi computation
 
template<typename V , typename PI >
static V fromPiToFneq (int iPop, const PI &pi) any_platform
 Compute off-equilibrium part of the f's from the stress tensor Pi.
 
template<typename V >
static V fromJneqToFneq (int iPop, const V jNeq[DESCRIPTOR::d]) any_platform
 

Detailed Description

template<typename DESCRIPTOR>
struct olb::equilibrium< DESCRIPTOR >

Definition at line 34 of file lbm.h.

Member Function Documentation

◆ firstOrder()

template<typename DESCRIPTOR >
template<typename RHO , typename U , typename V = RHO>
static V olb::equilibrium< DESCRIPTOR >::firstOrder ( int iPop,
const RHO & rho,
const U & u )
inlinestatic

Computation of equilibrium distribution, first order in u.

Definition at line 37 of file lbm.h.

38 {
39 V c_u{};
40 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
41 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
42 }
43 return rho
44 * descriptors::t<V,DESCRIPTOR>(iPop)
45 * ( V{1} + c_u * descriptors::invCs2<V,DESCRIPTOR>() )
46 - descriptors::t<V,DESCRIPTOR>(iPop);
47 }
+ Here is the caller graph for this function:

◆ fromJgradToFneq()

template<typename DESCRIPTOR >
template<typename V >
static V olb::equilibrium< DESCRIPTOR >::fromJgradToFneq ( int iPop,
const V Jgrad[DESCRIPTOR::d *DESCRIPTOR::d],
V omega )
inlinestatic

compute off-equilibrium part of the populations from gradient of the flux for asymmetric regularization init to circumvent pi computation

Definition at line 110 of file lbm.h.

113 {
114 using L = DESCRIPTOR;
115 V fNeq{};
116 int iJgrad = 0;
117 for (int iAlpha=0; iAlpha < L::d; ++iAlpha) {
118 for (int iBeta=0; iBeta < L::d; ++iBeta) {
119 V toAdd = descriptors::c<L>(iPop,iAlpha) * descriptors::c<L>(iPop,iBeta);
120 if (iAlpha == iBeta) {
121 toAdd -= 1./descriptors::invCs2<V,L>();
122 }
123 else {
124 toAdd *= V{2};
125 }
126 toAdd *= Jgrad[iJgrad++];
127 fNeq += toAdd;
128 }
129 }
130 fNeq *= - descriptors::t<V,L>(iPop) * descriptors::invCs2<V,L>() / omega;
131 return fNeq;
132 }

◆ fromJneqToFneq()

template<typename DESCRIPTOR >
template<typename V >
static V olb::equilibrium< DESCRIPTOR >::fromJneqToFneq ( int iPop,
const V jNeq[DESCRIPTOR::d] )
inlinestatic

Definition at line 168 of file lbm.h.

169 {
170 V fNeq{};
171 for (int iD = 0; iD < DESCRIPTOR::d; ++iD) {
172 fNeq += descriptors::c<DESCRIPTOR>(iPop,iD) * jNeq[iD];
173 }
174 fNeq *= descriptors::t<V,DESCRIPTOR>(iPop) * descriptors::invCs2<V,DESCRIPTOR>();
175 return fNeq;
176 }

◆ fromPiToFneq()

template<typename DESCRIPTOR >
template<typename V , typename PI >
static V olb::equilibrium< DESCRIPTOR >::fromPiToFneq ( int iPop,
const PI & pi )
inlinestatic

Compute off-equilibrium part of the f's from the stress tensor Pi.

Implements the following formula (with Einstein index contraction):

\[ f_i^{neq} = t_i / (2 c_s^4) *
                (c_{ia} c_{ib} - c_s^2 \delta_{ab}) \Pi_{ab} \]

By Pi we mean the tensor computed from the off-equilibrium functions:

\[ \Pi = \sum c_i c_i f_i^{neq}
        = \sum c_i c_i f_i - \rho u u - c_s^2 \rho\ Id \]

Definition at line 143 of file lbm.h.

144 {
145 using L = DESCRIPTOR;
146 V fNeq{};
147 int iPi = 0;
148 // Iterate only over superior triangle + diagonal, and add
149 // the elements under the diagonal by symmetry
150 for (int iAlpha=0; iAlpha < L::d; ++iAlpha) {
151 for (int iBeta=iAlpha; iBeta < L::d; ++iBeta) {
152 V toAdd = descriptors::c<L>(iPop,iAlpha)*descriptors::c<L>(iPop,iBeta);
153 if (iAlpha == iBeta) {
154 toAdd -= V{1}/descriptors::invCs2<V,L>();
155 }
156 else {
157 toAdd *= V{2}; // multiply off-diagonal elements by 2
158 } // because the Q tensor is symmetric
159 toAdd *= pi[iPi++];
160 fNeq += toAdd;
161 }
162 }
163 fNeq *= descriptors::t<V,L>(iPop) * descriptors::invCs2<V,L>() * descriptors::invCs2<V,L>() / V{2};
164 return fNeq;
165 }

◆ incompressible() [1/2]

template<typename DESCRIPTOR >
template<typename J , typename JSQR , typename PRESSURE , typename V = PRESSURE>
static V olb::equilibrium< DESCRIPTOR >::incompressible ( int iPop,
const J & j,
const JSQR & jSqr,
const PRESSURE & pressure )
inlinestatic

Definition at line 87 of file lbm.h.

88 {
89 V c_j{};
90 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
91 c_j += descriptors::c<DESCRIPTOR>(iPop,iD)*j[iD];
92 }
93 return descriptors::t<V,DESCRIPTOR>(iPop)
94 * ( descriptors::invCs2<V,DESCRIPTOR>() * pressure
95 + descriptors::invCs2<V,DESCRIPTOR>() * c_j
96 + descriptors::invCs2<V,DESCRIPTOR>() * descriptors::invCs2<V,DESCRIPTOR>()/V{2} * c_j * c_j
97 - descriptors::invCs2<V,DESCRIPTOR>()/V{2} * jSqr )
98 - descriptors::t<V,DESCRIPTOR>(iPop);
99 }
+ Here is the caller graph for this function:

◆ incompressible() [2/2]

template<typename DESCRIPTOR >
template<typename J , typename PRESSURE , typename V = PRESSURE>
static V olb::equilibrium< DESCRIPTOR >::incompressible ( int iPop,
const J & j,
const PRESSURE & pressure )
inlinestatic

Definition at line 101 of file lbm.h.

102 {
103 const V jSqr = util::normSqr<J,DESCRIPTOR::d>(j);
104 return incompressible(iPop, j, jSqr, pressure);
105 }
static V incompressible(int iPop, const J &j, const JSQR &jSqr, const PRESSURE &pressure) any_platform
Definition lbm.h:87

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

+ Here is the call graph for this function:

◆ P1()

template<typename DESCRIPTOR >
template<typename RHO , typename U , typename V = RHO>
static V olb::equilibrium< DESCRIPTOR >::P1 ( int iPop,
const RHO & rho,
const U & u )
inlinestatic

Definition at line 75 of file lbm.h.

76 {
77 V c_u{};
78 // compute scalar product of c[iPop]*u
79 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
80 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
81 }
82 return descriptors::t<V,DESCRIPTOR>(iPop) * (rho + c_u)
83 - descriptors::t<V,DESCRIPTOR>(iPop);
84 }
+ Here is the caller graph for this function:

◆ secondOrder() [1/2]

template<typename DESCRIPTOR >
template<typename RHO , typename U , typename V = RHO>
static V olb::equilibrium< DESCRIPTOR >::secondOrder ( int iPop,
const RHO & rho,
const U & u )
inlinestatic

Computation of equilibrium distribution, second order in u.

Definition at line 67 of file lbm.h.

68 {
69 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
70 return secondOrder(iPop, rho, u, uSqr);
71 }
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:

◆ secondOrder() [2/2]

template<typename DESCRIPTOR >
template<typename RHO , typename U , typename USQR , typename V = RHO>
static V olb::equilibrium< DESCRIPTOR >::secondOrder ( int iPop,
const RHO & rho,
const U & u,
const USQR & uSqr )
inlinestatic

Computation of equilibrium distribution, second order in u.

Definition at line 51 of file lbm.h.

52 {
53 V c_u{};
54 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
55 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
56 }
57 return rho
58 * descriptors::t<V,DESCRIPTOR>(iPop)
59 * ( V{1}
60 + descriptors::invCs2<V,DESCRIPTOR>() * c_u
61 + descriptors::invCs2<V,DESCRIPTOR>() * descriptors::invCs2<V,DESCRIPTOR>() * V{0.5} * c_u * c_u
62 - descriptors::invCs2<V,DESCRIPTOR>() * V{0.5} * uSqr)
63 - descriptors::t<V,DESCRIPTOR>(iPop);
64 }
+ Here is the caller graph for this function:

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