Dynamic optimization of thermodynamically rigorous models of multiphase flow in porous subsurface oil reservoirs. (June 2019)