I am trying to derive lattice boltzmann equation but I have few questions:

1- we know that p=\rho R T so the speed of sound should be c_s= sqrt(\gamma R T)
in d2q9 it can be shown that RT=1/3 but how we know that \gamma =1?

2- in chapman enskong analysis
a- why we take just one scale in spatial space?
b- at wiche scale in time we should stop and how we can relate this to the selection of lattice model?

your questions are a bit tricky, but I can try to answer them.

The reason is that one result comes from the Boltzmann equation, the other from the BGK approximation of the lattice Boltzmann equation. There is no one-to-one correspondence. The temperature for the standard lattice Boltzmann approach is not defined.

It will surprise you, but in the Chapman-Enskog analysis, the time is never decomposed into different scales. What happens at some point is that people write the operator $\partial_t$ as sum of operators $\partial_t_i$ and truncate after the second or third term. If you have a look into the book by Chapman and Cowling, you will see that the time operator $\partial_t$ itself is not decomposed. It is rather terms like $\partial_t F = \sum_i epsilon^i \nabla G_i$ which can be written as a series of powers of gradients. One can show that only the leading terms (smallest i) are relevant.
In other words: time itself cannot be expanded, this is simply a wrong interpretation of the Chapman-Enskog analysis. Therefore, in the Chapman-Enskog analysis, neither time nor space are expanded.

You have to go to the proper order of epsilon. If you want to expand up to epsilon^2, you need two terms in the expansion of $\partial_t F$.

My questions not tricky but I am hitting my head in the wall trying to understand what is goning on.

I understand this now. I think the physical speed of sound can not be related to Lattice speed of sound. Also this explains why we can not use the speed of sound in unit conversion when setting up the simulation.

May be I should ask the 3rd question more clearly.
Let us say you want to recover the compressible Navier stokes equation and you have three models D2Q9, D2Q13, and D2Q17.
How you know which one will recover the compressible Navier stokes equation?
Will we need three terms in the expansion of $\partial_t F$. instead of two?

I tried to do it but I got the same Equation for the three models(It shouldn’t be the same). I know I miss something but I do not know what is it.

Yes, you should remember that most LBEs use an unphysical equation of state, because the relationship between pressure and density varies according to the scaling used. In the incompressible limit, this doesn’t really matter and setting RT=1/3 (in lattice units) is the most stable, I believe.

When you apply the Chapman-Enskog expansion to the discrete Boltzmann equation (to the correct order, with a Maxwellian equilibrium) you always get the compressible Navier-Stokes equations, as opposed to the the incompressible version. The LBE is compressible by nature, but only weakly.

I think time-derivatives are expanded in Chapman and Cowling’s book. If they weren’t, then the system would become disordered for long times (which is why the Hilbert expansion is not usually used for Navier Stokes). An LBE with q discrete particle velocities can have at most q independent moments. All the lattices you mention should, I think, give you Navier-Stokes, The differences will be in the “error”. For example, the D2Q9 lattice will give you the (weakly) compressible Navier Stokes with an order Ma^3 error. This error is due to the inability to satisfy the third order moments correctly. Larger lattices may eliminate this error.