Analytical solutions for freezing a saturated liquid inside or outside cylinders