24#ifndef DYNAMICS_COLLISION_MRT_H
25#define DYNAMICS_COLLISION_MRT_H
44 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM>
49 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
51 const V omega =
parameters.template get<descriptors::OMEGA>();
53 V rt[DESCRIPTOR::q] { };
54 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
55 rt[iPop] = descriptors::s<V,DESCRIPTOR>(iPop);
57 for (
int iPop=0; iPop < descriptors::shearIndexes<DESCRIPTOR>(); ++iPop) {
58 rt[descriptors::shearViscIndexes<DESCRIPTOR>(iPop)] = omega;
60 V invM_S[DESCRIPTOR::q][DESCRIPTOR::q] { };
61 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
62 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
63 invM_S[iPop][jPop] = V{};
64 for (
int kPop = 0; kPop < DESCRIPTOR::q; ++kPop) {
66 invM_S[iPop][jPop] += descriptors::invM<V,DESCRIPTOR>(iPop,kPop) * rt[kPop];
72 V rho, u[DESCRIPTOR::d];
73 MomentaF().computeRhoU(cell, rho, u);
91 return "LaddVerbergForcing";
94 template <
typename DESCRIPTOR,
typename MOMENTA>
97 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM>
100 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM,
typename COLLISION>
102 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
103 using CollisionO =
typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>;
105 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
107 V rho, u[DESCRIPTOR::d];
108 MomentaF().computeRhoU(cell, rho, u);
109 const auto statistic =
CollisionO().apply(cell, parameters);
110 const V omega = parameters.template get<descriptors::OMEGA>();
112 V rt[DESCRIPTOR::q] { };
113 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
114 rt[iPop] = descriptors::s<V,DESCRIPTOR>(iPop);
116 for (
int iPop=0; iPop < descriptors::shearIndexes<DESCRIPTOR>(); ++iPop) {
117 rt[descriptors::shearViscIndexes<DESCRIPTOR>(iPop)] = omega;
119 V invM_S[DESCRIPTOR::q][DESCRIPTOR::q];
120 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
121 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
122 invM_S[iPop][jPop] = V{};
123 for (
int kPop = 0; kPop < DESCRIPTOR::q; ++kPop) {
125 invM_S[iPop][jPop] += descriptors::invM<V,DESCRIPTOR>(iPop,kPop) * rt[kPop];
130 const auto force = cell.template getField<descriptors::FORCE>();
136 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM,
typename COLLISION>
Interface for post-processing steps – header file.
DESCRIPTORBASE for all types of 2D and 3D lattices.
Helper functions for the implementation of LB dynamics.
Top level namespace for all of OpenLB.
Return value of any collision.
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > EquilibriumF
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters)
typename meta::list< descriptors::OMEGA > parameters
static std::string getName()
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters)
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Dynamics combination rule implementing the forcing scheme by Ladd and Verberg.
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > combined_equilibrium
typename MOMENTA::template type< DESCRIPTOR > combined_momenta
static std::string getName()
typename COLLISION::parameters combined_parameters
static V mrtCollision(CELL &cell, const RHO &rho, const U &u, const INVM_S &invM_S)
MRT collision step.
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.