The goal of this project was to simulate the multiphase flow through porous and poroelastic media using the Galerkin FEM. The project was accomplished in 2014-2016. The C++ code posted in this repository was used for the main results of my papers: Q. Deng, V. Ginting. Locally conservative continuous Galerkin finite element method for pressure equation in two-phase flow model in subsurfaces, Journal of Scientific Computing, 74 (3), 2018, 1264β1285; Q. Deng, V. Ginting, B. McCaskill, P. Torsu. A locally conservative stabilized continuous Galerkin finite element method for two-phase flow in poroelastic subsurfaces, Journal of Computational Physics, 347 (2017), 78β98.