fneqMethod
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › fneqMethod
- This topic has 1 reply, 2 voices, and was last updated 1 week, 6 days ago by FBukreev.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
October 8, 2024 at 1:53 pm #9332BranParticipant
Dear developers:
Does the following code implement the fneqmethod described in this article? I mean O. Malaspinas, P. Sagaut, Wall model for large-eddy simulation based on the lattice Boltzmann method, J. Comput. Phys. 275 (2014) 25–40. I reckon it dose. I want to confirm.template<typename T, typename DESCRIPTOR> void WallFunctionBoundaryProcessor3D<T,DESCRIPTOR>::computeRFneqfromFneq(T fneq_bc[DESCRIPTOR::q]) { T sum_cell_fneq = 0.; for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { sum_cell_fneq += fneq_bc[iPop]; } T pi_bc[util::TensorVal< DESCRIPTOR >::n]; int iPi = 0; for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) { for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) { pi_bc[iPi] = T(); for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { pi_bc[iPi] += descriptors::c<DESCRIPTOR>(iPop)[iAlpha]*descriptors::c<DESCRIPTOR>(iPop)[iBeta]*fneq_bc[iPop]; } if (iAlpha==iBeta) { pi_bc[iPi] -= (1./descriptors::invCs2<T,DESCRIPTOR>())*sum_cell_fneq; } ++iPi; } } for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { fneq_bc[iPop] = equilibrium<DESCRIPTOR>::template fromPiToFneq<T>(iPop, pi_bc); } }
And does the following code do the same thing? Just in another way?
template<typename T, typename DESCRIPTOR> void WallFunctionBoundaryProcessor3D<T,DESCRIPTOR>::computeFneqRSOFD(BlockLattice<T,DESCRIPTOR>& blockLattice, Cell<T,DESCRIPTOR>& cell, int x, int y, int z, T u_bc[DESCRIPTOR::d], T rho_bc, T fneq_bc[DESCRIPTOR::q]) { T pi_bc[util::TensorVal< DESCRIPTOR >::n]; T Velocity_Grad[DESCRIPTOR::d][DESCRIPTOR::d]; computeVelocityGradient(blockLattice, x, y, z, u_bc, Velocity_Grad); // Creation of strain Rate T tau_eff = cell.template getField<descriptors::TAU_EFF>(); T Factor = -1.*tau_eff*rho_bc/descriptors::invCs2<T,DESCRIPTOR>(); int iPi = 0; for (int Alpha=0; Alpha<DESCRIPTOR::d; ++Alpha) { for (int Beta=Alpha; Beta<DESCRIPTOR::d; ++Beta) { pi_bc[iPi] = Factor*(Velocity_Grad[Alpha][Beta] + Velocity_Grad[Beta][Alpha]); ++iPi; } } if (_wallFunctionParam.bodyForce) { // Force tensor //Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta) auto F = cell.template getField<descriptors::FORCE>(); iPi = 0; for (int Alpha=0; Alpha<DESCRIPTOR::d; ++Alpha) { for (int Beta=Alpha; Beta<DESCRIPTOR::d; ++Beta) { pi_bc[iPi] += -1.*(rho_bc/2.)*(F[Alpha]*u_bc[Beta] + u_bc[Alpha]*F[Beta]); ++iPi; } } } for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) { fneq_bc[iPop] = equilibrium<DESCRIPTOR>::template fromPiToFneq<T>(iPop, pi_bc); } }
Best regards!
October 22, 2024 at 11:49 am #9396FBukreevKeymasterThe first option is regularized LBM and the seond one is reconstruction of fNeq from stress tensor computed by finite diferences method.
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.