ComputeNusselt
› Forums › on OpenLB › General Topics › ComputeNusselt
- This topic has 3 replies, 2 voices, and was last updated 4 years, 5 months ago by stephan.
-
AuthorPosts
-
May 11, 2021 at 10:05 am #5669MikeParticipant
Dear everyone,
I am confused with the function ComputeNusselt() in squarecavity2d:
T computeNusselt(SuperGeometry2D<T>& superGeometry,
SuperLattice2D<T, NSDESCRIPTOR>& NSlattice,
SuperLattice2D<T, TDESCRIPTOR>& ADlattice)
{
int voxel = 0, material = 0;
T T_x = 0, T_xplus1 = 0, T_xplus2 = 0;
T q = 0;for (int iC = 0; iC < NSlattice.getLoadBalancer().size(); iC++) {
int ny = NSlattice.getBlockLattice(iC).getNy();
int iX = 0;
for (int iY = 0; iY < ny; ++iY) {
material = superGeometry.getBlockGeometry(iC).getMaterial(iX,iY);T_x = ADlattice.getBlockLattice(iC).get(iX,iY).computeRho();
T_xplus1 = ADlattice.getBlockLattice(iC).get(iX+1,iY).computeRho();
T_xplus2 = ADlattice.getBlockLattice(iC).get(iX+2,iY).computeRho();if ( material == 2 ) {
q += (3.0*T_x – 4.0*T_xplus1 + 1.0*T_xplus2)/2.0*N;
voxel++;
}
}
}
#ifdef PARALLEL_MODE_MPI
singleton::mpi().reduceAndBcast(q, MPI_SUM);
singleton::mpi().reduceAndBcast(voxel, MPI_SUM);
#endifreturn q / (T)voxel;
}Why can the Nusselt number be computed by the density?Maybe I got it wrong.Anyway,I wonder if anyone can provide the formula or equation which the code is based on.It would mean a lot to me.Many thanks in advance!
Best Regards,
MikeMay 20, 2021 at 9:41 am #5683stephanModeratorDear Mike,
thank you for your post.
Please note that “rho” on the ADlattice refers to the zeroth moment in LBM terms, which is now the temperature (in contrast to density on NSlattice).
In the example code the computeNusselt function does:
/// Compute the nusselt number at the left wall
Hence the function uses an approximation to the normalized temperature gradient (q := local Nu = normTempGrad * L) with a finite difference (second order forward) at boundary nodes:
q += (3.0*T_x – 4.0*T_xplus1 + 1.0*T_xplus2)/2.0*N;BR
StephanMay 21, 2021 at 3:02 am #5684MikeParticipantDear Stephan,
Thanks for your reply!I am sorry for my carelessness.Your reply really helps a lot,thanks again!
Best Regards,
MikeMay 21, 2021 at 11:31 am #5689stephanModeratorDear Mike,
you are welcome! In case you need further information please let me know.
BR
Stephan -
AuthorPosts
- You must be logged in to reply to this topic.
