This paper presents the modeling and model validation for a modular two-phase heat exchanger that recovers energy in heavy-duty diesel engines. The model is developed for temperature and vapor quality prediction and for control design of the waste heat recovery system. In the studied waste heat recovery system, energy is recovered from both the exhaust gas recirculation line and the main exhaust line. Due to the similar design of these two heat exchangers, only the exhaust gas recirculation heat exchanger model is presented in this paper. Based on mass and energy conservation principles, the model describes the dynamics of two-phase fluid flow. Compared to other studies, the model is able to capture multiple phase transitions along the fluid flow by combining finite difference approach with moving boundary approaches. The developed model has low computational complexity, which makes it suitable for control design and real-time implementation. To validate the model, experiments are performed on a state-of-the-art Euro-VI heavy-duty diesel engine equipped with the waste heat recovery system. Simulation results show good accuracy, over the complete engine operating range, with average error below 4%. This is demonstrated on transitions between stationary operating points and on a dynamic response to a standard world harmonized transient cycle for both cold-start and hot-start conditions.