From 4011caec643e58144b68ae3588b78dfe1ce2e08d Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Thu, 16 Aug 2018 10:07:10 +0200 Subject: [PATCH] Update after review --- ...sTransmissibilityCalculationFeatureImp.cpp | 4 +- .../RicMultiSegmentWellExportInfo.cpp | 40 +++++------ .../RicMultiSegmentWellExportInfo.h | 24 +++---- ...ellPathExportCompletionDataFeatureImpl.cpp | 66 +++++++++---------- 4 files changed, 67 insertions(+), 67 deletions(-) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp index 2ea66f172a..f33f8214ce 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicFishbonesTransmissibilityCalculationFeatureImp.cpp @@ -78,9 +78,9 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell { for (const RicWellSegmentCompletion& lateral : location.completions()) { - for (const RicWellSegmentSubSegment& segment : lateral.subSegments()) + for (const RicWellSubSegment& segment : lateral.subSegments()) { - for (const RicWellSegmentSubSegmentIntersection& intersection : segment.intersections()) + for (const RicWellSubSegmentCellIntersection& intersection : segment.intersections()) { double diameter = location.holeDiameter(); QString completionMetaData = (location.label() + QString(": Sub: %1 Lateral: %2").arg(location.subIndex()).arg(lateral.index())); diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp index 6b3480a97d..5049925bdb 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp @@ -10,7 +10,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicWellSegmentSubSegmentIntersection::RicWellSegmentSubSegmentIntersection(const QString& gridName, +RicWellSubSegmentCellIntersection::RicWellSubSegmentCellIntersection(const QString& gridName, size_t globalCellIndex, const cvf::Vec3st& gridLocalCellIJK, const cvf::Vec3d& lengthsInCell) @@ -25,7 +25,7 @@ RicWellSegmentSubSegmentIntersection::RicWellSegmentSubSegmentIntersection(const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const QString& RicWellSegmentSubSegmentIntersection::gridName() const +const QString& RicWellSubSegmentCellIntersection::gridName() const { return m_gridName; } @@ -33,7 +33,7 @@ const QString& RicWellSegmentSubSegmentIntersection::gridName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -size_t RicWellSegmentSubSegmentIntersection::globalCellIndex() const +size_t RicWellSubSegmentCellIntersection::globalCellIndex() const { return m_globalCellIndex; } @@ -41,7 +41,7 @@ size_t RicWellSegmentSubSegmentIntersection::globalCellIndex() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -cvf::Vec3st RicWellSegmentSubSegmentIntersection::gridLocalCellIJK() const +cvf::Vec3st RicWellSubSegmentCellIntersection::gridLocalCellIJK() const { return m_gridLocalCellIJK; } @@ -49,7 +49,7 @@ cvf::Vec3st RicWellSegmentSubSegmentIntersection::gridLocalCellIJK() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const cvf::Vec3d& RicWellSegmentSubSegmentIntersection::lengthsInCell() const +const cvf::Vec3d& RicWellSubSegmentCellIntersection::lengthsInCell() const { return m_lengthsInCell; } @@ -57,7 +57,7 @@ const cvf::Vec3d& RicWellSegmentSubSegmentIntersection::lengthsInCell() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicWellSegmentSubSegment::RicWellSegmentSubSegment(double startMD, +RicWellSubSegment::RicWellSubSegment(double startMD, double deltaMD, double startTVD, double deltaTVD) @@ -73,7 +73,7 @@ RicWellSegmentSubSegment::RicWellSegmentSubSegment(double startMD, //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RicWellSegmentSubSegment::startMD() const +double RicWellSubSegment::startMD() const { return m_startMD; } @@ -81,7 +81,7 @@ double RicWellSegmentSubSegment::startMD() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RicWellSegmentSubSegment::deltaMD() const +double RicWellSubSegment::deltaMD() const { return m_deltaMD; } @@ -89,7 +89,7 @@ double RicWellSegmentSubSegment::deltaMD() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RicWellSegmentSubSegment::startTVD() const +double RicWellSubSegment::startTVD() const { return m_startTVD; } @@ -97,7 +97,7 @@ double RicWellSegmentSubSegment::startTVD() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -double RicWellSegmentSubSegment::deltaTVD() const +double RicWellSubSegment::deltaTVD() const { return m_deltaTVD; } @@ -105,7 +105,7 @@ double RicWellSegmentSubSegment::deltaTVD() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -int RicWellSegmentSubSegment::segmentNumber() const +int RicWellSubSegment::segmentNumber() const { return m_segmentNumber; } @@ -113,7 +113,7 @@ int RicWellSegmentSubSegment::segmentNumber() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -int RicWellSegmentSubSegment::attachedSegmentNumber() const +int RicWellSubSegment::attachedSegmentNumber() const { return m_attachedSegmentNumber; } @@ -121,7 +121,7 @@ int RicWellSegmentSubSegment::attachedSegmentNumber() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicWellSegmentSubSegment::setSegmentNumber(int segmentNumber) +void RicWellSubSegment::setSegmentNumber(int segmentNumber) { m_segmentNumber = segmentNumber; } @@ -129,7 +129,7 @@ void RicWellSegmentSubSegment::setSegmentNumber(int segmentNumber) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicWellSegmentSubSegment::setAttachedSegmentNumber(int attachedSegmentNumber) +void RicWellSubSegment::setAttachedSegmentNumber(int attachedSegmentNumber) { m_attachedSegmentNumber = attachedSegmentNumber; } @@ -137,7 +137,7 @@ void RicWellSegmentSubSegment::setAttachedSegmentNumber(int attachedSegmentNumbe //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicWellSegmentSubSegment::addIntersection(const RicWellSegmentSubSegmentIntersection& intersection) +void RicWellSubSegment::addIntersection(const RicWellSubSegmentCellIntersection& intersection) { m_intersections.push_back(intersection); } @@ -145,7 +145,7 @@ void RicWellSegmentSubSegment::addIntersection(const RicWellSegmentSubSegmentInt //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RicWellSegmentSubSegment::intersections() const +const std::vector& RicWellSubSegment::intersections() const { return m_intersections; } @@ -153,7 +153,7 @@ const std::vector& RicWellSegmentSubSegmen //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector& RicWellSegmentSubSegment::intersections() +std::vector& RicWellSubSegment::intersections() { return m_intersections; } @@ -205,7 +205,7 @@ void RicWellSegmentCompletion::setBranchNumber(int branchNumber) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicWellSegmentCompletion::addSubSegment(const RicWellSegmentSubSegment& subSegment) +void RicWellSegmentCompletion::addSubSegment(const RicWellSubSegment& subSegment) { m_subSegments.push_back(subSegment); } @@ -213,7 +213,7 @@ void RicWellSegmentCompletion::addSubSegment(const RicWellSegmentSubSegment& sub //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector& RicWellSegmentCompletion::subSegments() +std::vector& RicWellSegmentCompletion::subSegments() { return m_subSegments; } @@ -221,7 +221,7 @@ std::vector& RicWellSegmentCompletion::subSegments() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RicWellSegmentCompletion::subSegments() const +const std::vector& RicWellSegmentCompletion::subSegments() const { return m_subSegments; } diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h index eb9a6dd420..b35401e165 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h @@ -33,10 +33,10 @@ class RimFishbonesMultipleSubs; //================================================================================================== /// //================================================================================================== -class RicWellSegmentSubSegmentIntersection +class RicWellSubSegmentCellIntersection { public: - RicWellSegmentSubSegmentIntersection(const QString& gridName, // Pass in empty string for main grid + RicWellSubSegmentCellIntersection(const QString& gridName, // Pass in empty string for main grid size_t globalCellIndex, const cvf::Vec3st& gridLocalCellIJK, const cvf::Vec3d& lengthsInCell); @@ -54,10 +54,10 @@ private: //================================================================================================== /// //================================================================================================== -class RicWellSegmentSubSegment +class RicWellSubSegment { public: - RicWellSegmentSubSegment(double startMD, + RicWellSubSegment(double startMD, double deltaMD, double startTVD, double deltaTVD); @@ -72,10 +72,10 @@ public: void setSegmentNumber(int segmentNumber); void setAttachedSegmentNumber(int attachedSegmentNumber); - void addIntersection(const RicWellSegmentSubSegmentIntersection& intersection); + void addIntersection(const RicWellSubSegmentCellIntersection& intersection); - const std::vector& intersections() const; - std::vector& intersections(); + const std::vector& intersections() const; + std::vector& intersections(); private: @@ -86,7 +86,7 @@ private: int m_segmentNumber; int m_attachedSegmentNumber; - std::vector m_intersections; + std::vector m_intersections; }; //================================================================================================== @@ -102,15 +102,15 @@ public: int branchNumber() const; void setBranchNumber(int branchNumber); - void addSubSegment(const RicWellSegmentSubSegment& subSegment); - std::vector& subSegments(); - const std::vector& subSegments() const; + void addSubSegment(const RicWellSubSegment& subSegment); + std::vector& subSegments(); + const std::vector& subSegments() const; private: RigCompletionData::CompletionType m_completionType; size_t m_index; int m_branchNumber; - std::vector m_subSegments; + std::vector m_subSegments; }; //================================================================================================== diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 719897d70b..447137e34b 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -497,14 +497,14 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse continue; } - for (const RicWellSegmentCompletion& lateral : location.completions()) + for (const RicWellSegmentCompletion& completion : location.completions()) { - if (lateral.completionType() == RigCompletionData::ICD) // Found ICD + if (completion.completionType() == RigCompletionData::ICD) // Found ICD { formatter.comment("ICD"); - formatter.add(lateral.subSegments().front().segmentNumber()); - formatter.add(lateral.subSegments().front().segmentNumber()); - formatter.add(lateral.branchNumber()); + formatter.add(completion.subSegments().front().segmentNumber()); + formatter.add(completion.subSegments().front().segmentNumber()); + formatter.add(completion.branchNumber()); formatter.add(location.segmentNumber()); formatter.add(0.1); // ICDs have 0.1 length formatter.add(0); // Depth change @@ -513,18 +513,18 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse formatter.rowCompleted(); } else { - if (lateral.completionType() == RigCompletionData::FISHBONES) + if (completion.completionType() == RigCompletionData::FISHBONES) { formatter.comment(QString("%1 : Sub index %2 - Lateral %3") .arg(location.label()) .arg(location.subIndex()) - .arg(lateral.index())); + .arg(completion.index())); } - else if (lateral.completionType() == RigCompletionData::FRACTURE) + else if (completion.completionType() == RigCompletionData::FRACTURE) { formatter.comment(QString("%1").arg(location.label())); } - for (const RicWellSegmentSubSegment& subSegment : lateral.subSegments()) + for (const RicWellSubSegment& subSegment : completion.subSegments()) { double depth = 0; double length = 0; @@ -542,7 +542,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse double diameter = location.effectiveDiameter(); formatter.add(subSegment.segmentNumber()); formatter.add(subSegment.segmentNumber()); - formatter.add(lateral.branchNumber()); + formatter.add(completion.branchNumber()); formatter.add(subSegment.attachedSegmentNumber()); formatter.add(length); formatter.add(depth); @@ -622,9 +622,9 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(RifEclipse { aggregatedLength = location.measuredDepth(); } - for (const RicWellSegmentSubSegment& segment : completion.subSegments()) + for (const RicWellSubSegment& segment : completion.subSegments()) { - for (const RicWellSegmentSubSegmentIntersection& intersection : segment.intersections()) + for (const RicWellSubSegmentCellIntersection& intersection : segment.intersections()) { bool isSubGridIntersection = !intersection.gridName().isEmpty(); if (isSubGridIntersection == exportSubGridIntersections) @@ -670,13 +670,13 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWsegvalvTable(RifEclips } for (const RicWellSegmentLocation& location : exportInfo.wellSegmentLocations()) { - for (const RicWellSegmentCompletion& lateral : location.completions()) + for (const RicWellSegmentCompletion& completion : location.completions()) { - if (lateral.completionType() == RigCompletionData::ICD) + if (completion.completionType() == RigCompletionData::ICD) { - CVF_ASSERT(lateral.subSegments().size() == 1u); + CVF_ASSERT(completion.subSegments().size() == 1u); formatter.add(exportInfo.wellPath()->name()); - formatter.add(lateral.subSegments().front().segmentNumber()); + formatter.add(completion.subSegments().front().segmentNumber()); formatter.add(location.icdFlowCoefficient()); formatter.add(location.icdArea()); formatter.rowCompleted(); @@ -1276,11 +1276,11 @@ RicMultiSegmentWellExportInfo RicWellPathExportCompletionDataFeatureImpl::genera double icdOrificeRadius = subs->icdOrificeDiameter(unitSystem) / 2; location.setIcdArea(icdOrificeRadius * icdOrificeRadius * cvf::PI_D * subs->icdCount()); - // Add lateral for ICD - RicWellSegmentCompletion icdLateral(RigCompletionData::ICD); - RicWellSegmentSubSegment icdSegment(measuredDepth, 0.1, -position.z(), 0.0); - icdLateral.addSubSegment(icdSegment); - location.addCompletion(icdLateral); + // Add completion for ICD + RicWellSegmentCompletion icdCompletion(RigCompletionData::ICD); + RicWellSubSegment icdSegment(measuredDepth, 0.1, -position.z(), 0.0); + icdCompletion.addSubSegment(icdSegment); + location.addCompletion(icdCompletion); for (size_t lateralIndex : sub.lateralIndices) { @@ -1414,15 +1414,15 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFishbonesLateralIntersect const RigMainGrid* grid = caseToApply->eclipseCaseData()->mainGrid(); - for (RicWellSegmentCompletion& lateral : location->completions()) + for (RicWellSegmentCompletion& completion : location->completions()) { - if (lateral.index() == cvf::UNDEFINED_SIZE_T) + if (completion.completionType() != RigCompletionData::FISHBONES) { continue; } std::vector> lateralCoordMDPairs = - fishbonesSubs->coordsAndMDForLateral(location->subIndex(), lateral.index()); + fishbonesSubs->coordsAndMDForLateral(location->subIndex(), completion.index()); if (lateralCoordMDPairs.empty()) { @@ -1460,17 +1460,17 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFishbonesLateralIntersect size_t i = 0u, j = 0u, k = 0u; localGrid->ijkFromCellIndex(localGridIdx, &i, &j, &k); - RicWellSegmentSubSegment subSegment (previousExitMD, + RicWellSubSegment subSegment (previousExitMD, cellIntInfo.endMD - previousExitMD, previousExitTVD, cellIntInfo.endPoint.z() - previousExitTVD); - RicWellSegmentSubSegmentIntersection intersection(gridName, + RicWellSubSegmentCellIntersection intersection(gridName, cellIntInfo.globCellIndex, cvf::Vec3st(i, j, k), cellIntInfo.intersectionLengthsInCellCS); subSegment.addIntersection(intersection); - lateral.addSubSegment(subSegment); + completion.addSubSegment(subSegment); previousExitMD = cellIntInfo.endMD; previousExitTVD = cellIntInfo.endPoint.z(); @@ -1491,8 +1491,8 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFractureIntersections(con const RigMainGrid* grid = caseToApply->eclipseCaseData()->mainGrid(); double fractureMD = fracture->fractureMD(); - RicWellSegmentCompletion lateral(RigCompletionData::FRACTURE); - RicWellSegmentSubSegment subSegment(fracture->fractureMD(), + RicWellSegmentCompletion fractureCompletion(RigCompletionData::FRACTURE); + RicWellSubSegment subSegment(fracture->fractureMD(), fracture->fractureTemplate()->computeFractureWidth(fracture), 0.0, 0.0); @@ -1502,14 +1502,14 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFractureIntersections(con const RigCompletionDataGridCell& cell = compIntersection.completionDataGridCell(); cvf::Vec3st localIJK(cell.localCellIndexI(), cell.localCellIndexJ(), cell.localCellIndexK()); - RicWellSegmentSubSegmentIntersection intersection(cell.lgrName(), + RicWellSubSegmentCellIntersection intersection(cell.lgrName(), cell.globalCellIndex(), localIJK, cvf::Vec3d::ZERO); subSegment.addIntersection(intersection); } - lateral.addSubSegment(subSegment); - location->addCompletion(lateral); + fractureCompletion.addSubSegment(subSegment); + location->addCompletion(fractureCompletion); } //-------------------------------------------------------------------------------------------------- @@ -1576,7 +1576,7 @@ void RicWellPathExportCompletionDataFeatureImpl::assignBranchAndSegmentNumbers(c } } - // Then assign branch and segment numbers to each lateral parts + // Then assign branch and segment numbers to each completion sub segment for (RicWellSegmentLocation& location : exportInfo->wellSegmentLocations()) { assignBranchAndSegmentNumbers(caseToApply, &location, &branchNumber, &segmentNumber);