Heat storage in direct-contact heat exchanger with phase change material