Dynamics of heat and mass transfer and phase transformations in porous systems