From 29277489e1dc800e1d510a5b780df27f3d412eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 13 Nov 2017 10:40:09 +0100 Subject: [PATCH] Make calling wsolvent() and wpolymer() always ok. With the existing code, it was a bug to call wsolvent() when the well was not a gas injector (and similar for wpolymer and water injectors). Since such calls could happen, this minor fix removes the assertation failure in those cases. --- opm/autodiff/WellInterface_impl.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opm/autodiff/WellInterface_impl.hpp b/opm/autodiff/WellInterface_impl.hpp index 7f5122070..035d9de09 100644 --- a/opm/autodiff/WellInterface_impl.hpp +++ b/opm/autodiff/WellInterface_impl.hpp @@ -298,10 +298,10 @@ namespace Opm if (injection.injectorType == WellInjector::GAS) { double solvent_fraction = well_ecl_->getSolventFraction(current_step_); return solvent_fraction; + } else { + // Not a gas injection well => no solvent. + return 0.0; } - - assert(false); - return 0.0; } @@ -323,10 +323,10 @@ namespace Opm if (injection.injectorType == WellInjector::WATER) { const double polymer_injection_concentration = polymer.m_polymerConcentration; return polymer_injection_concentration; + } else { + // Not a water injection well => no polymer. + return 0.0; } - - assert(false); // TODO: find a more logical way to handle this situation - return 0.0; }