24#ifndef DYNAMICS_EQUILIBRIUM_H
25#define DYNAMICS_EQUILIBRIUM_H
32template<
typename T>
struct CellStatistic;
43 template <
typename DESCRIPTOR,
typename MOMENTA>
47 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
49 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
55 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
57 V rho, u[DESCRIPTOR::d];
58 MomentaF().computeRhoU(cell, rho, u);
59 return compute(cell, rho, u, fEq);
71 template <
typename DESCRIPTOR,
typename MOMENTA>
75 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
77 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
83 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
85 V rho, u[DESCRIPTOR::d];
86 MomentaF().computeRhoU(cell, rho, u);
87 return compute(cell, rho, u, fEq);
96 return "CahnHilliardZerothOrder";
99 template <
typename DESCRIPTOR,
typename MOMENTA>
103 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
105 const auto mu = cell.template getField<descriptors::CHEM_POTENTIAL>();
107 for (
int iPop=1; iPop < DESCRIPTOR::q; ++iPop) {
113 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
115 V rho, u[DESCRIPTOR::d];
116 MomentaF().computeRhoU(cell, rho, u);
117 return compute(cell, rho, u, fEq);
129 template <
typename DESCRIPTOR,
typename MOMENTA>
133 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
135 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
141 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
143 V rho, u[DESCRIPTOR::d];
144 MomentaF().computeRhoU(cell, rho, u);
145 return compute(cell, rho, u, fEq);
154 return "SecondOrder";
157 template <
typename DESCRIPTOR,
typename MOMENTA>
161 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
164 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
170 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
172 V rho, u[DESCRIPTOR::d];
173 MomentaF().computeRhoU(cell, rho, u);
174 return compute(cell, rho, u, fEq);
186 template <
typename DESCRIPTOR,
typename MOMENTA>
190 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
193 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
199 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
201 V rho, u[DESCRIPTOR::d];
202 MomentaF().computeRhoU(cell, rho, u);
203 return compute(cell, rho, u, fEq);
212 return "Incompressible";
215 template <
typename DESCRIPTOR,
typename MOMENTA>
219 template <
typename CELL,
typename RHO,
typename J,
typename FEQ,
typename V=
typename CELL::value_t>
223 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
226 return {rho, jSqr / (rho*rho)};
229 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
231 V rho, j[DESCRIPTOR::d];
232 MomentaF().computeRhoJ(cell, rho, j);
233 return compute(cell, rho, j, fEq);
242 return "Multi-Phase-Incompressible";
245 template <
typename DESCRIPTOR,
typename MOMENTA>
249 template <
typename CELL,
typename P,
typename U,
typename FEQ,
typename V=
typename CELL::value_t>
251 const auto rho = cell.template getField<descriptors::RHO>();
253 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
259 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
261 V p, u[DESCRIPTOR::d];
263 return compute(cell, p, u, fEq);
275 template <
typename DESCRIPTOR,
typename MOMENTA>
279 template <
typename CELL,
typename RHO,
typename J,
typename FEQ,
typename V=
typename CELL::value_t>
281 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
287 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
289 V rho, j[DESCRIPTOR::d];
290 MomentaF().computeRhoJ(cell, rho, j);
291 return compute(cell, rho, j, fEq);
305 template <
typename DESCRIPTOR,
typename MOMENTA>
309 template <
typename CELL,
typename RHO,
typename U,
typename FEQ,
typename VS2,
typename V=
typename CELL::value_t>
312 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
320 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
333 template <
typename CELL,
typename PARAMETERS,
typename FEQ,
typename V=
typename CELL::value_t>
335 V rho, u[DESCRIPTOR::d];
336 MomentaF().computeRhoU(cell, rho, u);
337 const V vs2 =
parameters.template get<SPEED_OF_SOUND>();
339 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
347 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
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.
Return value of any collision.
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
static std::string getName()
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq, VS2 vs2=V{1}/descriptors::invCs2< V, DESCRIPTOR >()) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static std::string getName()
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, RHO &rho, J &j, FEQ &fEq) any_platform
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
CellStatistic< V > compute(CELL &cell, P &p, U &u, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static std::string getName()
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, RHO &rho, J &j, FEQ &fEq) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
static std::string getName()
CellStatistic< V > compute(CELL &cell, PARAMETERS ¶meters, FEQ &fEq) any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > compute(CELL &cell, RHO &rho, U &u, FEQ &fEq) any_platform
static std::string getName()
static V incompressible(int iPop, const J &j, const JSQR &jSqr, const PRESSURE &pressure) any_platform
static V thirdOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, third order in u.
static V P1(int iPop, const RHO &rho, const U &u) any_platform
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 V mpincompressible(int iPop, const RHO &rho, const U &u, const USQR &uSqr, const PRESSURE &pressure) any_platform
static V firstOrder(int iPop, const RHO &rho, const U &u) any_platform
Computation of equilibrium distribution, first order in u.