Thermal Energy Systems: Design and Analysis