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:
parent
99a61df00a
commit
6eb9c42e5c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user