Solution of Stefan problems imposed with cyclic temperature and flux boundary conditions