Thermodynamic and economic analysis of a heat recovery system