Second-law design of a latent heat thermal energy storage with branched fins