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

#include <mrt.h>

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

Static Public Member Functions

template<typename RHO , typename U , typename V = RHO>
static V equilibrium (int iPop, const RHO &rho, const U &u)
 Computation of equilibrium distribution (in momenta space)
 
template<typename MOMENTAEQ , typename RHO , typename U , typename V = RHO>
static void computeEquilibrium (MOMENTAEQ &momentaEq, const RHO &rho, const U &u)
 Computation of all equilibrium distribution (in momenta space)
 
template<typename MOMENTA , typename CELL , typename V = typename CELL::value_t>
static void computeMomenta (MOMENTA &momenta, CELL &cell)
 
template<typename CELL , typename RHO , typename U , typename INVM_S , typename V = typename CELL::value_t>
static V mrtCollision (CELL &cell, const RHO &rho, const U &u, const INVM_S &invM_S)
 MRT collision step.
 
template<typename CELL , typename RHO , typename U , typename OMEGA , typename INVM_S_SGS , typename V = typename CELL::value_t>
static V mrtSGSCollision (CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const INVM_S_SGS &invM_S_SGS)
 MRT SGS collision step.
 
template<typename CELL , typename RHO , typename U , typename INVM_S , typename FORCE , typename V = typename CELL::value_t>
static void addExternalForce (CELL &cell, const RHO &rho, const U &u, const INVM_S &invM_S, const FORCE &force)
 Ladd-Verberg-I body force model for MRT A.Ladd, R.
 

Detailed Description

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

Definition at line 39 of file mrt.h.

Member Function Documentation

◆ addExternalForce()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename INVM_S , typename FORCE , typename V = typename CELL::value_t>
static void olb::mrt< DESCRIPTOR >::addExternalForce ( CELL & cell,
const RHO & rho,
const U & u,
const INVM_S & invM_S,
const FORCE & force )
inlinestatic

Ladd-Verberg-I body force model for MRT A.Ladd, R.

Verberg, DESCRIPTOR-Boltzmann simulations of particle-fluid suspensions, Journal of Statistical Physics 104(2001)

Definition at line 138 of file mrt.h.

142 {
143 V f_u{};
144 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
145 f_u += force[iD] * u[iD];
146 }
147
148 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
149 V c_u{};
150 V c_f{};
151 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
152 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
153 c_f += descriptors::c<DESCRIPTOR>(iPop,iD)*force[iD];
154 }
155 V f1 = descriptors::t<V,DESCRIPTOR>(iPop)*rho*c_f*descriptors::invCs2<V,DESCRIPTOR>();
156 V f2 = descriptors::t<V,DESCRIPTOR>(iPop)*rho*(c_u*c_f*descriptors::invCs2<V,DESCRIPTOR>()-f_u)*descriptors::invCs2<V,DESCRIPTOR>();
157
158 V invMsM{};
159 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
160 invMsM += invM_S[iPop][jPop]*descriptors::m<V,DESCRIPTOR>(jPop,iPop);
161 }
162 cell[iPop] += f1 + f2 - invMsM*f2*V{0.5};
163 }
164 }
+ Here is the caller graph for this function:

◆ computeEquilibrium()

template<typename DESCRIPTOR >
template<typename MOMENTAEQ , typename RHO , typename U , typename V = RHO>
static void olb::mrt< DESCRIPTOR >::computeEquilibrium ( MOMENTAEQ & momentaEq,
const RHO & rho,
const U & u )
inlinestatic

Computation of all equilibrium distribution (in momenta space)

Definition at line 60 of file mrt.h.

62 {
63 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
64 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
65 momentaEq[iPop] = V{};
66 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
67 momentaEq[iPop] += descriptors::m<V,DESCRIPTOR>(iPop,jPop) *
69 descriptors::t<V,DESCRIPTOR>(jPop));
70 }
71 }
72 }
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:

◆ computeMomenta()

template<typename DESCRIPTOR >
template<typename MOMENTA , typename CELL , typename V = typename CELL::value_t>
static void olb::mrt< DESCRIPTOR >::computeMomenta ( MOMENTA & momenta,
CELL & cell )
inlinestatic

Definition at line 75 of file mrt.h.

76 {
77 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
78 momenta[iPop] = V{};
79 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
80 momenta[iPop] += descriptors::m<V,DESCRIPTOR>(iPop,jPop) *
81 (cell[jPop] + descriptors::t<V,DESCRIPTOR>(jPop));
82 }
83 }
84 }
+ Here is the caller graph for this function:

◆ equilibrium()

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

Computation of equilibrium distribution (in momenta space)

Definition at line 46 of file mrt.h.

47 {
48 V equ{};
49 const V uSqr = util::normSqr<U,DESCRIPTOR::d>(u);
50 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
51 equ += descriptors::m<V,DESCRIPTOR>(iPop,jPop) *
53 descriptors::t<V,DESCRIPTOR>(jPop));
54 }
55 return equ;
56 }

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

+ Here is the call graph for this function:

◆ mrtCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename INVM_S , typename V = typename CELL::value_t>
static V olb::mrt< DESCRIPTOR >::mrtCollision ( CELL & cell,
const RHO & rho,
const U & u,
const INVM_S & invM_S )
inlinestatic

MRT collision step.

Definition at line 88 of file mrt.h.

91 {
92 V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
93 V momenta[DESCRIPTOR::q] { };
94 V momentaEq[DESCRIPTOR::q] { };
95
96 computeMomenta(momenta, cell);
97 computeEquilibrium(momentaEq, rho, u);
98
99 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
100 V collisionTerm{};
101 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
102 collisionTerm += invM_S[iPop][jPop] * (momenta[jPop] - momentaEq[jPop]);
103 }
104 cell[iPop] -= collisionTerm;
105 }
106 return uSqr;
107 }
static void computeMomenta(MOMENTA &momenta, CELL &cell)
Definition mrt.h:75
static void computeEquilibrium(MOMENTAEQ &momentaEq, const RHO &rho, const U &u)
Computation of all equilibrium distribution (in momenta space)
Definition mrt.h:60

References olb::mrt< DESCRIPTOR >::computeEquilibrium(), and olb::mrt< DESCRIPTOR >::computeMomenta().

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

◆ mrtSGSCollision()

template<typename DESCRIPTOR >
template<typename CELL , typename RHO , typename U , typename OMEGA , typename INVM_S_SGS , typename V = typename CELL::value_t>
static V olb::mrt< DESCRIPTOR >::mrtSGSCollision ( CELL & cell,
const RHO & rho,
const U & u,
const OMEGA & omega,
const INVM_S_SGS & invM_S_SGS )
inlinestatic

MRT SGS collision step.

Definition at line 111 of file mrt.h.

115 {
116 V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
117 V momenta[DESCRIPTOR::q];
118 V momentaEq[DESCRIPTOR::q];
119
120 computeMomenta(momenta, cell);
121 computeEquilibrium(momentaEq, rho, u);
122
123 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
124 V collisionTerm{};
125 for (int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
126 collisionTerm += invM_S_SGS[iPop][jPop] * (momenta[jPop] - momentaEq[jPop]);
127 }
128 cell[iPop] -= collisionTerm;
129 }
130
131 return uSqr;
132 }

References olb::mrt< DESCRIPTOR >::computeEquilibrium(), and olb::mrt< DESCRIPTOR >::computeMomenta().

+ 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: