Merge pull request #1548 from joakim-hove/connection-updates

Get connection properties directly from the opm-common
This commit is contained in:
Joakim Hove
2018-09-11 13:19:07 +02:00
committed by GitHub
5 changed files with 14 additions and 180 deletions

View File

@@ -59,7 +59,7 @@ namespace Opm
const WellConnections& completion_set = well_ecl_->getConnections(current_step_);
for (int perf = 0; perf < number_of_perforations_; ++perf) {
const Connection& connection = completion_set.get(perf);
const int segment_index = segmentNumberToIndex(connection.segment_number);
const int segment_index = segmentNumberToIndex(connection.segment());
segment_perforations_[segment_index].push_back(perf);
}
@@ -80,7 +80,7 @@ namespace Opm
for (int seg = 0; seg < numberOfSegments(); ++seg) {
const double segment_depth = segmentSet()[seg].depth();
for (const int perf : segment_perforations_[seg]) {
perf_depth_[perf] = completion_set.get(perf).center_depth;
perf_depth_[perf] = completion_set.get(perf).depth();
perforation_segment_depth_diffs_[perf] = perf_depth_[perf] - segment_depth;
}
}

View File

@@ -552,7 +552,7 @@ namespace Opm
for (const auto& completion : completions) {
int complnum = completion.first;
for (int perf = 0; perf < perf_number; ++perf) {
if (complnum == connections.get ( perf ).complnum) {
if (complnum == connections.get ( perf ).complnum()) {
water_cut_in_completions[complnumIdx] += water_cut_perf[perf];
}
}
@@ -730,7 +730,7 @@ namespace Opm
bool allCompletionsClosed = true;
const auto& connections = well_ecl_->getConnections(current_step_);
for (const auto& connection : connections) {
if (!wellTestState.hasCompletion(name(), connection.complnum)) {
if (!wellTestState.hasCompletion(name(), connection.complnum())) {
allCompletionsClosed = false;
}
}
@@ -802,7 +802,7 @@ namespace Opm
const auto& connectionSet = well_ecl_->getConnections(current_step_);
for (size_t c=0; c<connectionSet.size(); c++) {
const auto& connection = connectionSet.get(c);
if (connection.state == WellCompletion::OPEN) {
if (connection.state() == WellCompletion::OPEN) {
const int i = connection.getI();
const int j = connection.getJ();
const int k = connection.getK();
@@ -817,19 +817,14 @@ namespace Opm
const int cell = cgit->second;
{
double radius = 0.5*connection.getDiameter();
if (radius <= 0.0) {
radius = 0.5*unit::feet;
OPM_MESSAGE("**** Warning: Well bore internal radius set to " << radius);
}
double radius = connection.rw();
const std::array<double, 3> cubical =
WellsManagerDetail::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
double re; // area equivalent radius of the grid block
double perf_length; // the length of the well perforation
switch (connection.dir) {
switch (connection.dir()) {
case Opm::WellCompletion::DirectionEnum::X:
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
perf_length = cubical[0];
@@ -918,7 +913,7 @@ namespace Opm
const auto& connections = well_ecl_->getConnections(current_step_);
int perfIdx = 0;
for (const auto& connection : connections) {
if (wellTestState.hasCompletion(name(), connection.complnum)) {
if (wellTestState.hasCompletion(name(), connection.complnum())) {
well_index_[perfIdx] = 0.0;
}
perfIdx++;

View File

@@ -559,7 +559,7 @@ namespace Opm
std::vector<std::vector<int>> segment_perforations(well_nseg);
for (int perf = 0; perf < nperf; ++perf) {
const Connection& connection = completion_set.get(perf);
const int segment_index = segment_set.segmentNumberToIndex(connection.segment_number);
const int segment_index = segment_set.segmentNumberToIndex(connection.segment());
segment_perforations[segment_index].push_back(perf);
}