Loading [MathJax]/extensions/tex2jax.js
MAIA bb96820c
Multiphysics at AIA
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
lbfunc Namespace Reference

Functions

template<MInt nDim, MInt nDist>
void calcEqDistsIncompressible (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist)
 Calculate equilibrium function (incompressible version). Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsCompressible (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist)
 Calculate equilibrium function (compressible version). Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcEqDists (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist)
 Calculate equilibrium function. Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcEqDists (const MFloat &p_rho, MFloat const *const p_u, MFloat *const eqDist)
 Calculate equilibrium function. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsIncompressible (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate equilibrium function (incompressible version, GPU version). Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsCompressible (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate equilibrium function (compressible version, GPU version). Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcEqDists (const MFloat &p_rho, const MFloat &p_squaredVelocity, MFloat const *const p_u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate equilibrium function. Squared velocity has already been computed. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcEqDists (const MFloat &p_rho, MFloat const *const p_u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate equilibrium function. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcNonEqDists (const MFloat &rho, const MFloat *const u, const MFloat *const dist, MFloat *const nonEqDist)
 Calculate the non-equilibrium part for given macroscopic variables and distribution. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcNonEqDists (const MFloat *const dist, MFloat *const nonEqDist)
 Calculate the non-equilibrium part for given distribution. More...
 
template<MInt nDim, MInt nDist>
void calcMomentumFluxFromNonEq (const MFloat *const nonEqDist, MFloat *const momentumFlux)
 Calculate the momentum flux for a given non-equilibirum distribution. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcMomentumFlux (const MFloat &rho, const MFloat *const u, const MFloat *const dist, MFloat *const momentumFlux)
 Calculate the momentum flux for given macroscopic variables and distribution. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcMomentumFlux (const MFloat *const dist, MFloat *const momentumFlux)
 Calculate the momentum flux for given macroscopic variables and distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsThermal (const MFloat &T, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist)
 Calculate thermal equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsThermal (const MFloat &T, const MFloat *const u, MFloat *const eqDist)
 Calculate thermal equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsThermal (const MFloat &T, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate thermal equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsThermal (const MFloat &T, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate thermal equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsInnerEnergy (const MFloat &T, const MFloat &rho, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist)
 
template<MInt nDim, MInt nDist>
void calcEqDistsInnerEnergy (const MFloat &T, const MFloat &rho, const MFloat *const u, MFloat *const eqDist)
 
template<MInt nDim, MInt nDist>
void calcEqDistsInnerEnergy (const MFloat &T, const MFloat &rho, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 
template<MInt nDim, MInt nDist>
void calcEqDistsInnerEnergy (const MFloat &T, const MFloat &rho, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 
template<MInt nDim, MInt nDist>
void calcEqDistsTotalEnergy (const MFloat &T, const MFloat &rho, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDistT)
 
template<MInt nDim, MInt nDist>
void calcEqDistsTotalEnergy (const MFloat &T, const MFloat &rho, const MFloat *const u, MFloat *const eqDist)
 
template<MInt nDim, MInt nDist>
void calcEqDistsTotalEnergy (const MFloat &T, const MFloat &rho, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDistT, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 
template<MInt nDim, MInt nDist>
void calcEqDistsTotalEnergy (const MFloat &T, const MFloat &rho, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 
template<MInt nDim, MInt nDist>
void calcEqDistsTransport (const MFloat &C, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist)
 Calculate transport equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsTransport (const MFloat &C, const MFloat *const u, MFloat *const eqDist)
 Calculate transport equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsTransport (const MFloat &C, const MFloat squaredVelocity, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate transport equilibrium distribution. More...
 
template<MInt nDim, MInt nDist>
void calcEqDistsTransport (const MFloat &C, const MFloat *const u, MFloat *const eqDist, const MInt *myMFld1, const MInt *myMFld2, const MFloat *myTp, const MInt *myDistFld)
 Calculate transport equilibrium distribution. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcMacroVars (MFloat const *const p_dist, MFloat &p_rho, MFloat *const p_u)
 Calculate macroscopic variables from distribution. More...
 
template<MInt nDim, MInt nDist, MBool compressible = false>
void calcMacroVars (MFloat const *const p_dist, MFloat &p_rho, MFloat *const p_u, MInt *const myPFld, MInt *const myNFld, const MInt fldlen)
 Calculate macroscopic variables from distribution. More...
 

Function Documentation

◆ calcEqDists() [1/4]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcEqDists ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist 
)
inline
Author
Daniel Lauwers
Date
01.12.2021
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 122 of file lbfunctions.h.

123 {
124 if constexpr(compressible)
125 calcEqDistsCompressible<nDim, nDist>(p_rho, p_squaredVelocity, p_u, eqDist);
126 else
127 calcEqDistsIncompressible<nDim, nDist>(p_rho, p_squaredVelocity, p_u, eqDist);
128}

◆ calcEqDists() [2/4]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcEqDists ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline
Author
Daniel Lauwers
Date
01.12.2021
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 244 of file lbfunctions.h.

246 {
247 if constexpr(compressible)
248 calcEqDistsCompressible<nDim, nDist>(p_rho, p_squaredVelocity, p_u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
249 else
250 calcEqDistsIncompressible<nDim, nDist>(p_rho, p_squaredVelocity, p_u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
251}

◆ calcEqDists() [3/4]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcEqDists ( const MFloat p_rho,
MFloat const *const  p_u,
MFloat *const  eqDist 
)
inline
Author
(?, refactored by Miro Gondrum)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 138 of file lbfunctions.h.

138 {
139 const MFloat p_squaredVelocity = std::inner_product(&p_u[0], &p_u[nDim], &p_u[0], .0);
140
141 calcEqDists<nDim, nDist, compressible>(p_rho, p_squaredVelocity, p_u, eqDist);
142}
double MFloat
Definition: maiatypes.h:52

◆ calcEqDists() [4/4]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcEqDists ( const MFloat p_rho,
MFloat const *const  p_u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline
Author
(?, refactored by Miro Gondrum)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 261 of file lbfunctions.h.

262 {
263 const MFloat p_squaredVelocity = std::inner_product(&p_u[0], &p_u[nDim], &p_u[0], .0);
264
265 calcEqDists<nDim, nDist, compressible>(p_rho, p_squaredVelocity, p_u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
266}

◆ calcEqDistsCompressible() [1/2]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsCompressible ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist 
)
inline
Author
(?, refactored by Miro Gondrum, compressible changes by Daniel Lauwers)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 77 of file lbfunctions.h.

78 {
80 const MFloat squaredVelocityB2 = p_squaredVelocity * F1B2;
81
82 MFloat b[2 * nDim];
83 for(MInt n = 0; n < nDim; n++) {
84 b[2 * n] = -p_u[n];
85 b[2 * n + 1] = p_u[n];
86 }
87
88 // Calculation of distributions for directions with only one component
89 constexpr MFloat lb_tp_coef1 = Ld::tp(1) * F1BCSsq;
90 for(MInt j = 0; j < Ld::distFld(0); j++) {
91 eqDist[j] = lb_tp_coef1 * (CSsq + b[j] + b[j] * b[j] * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
92 }
93
94 // Calculation of distributions for directions with two components
95 constexpr MFloat lb_tp_coef2 = Ld::tp(2) * F1BCSsq;
96 for(MInt j = 0; j < Ld::distFld(1); j++) {
97 const MFloat tmp = (b[Ld::mFld1(2 * j)] + b[Ld::mFld1(2 * j + 1)]);
98 eqDist[Ld::distFld(0) + j] = lb_tp_coef2 * (CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
99 }
100
101 // Calculation of distributions for directions with three components
102 constexpr MFloat lb_tp_coef3 = Ld::tp(3) * F1BCSsq;
103 for(MInt j = 0; j < Ld::distFld(2); j++) {
104 const MFloat tmp = (b[Ld::mFld2(3 * j)] + b[Ld::mFld2(3 * j + 1)] + b[Ld::mFld2(3 * j + 2)]);
105 eqDist[Ld::distFld(0) + Ld::distFld(1) + j] =
106 lb_tp_coef3 * (CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
107 }
108
109 // Calculation of distribution for rest particle distribution (center)
110 eqDist[Ld::lastId()] = Ld::tp(0) * (1.0 - F1B2mulF1BCSsq * p_squaredVelocity) * p_rho;
111}
int32_t MInt
Definition: maiatypes.h:62
LB lattice descriptor for arrays depending on D and Q.

◆ calcEqDistsCompressible() [2/2]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsCompressible ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline
Author
(?, refactored by Moritz Waldmann)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 198 of file lbfunctions.h.

200 {
202 const MFloat squaredVelocityB2 = p_squaredVelocity * F1B2;
203
204 MFloat b[2 * nDim];
205 for(MInt n = 0; n < nDim; n++) {
206 b[2 * n] = -p_u[n];
207 b[2 * n + 1] = p_u[n];
208 }
209
210 // Calculation of distributions for directions with only one component
211 const MFloat lb_tp_coef1 = myTp[1] * F1BCSsq;
212 for(MInt j = 0; j < myDistFld[0]; j++) {
213 eqDist[j] = lb_tp_coef1 * (CSsq + b[j] + b[j] * b[j] * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
214 }
215
216 // Calculation of distributions for directions with two components
217 const MFloat lb_tp_coef2 = myTp[2] * F1BCSsq;
218 for(MInt j = 0; j < myDistFld[1]; j++) {
219 const MFloat tmp = (b[myMFld1[2 * j]] + b[myMFld1[2 * j + 1]]);
220 eqDist[myDistFld[0] + j] = lb_tp_coef2 * (CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
221 }
222
223 // Calculation of distributions for directions with three components
224 const MFloat lb_tp_coef3 = myTp[3] * F1BCSsq;
225 for(MInt j = 0; j < myDistFld[2]; j++) {
226 const MFloat tmp = (b[myMFld2[3 * j]] + b[myMFld2[3 * j + 1]] + b[myMFld2[3 * j + 2]]);
227 eqDist[myDistFld[0] + myDistFld[1] + j] =
228 lb_tp_coef3 * (CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2) * p_rho;
229 }
230
231 // Calculation of distribution for rest particle distribution (center)
232 eqDist[Ld::lastId()] = myTp[0] * (1.0 - F1B2mulF1BCSsq * p_squaredVelocity) * p_rho;
233}

◆ calcEqDistsIncompressible() [1/2]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsIncompressible ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist 
)
inline
Author
(?, refactored by Miro Gondrum)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 29 of file lbfunctions.h.

30 {
32 const MFloat squaredVelocityB2 = p_squaredVelocity * F1B2;
33
34 const MFloat rhomulCSsq = p_rho * CSsq;
35
36 const MFloat preTerm = rhomulCSsq - squaredVelocityB2;
37
38 MFloat b[2 * nDim];
39 for(MInt n = 0; n < nDim; n++) {
40 b[2 * n] = -p_u[n];
41 b[2 * n + 1] = p_u[n];
42 }
43
44 // Calculation of distributions for directions with only one component
45 constexpr MFloat lb_tp_coef1 = Ld::tp(1) * F1BCSsq;
46 for(MInt j = 0; j < Ld::distFld(0); j++) {
47 eqDist[j] = lb_tp_coef1 * (preTerm + b[j] + b[j] * b[j] * F1B2mulF1BCSsq);
48 }
49
50 // Calculation of distributions for directions with two components
51 constexpr MFloat lb_tp_coef2 = Ld::tp(2) * F1BCSsq;
52 for(MInt j = 0; j < Ld::distFld(1); j++) {
53 const MFloat tmp = (b[Ld::mFld1(2 * j)] + b[Ld::mFld1(2 * j + 1)]);
54 eqDist[Ld::distFld(0) + j] = lb_tp_coef2 * (preTerm + tmp + tmp * tmp * F1B2mulF1BCSsq);
55 }
56
57 // Calculation of distributions for directions with three components
58 constexpr MFloat lb_tp_coef3 = Ld::tp(3) * F1BCSsq;
59 for(MInt j = 0; j < Ld::distFld(2); j++) {
60 const MFloat tmp = (b[Ld::mFld2(3 * j)] + b[Ld::mFld2(3 * j + 1)] + b[Ld::mFld2(3 * j + 2)]);
61 eqDist[Ld::distFld(0) + Ld::distFld(1) + j] = lb_tp_coef3 * (preTerm + tmp + tmp * tmp * F1B2mulF1BCSsq);
62 }
63
64 // Calculation of distribution for rest particle distribution (center)
65 eqDist[Ld::lastId()] = Ld::tp(0) * (p_rho - F1B2mulF1BCSsq * p_squaredVelocity);
66}

◆ calcEqDistsIncompressible() [2/2]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsIncompressible ( const MFloat p_rho,
const MFloat p_squaredVelocity,
MFloat const *const  p_u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline
Author
(?, refactored by Moritz Waldmann)
Date
14.01.2020
Parameters
[in]p_rhomacroscopic rho
[in]p_squaredVelocitymacroscopic velocity squared
[in]p_umacroscopic velocity
[out]eqDistequilibrium distributions based on given macrosopic variables

Definition at line 152 of file lbfunctions.h.

154 {
156 const MFloat squaredVelocityB2 = p_squaredVelocity * F1B2;
157
158 const MFloat rhomulCSsq = p_rho * CSsq;
159
160 MFloat b[2 * nDim];
161 for(MInt n = 0; n < nDim; n++) {
162 b[2 * n] = -p_u[n];
163 b[2 * n + 1] = p_u[n];
164 }
165
166 // Calculation of distributions for directions with only one component
167 const MFloat lb_tp_coef1 = myTp[1] * F1BCSsq;
168 for(MInt j = 0; j < myDistFld[0]; j++) {
169 eqDist[j] = lb_tp_coef1 * (rhomulCSsq + b[j] + b[j] * b[j] * F1B2mulF1BCSsq - squaredVelocityB2);
170 }
171
172 // Calculation of distributions for directions with two components
173 const MFloat lb_tp_coef2 = myTp[2] * F1BCSsq;
174 for(MInt j = 0; j < myDistFld[1]; j++) {
175 const MFloat tmp = (b[myMFld1[2 * j]] + b[myMFld1[2 * j + 1]]);
176 eqDist[myDistFld[0] + j] = lb_tp_coef2 * (rhomulCSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2);
177 }
178
179 // Calculation of distributions for directions with three components
180 const MFloat lb_tp_coef3 = myTp[3] * F1BCSsq;
181 for(MInt j = 0; j < myDistFld[2]; j++) {
182 const MFloat tmp = (b[myMFld2[3 * j]] + b[myMFld2[3 * j + 1]] + b[myMFld2[3 * j + 2]]);
183 eqDist[myDistFld[0] + myDistFld[1] + j] =
184 lb_tp_coef3 * (rhomulCSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2);
185 }
186
187 // Calculation of distribution for rest particle distribution (center)
188 eqDist[Ld::lastId()] = myTp[0] * (p_rho - F1B2mulF1BCSsq * p_squaredVelocity);
189}

◆ calcEqDistsInnerEnergy() [1/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsInnerEnergy ( const MFloat T,
const MFloat rho,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Definition at line 501 of file lbfunctions.h.

501 {
502 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
503
504 calcEqDistsInnerEnergy<nDim, nDist>(T, rho, squaredVelocity, u, eqDist);
505}

◆ calcEqDistsInnerEnergy() [2/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsInnerEnergy ( const MFloat T,
const MFloat rho,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Definition at line 556 of file lbfunctions.h.

558 {
559 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
560
561 calcEqDistsInnerEnergy<nDim, nDist>(T, rho, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
562}

◆ calcEqDistsInnerEnergy() [3/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsInnerEnergy ( const MFloat T,
const MFloat rho,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Definition at line 458 of file lbfunctions.h.

459 {
461
462 const MFloat F1BD = F1 / nDim;
463 const MFloat squaredVelocityB2 = 0.5 * squaredVelocity;
464 const MFloat innerEnergy = rho * T * F1B2 * (MFloat)nDim;
465
466 std::array<MFloat, 2 * nDim> b{};
467 for(MInt d = 0; d < nDim; d++) {
468 b[2 * d] = -u[d];
469 b[2 * d + 1] = u[d];
470 }
471
472 // Calculate all equilibrium distributions
473 // Calculation of eq. distributions for directions with only one component
474 for(MInt j = 0; j < Ld::distFld(0); j++) {
475 const MFloat l_innerterm_ie =
476 F1BCSsq * F1BD * CSsq + (F1BCSsq * F1BD - F2 * F1BD) * b[j] + b[j] * b[j] * F1B2 * F1BCSsq - squaredVelocityB2;
477 eqDist[j] = Ld::tp(1) * F1BCSsq * innerEnergy * l_innerterm_ie;
478 }
479
480 // Calculation of eq. distributions for directions with two components
481 for(MInt j = 0; j < Ld::distFld(1); j++) {
482 const MFloat tmp = (b[Ld::mFld1(2 * j)] + b[Ld::mFld1(2 * j + 1)]);
483 const MFloat l_innerterm_ie = F2 * F1BCSsq * F1BD * CSsq + (F2 * F1BCSsq * F1BD - F2 * F1BD) * tmp
484 + tmp * tmp * F1B2 * F1BCSsq - squaredVelocityB2;
485 eqDist[Ld::distFld(0) + j] = Ld::tp(2) * F1BCSsq * innerEnergy * l_innerterm_ie;
486 }
487
488 // Calculation of eq. distributions for directions with three components
489 for(MInt j = 0; j < Ld::distFld(2); j++) {
490 const MFloat tmp = (b[Ld::mFld2(3 * j)] + b[Ld::mFld2(3 * j + 1)] + b[Ld::mFld2(3 * j + 2)]);
491 const MFloat l_innerterm_ie = F3 * F1BCSsq * F1BD * CSsq + (F3 * F1BCSsq * F1BD - F2 * F1BD) * tmp
492 + tmp * tmp * F1B2 * F1BCSsq - squaredVelocityB2;
493 eqDist[Ld::distFld(0) + Ld::distFld(1) + j] = Ld::tp(3) * F1BCSsq * innerEnergy * l_innerterm_ie;
494 }
495
496 // Rest distribution
497 eqDist[Ld::lastId()] = -Ld::tp(0) * innerEnergy * F1B2 * F1BCSsq * squaredVelocity;
498}

◆ calcEqDistsInnerEnergy() [4/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsInnerEnergy ( const MFloat T,
const MFloat rho,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Definition at line 509 of file lbfunctions.h.

511 {
513
514 const MFloat F1BD = F1 / nDim;
515 const MFloat squaredVelocityB2 = 0.5 * squaredVelocity;
516 const MFloat innerEnergy = rho * T * F1B2 * nDim;
517
518 std::array<MFloat, 2 * nDim> b{};
519 for(MInt d = 0; d < nDim; d++) {
520 b[2 * d] = -u[d];
521 b[2 * d + 1] = u[d];
522 }
523
524 // Calculate all equilibrium distributions
525 // Calculation of eq. distributions for directions with only one component
526 const MFloat lb_tp_coef1 = myTp[1] * F1BCSsq;
527 for(MInt j = 0; j < myDistFld[0]; j++) {
528 const MFloat l_innerterm_ie =
529 F1BCSsq * F1BD * CSsq + (F1BCSsq * F1BD - F2 * F1BD) * b[j] + b[j] * b[j] * F1B2 * F1BCSsq - squaredVelocityB2;
530 eqDist[j] = lb_tp_coef1 * innerEnergy * l_innerterm_ie;
531 }
532
533 // Calculation of eq. distributions for directions with two components
534 const MFloat lb_tp_coef2 = myTp[2] * F1BCSsq;
535 for(MInt j = 0; j < myDistFld[1]; j++) {
536 const MFloat tmp = (b[myMFld1[2 * j]] + b[myMFld1[2 * j + 1]]);
537 const MFloat l_innerterm_ie = F2 * F1BCSsq * F1BD * CSsq + (F2 * F1BCSsq * F1BD - F2 * F1BD) * tmp
538 + tmp * tmp * F1B2 * F1BCSsq - squaredVelocityB2;
539 eqDist[myDistFld[0] + j] = lb_tp_coef2 * innerEnergy * l_innerterm_ie;
540 }
541
542 // Calculation of eq. distributions for directions with three components
543 const MFloat lb_tp_coef3 = myTp[3] * F1BCSsq;
544 for(MInt j = 0; j < myDistFld[2]; j++) {
545 const MFloat tmp = (b[myMFld2[3 * j]] + b[myMFld2[3 * j + 1]] + b[myMFld2[3 * j + 2]]);
546 const MFloat l_innerterm_ie = F3 * F1BCSsq * F1BD * CSsq + (F3 * F1BCSsq * F1BD - F2 * F1BD) * tmp
547 + tmp * tmp * F1B2 * F1BCSsq - squaredVelocityB2;
548 eqDist[myDistFld[0] + myDistFld[1] + j] = lb_tp_coef3 * innerEnergy * l_innerterm_ie;
549 }
550
551 // Rest distribution
552 eqDist[Ld::lastId()] = -myTp[0] * innerEnergy * F1B2 * F1BCSsq * squaredVelocity;
553}

◆ calcEqDistsThermal() [1/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsThermal ( const MFloat T,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Attention: This is the basic thermal LBM

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 410 of file lbfunctions.h.

410 {
411 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
412
413 calcEqDists<nDim, nDist, true>(T, squaredVelocity, u, eqDist);
414}

◆ calcEqDistsThermal() [2/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsThermal ( const MFloat T,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Attention: This is the basic thermal LBM

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 449 of file lbfunctions.h.

450 {
451 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
452
453 calcEqDists<nDim, nDist, true>(T, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
454}

◆ calcEqDistsThermal() [3/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsThermal ( const MFloat T,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Attention: This is the basic thermal LBM

Use this version if the squaredVelocity is already precomputed

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 393 of file lbfunctions.h.

394 {
395 calcEqDists<nDim, nDist, true>(T, squaredVelocity, u, eqDist);
396}

◆ calcEqDistsThermal() [4/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsThermal ( const MFloat T,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Attention: This is the basic thermal LBM

Use this version if the squaredVelocity is already precomputed

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 431 of file lbfunctions.h.

433 {
434 calcEqDists<nDim, nDist, true>(T, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
435}

◆ calcEqDistsTotalEnergy() [1/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTotalEnergy ( const MFloat T,
const MFloat rho,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Definition at line 619 of file lbfunctions.h.

619 {
620 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
621
622 calcEqDistsTotalEnergy<nDim, nDist>(T, rho, squaredVelocity, u, eqDist);
623}

◆ calcEqDistsTotalEnergy() [2/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTotalEnergy ( const MFloat T,
const MFloat rho,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Definition at line 680 of file lbfunctions.h.

682 {
683 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
684
685 calcEqDistsTotalEnergy<nDim, nDist>(T, rho, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
686}

◆ calcEqDistsTotalEnergy() [3/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTotalEnergy ( const MFloat T,
const MFloat rho,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDistT 
)
inline

Definition at line 566 of file lbfunctions.h.

567 {
569
570 const MFloat squaredVelocityB2 = 0.5 * squaredVelocity;
571 const MFloat p0 = rho * CSsq;
572 const MFloat totalEnergy = T * nDim * F1B2 + squaredVelocityB2;
573
574 std::array<MFloat, 2 * nDim> b{};
575 for(MInt d = 0; d < nDim; d++) {
576 b[d * 2] = -u[d];
577 b[d * 2 + 1] = u[d];
578 }
579
580 // Calculate all equilibrium distributions
581 // Calculation of eq. distributions for directions with only one component
582 constexpr MFloat lb_tp_coef1 = Ld::tp(1) * F1BCSsq;
583 for(MInt j = 0; j < Ld::distFld(0); j++) {
584 const MFloat l_innerterm = CSsq + b[j] + b[j] * b[j] * F1B2mulF1BCSsq - squaredVelocityB2;
585 const MFloat eq_dist = lb_tp_coef1 * rho * l_innerterm;
586 const MFloat l_innerterm_te = b[j] + b[j] * b[j] * F1BCSsq - squaredVelocity + F1B2 * (F1 - nDim * CSsq);
587 eqDistT[j] = lb_tp_coef1 * p0 * l_innerterm_te + totalEnergy * eq_dist;
588 }
589
590 // Calculation of eq. distributions for directions with two components
591 constexpr MFloat lb_tp_coef2 = Ld::tp(2) * F1BCSsq;
592 for(MInt j = 0; j < Ld::distFld(1); j++) {
593 const MFloat tmp = (b[Ld::mFld1(2 * j)] + b[Ld::mFld1(2 * j + 1)]);
594 const MFloat l_innerterm = CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2;
595 const MFloat eq_dist = lb_tp_coef2 * rho * l_innerterm;
596 const MFloat l_innerterm_te = tmp + tmp * tmp * F1BCSsq - squaredVelocity + F1B2 * (F2 - nDim * CSsq);
597 eqDistT[Ld::distFld(0) + j] = lb_tp_coef2 * p0 * l_innerterm_te + totalEnergy * eq_dist;
598 }
599
600 // Calculation of eq. distributions for directions with three components
601 constexpr MFloat lb_tp_coef3 = Ld::tp(3) * F1BCSsq;
602 for(MInt j = 0; j < Ld::distFld(2); j++) {
603 const MFloat tmp = (b[Ld::mFld2(3 * j)] + b[Ld::mFld2(3 * j + 1)] + b[Ld::mFld2(3 * j + 2)]);
604 const MFloat l_innerterm = CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2;
605 const MFloat eq_dist = lb_tp_coef3 * rho * l_innerterm;
606 const MFloat l_innerterm_te = tmp + tmp * tmp * F1BCSsq - squaredVelocity + F1B2 * (F3 - nDim * CSsq);
607 eqDistT[Ld::distFld(0) + Ld::distFld(1) + j] = lb_tp_coef3 * p0 * l_innerterm_te + totalEnergy * eq_dist;
608 }
609
610 // Rest distribution
611 constexpr MFloat lb_tp_coef0 = Ld::tp(0);
612 const MFloat l_innerterm = F1 - F1B2mulF1BCSsq * squaredVelocity;
613 const MFloat eq_dist = lb_tp_coef0 * rho * l_innerterm;
614 const MFloat l_innerterm_te = -F1BCSsq * squaredVelocity + F1B2mulF1BCSsq * (F0 - nDim * CSsq);
615 eqDistT[Ld::lastId()] = lb_tp_coef0 * p0 * l_innerterm_te + totalEnergy * eq_dist;
616}

◆ calcEqDistsTotalEnergy() [4/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTotalEnergy ( const MFloat T,
const MFloat rho,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDistT,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Definition at line 627 of file lbfunctions.h.

629 {
631
632 const MFloat squaredVelocityB2 = 0.5 * squaredVelocity;
633 const MFloat p0 = rho * CSsq;
634 const MFloat totalEnergy = T * nDim * F1B2 + squaredVelocityB2;
635
636 std::array<MFloat, 2 * nDim> b{};
637 for(MInt d = 0; d < nDim; d++) {
638 b[2 * d] = -u[d];
639 b[2 * d + 1] = u[d];
640 }
641
642 // Calculate all equilibrium distributions
643 // Calculation of eq. distributions for directions with only one component
644 const MFloat lb_tp_coef1 = myTp[1] * F1BCSsq;
645 for(MInt j = 0; j < myDistFld[0]; j++) {
646 const MFloat l_innerterm = CSsq + b[j] + b[j] * b[j] * F1B2mulF1BCSsq - squaredVelocityB2;
647 const MFloat eq_dist = lb_tp_coef1 * rho * l_innerterm;
648 const MFloat l_innerterm_te = b[j] + b[j] * b[j] * F1BCSsq - squaredVelocity + F1B2 * (F1 - nDim * CSsq);
649 eqDistT[j] = lb_tp_coef1 * p0 * l_innerterm_te + totalEnergy * eq_dist;
650 }
651
652 // Calculation of eq. distributions for directions with two components
653 const MFloat lb_tp_coef2 = myTp[2] * F1BCSsq;
654 for(MInt j = 0; j < myDistFld[1]; j++) {
655 const MFloat tmp = (b[myMFld1[2 * j]] + b[myMFld1[2 * j + 1]]);
656 const MFloat l_innerterm = CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2;
657 const MFloat eq_dist = lb_tp_coef2 * rho * l_innerterm;
658 const MFloat l_innerterm_te = tmp + tmp * tmp * F1BCSsq - squaredVelocity + F1B2 * (F2 - nDim * CSsq);
659 eqDistT[myDistFld[0] + j] = lb_tp_coef2 * p0 * l_innerterm_te + totalEnergy * eq_dist;
660 }
661
662 // Calculation of eq. distributions for directions with three components
663 const MFloat lb_tp_coef3 = myTp[3] * F1BCSsq;
664 for(MInt j = 0; j < myDistFld[2]; j++) {
665 const MFloat tmp = (b[myMFld2[3 * j]] + b[myMFld2[3 * j + 1]] + b[myMFld2[3 * j + 2]]);
666 const MFloat l_innerterm = CSsq + tmp + tmp * tmp * F1B2mulF1BCSsq - squaredVelocityB2;
667 const MFloat eq_dist = lb_tp_coef3 * rho * l_innerterm;
668 const MFloat l_innerterm_te = tmp + tmp * tmp * F1BCSsq - squaredVelocity + F1B2 * (F3 - nDim * CSsq);
669 eqDistT[myDistFld[0] + myDistFld[1] + j] = lb_tp_coef3 * p0 * l_innerterm_te + totalEnergy * eq_dist;
670 }
671
672 // Rest distribution
673 const MFloat l_innerterm = F1 - F1B2mulF1BCSsq * squaredVelocity;
674 const MFloat eq_dist = myTp[0] * rho * l_innerterm;
675 const MFloat l_innerterm_te = -F1BCSsq * squaredVelocity + F1B2mulF1BCSsq * (F0 - nDim * CSsq);
676 eqDistT[Ld::lastId()] = myTp[0] * p0 * l_innerterm_te + totalEnergy * eq_dist;
677}

◆ calcEqDistsTransport() [1/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTransport ( const MFloat C,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Attention: This is the basic transport LBM

Author
Shota Ito, Julian Vorspohl
Date
07.06.2022
Parameters
[in]CMacroscopic concentration
[out]eqDistResulting equilibrium distribution

Definition at line 720 of file lbfunctions.h.

720 {
721 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
722
723 calcEqDists<nDim, nDist, true>(C, squaredVelocity, u, eqDist);
724}

◆ calcEqDistsTransport() [2/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTransport ( const MFloat C,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Attention: This is the basic transport LBM

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 759 of file lbfunctions.h.

760 {
761 const MFloat squaredVelocity = std::inner_product(&u[0], &u[nDim], &u[0], .0);
762
763 calcEqDists<nDim, nDist, true>(C, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
764}

◆ calcEqDistsTransport() [3/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTransport ( const MFloat C,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist 
)
inline

Attention: This is the basic transport LBM

Use this version if the squaredVelocity is already precomputed

Author
Shota Ito, Julian Vorspohl
Date
07.06.2022
Parameters
[in]CMacroscopic concentration
[out]eqDistResulting equilibrium distribution

Definition at line 703 of file lbfunctions.h.

704 {
705 calcEqDists<nDim, nDist, true>(C, squaredVelocity, u, eqDist);
706}

◆ calcEqDistsTransport() [4/4]

template<MInt nDim, MInt nDist>
void lbfunc::calcEqDistsTransport ( const MFloat C,
const MFloat  squaredVelocity,
const MFloat *const  u,
MFloat *const  eqDist,
const MInt myMFld1,
const MInt myMFld2,
const MFloat myTp,
const MInt myDistFld 
)
inline

Attention: This is the basic transport LBM

Use this version if the squaredVelocity is already precomputed

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Date
29.09.2021
Parameters
[in]TMacroscopic temperature
[out]eqDistResulting equilibrium distribution

Definition at line 741 of file lbfunctions.h.

743 {
744 calcEqDists<nDim, nDist, true>(C, squaredVelocity, u, eqDist, myMFld1, myMFld2, myTp, myDistFld);
745}

◆ calcMacroVars() [1/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcMacroVars ( MFloat const *const  p_dist,
MFloat p_rho,
MFloat *const  p_u 
)
inline
Author
Miro Gondrum
Date
14.01.2020
Parameters
[in]p_distdistributions
[out]p_rhomacroscopic density
[out]p_umacroscopic velocity (u*rho)

Definition at line 775 of file lbfunctions.h.

775 {
777 // density
778 p_rho = 0.0;
779 for(MInt j = 0; j < nDist; j++) {
780 p_rho += p_dist[j];
781 }
782 // velocities [rho*u]
783 for(MInt i = 0; i < nDim; i++) {
784 p_u[i] = 0.0;
785 for(MInt j = 0; j < Ld::dxQyFld(); j++) {
786 p_u[i] += p_dist[Ld::pFld(i, j)];
787 p_u[i] -= p_dist[Ld::nFld(i, j)];
788 }
789 if constexpr(compressible) p_u[i] /= p_rho;
790 }
791}

◆ calcMacroVars() [2/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcMacroVars ( MFloat const *const  p_dist,
MFloat p_rho,
MFloat *const  p_u,
MInt *const  myPFld,
MInt *const  myNFld,
const MInt  fldlen 
)
inline
Author
Miro Gondrum
Date
14.01.2020
Parameters
[in]p_distdistributions
[out]p_rhomacroscopic density
[out]p_umacroscopic velocity

Definition at line 802 of file lbfunctions.h.

803 {
805 // density
806 p_rho = 0.0;
807 for(MInt j = 0; j < nDist; j++) {
808 p_rho += p_dist[j];
809 }
810 // velocities [rho*u]
811 for(MInt i = 0; i < nDim; i++) {
812 p_u[i] = 0.0;
813 for(MInt j = 0; j < fldlen; j++) {
814 p_u[i] += p_dist[myPFld[i * fldlen + j]];
815 p_u[i] -= p_dist[myNFld[i * fldlen + j]];
816 }
817 if constexpr(compressible) p_u[i] /= p_rho;
818 }
819}

◆ calcMomentumFlux() [1/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcMomentumFlux ( const MFloat rho,
const MFloat *const  u,
const MFloat *const  dist,
MFloat *const  momentumFlux 
)
inline

Remember: This calculation is only meaningful for the post-propagation state!

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]rhoMacroscopic density
[in]uMacroscopic velocity
[in]distDistribution
[out]momentumFluxMomentum flux tensor

Definition at line 353 of file lbfunctions.h.

354 {
355 std::array<MFloat, nDist> nonEqDist{};
356 calcNonEqDists<nDim, nDist, compressible>(rho, u, dist, nonEqDist.data());
357
358 calcMomentumFluxFromNonEq<nDim, nDist>(nonEqDist.data(), momentumFlux);
359}
MFloat dist(const Point< DIM > &p, const Point< DIM > &q)
Definition: pointbox.h:54

◆ calcMomentumFlux() [2/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcMomentumFlux ( const MFloat *const  dist,
MFloat *const  momentumFlux 
)
inline

Remember: This calculation is only meaningful for the post-propagation state!

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]distDistribution
[out]momentumFluxMomentum flux tensor

Definition at line 372 of file lbfunctions.h.

372 {
373 std::array<MFloat, nDist> nonEqDist{};
374 calcNonEqDists<nDim, nDist, compressible>(dist, nonEqDist.data());
375
376 calcMomentumFluxFromNonEq<nDim, nDist>(nonEqDist.data(), momentumFlux);
377}

◆ calcMomentumFluxFromNonEq()

template<MInt nDim, MInt nDist>
void lbfunc::calcMomentumFluxFromNonEq ( const MFloat *const  nonEqDist,
MFloat *const  momentumFlux 
)
inline

Remember: This calculation is only meaningful for the post-propagation state!

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]nonEqDistNon-Equilibrium distribution
[out]momentumFluxMomentum flux tensor

Definition at line 325 of file lbfunctions.h.

325 {
327
328 for(MInt d = 0; d < nDim * nDim; d++) {
329 momentumFlux[d] = F0;
330 }
331 for(MInt j = 0; j < nDist; j++) {
332 for(MInt k = 0; k < nDim; k++) {
333 for(MInt l = 0; l < nDim; l++) {
334 momentumFlux[k * nDim + l] += nonEqDist[j] * Ld::ppdfDir(j, k) * Ld::ppdfDir(j, l);
335 }
336 }
337 }
338}

◆ calcNonEqDists() [1/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcNonEqDists ( const MFloat rho,
const MFloat *const  u,
const MFloat *const  dist,
MFloat *const  nonEqDist 
)
inline

Remember: This calculation is only meaningful for the post-propagation state!

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]rhoMacroscopic density
[in]uMacroscopic velocity
[in]distDistribution
[out]nonEqDistNon-equilibrium part of the distribution

Definition at line 282 of file lbfunctions.h.

283 {
284 // Calculate equlibirum distribution
285 std::array<MFloat, nDist> eqDist{};
286 calcEqDists<nDim, nDist, compressible>(rho, u, eqDist.data());
287
288 // Calculate non-equilibium part
289 for(MInt j = 0; j < nDist; j++) {
290 nonEqDist[j] = dist[j] - eqDist[j];
291 }
292}

◆ calcNonEqDists() [2/2]

template<MInt nDim, MInt nDist, MBool compressible = false>
void lbfunc::calcNonEqDists ( const MFloat *const  dist,
MFloat *const  nonEqDist 
)
inline

Remember: This calculation is only meaningful for the post-propagation state!

Author
Julian Vorspohl j.vor.nosp@m.spoh.nosp@m.l@aia.nosp@m..rwt.nosp@m.h-aac.nosp@m.hen..nosp@m.de
Parameters
[in]distDistribution
[out]nonEqDistNon-equilibrium part of the distribution

Definition at line 305 of file lbfunctions.h.

305 {
306 // Calculate macroscopic variables
307 MFloat rho{};
308 std::array<MFloat, nDim> u{};
309 calcMacroscopicVars(dist, rho, u.data());
310
311 calcNonEqDists<nDim, nDist, compressible>(rho, u.data(), dist, nonEqDist);
312}