From 3e2907f4bd0bffee1f41cdadab07efc4f4bf3c77 Mon Sep 17 00:00:00 2001 From: Liu Ming Date: Wed, 3 Aug 2016 11:10:37 +0800 Subject: [PATCH] fix polymer in flow bug. --- opm/polymer/PolymerInflow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opm/polymer/PolymerInflow.cpp b/opm/polymer/PolymerInflow.cpp index 2c9f103c4..b280c4e55 100644 --- a/opm/polymer/PolymerInflow.cpp +++ b/opm/polymer/PolymerInflow.cpp @@ -72,12 +72,14 @@ namespace Opm { ScheduleConstPtr schedule = eclipseState->getSchedule(); for (const auto& well : schedule->getWells(currentStep)) { - WellInjectionProperties injection = well->getInjectionProperties(currentStep); - if (injection.injectorType == WellInjector::WATER) { - WellPolymerProperties polymer = well->getPolymerProperties(currentStep); - wellPolymerRate_.insert(std::make_pair(well->name(), polymer.m_polymerConcentration)); - } else { - OPM_THROW(std::logic_error, "For polymer injector you must have a water injector"); + if (well->isInjector(currentStep)) { + WellInjectionProperties injection = well->getInjectionProperties(currentStep); + if (injection.injectorType == WellInjector::WATER) { + WellPolymerProperties polymer = well->getPolymerProperties(currentStep); + wellPolymerRate_.insert(std::make_pair(well->name(), polymer.m_polymerConcentration)); + } else { + OPM_THROW(std::logic_error, "For polymer injector you must have a water injector"); + } } } }