From 52d97cfc1c702370186c2b6088ce20a2d7709494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 8 Oct 2012 14:26:46 +0200 Subject: [PATCH 1/2] Fix order of arguments in function call. Rate and fractional flow were switched in call to computePhaseFlowRatesPerWell(). --- opm/core/simulator/SimulatorCompressibleTwophase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/simulator/SimulatorCompressibleTwophase.cpp b/opm/core/simulator/SimulatorCompressibleTwophase.cpp index 6fb475e9..e921db87 100644 --- a/opm/core/simulator/SimulatorCompressibleTwophase.cpp +++ b/opm/core/simulator/SimulatorCompressibleTwophase.cpp @@ -407,8 +407,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 From 9de3b03e69b32004254d83c935614c692e2e2c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 8 Oct 2012 14:27:56 +0200 Subject: [PATCH 2/2] Fix sign of production rate controls. In the Wells struct, production rate control targets must be negative (and injection rate control targets are always positive). In the WellsGroup classes, there are separate variables for injection and production, and all rates are positive. Therefore, upon adding or modification of a production rate control, the negated value must be used. --- opm/core/wells/WellsGroup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opm/core/wells/WellsGroup.cpp b/opm/core/wells/WellsGroup.cpp index afa17f12..c340c1ae 100644 --- a/opm/core/wells/WellsGroup.cpp +++ b/opm/core/wells/WellsGroup.cpp @@ -863,7 +863,7 @@ namespace Opm return; } // We're a producer, so we need to negate the input - double ntarget = target; + double ntarget = -target; double distr[3] = { 0.0, 0.0, 0.0 }; const int* phase_pos = phaseUsage().phase_pos;