mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1519 from joakim-hove/completion-refactor
Completion refactor
This commit is contained in:
commit
7568ec0f90
@ -58,9 +58,8 @@ namespace Opm
|
||||
// initialize the segment_perforations_
|
||||
const WellConnections& completion_set = well_ecl_->getConnections(current_step_);
|
||||
for (int perf = 0; perf < number_of_perforations_; ++perf) {
|
||||
const Connection& completion = completion_set.get(perf);
|
||||
const int segment_number = completion.getSegmentNumber();
|
||||
const int segment_index = segmentNumberToIndex(segment_number);
|
||||
const Connection& connection = completion_set.get(perf);
|
||||
const int segment_index = segmentNumberToIndex(connection.segment_number);
|
||||
segment_perforations_[segment_index].push_back(perf);
|
||||
}
|
||||
|
||||
@ -81,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).getCenterDepth();
|
||||
perf_depth_[perf] = completion_set.get(perf).center_depth;
|
||||
perforation_segment_depth_diffs_[perf] = perf_depth_[perf] - segment_depth;
|
||||
}
|
||||
}
|
||||
|
@ -757,7 +757,7 @@ namespace Opm
|
||||
const auto& completionSet = well_ecl_->getConnections(current_step_);
|
||||
for (size_t c=0; c<completionSet.size(); c++) {
|
||||
const auto& completion = completionSet.get(c);
|
||||
if (completion.getState() == WellCompletion::OPEN) {
|
||||
if (completion.state == WellCompletion::OPEN) {
|
||||
const int i = completion.getI();
|
||||
const int j = completion.getJ();
|
||||
const int k = completion.getK();
|
||||
@ -781,12 +781,10 @@ namespace Opm
|
||||
const std::array<double, 3> cubical =
|
||||
WellsManagerDetail::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
|
||||
|
||||
WellCompletion::DirectionEnum direction = completion.getDirection();
|
||||
|
||||
double re; // area equivalent radius of the grid block
|
||||
double perf_length; // the length of the well perforation
|
||||
|
||||
switch (direction) {
|
||||
switch (completion.dir) {
|
||||
case Opm::WellCompletion::DirectionEnum::X:
|
||||
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
|
||||
perf_length = cubical[0];
|
||||
|
@ -558,9 +558,8 @@ namespace Opm
|
||||
// that is why I think we should use a well model to initialize the WellState here
|
||||
std::vector<std::vector<int>> segment_perforations(well_nseg);
|
||||
for (int perf = 0; perf < nperf; ++perf) {
|
||||
const Connection& completion = completion_set.get(perf);
|
||||
const int segment_number = completion.getSegmentNumber();
|
||||
const int segment_index = segment_set.segmentNumberToIndex(segment_number);
|
||||
const Connection& connection = completion_set.get(perf);
|
||||
const int segment_index = segment_set.segmentNumberToIndex(connection.segment_number);
|
||||
segment_perforations[segment_index].push_back(perf);
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
|
||||
// shut completions and open ones stored in this process will have 1 others 0.
|
||||
|
||||
for(const auto& completion : well->getConnections(timeStep)) {
|
||||
if (completion.getState() == WellCompletion::OPEN) {
|
||||
if (completion.state == WellCompletion::OPEN) {
|
||||
int i = completion.getI();
|
||||
int j = completion.getJ();
|
||||
int k = completion.getK();
|
||||
@ -195,7 +195,7 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
|
||||
pd.cell = cell;
|
||||
{
|
||||
const Value<double>& transmissibilityFactor = completion.getConnectionTransmissibilityFactorAsValueObject();
|
||||
const double wellPi = completion.getWellPi();
|
||||
const double wellPi = completion.wellPi;
|
||||
if (transmissibilityFactor.hasValue()) {
|
||||
pd.well_index = transmissibilityFactor.getValue();
|
||||
} else {
|
||||
@ -217,17 +217,17 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
|
||||
pd.well_index =
|
||||
WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm,
|
||||
completion.getSkinFactor(),
|
||||
completion.getDirection(),
|
||||
completion.dir,
|
||||
ntg[cell]);
|
||||
}
|
||||
pd.satnumid = completion.getSatTableId();
|
||||
pd.satnumid = completion.sat_tableId;
|
||||
pd.well_index *= wellPi;
|
||||
}
|
||||
wellperf_data[active_well_index].push_back(pd);
|
||||
}
|
||||
} else {
|
||||
if (completion.getState() != WellCompletion::SHUT) {
|
||||
OPM_THROW(std::runtime_error, "Completion state: " << WellCompletion::StateEnum2String( completion.getState() ) << " not handled");
|
||||
if (completion.state != WellCompletion::SHUT) {
|
||||
OPM_THROW(std::runtime_error, "Completion state: " << WellCompletion::StateEnum2String( completion.state ) << " not handled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user