Comprehensive analytical model of energy and exergy performance of the thermal energy storage