Latent heat thermal storage (LHTS) system is a crucial technology for achieving carbon neutrality and alleviating energy stress. Although metal foam can ameliorate the thermal storage rate of the LHTS system, the impact of the inlet velocity and temperature of heat transfer fluid (HTF) on the phase transition of phase change material (PCM) needs to be properly designed to achieve optimal performance. A novel multi-channel LHTS tank with metal foam is designed. A three-dimensional numerical model is established to describe the transient melting process in the LHTS tank. Besides, a new LSTM-BP neural network is developed, in which the HTF inlet velocity, temperature and time are employed as input data. Simulated results are consistent with the previous measurement data, verifying the correctness of the numerical methods. Results suggest that the whole melting time of the PCM is diminishing with increasing HTF velocity (or temperature). The machine learning prediction results show minor differences with the simulation results. The developed machine learning model provides new adaptive approaches for thermal storage design and operation.