An OpenFOAM based solver for three-phase flow in porous media incorporating foam effects | Synapse