From f5359936e0379514e9d457536e5e41522e297474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 10 Oct 2012 14:09:09 +0200 Subject: [PATCH 1/5] Bugfix: order of function arguments. Order of arguments for computePhaseFlowRatesPerWell() was wrong. This fix was done previously for SimulatorCompressibleTwophase, but the incompressible sim was ignored. Also added an ASSERT that may help catch some misuse. --- opm/core/simulator/SimulatorIncompTwophase.cpp | 2 +- opm/core/utility/miscUtilities.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/simulator/SimulatorIncompTwophase.cpp b/opm/core/simulator/SimulatorIncompTwophase.cpp index 60f63806..911c64ce 100644 --- a/opm/core/simulator/SimulatorIncompTwophase.cpp +++ b/opm/core/simulator/SimulatorIncompTwophase.cpp @@ -485,8 +485,8 @@ namespace Opm // Optionally, check if well controls are satisfied. if (check_well_controls_) { Opm::computePhaseFlowRatesPerWell(*wells_, - fractional_flows, well_state.perfRates(), + fractional_flows, well_resflows_phase); std::cout << "Checking well conditions." << std::endl; // For testing we set surface := reservoir diff --git a/opm/core/utility/miscUtilities.cpp b/opm/core/utility/miscUtilities.cpp index 53e99773..73e10ac9 100644 --- a/opm/core/utility/miscUtilities.cpp +++ b/opm/core/utility/miscUtilities.cpp @@ -553,6 +553,7 @@ namespace Opm { const int np = wells.number_of_phases; const int nw = wells.number_of_wells; + ASSERT(int(flow_rates_per_well_cell.size()) == wells.well_connpos[nw]); phase_flow_per_well.resize(nw * np); for (int wix = 0; wix < nw; ++wix) { for (int phase = 0; phase < np; ++phase) { From 0243aebcfa14b6f44d26749e36f7191709982c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 10 Oct 2012 14:12:38 +0200 Subject: [PATCH 2/5] Fix comment. --- opm/core/fluid/IncompPropertiesInterface.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/fluid/IncompPropertiesInterface.hpp b/opm/core/fluid/IncompPropertiesInterface.hpp index 4f8bfb51..d3aaaa7b 100644 --- a/opm/core/fluid/IncompPropertiesInterface.hpp +++ b/opm/core/fluid/IncompPropertiesInterface.hpp @@ -62,7 +62,7 @@ namespace Opm /// \return Array of P viscosity values. virtual const double* viscosity() const = 0; - /// Densities of fluid phases at surface conditions. + /// Densities of fluid phases at reservoir conditions. /// \return Array of P density values. virtual const double* density() const = 0; From 2ded7e7dfeff96f88e54c99f046968f97814fd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 10 Oct 2012 14:13:13 +0200 Subject: [PATCH 3/5] Table interpolation for default values improved. If there were no non-defaulted elements in the table, we would crash. Now, all defaulted elements get the value 0.0 instead. The usage pattern was encountered for the capillary pressure column of a SWOF table. --- opm/core/eclipse/EclipseGridParserHelpers.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/opm/core/eclipse/EclipseGridParserHelpers.hpp b/opm/core/eclipse/EclipseGridParserHelpers.hpp index 6ab5fb78..62c998cd 100644 --- a/opm/core/eclipse/EclipseGridParserHelpers.hpp +++ b/opm/core/eclipse/EclipseGridParserHelpers.hpp @@ -398,10 +398,17 @@ namespace yv.push_back(table[k][i]); } } - // Interpolate - for (int i=0; i Date: Wed, 10 Oct 2012 14:16:11 +0200 Subject: [PATCH 4/5] Fix bug in GCONINJE input. --- opm/core/eclipse/SpecialEclipseFields.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/eclipse/SpecialEclipseFields.hpp b/opm/core/eclipse/SpecialEclipseFields.hpp index a8a1ba11..507073d3 100644 --- a/opm/core/eclipse/SpecialEclipseFields.hpp +++ b/opm/core/eclipse/SpecialEclipseFields.hpp @@ -1047,7 +1047,7 @@ struct GCONINJE : public SpecialBase gconinje_line.injector_type_ = readString(is); gconinje_line.control_mode_ = readString(is); std::vector double_data(10, -1.0E20); - const int num_to_read = 10; + const int num_to_read = 4; int num_read = readDefaultedVectorData(is, double_data, num_to_read); gconinje_line.surface_flow_max_rate_ = double_data[0]; gconinje_line.resv_flow_max_rate_ = double_data[1]; From 6f4775df9c09a702b23fbfdfefd840150d0587d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 10 Oct 2012 19:23:11 +0200 Subject: [PATCH 5/5] Improve comment. --- opm/core/eclipse/EclipseGridParserHelpers.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/eclipse/EclipseGridParserHelpers.hpp b/opm/core/eclipse/EclipseGridParserHelpers.hpp index 62c998cd..7bc0e003 100644 --- a/opm/core/eclipse/EclipseGridParserHelpers.hpp +++ b/opm/core/eclipse/EclipseGridParserHelpers.hpp @@ -399,7 +399,8 @@ namespace } } if (xv.empty()) { - // Nothing specified, insert zeros. + // Nothing specified, the entire column is defaulted. + // We insert zeros. for (int i=0; i