Pore-by-pore modeling, analysis, and prediction of two-phase flow in mixed-wet rocks.