CUDA lattice Boltzmann, memory optimization