From f32198a0402f69d893ac9100f135f81572694d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 7 Aug 2014 12:57:05 +0200 Subject: [PATCH] Properly handle defaulted well reference depths. --- opm/core/wells/WellsManager_impl.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index 36e231c6..6f877b5d 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -101,11 +101,11 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t well_names.push_back(well->name()); { WellData wd; - // If negative (defaulted), set refdepth to a marker + // If defaulted, set refdepth to a marker // value, will be changed after getting perforation // data to the centroid of the cell of the top well // perforation. - wd.reference_bhp_depth = (well->getRefDepth() < 0.0) ? -1e100 : well->getRefDepth(); + wd.reference_bhp_depth = (well->getRefDepthDefaulted()) ? -1e100 : well->getRefDepth(); wd.welspecsline = -1; if (well->isInjector( timeStep )) wd.type = INJECTOR; @@ -160,7 +160,7 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t assert(dimensions == 3); for (int w = 0; w < num_wells; ++w) { num_perfs += wellperf_data[w].size(); - if (well_data[w].reference_bhp_depth < 0.0) { + if (well_data[w].reference_bhp_depth == -1e100) { // It was defaulted. Set reference depth to minimum perforation depth. double min_depth = 1e100; int num_wperfs = wellperf_data[w].size();