Local mesh refinement sensor for the lattice Boltzmann method