diff --git a/opm/material/constraintsolvers/ChiFlash.hpp b/opm/material/constraintsolvers/ChiFlash.hpp index 8cc954537..77d691cd6 100644 --- a/opm/material/constraintsolvers/ChiFlash.hpp +++ b/opm/material/constraintsolvers/ChiFlash.hpp @@ -931,8 +931,11 @@ protected: { // (f_liquid/f_vapor) - 1 = 0 - auto local_res = (fluid_state.fugacity(oilPhaseIdx, compIdx) / - fluid_state.fugacity(gasPhaseIdx, compIdx)) - 1.0; + /* auto local_res = (fluid_state.fugacity(oilPhaseIdx, compIdx) / + fluid_state.fugacity(gasPhaseIdx, compIdx)) - 1.0; */ + // TODO: it looks this formulation converges quicker while begin with bigger residual + auto local_res = (fluid_state.fugacity(oilPhaseIdx, compIdx) - + fluid_state.fugacity(gasPhaseIdx, compIdx)); res[compIdx + numComponents] = Opm::getValue(local_res); for (unsigned i = 0; i < num_equation; ++i) { jac[compIdx + numComponents][i] = local_res.derivative(i); diff --git a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh b/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh index 32b625972..fd9a04474 100644 --- a/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh +++ b/opm/material/fluidsystems/chifluid/juliathreecomponentfluidsystem.hh @@ -158,6 +158,8 @@ namespace Opm { assert(0 <= phaseIdx && phaseIdx < numPhases); assert(0 <= compIdx && compIdx < numComponents); + // TODO: here the derivatives for the phi are dropped. Should we keep the derivatives against the pressure + // and temperature? Scalar phi = Opm::getValue( PengRobinsonMixture::computeFugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx)); return phi;