  This paper aims to provide a machine learning framework to simulate two-phase
flow in porous media. The proposed algorithm is based on Physics-informed
neural networks (PINN). A novel residual-based adaptive PINN is developed and
compared with the residual-based adaptive refinement (RAR) method and with PINN
with fixed collocation points. The proposed algorithm is expected to have great
potential to be applied to different fields where adaptivity is needed. In this
paper, we focus on the two-phase flow in porous media problem. We provide two
numerical examples to show the effectiveness of the new algorithm. It is found
that adaptivity is essential to capture moving flow fronts. We show how the
results obtained through this approach are more accurate than using RAR method
or PINN with fixed collocation points, while having a comparable computational
cost.
