From a8d067af184071e67f41f66122032c512eae09b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 20 Mar 2012 11:21:02 +0100 Subject: [PATCH] Solve(rock_comp): Refactor rock-compressibility diagonal term calculation. --- opm/core/pressure/IncompTpfa.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opm/core/pressure/IncompTpfa.cpp b/opm/core/pressure/IncompTpfa.cpp index d202eea0..fce337fe 100644 --- a/opm/core/pressure/IncompTpfa.cpp +++ b/opm/core/pressure/IncompTpfa.cpp @@ -187,8 +187,9 @@ namespace Opm for (int c = 0; c < gg->number_of_cells; ++c) { // Find diagonal size_t j = csrmatrix_elm_index(c, c, h_->A); - h_->A->sa[j] += porevol[c]*rock_comp[c]/dt; - h_->b[c] += porevol[c]*rock_comp[c]*pressure[c]/dt; + double d = porevol[c] * rock_comp[c] / dt; + h_->A->sa[j] += d; + h_->b[c] += d * pressure[c]; } }