The compactness theorem is proved for sequences of functions that have estimates of the higher derivatives in each subdomain of the domain of definition, divided into parts by a sequence of some curves of class W_2^1. At the same time, in the entire domain of determining summable higher derivatives, these sequences do not have. These results allow us to make limit transitions using approximate solutions in problems with an unknown boundary that describe the processes of phase transitions.