38template<
typename DESCRIPTOR>
41 std::is_same<typename DESCRIPTOR::category_tag, descriptors::tag::MRT>::value,
42 "DESCRIPTOR is tagged as MRT");
45 template <
typename RHO,
typename U,
typename V=RHO>
50 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
59 template <
typename MOMENTAEQ,
typename RHO,
typename U,
typename V=RHO>
61 const RHO& rho,
const U& u)
64 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
65 momentaEq[iPop] = V{};
66 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
74 template <
typename MOMENTA,
typename CELL,
typename V=
typename CELL::value_t>
77 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
79 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
87 template <
typename CELL,
typename RHO,
typename U,
typename INVM_S,
typename V=
typename CELL::value_t>
89 const RHO& rho,
const U& u,
93 V momenta[DESCRIPTOR::q] { };
94 V momentaEq[DESCRIPTOR::q] { };
99 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
101 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
102 collisionTerm += invM_S[iPop][jPop] * (momenta[jPop] - momentaEq[jPop]);
104 cell[iPop] -= collisionTerm;
110 template <
typename CELL,
typename RHO,
typename U,
typename OMEGA,
typename INVM_S_SGS,
typename V=
typename CELL::value_t>
112 const RHO& rho,
const U& u,
114 const INVM_S_SGS& invM_S_SGS)
117 V momenta[DESCRIPTOR::q];
118 V momentaEq[DESCRIPTOR::q];
123 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
125 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
126 collisionTerm += invM_S_SGS[iPop][jPop] * (momenta[jPop] - momentaEq[jPop]);
128 cell[iPop] -= collisionTerm;
137 template <
typename CELL,
typename RHO,
typename U,
typename INVM_S,
typename FORCE,
typename V=
typename CELL::value_t>
139 const RHO& rho,
const U& u,
140 const INVM_S& invM_S,
144 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
145 f_u += force[iD] * u[iD];
148 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
151 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
159 for (
int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
162 cell[iPop] += f1 + f2 - invMsM*f2*V{0.5};
constexpr T m(unsigned iPop, unsigned jPop, tag::MRT)
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Top level namespace for all of OpenLB.
static V secondOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, second order in u.
static void computeMomenta(MOMENTA &momenta, CELL &cell)
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.
static V mrtCollision(CELL &cell, const RHO &rho, const U &u, const INVM_S &invM_S)
MRT collision step.
static V equilibrium(int iPop, const RHO &rho, const U &u)
Computation of equilibrium distribution (in momenta space)
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.
static void computeEquilibrium(MOMENTAEQ &momentaEq, const RHO &rho, const U &u)
Computation of all equilibrium distribution (in momenta space)