From f27f75b0b9ebdfb1e9d851e155b76ca34f96f2c7 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 3 Feb 2015 13:10:38 +0100 Subject: [PATCH] Use Value for Connection Factor --- opm/core/wells/WellsManager_impl.hpp | 38 +++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index abdf5f43b..bd5f0d4ba 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -166,24 +166,28 @@ void WellsManager::createWellsFromSpecs(std::vector& wells, size_t int cell = cgit->second; PerfData pd; pd.cell = cell; - if (completion->getConnectionTransmissibilityFactor() > 0.0) { - pd.well_index = completion->getConnectionTransmissibilityFactor(); - } else { - double radius = 0.5*completion->getDiameter(); - if (radius <= 0.0) { - radius = 0.5*unit::feet; - OPM_MESSAGE("**** Warning: Well bore internal radius set to " << radius); + { + const Value& transmissibilityFactor = completion->getConnectionTransmissibilityFactorAsValueObject(); + + if (transmissibilityFactor.hasValue()) { + pd.well_index = transmissibilityFactor.getValue(); + } else { + double radius = 0.5*completion->getDiameter(); + if (radius <= 0.0) { + radius = 0.5*unit::feet; + OPM_MESSAGE("**** Warning: Well bore internal radius set to " << radius); + } + + const std::array cubical = + WellsManagerDetail::getCubeDim<3>(c2f, begin_face_centroids, cell); + + const double* cell_perm = &permeability[dimensions*dimensions*cell]; + pd.well_index = + WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, + completion->getSkinFactor(), + completion->getDirection(), + ntg[cell]); } - - const std::array cubical = - WellsManagerDetail::getCubeDim<3>(c2f, begin_face_centroids, cell); - - const double* cell_perm = &permeability[dimensions*dimensions*cell]; - pd.well_index = - WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, - completion->getSkinFactor(), - completion->getDirection(), - ntg[cell]); } wellperf_data[well_index].push_back(pd); } else {