A thermodynamical framework for the solidification of molten polymers and its application to fiber extrusion