Properly handle defaulted well reference depths.

This commit is contained in:
Atgeirr Flø Rasmussen 2014-08-07 12:57:05 +02:00
parent 115914119b
commit f32198a040

View File

@ -101,11 +101,11 @@ void WellsManager::createWellsFromSpecs(std::vector<WellConstPtr>& wells, size_t
well_names.push_back(well->name()); well_names.push_back(well->name());
{ {
WellData wd; WellData wd;
// If negative (defaulted), set refdepth to a marker // If defaulted, set refdepth to a marker
// value, will be changed after getting perforation // value, will be changed after getting perforation
// data to the centroid of the cell of the top well // data to the centroid of the cell of the top well
// perforation. // perforation.
wd.reference_bhp_depth = (well->getRefDepth() < 0.0) ? -1e100 : well->getRefDepth(); wd.reference_bhp_depth = (well->getRefDepthDefaulted()) ? -1e100 : well->getRefDepth();
wd.welspecsline = -1; wd.welspecsline = -1;
if (well->isInjector( timeStep )) if (well->isInjector( timeStep ))
wd.type = INJECTOR; wd.type = INJECTOR;
@ -160,7 +160,7 @@ void WellsManager::createWellsFromSpecs(std::vector<WellConstPtr>& wells, size_t
assert(dimensions == 3); assert(dimensions == 3);
for (int w = 0; w < num_wells; ++w) { for (int w = 0; w < num_wells; ++w) {
num_perfs += wellperf_data[w].size(); 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. // It was defaulted. Set reference depth to minimum perforation depth.
double min_depth = 1e100; double min_depth = 1e100;
int num_wperfs = wellperf_data[w].size(); int num_wperfs = wellperf_data[w].size();