38ShanChenForcedSingleComponentPostProcessor2D <T,DESCRIPTOR>::
39ShanChenForcedSingleComponentPostProcessor2D(
int x0_,
int x1_,
int y0_,
int y1_, T G_,
43 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), G(G_), rho0(rho0_), interactionPotential(iP_), partners(partners_)
45 this->
getName() =
"ShanChenForcedSingleComponentPostProcessor2D";
49ShanChenForcedSingleComponentPostProcessor2D <T,DESCRIPTOR>::
50ShanChenForcedSingleComponentPostProcessor2D(T G_,
54 : x0(0), x1(0), y0(0), y1(0), G(G_), rho0(rho0_), interactionPotential(iP_), partners(partners_)
56 this->
getName() =
"ShanChenForcedSingleComponentPostProcessor2D";
62 int x0_,
int x1_,
int y0_,
int y1_ )
66 int newX0, newX1, newY0, newY1;
69 newX0, newX1, newY0, newY1 ) ) {
71 auto& rhoField = blockLattice.template getField<RHO_CACHE>()[0];
76 for (
int iX=newX0-1; iX<=newX1+1; ++iX) {
77 for (
int iY=newY0-1; iY<=newY1+1; ++iY) {
79 rhoField[cell.getCellId()] = cell.computeRho()*rho0[0];
83 for (
int iX=newX0; iX<=newX1; ++iX) {
84 for (
int iY=newY0; iY<=newY1; ++iY) {
87 auto j = blockCell.template getField<descriptors::VELOCITY>();
89 blockCell.template setField<descriptors::VELOCITY>(j);
91 T blockOmega = blockCell.getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
94 T rhoTot = rhoField[blockCell.getCellId()]*blockOmega;
97 auto blockU = blockCell.template getField<descriptors::VELOCITY>();
98 uTot = (blockU*rho0[0]*blockOmega) / rhoTot;
103 interactionPotential(&psi, &rhoField[blockCell.getCellId()]);
104 for (
int iPop = 0; iPop < L::q; ++iPop) {
108 interactionPotential(&blockRho, &rhoField[blockLattice.getCellId(nextX, nextY)]);
115 auto externalBlockForce = blockCell.template getField<descriptors::EXTERNAL_FORCE>();
117 blockCell.template setField<descriptors::VELOCITY>(uTot);
118 blockCell.template setField<descriptors::FORCE>(externalBlockForce
119 - G*rhoBlockContribution/rhoField[blockCell.getCellId()]);
Interface of 2D post-processing steps.
std::string & getName()
read and write access to name
ShanChenForcedSingleComponentGenerator2D(int x0_, int x1_, int y0_, int y1_, T G_, std::vector< T > rho0_, AnalyticalF< 1, T, T > &iP_)
LatticeCouplingGenerator for NS coupling.
Multiphysics class for coupling between different lattices.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)