Optimal DHC energy supply harnessing its thermal mass