From 25c4a8c1560f94a42e94bfd19e6007ddb439875b Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 19 Jul 2016 18:13:38 +0200 Subject: [PATCH] fix incorrect derivative of rock compressibility w.r.t. pressure since f(x) = 1 + 0.5*g(x)*g(x) the derivative is f'(x) = 0 + 2*0.5*g(x) * g'(x) = g(x)*g'(x) note that the previous incorrect values do not affect the quality of the obtained results (if the tolerance of the non-linear solver is chosen to be small enough), but it may have deteriorated convergence rates. --- opm/core/props/rock/RockCompressibility.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/props/rock/RockCompressibility.cpp b/opm/core/props/rock/RockCompressibility.cpp index 2f0b48f7..b4f48ad5 100644 --- a/opm/core/props/rock/RockCompressibility.cpp +++ b/opm/core/props/rock/RockCompressibility.cpp @@ -101,7 +101,8 @@ namespace Opm if (p_.empty()) { // Approximating poro multiplier with a quadratic curve, // we must use its derivative. - return rock_comp_ + 2 * rock_comp_ * rock_comp_ * (pressure - pref_); + const double cpnorm = rock_comp_*(pressure - pref_); + return rock_comp_ + cpnorm*rock_comp_; } else { return Opm::linearInterpolationDerivative(p_, poromult_, pressure); }