39ShanChenForcedSingleComponentPostProcessor3D <T,DESCRIPTOR>::
40ShanChenForcedSingleComponentPostProcessor3D(
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
43 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_), G(G_), rho0(rho0_), interactionPotential(iP_), partners(partners_)
45 this->
getName() =
"ShanChenForcedSingleComponentPostProcessor3D";
49ShanChenForcedSingleComponentPostProcessor3D <T,DESCRIPTOR>::
50ShanChenForcedSingleComponentPostProcessor3D(T G_, std::vector<T> rho0_,
AnalyticalF<1,T,T>& iP_,
52 : x0(0), x1(0), y0(0), y1(0), z0(0), z1(0), G(G_), rho0(rho0_), interactionPotential(iP_), partners(partners_)
54 this->
getName() =
"ShanChenForcedSingleComponentPostProcessor3D";
60 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
64 int newX0, newX1, newY0, newY1, newZ0, newZ1;
66 x0_, x1_, y0_, y1_, z0_, z1_,
67 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
69 auto& rhoField = blockLattice.template getField<RHO_CACHE>()[0];
74 for (
int iX=newX0-1; iX<=newX1+1; ++iX) {
75 for (
int iY=newY0-1; iY<=newY1+1; ++iY) {
76 for (
int iZ=newZ0-1; iZ<=newZ1+1; ++iZ) {
83 for (
int iX=newX0; iX<=newX1; ++iX) {
84 for (
int iY=newY0; iY<=newY1; ++iY) {
85 for (
int iZ=newZ0; iZ<=newZ1; ++iZ) {
88 auto j = blockCell.template getField<descriptors::VELOCITY>();
90 blockCell.template setField<descriptors::VELOCITY>(j);
92 T blockOmega = blockCell.
getDynamics()->getParameters(blockLattice).template getOrFallback<descriptors::OMEGA>(0);
95 T rhoTot = rhoField[blockCell.
getCellId()]*blockOmega;
98 auto blockU = blockCell.template getFieldPointer<descriptors::VELOCITY>();
99 uTot = (blockU*rho0[0]*blockOmega) / rhoTot;
104 interactionPotential(&psi, &rhoField[blockCell.
getCellId()]);
105 for (
int iPop = 0; iPop < L::q; ++iPop) {
106 int nextX = iX + descriptors::c<L>(iPop,0);
107 int nextY = iY + descriptors::c<L>(iPop,1);
108 int nextZ = iZ + descriptors::c<L>(iPop,2);
110 interactionPotential(&blockRho, &rhoField[blockLattice.
getCellId(nextX, nextY, nextZ)]);
111 rhoBlockContribution += psi * blockRho * descriptors::c<L>(iPop)* descriptors::t<T,L>(iPop);
117 auto externalBlockForce = blockCell.template getFieldPointer<descriptors::EXTERNAL_FORCE>();
119 blockCell.template setField<descriptors::VELOCITY>(uTot);
120 blockCell.template setField<descriptors::FORCE>(externalBlockForce
121 - G*rhoBlockContribution/rhoField[blockCell.
getCellId()]);
std::string & getName()
read and write access to name
ShanChenForcedSingleComponentGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, 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_, int z0_, int z1_) 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)