Skip to content

ComputeNusselt

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

    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
    Stephan

    #5684
    Mike
    Participant

    Dear Stephan,

    Thanks for your reply!I am sorry for my carelessness.Your reply really helps a lot,thanks again!

    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.