Abstract Utilization of neural networks to solve physical problems has been receiving wide attention recently. These neural networks are commonly named physics-informed neural network (PINN), in which the physics are employed through the governing partial differential equations (PDEs). Traditional PINNs suffer from unstable performance when dealing with flow problems in highly heterogeneous domains. This work presents the applicability of the extended PINN (XPINN) method in solving heterogeneous problems. XPINN can create a full solution model to the solution of the governing PDEs by training the neural network on the PDEs and its constraints such as boundary and initial conditions, and known solution points. The heterogeneous problem is solved by performing domain decomposition, which divides the original heterogeneous domain into various homogeneous sub-domains. Each sub-domain incorporates its own PINN structure. The different PINNs are connected through interface conditions, allowing for information to communicate across the interfaces. These conditions include pressure and flux continuities. Various heterogeneous scenarios are implemented in this study to investigate the robustness of the proposed method. We demonstrate the accuracy of the XPINN model by comparing it with the ground truth solved from high-fidelity simulations. Results show a good match in terms of pressure and velocity with errors of less than 1%. Different interface conditions were tested, and it was observed that without the inclusion of pressure and flux continuities, the solver does not converge to the solution of interest. Sensitivity analysis was performed to explore the effects of the neural network architecture, the weights given to each loss term, and the number of training iterations. Results show that wide and shallow networks performed well due to avoiding the gradient vanishing issue that comes with deeper networks. In addition, balanced weights produced better accuracy in general. Moreover, more training iterations improved the accuracy of the results but at lower rates in later training stages. This paper presents XPINN to solve fluid flow in heterogeneous media. We demonstrate the robustness and accuracy of the proposed XPINN model by comparing it with the ground truth solutions in multiple heterogeneous cases. The model shows good potential and can be readily implemented in reservoir characterization workflow.