A comparative study of computational methods in cosmic gas dynamics