LiveOilPvt: fix convergence criterium for oilSaturationPressure()

in some cases this pressure can be quite low (e.g. 0), and für
slightly inconsistent decks it can be even negative, so it makes sense
to compare the absolute values and to add an absolute convergence
criterion.
This commit is contained in:
Andreas Lauser 2015-07-03 11:51:14 +02:00
parent 99a61df00a
commit 6eb9c42e5c
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
Copyright (C) 2011-2013 by Andreas Lauser
Copyright (C) 2011-2015 by Andreas Lauser
This file is part of the Open Porous Media project (OPM).
@ -405,7 +405,6 @@ public:
// calculate the mass fractions of gas and oil
const auto& XoG = saturatedOilGasMassFraction(temperature, pressure, regionIdx);
// ATTENTION: XoG is represented by the _first_ axis!
return oilFormationVolumeFactor(temperature, pressure, XoG, regionIdx);
}

View File

@ -482,7 +482,8 @@ private:
const LhsEval& delta = f/fPrime;
pSat -= delta;
if (std::abs(Toolbox::value(delta)) < Toolbox::value(pSat) * 1e-10)
Scalar absDelta = std::abs(Toolbox::value(delta));
if (absDelta < Toolbox::value(pSat) * 1e-10 || absDelta < 1e-4)
return pSat;
}