As of 1 April 2026, the PSJD database will become an archive and will no longer accept new data. Current publications from Polish scientific journals are available through the Library of Science: https://bibliotekanauki.pl
In this paper we describe an algorithm for solving the one-dimensional Stefan problem by involving metal shrinkage. In this algorithm we use the finite element method supplemented by the procedures allowing to define the position of moving interface and the change material size associated with shrinkage. We present also some examples illustrating the precision of the presented method.