# some small questions on lbm for thermal flow

Hi LBM-Fellows,

I am developing my own LB-Code based on GPU/CUDA.
Having finished the isothermal part, I started to add in the temperature. I have following questions:

1. should I use D3Q7 or D3Q19 for temperature? Big difference?

2. I am thinking about implementing the simple BC first, which goes like this:
temperature populations stream to the boundaries, fixed temp. value on boundaries (Dirichlet), the difference is then the unknown populations, which stream back into bulk. (In this case, D3Q7 would be more convenient.)
I see there is also regularized version for temp. BC, I want to know is there big difference in the results?

3. for 0-gradient temp. boundaries I am copying all the nearest bulk node pops to the next boundary node… I am not sure if this is correct, any ideas?

4. should collision step be done for temperature boundaries?

Thanks for any responces!
Peter

Hi Peter,

1. It depends on the system you happen to be modelling … you may need to use D3Q19 rather than D3Q7 if there are comparatively rapid heat transfers (i.e. the thermal diffusivity is low). It may also be easier for memory allocation if you use a thermal lattice with a similar number of lattice links to the isothermal lattice, although the D3Q7 lattice will perform better due to lower memory requirements.

2. The simple BC you describe is very similar to the Inamuro approach, which involves using the known populations to calculate a compensating temperature and using the equilibrium distribution function with the compensating temperature for the unknown populations. This is fairly easy to implement with any lattice scheme, although you would only need to calculate one ‘unknown’ distribution function for D3Q7 instead of five for D3Q19. I don’t know whether using a regularised BC for temperature has any significant benefit over a simpler scheme.

3. This is indeed correct, although you can also do the same by applying a Dirichlet BC at the boundary but setting the temperature to the value at that neighbouring bulk grid point. If you are interested in applying the boundary condition more accurately, you can try using both the nearest and next-nearest bulk nodes to get a more accurate temperature gradient: there is an article on the Palabos Wiki here if you would like some more information.

4. If the temperature boundaries are ‘wet’ nodes, yes, you will need to apply the collision step!

Regards,

Michael

Hi Michael,

Here are some updates of the work.

1. I have changed the whole lattice for temperature to D3Q7. Firstly just to see how it performs. The whole code gets speed doubled - I was positively surprised. Haven’t got any meaningful results though, due to bugs!

The test case I am using is closed cavity flow. Experiment data for validation comes from Tian, 2000,
“Low turbulence natural convection in an air filled square cavity”.
The Ra I wish to get for the simulation is 1.58e9. I hope the simple model I use for temperature will be stable enough. (I will know that soon, after fixing all the bugs.)

1. I have finished implementing the simple BC scheme for temperature:
f_missing = rho_bc - sum(f_known);

For the edges and corners I used following method:
f_missing = f_eq_missing - ( f_oppositeOfMissing - f_eq_oppositeOfMissing )

Here I get another problem though: Beside streaming the normal populations to the boundaries, I also streamed the “on wall” populations on the boundaries, which I think is causing the following problem:

On the top surface I added a temperature profile as dirichlet condition. If I stream the on wall pops, then at least on the edges with the temperature profile the temp. value would go crazy. I am trying to fix that.

1. Thanks for the ideas, very helpful. I will check out later.

2. OK, I added the collision step also for the temperature boundaries.
At the beginning I did all boundaries with bounce back, then I changed them to wet nodes. Much more complex, less stable, but the results get better (if no bugs exist :-).

I still have a few other small things to share and discuss, but I think we can put it another day.

Regards, Peter

The best results for Ra = 1.58e9 I got until now:

Models used:
two D3Q19 lattices, for velocity and temperature;
Dry boundary nodes - bounce back for f_vel s;
RegularizedBGK for f_vel in bulk;
BGK for f_temp in bulk;
trivial BC for f_temp (which means I just let the initial equi populations there as constants and no streaming of f_temp on or to the boundaries…);
Resolution: 128x128x128x2; U_lb = 0.02;

dear friends, I fixed the bugs I could find and finally the code runs stable with Ra=1.58e9

Then I get the strange result as shown above. This is the temperature field after 10 time steps. T_hot=1, T_cold=0.
The max. values of temperature goes now way over 1 and 0!
I guess the reason is the BC type I implemented.
Anyone else has faced the same problem? Any ideas how can I improve this?

Thanks,
Peter