Nuclear magnetic resonance studies to characterize phase transitions in porous systems