Skip to content

Thermal Channel Flow 2D

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #7375

    Dear Developers,

    I am currently simulating a non-isothermal flow in a 2D channel with a hot wall with temperature of 80C and the fluid is flowing initially with a temperature of 20C. The thing is that I notice at the start of the simulation, that fluid inlet will have a temperature less than 20 which is not possible. I defined the lattice of my simulation as the following:

    Code snippet:

    NSlattice.defineDynamics<NoDynamics>(superGeometry, 0);
    NSlattice.defineDynamics<ForcedBulkDynamics>(superGeometry.getMaterialIndicator({1, 2 ,3}));
    NSlattice.defineDynamics<BounceBack>(superGeometry, 4);

    ADlattice.defineDynamics<NoDynamics>(superGeometry, 0);
    ADlattice.defineDynamics<AdvectionDiffusionBGKdynamics>(superGeometry.getMaterialIndicator({1, 2 ,3}));

    int Lx = converter.getLatticeLength( lx );
    int Ly = converter.getLatticeLength( ly );

    T p0 = 8. * converter.getLatticeViscosity() * converter.getCharLatticeVelocity()*Lx/( Ly*Ly );
    AnalyticalLinear2D<T,T> rho( -p0/lx*invCs2<T,NSDESCRIPTOR>(), 0, p0*invCs2<T,NSDESCRIPTOR>()+1 );

    const T maxVelocity = converter.getCharLatticeVelocity();
    const T radius = 0.5* ly;
    std::vector<T> axisPoint( 2,T() );
    axisPoint[0] = lx/2.;
    axisPoint[1] = ly/2.;
    std::vector<T> axisDirection(2,T());
    axisDirection[0] = 1;
    axisDirection[1] = 0;

    Poiseuille2D<T> u( axisPoint, axisDirection, maxVelocity, radius );

    std::vector<T> zero(2, T());
    AnalyticalConst2D<T, T> u0(zero);
    AnalyticalConst2D<T, T> one(1.);
    AnalyticalConst2D<T,T> T_cold(converter.getLatticeTemperature(Tcold));
    AnalyticalConst2D<T,T> T_Hot(converter.getLatticeTemperature(Thot));
    std::vector<T> velocity( 2,T( 0 ) );
    //velocity[0] = converter.getCharLatticeVelocity();
    //AnalyticalConst2D<T, T> u(velocity);
    //AnalyticalConst2D<T,T> rho(1);

    // Initialize all values of distribution functions to their local equilibrium
    NSlattice.defineRhoU(superGeometry, 0, rho, u0);
    NSlattice.iniEquilibrium(superGeometry, 0, rho, u0);
    NSlattice.defineRhoU( superGeometry, 1, rho, u );
    NSlattice.iniEquilibrium( superGeometry, 1, rho, u );
    NSlattice.defineRhoU( superGeometry, 2, rho, u );
    NSlattice.iniEquilibrium( superGeometry, 2, rho, u );
    NSlattice.defineRhoU( superGeometry, 3, rho, u0 );
    NSlattice.iniEquilibrium( superGeometry, 3, rho, u0 );
    NSlattice.defineRhoU( superGeometry, 4, rho, u0 );
    NSlattice.iniEquilibrium( superGeometry, 4, rho, u0 );

    ADlattice.defineRho(superGeometry, 1, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 1, T_cold, u);
    ADlattice.defineRho(superGeometry, 2, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 2, T_cold, u);
    ADlattice.defineRho(superGeometry, 3, T_cold);
    ADlattice.iniEquilibrium(superGeometry, 3, T_cold, u0);
    ADlattice.defineRho(superGeometry, 4, T_Hot);
    ADlattice.iniEquilibrium(superGeometry, 4, T_Hot, u0);
    ////////////////////////////////////////////////////// End of the code:
    Material 1 is the fluid, 3 is the inlet, 2 is the outlet and 4 is the heating walls
    Kindly point out the cause of this problem.

    • This topic was modified 1 year, 2 months ago by Jijo.

    Dear community,

    Quick note, I also notice that the velocity is decreasing gradually. I wonder why? Maybe this is the main cause. I used different BCs, reduced the time step and the grid length but the reducing effect is still there.



    Dear Anas,

    which boundary conditions did you apply? There seems to be a problem..



    Dear Dr. Mathias,

    I used the interpolated velocity and pressure for the inlet and outlet, respectively. For the walls, I used bounce back for the NSlattice and drichlet (constant T) for the ADlattice.



    Dear Anas,

    please, have a look at our other examples on thermal flows. There might be a similar situation which you can copy paste from.



    Dear Dr. Mathias,

    I appreciate your reply but I could not find any example on forced convection flow. So I have combined two examples together. My main problem is that the velocity profile weakens during the run. by that I mean it decreases. My analysis is a transient so it must stay consistent throughout the run. Any suggestions on that?



    Its not possible to answer it without knowing the details. E-mail me to set up a common project..

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