Thermal Channel Flow 2D
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Thermal Channel Flow 2D
- This topic has 6 replies, 2 voices, and was last updated 1 year, 10 months ago by mathias.
-
AuthorPosts
-
April 7, 2023 at 2:50 am #7375JijoParticipant
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.
Regards,
Anas- This topic was modified 1 year, 11 months ago by Jijo.
April 9, 2023 at 4:44 am #7377JijoParticipantDear 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.
Sincerely,
AnasApril 9, 2023 at 10:46 am #7378mathiasKeymasterDear Anas,
which boundary conditions did you apply? There seems to be a problem..
Best
MathiasApril 9, 2023 at 7:37 pm #7381JijoParticipantDear 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.
Sincerely,
AnasApril 10, 2023 at 2:53 pm #7387mathiasKeymasterDear Anas,
please, have a look at our other examples on thermal flows. There might be a similar situation which you can copy paste from.
Best
MathiasMay 22, 2023 at 8:59 am #7475JijoParticipantDear 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?
regards
May 22, 2023 at 2:35 pm #7476mathiasKeymasterIts not possible to answer it without knowing the details. E-mail me to set up a common project..
-
AuthorPosts
- You must be logged in to reply to this topic.