A two-phase hydrothermal cooling model for shallow intrusions