Despite the large quantity of works dedicated to the analysis and modelling of deposition in single-phase flows, very few models have been proposed for deposition of solids in two-phase pipe flows of gas and liquid. A comprehensive mechanistic model for transient, multiphase pipe flow with phase change is proposed, which takes into account effects of deposition by mass diffusion, ageing, and shearing of the deposit layer. Validation is performed with an exhaustive database of experimental data from the literature, for steady and transient flows without deposition, and deposit thickness measurements for single-phase, slug and stratified flows. Most of the predictions are within a ±20% error band from the experimental data, with slightly worse performance in the case of deposition in slug flows. A surrogate model is also developed based on active-learning sampling of the simulator results, demonstrating a technique that could be used for optimization or design of engineering devices.