65 T physPosP[],
int latticeRoundedP[],
69 util::pow(latticeVelF[1] - latticeVelP[1],2) +
70 util::pow(latticeVelF[2] - latticeVelP[2],2) );
72 int locIC = this->_sLattice.getLoadBalancer().loc(globic);
73 T rhoL = this->_sLattice.getBlock(locIC).get(
76 latticeRoundedP[2]).computeRho();
102 T physPosP[],
int latticeRoundedP[],
105 T physLatticeL = this->_converter.getConversionFactorLength();
114 T faPos[3] = {T(), T(), T()};
115 T fbPos[3] = {T(), T(), T()};
117 T fa[Lattice::q] = { T() };
118 T fb[Lattice::q] = { T() };
119 T lFU[3] = {T(), T(), T()};
122 for (
unsigned iPop = 0; iPop < Lattice::q; ++iPop) {
124 faPos[0] = physPosP[0] + physLatticeL * descriptors::c<Lattice>(iPop,0);
125 faPos[1] = physPosP[1] + physLatticeL * descriptors::c<Lattice>(iPop,1);
126 faPos[2] = physPosP[2] + physLatticeL * descriptors::c<Lattice>(iPop,2);
128 this->_interpLatticeDensity->operator() (fa, faPos, globic);
131 fbPos[0] = physPosP[0] - physLatticeL * descriptors::c<Lattice>(iPop,0);
132 fbPos[1] = physPosP[1] - physLatticeL * descriptors::c<Lattice>(iPop,1);
133 fbPos[2] = physPosP[2] - physLatticeL * descriptors::c<Lattice>(iPop,2);
135 this->_interpLatticeDensity->operator() (fb, fbPos, globic);
138 fiPop = fb[descriptors::opposite<Lattice >(iPop)];
144 lFU[0] = -descriptors::c<Lattice>(iPop,0) * fiPop;
145 lFU[1] = -descriptors::c<Lattice>(iPop,1) * fiPop;
146 lFU[2] = -descriptors::c<Lattice>(iPop,2) * fiPop;
149 sp = descriptors::c<Lattice>(iPop,0) * latticeVelP[0] + descriptors::c<Lattice>(iPop,1) * latticeVelP[1]
150 + descriptors::c<Lattice>(iPop,2) * latticeVelP[2];
151 sp *= 2. * descriptors::invCs2<T,Lattice>()
152 * descriptors::t<T,Lattice>(iPop);
155 gF[0] += (lFU[0] - descriptors::c<Lattice>(iPop,0) * (sp));
156 gF[1] += (lFU[1] - descriptors::c<Lattice>(iPop,1) * (sp));
157 gF[2] += (lFU[2] - descriptors::c<Lattice>(iPop,2) * (sp));
LaddMomentumExchange(UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > interpLatticeDensity, std::shared_ptr< SuperLatticeInterpPhysVelocity3D< T, Lattice > > interpLatticeVelocity)
Constructor.
virtual bool operator()(T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic) override
Computes the momentum transfer from fluid to particle.
virtual bool operator()(T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic) override
Computes the momentum transfer from fluid to particle.