Controlling the flow of liquid in a heat pump system