Analysis and optimization of a latent thermal energy storage system with embedded heat pipes