56 for (
int iX=x0; iX<=x1; ++iX) {
57 for (
int iY=y0; iY<=y1; ++iY) {
62 T uSqr = util::normSqr<T,DESCRIPTOR::d>(u);
64 T dx_U[L::d], dy_U[L::d];
65 interpolateGradients<0>(blockLattice, dx_U, iX, iY);
66 interpolateGradients<1>(blockLattice, dy_U, iX, iY);
68 T rhoGradU[L::d][L::d];
69 rhoGradU[x][x] = rho * dx_U[x];
70 rhoGradU[x][y] = rho * dx_U[y];
71 rhoGradU[y][x] = rho * dy_U[x];
72 rhoGradU[y][y] = rho * dy_U[y];
74 T omega = blockLattice.
getDynamics(iX, iY) -> getOmega();
75 T sToPi = - (T)1 / descriptors::invCs2<T,DESCRIPTOR>() / omega;
78 pi[xx] = (T)2 * rhoGradU[x][x] * sToPi;
79 pi[yy] = (T)2 * rhoGradU[y][y] * sToPi;
80 pi[xy] = (rhoGradU[x][y] + rhoGradU[y][x]) * sToPi;
87 interpolateGradients<0>(blockLattice, dx_rho, iX, iY);
88 interpolateGradients<1>(blockLattice, dy_rho, iX, iY);
89 for (
int iPop = 0; iPop < L::q; ++iPop) {
91 for (
int iAlpha=0; iAlpha < L::d; ++iAlpha) {
92 cGradRhoUU += descriptors::c<L>(iPop,iAlpha) * (
93 dx_rho*u[iAlpha]*u[x] +
94 dx_U[iAlpha]*rho*u[x] +
95 dx_U[x]*rho*u[iAlpha] +
96 dy_rho*u[iAlpha]*u[y] +
97 dy_U[iAlpha]*rho*u[y] +
98 dy_U[y]*rho*u[iAlpha]);
103 T cDivRhoUU[L::d][L::d];
104 for (
int iAlpha = 0; iAlpha < L::d; ++iAlpha) {
105 for (
int iBeta = 0; iBeta < L::d; ++iBeta) {
106 cDivRhoUU[iAlpha][iBeta] = descriptors::c<L>(iPop,x) *
107 (dx_rho*u[iAlpha]*u[iBeta] +
108 dx_U[iAlpha]*rho*u[iBeta] +
109 dx_U[iBeta]*rho*u[iAlpha])
110 + descriptors::c<L>(iPop,y) *
111 (dy_rho*u[iAlpha]*u[iBeta] +
112 dy_U[iAlpha]*rho*u[iBeta] +
113 dy_U[iBeta]*rho*u[iAlpha]);
122 for (
int iAlpha = 0; iAlpha < L::d; ++iAlpha) {
123 for (
int iBeta = 0; iBeta < L::d; ++iBeta) {
124 int ci_ci = descriptors::c<L>(iPop,iAlpha)*descriptors::c<L>(iPop,iBeta);
125 qCdivRhoUU += ci_ci * cDivRhoUU[iAlpha][iBeta];
126 qRhoGradU += ci_ci * rhoGradU[iAlpha][iBeta];
127 if (iAlpha == iBeta) {
128 qCdivRhoUU -= cDivRhoUU[iAlpha][iBeta]/descriptors::invCs2<T,L>();
129 qRhoGradU -= rhoGradU[iAlpha][iBeta]/descriptors::invCs2<T,L>();
136 cell[iPop] = lbH::equilibrium(iPop,rho,u,uSqr)
137 - descriptors::t<T,L>(iPop) * descriptors::invCs2<T,L>() / omega
138 * (qRhoGradU - cGradRhoUU + 0.5*descriptors::invCs2<T,L>()*qCdivRhoUU);
This class computes the finite difference approximation to LB boundary conditions on a flat wall in 2...
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.
ExtendedStraightFdBoundaryPostProcessor2D(int x0_, int x1_, int y0_, int y1_)
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
Interface of 2D post-processing steps.
std::string & getName()
read and write access to name