Modeling and simulation of the heat transfer in a thermal battery