25#ifndef DYNAMICS_DYNAMICS_H
26#define DYNAMICS_DYNAMICS_H
50template <
typename T,
typename DESCRIPTOR>
65template <
typename T,
typename DESCRIPTOR>
74template <
typename T,
typename DESCRIPTOR>
89template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
93 std::conditional_t< (DESCRIPTOR::d == 3 && DESCRIPTOR::q == 7)
94 || (DESCRIPTOR::d == 2 && DESCRIPTOR::q == 5),
101template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
110template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
118template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
126template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
135template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
144template <
typename T,
typename DESCRIPTOR>
157template <
typename T,
typename DESCRIPTOR>
171template <
typename T,
typename DESCRIPTOR>
184template <
typename T,
typename DESCRIPTOR>
199template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
213template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
223template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::ExternalVelocityTuple>
238template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
253template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
268template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
278template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
285template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
295template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
311template <
typename T,
typename DESCRIPTOR>
320template <
typename T,
typename DESCRIPTOR>
329template <
typename T,
typename DESCRIPTOR>
338template <
typename T,
typename DESCRIPTOR>
347template <
typename T,
typename DESCRIPTOR>
356template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::ExternalVelocityTuple>
365template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::ExternalVelocityTuple>
381template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
394template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA>
401 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
406 template <
typename NEW_T>
413 template <
typename M>
416 std::type_index
id()
override {
421 return block.template getData<OperatorParameters<CombinedRLBdynamics>>();
424 template <concepts::Cell CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
427 MomentaF().computeAllMomenta(cell,rho,u,pi);
428 V fEq[DESCRIPTOR::q] { };
431 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
435 return CORRECTED_DYNAMICS().collide(cell,
parameters);
443 return "CombinedRLBdynamics<" + CORRECTED_DYNAMICS().getName() +
">";
449template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
461template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
476template <
typename T,
typename DESCRIPTOR>
495template <
typename T,
typename DESCRIPTOR>
508template <
typename T,
typename DESCRIPTOR>
521template <
typename T,
typename DESCRIPTOR>
534template <
typename T,
typename DESCRIPTOR>
553template <
typename T,
typename DESCRIPTOR>
565template <
typename T,
typename DESCRIPTOR>
574template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::PoissonTuple>
583template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::P1Tuple>
592template <
typename T,
typename DESCRIPTOR>
596 momenta::BulkDensity,
597 momenta::ZeroMomentum,
599 momenta::DefineSeparately
611 template <
typename NEW_T>
614 template <
typename M>
617 std::type_index
id()
override {
622 return block.template getData<OperatorParameters<ZeroDistributionDynamics>>();
625 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
627 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
634 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
640 return "ZeroDistributionDynamics";
644template <
typename T,
typename DESCRIPTOR,
typename MOMENTA>
657template <
typename T,
typename DESCRIPTOR>
670template <
typename T,
typename DESCRIPTOR>
683template <
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::BulkTuple>
685 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
689 template <
typename NEW_T>
692 std::type_index
id()
override {
697 return block.template getData<OperatorParameters<ForcedVANSBGKdynamics>>();
702 T porosity = cell.template getField<descriptors::POROSITY>();
703 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
704 auto force = cell.template getFieldPointer<descriptors::FORCE>();
705 for (
int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
706 u[iVel] += force[iVel] * T{0.5};
711 T porosity = cell.template getField<descriptors::POROSITY>();
712 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
713 auto force = cell.template getFieldPointer<descriptors::FORCE>();
714 for (
int iVel=0; iVel<DESCRIPTOR::d; ++iVel) {
715 u[iVel] += force[iVel] * T{0.5};
719 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
721 V rho, u[DESCRIPTOR::d];
722 V porosity = cell.template getField<descriptors::POROSITY>();
723 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
724 auto force = cell.template getFieldPointer<descriptors::FORCE>();
725 for (
int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
726 u[iVel] += force[iVel] * V{0.5};
730 const auto omega =
parameters.template get<descriptors::OMEGA>();
733 return {rho / porosity, uSqr * porosity * porosity};
Regularized BGK collision followed by any other Dynamics.
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
typename CORRECTED_DYNAMICS::EquilibriumF EquilibriumF
std::string getName() const override
Return human-readable name.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
void computeEquilibrium(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
Return iPop equilibrium for given first and second momenta.
typename CORRECTED_DYNAMICS::parameters parameters
std::type_index id() override
Expose unique type-identifier for RTTI.
Highest-level interface to read-only Cell data.
Dynamics combination rule implementing the forcing scheme by Shan and Chen.
Instantiation of Momenta tuples which define the computation and definition of momenta in a specific ...
Interface for post-processing steps – header file.
File provides a generic interface for the computation and definition of momenta (density,...
constexpr T t(unsigned iPop, tag::CUM) any_platform
Tuple< ZeroDensity, ZeroMomentum, ZeroStress, DefineSeparately > None
Tuple< FixedDensity, FixedVelocityMomentumGeneric, ZeroStress, DefineSeparately > EquilibriumBoundaryTuple
Velocity and density are stored in external fields.
Tuple< FixedDensity, FixedVelocityMomentum, BulkStress, DefineUSeparately > ExternalVelocityFixedDensityTuple
The Velocity is stored in descriptors::VELOCITY (and computed e.g.
Top level namespace for all of OpenLB.
Dynamic access interface for FIELD-valued parameters.
Return value of any collision.
VANS BGK collision step with external force.
void computeU(ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
Compute fluid velocity.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
std::type_index id() override
Expose unique type-identifier for RTTI.
void computeRhoU(ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
Compute fluid velocity and particle density.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters)
Models a density sink by enforcing a zero distribution on the cell.
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
typename equilibria::None::template type< DESCRIPTOR, momenta::Tuple< momenta::BulkDensity, momenta::ZeroMomentum, momenta::ZeroStress, momenta::DefineSeparately > > EquilibriumF
std::string getName() const override
Return human-readable name.
void computeEquilibrium(ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
Return iPop equilibrium for given first and second momenta.
std::type_index id() override
Expose unique type-identifier for RTTI.
Nguyen-Ladd Velocity Correction using momenta-defined velocity.
Override COLLISION parameter OMEGA with inverse of cell field TAU_EFF.
Override COLLISION parameter PARAMETER with cell field PARAMETER.
Dynamics constructed as a tuple of momenta, equilibrium and collision.
Dynamics combination rule implementing the forcing scheme by Guo et al. for 3rd order RLB.
Dynamics combination rule implementing the forcing scheme by Guo et al.
Dynamics combination rule implementing the forcing scheme by Kupershtokh et al.
Dynamics combination rule implementing the forcing scheme by Guo et al. with barycentric velocity.
Dynamics combination rule implementing the forcing scheme by A.J. Wagner, Phys. Rev....
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
Add a force term after BGK collision.
static V bgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
BGK collision step.
Standard computation for density in the bulk as zeroth moment of the population.
Standard stress computation as second moment of the population.
The momenta are defined one after the other.
When momenta are changed, the equilibrium part of the population is modified while the non-equilibriu...
The density is fixed and stored in the external field RHO.
Momentum is zero at solid material.
The stress is always zero.
Compute number of elements of a symmetric d-dimensional tensor.
Set of functions commonly used in LB computations – header file.