From 83274c402796b91056285f1ee506769f2a128a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 15 May 2012 14:34:56 +0200 Subject: [PATCH 1/6] compute_cell_contrib(): Advance derivative pointer for each connection. Failing to do this operation resulted in incorrect matrices in cases with anisotropic tensors and/or non-cube cells. The error has been present since the inception of this implementation. --- opm/core/pressure/tpfa/cfs_tpfa_residual.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opm/core/pressure/tpfa/cfs_tpfa_residual.c b/opm/core/pressure/tpfa/cfs_tpfa_residual.c index 6bf0c7a59..e1e42c66f 100644 --- a/opm/core/pressure/tpfa/cfs_tpfa_residual.c +++ b/opm/core/pressure/tpfa/cfs_tpfa_residual.c @@ -606,6 +606,8 @@ compute_cell_contrib(struct UnstructuredGrid *G , pimpl->ratio->mat_row[ 0 ] += s * dt * dF1; pimpl->ratio->mat_row[ off ] += s * dt * dF2; + + dv += 2 * np; /* '2' == number of one-sided derivatives. */ } } } From 156bf0a5603eb187d67b6875a6cc6ad0fc6065e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 15 May 2012 17:19:35 +0200 Subject: [PATCH 2/6] toInjectorType(): Distinguish types based on first characters only. The manual states that injection types in the "WCONINJE" keyword need only be specified using a single character. --- opm/core/WellsGroup.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/core/WellsGroup.cpp b/opm/core/WellsGroup.cpp index f892c83e9..d221e91e7 100644 --- a/opm/core/WellsGroup.cpp +++ b/opm/core/WellsGroup.cpp @@ -964,13 +964,13 @@ namespace Opm InjectionSpecification::InjectorType toInjectorType(std::string type) { - if (type == "OIL") { + if (type[0] == 'O') { return InjectionSpecification::OIL; } - if (type == "WATER") { + if (type[0] == 'W') { return InjectionSpecification::WATER; } - if (type == "GAS") { + if (type[0] == 'G') { return InjectionSpecification::GAS; } THROW("Unknown type " << type << ", could not convert to SurfaceComponent"); From 562c133dff7308c75e8a9719a4cb39b81ec248d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 15 May 2012 17:22:05 +0200 Subject: [PATCH 3/6] toInjectorType(): Pass parameter as "reference-to-const" rather than copied object. --- opm/core/WellsGroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/WellsGroup.cpp b/opm/core/WellsGroup.cpp index d221e91e7..bfedccaf2 100644 --- a/opm/core/WellsGroup.cpp +++ b/opm/core/WellsGroup.cpp @@ -962,7 +962,7 @@ namespace Opm namespace { - InjectionSpecification::InjectorType toInjectorType(std::string type) + InjectionSpecification::InjectorType toInjectorType(const std::string& type) { if (type[0] == 'O') { return InjectionSpecification::OIL; From b2770d1414adf8cd2f3f7b88e926920f74e9ad4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 16 May 2012 00:50:23 +0200 Subject: [PATCH 4/6] WCONINJE: Distinguish injectors based on first character only. This is the completion of change-set e6015b19c4e8 from WellsGroup.cpp . --- opm/core/WellsManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/core/WellsManager.cpp b/opm/core/WellsManager.cpp index 6fe66a1ea..8253d36a5 100644 --- a/opm/core/WellsManager.cpp +++ b/opm/core/WellsManager.cpp @@ -467,17 +467,17 @@ namespace Opm // Set well component fraction. double cf[3] = { 0.0, 0.0, 0.0 }; - if (wci_line.injector_type_ == "WATER") { + if (wci_line.injector_type_[0] == 'W') { if (!pu.phase_used[BlackoilPhases::Aqua]) { THROW("Water phase not used, yet found water-injecting well."); } cf[pu.phase_pos[BlackoilPhases::Aqua]] = 1.0; - } else if (wci_line.injector_type_ == "OIL") { + } else if (wci_line.injector_type_[0] == 'O') { if (!pu.phase_used[BlackoilPhases::Liquid]) { THROW("Oil phase not used, yet found oil-injecting well."); } cf[pu.phase_pos[BlackoilPhases::Liquid]] = 1.0; - } else if (wci_line.injector_type_ == "GAS") { + } else if (wci_line.injector_type_[0] == 'G') { if (!pu.phase_used[BlackoilPhases::Vapour]) { THROW("Water phase not used, yet found water-injecting well."); } From 203ebe6273176981ae228b766f20ffaba136ad22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 16 May 2012 09:24:34 +0200 Subject: [PATCH 5/6] Remove unneeded debug output. --- opm/core/WellsGroup.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/opm/core/WellsGroup.cpp b/opm/core/WellsGroup.cpp index bfedccaf2..903cc9b2f 100644 --- a/opm/core/WellsGroup.cpp +++ b/opm/core/WellsGroup.cpp @@ -1076,11 +1076,6 @@ namespace Opm if (deck.hasField("WCONPROD")) { WCONPROD wconprod = deck.getWCONPROD(); - -#if THIS_STATEMENT_IS_REALLY_NEEDED - std::cout << wconprod.wconprod.size() << std::endl; -#endif - for (size_t i = 0; i < wconprod.wconprod.size(); i++) { if (wconprod.wconprod[i].well_ == name) { WconprodLine line = wconprod.wconprod[i]; From e29364e3cc119e3fc28617b56415c65db2c9ea13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Wed, 16 May 2012 11:13:38 +0200 Subject: [PATCH 6/6] Don't #include EclipseGridInspector for the side effect of --- opm/core/fluid/RockFromDeck.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/fluid/RockFromDeck.cpp b/opm/core/fluid/RockFromDeck.cpp index 4e45b0d18..947779047 100644 --- a/opm/core/fluid/RockFromDeck.cpp +++ b/opm/core/fluid/RockFromDeck.cpp @@ -19,7 +19,8 @@ #include -#include + +#include namespace Opm {