39ShanChenDynOmegaForcedPostProcessor3D <T,DESCRIPTOR>::
40ShanChenDynOmegaForcedPostProcessor3D(
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() =
"ShanChenDynOmegaForcedPostProcessor3D";
60 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
66 int newX0, newX1, newY0, newY1, newZ0, newZ1;
68 x0_, x1_, y0_, y1_, z0_, z1_,
69 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
71 auto& rhoField = blockLattice.template getField<RHO_CACHE>();
76 for (
int iX=newX0-1; iX<=newX1+1; ++iX) {
77 for (
int iY=newY0-1; iY<=newY1+1; ++iY) {
78 for (
int iZ=newZ0-1; iZ<=newZ1+1; ++iZ) {
88 for (
int iX=newX0-1; iX<=newX1+1; ++iX) {
89 for (
int iY=newY0-1; iY<=newY1+1; ++iY) {
90 for (
int iZ=newZ0-1; iZ<=newZ1+1; ++iZ) {
97 for (
int iX=newX0; iX<=newX1; ++iX) {
98 for (
int iY=newY0; iY<=newY1; ++iY) {
99 for (
int iZ=newZ0; iZ<=newZ1; ++iZ) {
106 blockCell.template setField<descriptors::VELOCITY>(j);
109 partnerCell.template setField<descriptors::VELOCITY>(j);
112 T blockOmega = blockCell.template getField<descriptors::OMEGA>();
113 T partnerOmega = partnerCell.template getField<descriptors::OMEGA>();
115 T rhoTot = rhoField[0][blockCell.
getCellId()]*blockOmega +
116 rhoField[1][blockCell.
getCellId()]*partnerOmega;
119 auto blockU = blockCell.template getField<descriptors::VELOCITY>();
120 auto partnerU = partnerCell.template getField<descriptors::VELOCITY>();
121 uTot = (blockU*rho0[0]*blockOmega + partnerU*rho0[1]*partnerOmega) / rhoTot;
128 interactionPotential(&psi2, &rhoField[1][blockCell.
getCellId()]);
129 interactionPotential(&psi1, &rhoField[0][blockCell.
getCellId()]);
130 for (
int iPop = 0; iPop < L::q; ++iPop) {
131 int nextX = iX + descriptors::c<L>(iPop,0);
132 int nextY = iY + descriptors::c<L>(iPop,1);
133 int nextZ = iZ + descriptors::c<L>(iPop,2);
136 interactionPotential(&blockRho, &rhoField[0][blockLattice.
getCellId(nextX, nextY, nextZ)]);
137 interactionPotential(&partnerRho, &rhoField[1][blockLattice.
getCellId(nextX, nextY, nextZ)]);
138 rhoBlockContribution += psi2 * blockRho * descriptors::c<L>(iPop) * descriptors::t<T, L>(iPop);
139 rhoPartnerContribution += psi1 * partnerRho * descriptors::c<L>(iPop) * descriptors::t<T, L>(iPop);
145 auto externalBlockForce = blockCell.template getField<descriptors::EXTERNAL_FORCE>();
146 auto externalPartnerForce = partnerCell.template getField<descriptors::EXTERNAL_FORCE>();
148 blockCell.template setField<descriptors::VELOCITY>(uTot);
149 partnerCell.template setField<descriptors::VELOCITY>(uTot);
150 blockCell.template setField<descriptors::FORCE>(externalBlockForce
151 - G*rhoPartnerContribution/rhoField[0][blockCell.
getCellId()]);
152 partnerCell.template setField<descriptors::FORCE>(externalPartnerForce
153 - G*rhoBlockContribution/rhoField[1][blockCell.
getCellId()]);
std::string & getName()
read and write access to name
Multiphysics class for coupling between different lattices.
virtual void process(BlockLattice< T, DESCRIPTOR > &blockLattice)
Execute post-processing step.
virtual void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
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)