From 8ede0e67b2e5610384bbad400ae71f9545ee6504 Mon Sep 17 00:00:00 2001 From: hnil Date: Fri, 21 Oct 2022 12:51:05 +0200 Subject: [PATCH] - made heuristic scaling of trueimpes --- opm/simulators/linalg/getQuasiImpesWeights.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/simulators/linalg/getQuasiImpesWeights.hpp b/opm/simulators/linalg/getQuasiImpesWeights.hpp index 455fdcb7e..cf2cb8090 100644 --- a/opm/simulators/linalg/getQuasiImpesWeights.hpp +++ b/opm/simulators/linalg/getQuasiImpesWeights.hpp @@ -122,7 +122,11 @@ namespace Amg VectorBlockType bweights; MatrixBlockType block_transpose = Details::transposeDenseMatrix(block); block_transpose.solve(bweights, rhs); - bweights /= 1000.0; // given normal densities this scales weights to about 1. + double abs_max = *std::max_element( + bweights.begin(), bweights.end(), [](double a, double b) { return std::fabs(a) < std::fabs(b); }); + // probably a scaling which could give approximately total compressibility would be better + bweights /= std::fabs(abs_max); // given normal densities this scales weights to about 1. + weights[index] = bweights; ++index; }