Viewing 4 posts - 1 through 4 (of 4 total)
• Author
Posts
• #5669
Mike
Participant

Dear everyone,

I am confused with the function ComputeNusselt() in squarecavity2d:
T computeNusselt(SuperGeometry2D<T>& superGeometry,
SuperLattice2D<T, NSDESCRIPTOR>& NSlattice,
{
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);

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);
#endif

return 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,
Mike

#5683
stephan
Moderator

Dear Mike,

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
Stephan

#5684
Mike
Participant

Dear Stephan,

Best Regards,
Mike

#5689
stephan
Moderator

Dear Mike,

you are welcome! In case you need further information please let me know.

BR
Stephan

Viewing 4 posts - 1 through 4 (of 4 total)
• You must be logged in to reply to this topic.