Two-tank molten salt (MS) thermal energy storage (TES) technology is an efficient and widely used energy storage technology. This study develops a two-dimensional discrete model (2DIM) using the Modelica language to accurately and quickly represent molten salt temperature distribution and heat loss, applicable to system-level analysis in thermal power systems. It also uncovers variations in heat loss, cooling rate, and required auxiliary electric heating power across different tank volumes, liquid levels, and MS temperatures, offering guidance for optimizing design, energy management, and operational strategies. Additionally, the study examined the impact of different electric heater placements on the performance of the thermal storage system. The results show that heating the gas inside the tank is more effective than traditional direct electric heating, reducing molten salt heat loss by 25.89 % and increasing energy storage efficiency by 0.17 %.The research provide a reference for the study of efficient utilization of TES tank in different thermal systems.