diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp index 7fd77802ce..0c074385a2 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesLateralsFeature.cpp @@ -86,11 +86,11 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked) { if (!fishbone->isChecked()) continue; - for (size_t subIndex = 0; subIndex < fishbone->locationOfSubs().size(); subIndex++) + for (auto& sub : fishbone->installedLateralIndices()) { - for (size_t lateralIndex = 0; lateralIndex < fishbone->lateralLengths().size(); lateralIndex++) + for (size_t lateralIndex : sub.lateralIndices) { - std::vector> coordsAndMD = fishbone->coordsAndMDForLateral(subIndex, lateralIndex); + std::vector> coordsAndMD = fishbone->coordsAndMDForLateral(sub.subIndex, lateralIndex); // Pad with "0" to get a total of two characters defining the sub index text QString subIndexText = QString("%1").arg(fishboneSubIndex++, 2, 10, QChar('0')); @@ -106,12 +106,13 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked) int numberOfDecimals = 2; // Export X and Y unchanged, invert sign of Z to get TVD, export MD unchanged - stream << formatNumber( coordMD.first.x(), numberOfDecimals); - stream << " " << formatNumber( coordMD.first.y(), numberOfDecimals); + stream << formatNumber(coordMD.first.x(), numberOfDecimals); + stream << " " << formatNumber(coordMD.first.y(), numberOfDecimals); stream << " " << formatNumber(-coordMD.first.z(), numberOfDecimals); - stream << " " << formatNumber( coordMD.second, numberOfDecimals) << endl; + stream << " " << formatNumber(coordMD.second, numberOfDecimals) << endl; } stream << -999 << endl << endl; + } } } diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp index 59fb04be6a..0856cf0b00 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.cpp @@ -36,6 +36,8 @@ #include "cafSelectionManager.h" #include "cafPdmUiPropertyViewDialog.h" +#include "cvfMath.h" + #include #include #include @@ -170,12 +172,16 @@ void RicExportFishbonesWellSegmentsFeature::exportWellSegments(const RimWellPath RifEclipseDataTableFormatter formatter(stream); generateWelsegsTable(formatter, wellPath, settings, locations); generateCompsegsTable(formatter, wellPath, settings, locations); + generateWsegvalvTable(formatter, wellPath, settings, locations); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations) +void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataTableFormatter& formatter, + const RimWellPath* wellPath, + const RicExportWellSegmentsSettingsUi& settings, + const std::vector& locations) { formatter.keyword("WELSEGS"); @@ -230,12 +236,12 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT if (settings.lengthAndDepth() == RicExportWellSegmentsSettingsUi::INC) { depth = location.trueVerticalDepth - previousLocation.trueVerticalDepth; - length = location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex]; + length = location.fishbonesSubs->measuredDepth(location.subIndex) - previousLocation.fishbonesSubs->measuredDepth(previousLocation.subIndex); } else { depth += location.trueVerticalDepth - previousLocation.trueVerticalDepth; - length += location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex]; + length += location.fishbonesSubs->measuredDepth(location.subIndex) - previousLocation.fishbonesSubs->measuredDepth(previousLocation.subIndex); } formatter.comment(QString("Segment for sub %1").arg(location.subIndex)); @@ -258,6 +264,16 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT formatter.comment("Rough: MSW - Open Hole Roughness Factor"); for (const WellSegmentLocation& location : locations) { + formatter.comment("ICD"); + formatter.add(location.icdSegmentNumber).add(location.icdSegmentNumber); + formatter.add(location.icdBranchNumber); + formatter.add(location.segmentNumber); + formatter.add(0.1); // ICDs have 0.1 length + formatter.add(0); // Depth change + formatter.add(-1.0); // Diam? + formatter.add(-1.0); // Rough? + formatter.rowCompleted(); + for (const WellSegmentLateral& lateral : location.laterals) { formatter.comment(QString("%1 : Sub index %2 - Lateral %3").arg(location.fishbonesSubs->name()).arg(location.subIndex).arg(lateral.lateralIndex)); @@ -297,7 +313,10 @@ void RicExportFishbonesWellSegmentsFeature::generateWelsegsTable(RifEclipseDataT //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations) +void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseDataTableFormatter& formatter, + const RimWellPath* wellPath, + const RicExportWellSegmentsSettingsUi& settings, + const std::vector& locations) { RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid(); formatter.keyword("COMPSEGS"); @@ -329,38 +348,54 @@ void RicExportFishbonesWellSegmentsFeature::generateCompsegsTable(RifEclipseData { for (const WellSegmentLateral& lateral : location.laterals) { - double length = 0; + double aggregatedLength = 0; for (const WellSegmentLateralIntersection& intersection : lateral.intersections) { - length += intersection.length; - size_t i, j, k; grid->ijkFromCellIndex(intersection.cellIndex, &i, &j, &k); formatter.addZeroBasedCellIndex(i).addZeroBasedCellIndex(j).addZeroBasedCellIndex(k); formatter.add(lateral.branchNumber); - formatter.add(length); - formatter.add("1*"); - switch (intersection.direction) - { - case POS_I: - case NEG_I: - formatter.add("I"); - break; - case POS_J: - case NEG_J: - formatter.add("J"); - break; - case POS_K: - case NEG_K: - formatter.add("K"); - break; - } - formatter.add(-1); + formatter.add(aggregatedLength); + formatter.add(aggregatedLength + intersection.length); formatter.rowCompleted(); + + aggregatedLength += intersection.length; } } } formatter.tableCompleted(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicExportFishbonesWellSegmentsFeature::generateWsegvalvTable(RifEclipseDataTableFormatter& formatter, + const RimWellPath* wellPath, + const RicExportWellSegmentsSettingsUi& settings, + const std::vector& locations) +{ + { + formatter.keyword("WSEGVALV"); + std::vector header = { + RifEclipseOutputTableColumn("Well Name"), + RifEclipseOutputTableColumn("Seg No"), + RifEclipseOutputTableColumn("Cv"), + RifEclipseOutputTableColumn("Ac"), + }; + formatter.header(header); + } + for (const WellSegmentLocation& location : locations) + { + formatter.add(wellPath->name()); + formatter.add(location.icdSegmentNumber); + formatter.add(location.fishbonesSubs->icdFlowCoefficient()); + + double icdOrificeRadius = location.fishbonesSubs->icdOrificeDiameter() / 2; + double icdArea = icdOrificeRadius * icdOrificeRadius * cvf::PI_D; + formatter.add(icdArea * static_cast(location.fishbonesSubs->icdCount())); + formatter.rowCompleted(); + } + formatter.tableCompleted(); +} diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h index 142658e1f7..4f357ce74a 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFishbonesWellSegmentsFeature.h @@ -49,4 +49,5 @@ private: static void exportWellSegments(const RimWellPath* wellPath, const std::vector& fishbonesSubs, const RicExportWellSegmentsSettingsUi& settings); static void generateWelsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); static void generateCompsegsTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); + static void generateWsegvalvTable(RifEclipseDataTableFormatter& formatter, const RimWellPath* wellPath, const RicExportWellSegmentsSettingsUi& settings, const std::vector& locations); }; diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp index 016bebc50e..d91ce7f5b8 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsAtMeasuredDepthFeature.cpp @@ -61,7 +61,7 @@ void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked RimProject* proj; wellPath->firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } //-------------------------------------------------------------------------------------------------- @@ -82,7 +82,7 @@ RiuWellPathSelectionItem* RicNewFishbonesSubsAtMeasuredDepthFeature::wellPathSel //-------------------------------------------------------------------------------------------------- void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup) { - //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setIcon(QIcon(":/FishBoneGroup16x16.png")); actionToSetup->setText("New Fishbones Subs Definition"); } diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp index 5c8519f173..22a77e6885 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp @@ -56,7 +56,7 @@ void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked) RimProject* proj; fishbonesCollection->firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } //-------------------------------------------------------------------------------------------------- @@ -82,7 +82,7 @@ RimFishbonesCollection* RicNewFishbonesSubsFeature::selectedFishbonesCollection( //-------------------------------------------------------------------------------------------------- void RicNewFishbonesSubsFeature::setupActionLook(QAction* actionToSetup) { - //actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png")); + actionToSetup->setIcon(QIcon(":/FishBoneGroup16x16.png")); actionToSetup->setText("New Fishbones Subs Definition"); } diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index c22f8b98e9..ba851b8d5d 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -406,7 +406,6 @@ std::vector RicWellPathExportCompletionDataFeature::generateP //-------------------------------------------------------------------------------------------------- std::vector RicWellPathExportCompletionDataFeature::findIntersectingCells(const RigEclipseCaseData* caseData, const std::vector& coords) { - const std::vector& nodeCoords = caseData->mainGrid()->nodes(); std::set cells; std::vector intersections = RigWellPathIntersectionTools::getIntersectedCells(caseData->mainGrid(), coords); @@ -444,35 +443,6 @@ void RicWellPathExportCompletionDataFeature::markWellPathCells(const std::vector } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -std::map RicWellPathExportCompletionDataFeature::computeLateralsPerCell(const std::vector& segmentLocations, bool removeMainBoreCells) -{ - std::map lateralsPerCell; - for (const WellSegmentLocation& location : segmentLocations) - { - for (const WellSegmentLateral& lateral : location.laterals) - { - for (const WellSegmentLateralIntersection& intersection : lateral.intersections) - { - if (removeMainBoreCells && intersection.mainBoreCell) continue; - - auto match = lateralsPerCell.find(intersection.cellIndex); - if (match == lateralsPerCell.end()) - { - lateralsPerCell[intersection.cellIndex] = 1; - } - else - { - lateralsPerCell[intersection.cellIndex] = match->second + 1; - } - } - } - } - return lateralsPerCell; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -512,12 +482,12 @@ std::vector RicWellPathExportCompletionDataFeature::findWel std::vector wellSegmentLocations; for (RimFishbonesMultipleSubs* subs : fishbonesSubs) { - for (size_t subIndex = 0; subIndex < subs->locationOfSubs().size(); ++subIndex) + for (auto& sub : subs->installedLateralIndices()) { - double measuredDepth = subs->locationOfSubs()[subIndex]; + double measuredDepth = subs->measuredDepth(sub.subIndex); cvf::Vec3d position = wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(measuredDepth); - WellSegmentLocation location = WellSegmentLocation(subs, measuredDepth, -position.z(), subIndex); - for (size_t lateralIndex = 0; lateralIndex < subs->lateralLengths().size(); ++lateralIndex) + WellSegmentLocation location = WellSegmentLocation(subs, measuredDepth, -position.z(), sub.subIndex); + for (size_t lateralIndex : sub.lateralIndices) { location.laterals.push_back(WellSegmentLateral(lateralIndex)); } @@ -546,7 +516,7 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const double length = 0; double depth = 0; cvf::Vec3d startPoint = coords[0]; - int attachedSegmentNumber = location->segmentNumber; + int attachedSegmentNumber = location->icdSegmentNumber; for (size_t i = 1; i < coords.size() && intersection != intersections.cend(); ++i) { @@ -561,7 +531,7 @@ void RicWellPathExportCompletionDataFeature::calculateLateralIntersections(const length = 0; depth = 0; - startPoint = intersection->startPoint; + startPoint = intersection->endPoint; attachedSegmentNumber = *segmentNum; ++intersection; } @@ -586,6 +556,8 @@ void RicWellPathExportCompletionDataFeature::assignBranchAndSegmentNumbers(const for (WellSegmentLocation& location : *locations) { location.segmentNumber = ++segmentNumber; + location.icdBranchNumber = ++branchNumber; + location.icdSegmentNumber = ++segmentNumber; } // Then assign branch and segment numbers to each lateral parts for (WellSegmentLocation& location : *locations) diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.h b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.h index 90ed873cc7..a4b2d40ef7 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.h +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.h @@ -65,7 +65,10 @@ struct WellSegmentLateralIntersection { /// //================================================================================================== struct WellSegmentLateral { - WellSegmentLateral(size_t lateralIndex) : lateralIndex(lateralIndex) {} + WellSegmentLateral(size_t lateralIndex) + : lateralIndex(lateralIndex), + branchNumber(0) + {} size_t lateralIndex; int branchNumber; @@ -90,6 +93,8 @@ struct WellSegmentLocation { double trueVerticalDepth; size_t subIndex; int segmentNumber; + int icdBranchNumber; + int icdSegmentNumber; std::vector laterals; }; @@ -137,7 +142,6 @@ private: static std::vector generateFishbonesWellPathCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings); static std::vector generatePerforationsCompdatValues(const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings); - static std::map computeLateralsPerCell(const std::vector& segmentLocations, bool removeMainBoreCells); static std::vector findIntersectingCells(const RigEclipseCaseData* grid, const std::vector& coords); static void markWellPathCells(const std::vector& wellPathCells, std::vector* locations); static bool wellSegmentLocationOrdering(const WellSegmentLocation& first, const WellSegmentLocation& second); diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathImportCompletionsFileFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathImportCompletionsFileFeature.cpp index 3d11812a51..0c24b02523 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathImportCompletionsFileFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathImportCompletionsFileFeature.cpp @@ -80,7 +80,7 @@ void RicWellPathImportCompletionsFileFeature::onActionTriggered(bool isChecked) void RicWellPathImportCompletionsFileFeature::setupActionLook(QAction* actionToSetup) { actionToSetup->setText("Import Completions from File"); - actionToSetup->setIcon(QIcon(":/Well.png")); + actionToSetup->setIcon(QIcon(":/FishBoneGroupFromFile16x16.png")); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp index 446a3503c8..414dd140a2 100644 --- a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp @@ -89,11 +89,11 @@ void RivFishbonesSubsPartMgr::buildParts(caf::DisplayCoordTransform* displayCoor RivPipeGeometryGenerator geoGenerator; - for (size_t subIndex = 0; subIndex < m_rimFishbonesSubs->locationOfSubs().size(); subIndex++) + for (auto& sub : m_rimFishbonesSubs->installedLateralIndices()) { - for (size_t lateralIndex = 0; lateralIndex < m_rimFishbonesSubs->lateralLengths().size(); lateralIndex++) + for (size_t lateralIndex : sub.lateralIndices) { - std::vector lateralDomainCoords = m_rimFishbonesSubs->coordsForLateral(subIndex, lateralIndex); + std::vector lateralDomainCoords = m_rimFishbonesSubs->coordsForLateral(sub.subIndex, lateralIndex); std::vector displayCoords; for (auto domainCoord : lateralDomainCoords) diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp index 1cf4859aa2..dc57e4e516 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp @@ -267,9 +267,7 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCellC cvf::Vec2fArray& surfaceCoords = *m_surfaceFacesTextureCoords.p(); for (cvf::Vec2f& vec : surfaceCoords) { - { - vec[1] = 0.5; - } + vec[1] = 0.5; } m_opacityLevel = 0.5; } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimCompletionCellIntersectionCalc.cpp b/ApplicationCode/ProjectDataModel/Completions/RimCompletionCellIntersectionCalc.cpp index 891df1045e..29c64360e2 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimCompletionCellIntersectionCalc.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimCompletionCellIntersectionCalc.cpp @@ -80,14 +80,14 @@ void RimCompletionCellIntersectionCalc::calculateWellPathIntersections(const Rim //-------------------------------------------------------------------------------------------------- void RimCompletionCellIntersectionCalc::calculateFishbonesIntersections(const RimFishbonesMultipleSubs* fishbonesSubs, const RigMainGrid* grid, std::vector& values) { - for (size_t subIndex = 0; subIndex < fishbonesSubs->locationOfSubs().size(); ++subIndex) + for (auto& sub : fishbonesSubs->installedLateralIndices()) { - for (size_t lateralIndex = 0; lateralIndex < fishbonesSubs->lateralCountPerSub(); ++lateralIndex) + for (size_t lateralIndex : sub.lateralIndices) { - std::vector intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, fishbonesSubs->coordsForLateral(subIndex, lateralIndex)); + std::vector intersections = RigWellPathIntersectionTools::getIntersectedCells(grid, fishbonesSubs->coordsForLateral(sub.subIndex, lateralIndex)); for (auto& intersection : intersections) { - values[intersection.m_hexIndex] = RimDefines::FISHBONE; + values[intersection.m_hexIndex] = RimDefines::FISHBONES; } } } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPath.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPath.cpp index 9915e8e372..7ade5a00b5 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPath.cpp @@ -31,7 +31,7 @@ CAF_PDM_SOURCE_INIT(RimFishboneWellPath, "WellPathCompletion"); //-------------------------------------------------------------------------------------------------- RimFishboneWellPath::RimFishboneWellPath() { - CAF_PDM_InitObject("WellPathCompletion", ":/Well.png", "", ""); + CAF_PDM_InitObject("WellPathCompletion", ":/FishBoneLateralFromFile16x16.png", "", ""); CAF_PDM_InitFieldNoDefault(&m_coordinates, "Coordinates", "Coordinates", "", "", ""); m_coordinates.uiCapability()->setUiHidden(true); CAF_PDM_InitFieldNoDefault(&m_measuredDepths, "MeasuredDepth", "MeasuredDepth", "", "", ""); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp index 8e98995953..2d4cb878f9 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishboneWellPathCollection.cpp @@ -38,7 +38,7 @@ CAF_PDM_SOURCE_INIT(RimFishboneWellPathCollection, "WellPathCompletionCollection //-------------------------------------------------------------------------------------------------- RimFishboneWellPathCollection::RimFishboneWellPathCollection() { - CAF_PDM_InitObject("WellPathCompletions", ":/WellCollection.png", "", ""); + CAF_PDM_InitObject("WellPathCompletions", ":/FishBoneGroupFromFile16x16.png", "", ""); m_name.uiCapability()->setUiHidden(true); m_name = "Well Paths"; @@ -103,7 +103,7 @@ void RimFishboneWellPathCollection::appendCompletion(RimFishboneWellPath* comple firstAncestorOrThisOfTypeAsserted(project); if (project) { - project->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + project->reloadCompletionTypeResultsInAllViews(); } } diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp index 15f2063c48..6b266b9d1c 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesCollection.cpp @@ -37,7 +37,7 @@ CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection"); //-------------------------------------------------------------------------------------------------- RimFishbonesCollection::RimFishbonesCollection() { - CAF_PDM_InitObject("Fishbones", ":/Folder.png", "", ""); + CAF_PDM_InitObject("Fishbones", ":/FishBones16x16.png", "", ""); m_name.uiCapability()->setUiHidden(true); m_name = "Fishbones"; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp index 4681a2cd6e..420134caf1 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.cpp @@ -57,7 +57,7 @@ namespace caf { //-------------------------------------------------------------------------------------------------- RimFishbonesMultipleSubs::RimFishbonesMultipleSubs() { - CAF_PDM_InitObject("FishbonesMultipleSubs", ":/Default.png", "", ""); + CAF_PDM_InitObject("FishbonesMultipleSubs", ":/FishBoneGroup16x16.png", "", ""); CAF_PDM_InitField(&fishbonesColor, "FishbonesColor", cvf::Color3f(0.999f, 0.333f, 0.999f), "Fishbones Color", "", "", ""); @@ -72,11 +72,11 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs() CAF_PDM_InitField(&m_lateralOpenHoleRoghnessFactor, "LateralOpenHoleRoghnessFactor", 0.001, "Open Hole Roghness Factor [m]", "", "", ""); CAF_PDM_InitField(&m_lateralTubingRoghnessFactor, "LateralTubingRoghnessFactor", 1e-5, "Tubing Roghness Factor [m]", "", "", ""); - CAF_PDM_InitField(&m_lateralLengthFraction, "LateralLengthFraction", 0.8, "Length Fraction [0..1]", "", "", ""); - CAF_PDM_InitField(&m_lateralInstallFraction, "LateralInstallFraction", 0.7, "Install Fraction [0..1]", "", "", ""); + CAF_PDM_InitField(&m_lateralInstallSuccessFraction, "LateralInstallSuccessFraction", 0.7, "Install Success Rate [0..1]", "", "", ""); CAF_PDM_InitField(&m_icdCount, "IcdCount", size_t(2), "ICDs per Sub", "", "", ""); CAF_PDM_InitField(&m_icdOrificeDiameter, "IcdOrificeDiameter", 7.0, "ICD Orifice Diameter [mm]", "", "", ""); + CAF_PDM_InitField(&m_icdFlowCoefficient, "IcdFlowCoeficcient", -1.0, "ICD Flow Coefficient", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_locationOfSubs, "LocationOfSubs", "Measured Depths [m]", "", "", ""); m_locationOfSubs.uiCapability()->setUiEditorTypeName(caf::PdmUiListEditor::uiEditorTypeName()); @@ -102,6 +102,8 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs() m_name.uiCapability()->setUiReadOnly(true); m_rigFishbonesGeometry = std::unique_ptr(new RigFisbonesGeometry(this)); + + computeSubLateralIndices(); } //-------------------------------------------------------------------------------------------------- @@ -125,14 +127,17 @@ void RimFishbonesMultipleSubs::setMeasuredDepthAndCount(double measuredDepth, do computeRangesAndLocations(); computeRotationAngles(); + computeSubLateralIndices(); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RimFishbonesMultipleSubs::locationOfSubs() const +double RimFishbonesMultipleSubs::measuredDepth(size_t subIndex) const { - return m_locationOfSubs; + CVF_ASSERT(subIndex < m_locationOfSubs().size()); + + return m_locationOfSubs()[subIndex]; } //-------------------------------------------------------------------------------------------------- @@ -176,14 +181,6 @@ double RimFishbonesMultipleSubs::tubingDiameter() const return m_lateralTubingDiameter; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -size_t RimFishbonesMultipleSubs::lateralCountPerSub() const -{ - return m_lateralCountPerSub; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -277,9 +274,17 @@ void RimFishbonesMultipleSubs::fieldChangedByUi(const caf::PdmFieldHandle* chang computeRotationAngles(); } + if (recomputeLocations || + changedField == &m_locationOfSubs || + changedField == &m_lateralInstallSuccessFraction || + changedField == &m_lateralCountPerSub) + { + computeSubLateralIndices(); + } + RimProject* proj; this->firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } //-------------------------------------------------------------------------------------------------- @@ -381,14 +386,8 @@ void RimFishbonesMultipleSubs::defineUiOrdering(QString uiConfigName, caf::PdmUi lateralConfigGroup->add(&m_fixedInstallationRotationAngle); } + lateralConfigGroup->add(&m_lateralInstallSuccessFraction); - { - caf::PdmUiGroup* successGroup = lateralConfigGroup->addNewGroup("Installation Success Fractions"); - successGroup->setCollapsedByDefault(true); - - successGroup->add(&m_lateralLengthFraction); - successGroup->add(&m_lateralInstallFraction); - } } { @@ -405,6 +404,7 @@ void RimFishbonesMultipleSubs::defineUiOrdering(QString uiConfigName, caf::PdmUi mswGroup->add(&m_lateralTubingRoghnessFactor); mswGroup->add(&m_icdCount); mswGroup->add(&m_icdOrificeDiameter); + mswGroup->add(&m_icdFlowCoefficient); } // Visibility @@ -451,6 +451,7 @@ void RimFishbonesMultipleSubs::initAfterRead() { computeRotationAngles(); } + computeSubLateralIndices(); } //-------------------------------------------------------------------------------------------------- @@ -472,11 +473,11 @@ cvf::BoundingBox RimFishbonesMultipleSubs::boundingBoxInDomainCoords() { cvf::BoundingBox bb; - for (size_t i = 0; i < m_locationOfSubs().size(); i++) + for (auto& sub : installedLateralIndices()) { - for (size_t lateralIndex = 0; lateralIndex < m_lateralCountPerSub; lateralIndex++) + for (size_t lateralIndex : sub.lateralIndices) { - std::vector coords = coordsForLateral(i, lateralIndex); + std::vector coords = coordsForLateral(sub.subIndex, lateralIndex); for (auto c : coords) { @@ -503,6 +504,36 @@ void RimFishbonesMultipleSubs::computeRotationAngles() m_installationRotationAngles = vals; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimFishbonesMultipleSubs::computeSubLateralIndices() +{ + m_subLateralIndices.clear(); + for (size_t subIndex = 0; subIndex < m_locationOfSubs().size(); ++subIndex) + { + SubLateralIndex subLateralIndex{ subIndex }; + for (size_t lateralIndex = 0; lateralIndex < m_lateralCountPerSub(); ++lateralIndex) + { + subLateralIndex.lateralIndices.push_back(lateralIndex); + } + m_subLateralIndices.push_back(subLateralIndex); + } + double numLaterals = static_cast(m_locationOfSubs().size() * m_lateralCountPerSub); + int numToRemove = static_cast(std::round((1 - m_lateralInstallSuccessFraction) * numLaterals)); + srand(m_randomSeed()); + while (numToRemove > 0) + { + int subIndexToRemove; + do { + subIndexToRemove = rand() % m_subLateralIndices.size(); + } while (m_subLateralIndices[subIndexToRemove].lateralIndices.empty()); + int lateralIndexToRemove = rand() % m_subLateralIndices[subIndexToRemove].lateralIndices.size(); + m_subLateralIndices[subIndexToRemove].lateralIndices.erase(m_subLateralIndices[subIndexToRemove].lateralIndices.begin() + lateralIndexToRemove); + --numToRemove; + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.h b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.h index 854bd158f5..835506abbf 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFishbonesMultipleSubs.h @@ -35,6 +35,15 @@ class RigFisbonesGeometry; +//================================================================================================== +/// +/// +//================================================================================================== +struct SubLateralIndex { + size_t subIndex; + std::vector lateralIndices; +}; + //================================================================================================== /// /// @@ -64,18 +73,22 @@ public: void setMeasuredDepthAndCount(double measuredDepth, double spacing, int subCount); - std::vector locationOfSubs() const; + double measuredDepth(size_t subIndex) const; + double rotationAngle(size_t subIndex) const; - double rotationAngle(size_t index) const; double exitAngle() const; double buildAngle() const; double tubingDiameter() const; double holeDiameter() const { return m_pipeProperties()->holeDiameter(); } double openHoleRoughnessFactor() const { return m_lateralOpenHoleRoghnessFactor(); } - size_t lateralCountPerSub() const; + double icdOrificeDiameter() const { return m_icdOrificeDiameter(); } + double icdFlowCoefficient() const { return m_icdFlowCoefficient(); } + size_t icdCount() const { return m_icdCount(); } std::vector lateralLengths() const; + const std::vector& installedLateralIndices() const { return m_subLateralIndices; }; + std::vector coordsForLateral(size_t subIndex, size_t lateralIndex) const; std::vector> coordsAndMDForLateral(size_t subIndex, size_t lateralIndex) const; @@ -95,10 +108,11 @@ protected: private: void computeRangesAndLocations(); void computeRotationAngles(); + void computeSubLateralIndices(); static std::vector locationsFromStartSpacingAndCount(double start, double spacing, size_t count); static int randomValueFromRange(int min, int max); - + private: caf::PdmField m_lateralCountPerSub; caf::PdmField m_lateralLength; @@ -111,11 +125,11 @@ private: caf::PdmField m_lateralOpenHoleRoghnessFactor; caf::PdmField m_lateralTubingRoghnessFactor; - caf::PdmField m_lateralLengthFraction; - caf::PdmField m_lateralInstallFraction; + caf::PdmField m_lateralInstallSuccessFraction; caf::PdmField m_icdCount; caf::PdmField m_icdOrificeDiameter; + caf::PdmField m_icdFlowCoefficient; caf::PdmField > m_subsLocationMode; caf::PdmField m_rangeStart; @@ -132,5 +146,8 @@ private: caf::PdmChildField m_pipeProperties; + caf::PdmField m_randomSeed; + std::unique_ptr m_rigFishbonesGeometry; + std::vector m_subLateralIndices; }; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp index bd30ec346a..808aa571d7 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimPerforationCollection.cpp @@ -38,7 +38,7 @@ CAF_PDM_SOURCE_INIT(RimPerforationCollection, "PerforationCollection"); //-------------------------------------------------------------------------------------------------- RimPerforationCollection::RimPerforationCollection() { - CAF_PDM_InitObject("Perforations", ":/Folder.png", "", ""); + CAF_PDM_InitObject("Perforations", ":/PerforationIntervals16x16.png", "", ""); m_name.uiCapability()->setUiHidden(true); m_name = "Perforations"; @@ -77,7 +77,7 @@ void RimPerforationCollection::appendPerforation(RimPerforationInterval* perfora RimProject* proj; this->firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimPerforationInterval.cpp b/ApplicationCode/ProjectDataModel/Completions/RimPerforationInterval.cpp index 883c6dd0c0..688fabb42a 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimPerforationInterval.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimPerforationInterval.cpp @@ -36,7 +36,7 @@ CAF_PDM_SOURCE_INIT(RimPerforationInterval, "Perforation"); //-------------------------------------------------------------------------------------------------- RimPerforationInterval::RimPerforationInterval() { - CAF_PDM_InitObject("Perforation", ":/Default.png", "", ""); + CAF_PDM_InitObject("Perforation", ":/PerforationInterval16x16.png", "", ""); CAF_PDM_InitField(&m_startMD, "StartMeasuredDepth", 0.0, "Start MD [m]", "", "", ""); CAF_PDM_InitField(&m_endMD, "EndMeasuredDepth", 0.0, "End MD [m]", "", "", ""); @@ -145,7 +145,7 @@ void RimPerforationInterval::fieldChangedByUi(const caf::PdmFieldHandle* changed RimProject* proj; this->firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp b/ApplicationCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp index a85a2c2952..9a65a33d81 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp @@ -32,7 +32,7 @@ CAF_PDM_SOURCE_INIT(RimWellPathCompletions, "WellPathCompletions"); //-------------------------------------------------------------------------------------------------- RimWellPathCompletions::RimWellPathCompletions() { - CAF_PDM_InitObject("Completions", ":/WellCollection.png", "", ""); + CAF_PDM_InitObject("Completions", ":/CompletionsSymbol16x16.png", "", ""); CAF_PDM_InitFieldNoDefault(&m_perforationCollection, "Perforations", "Perforations", "", "", ""); m_perforationCollection = new RimPerforationCollection; diff --git a/ApplicationCode/ProjectDataModel/RimDefines.cpp b/ApplicationCode/ProjectDataModel/RimDefines.cpp index 15b5cf7ac8..0737abd428 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.cpp +++ b/ApplicationCode/ProjectDataModel/RimDefines.cpp @@ -80,7 +80,7 @@ namespace caf { addItem(RimDefines::WELL_PATH, "WELL_PATH", "Well Path"); addItem(RimDefines::PERFORATION_INTERVAL, "PERFORATION_INTERVAL", "Perforation Interval"); - addItem(RimDefines::FISHBONE, "FISHBONE", "Fishbone"); + addItem(RimDefines::FISHBONES, "FISHBONES", "Fishbones"); setDefault(RimDefines::WELL_PATH); } diff --git a/ApplicationCode/ProjectDataModel/RimDefines.h b/ApplicationCode/ProjectDataModel/RimDefines.h index ff76caf379..718dcddf52 100644 --- a/ApplicationCode/ProjectDataModel/RimDefines.h +++ b/ApplicationCode/ProjectDataModel/RimDefines.h @@ -46,7 +46,7 @@ public: enum CompletionType { WELL_PATH, PERFORATION_INTERVAL, - FISHBONE + FISHBONES }; static bool isPerCellFaceResult(const QString& resultName); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index 96dcf6b587..bc061d5217 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -249,7 +249,7 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimEclipseCase::removeResult(RimDefines::ResultCatType type, const QString& resultName) +void RimEclipseCase::removeEclipseResultAndScheduleRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName) { m_matrixModelResults->clearScalarResult(type, resultName); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index ff767e02ea..3056d8884f 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -78,7 +78,7 @@ public: RimEclipseView* createAndAddReservoirView(); RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView); - void removeResult(RimDefines::ResultCatType type, const QString& resultName); + void removeEclipseResultAndScheduleRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName); virtual QString locationOnDisc() const { return QString(); } virtual QString gridFileName() const { return QString(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp index 6a932e2f06..973e1e9165 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCellColors.cpp @@ -387,7 +387,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep) std::vector< std::tuple > categories; caf::AppEnum wellPath(RimDefines::WELL_PATH); - caf::AppEnum fishbone(RimDefines::FISHBONE); + caf::AppEnum fishbone(RimDefines::FISHBONES); caf::AppEnum perforationInterval(RimDefines::PERFORATION_INTERVAL); categories.push_back(std::make_tuple(wellPath.uiText(), wellPath.index(), cvf::Color3::RED)); diff --git a/ApplicationCode/ProjectDataModel/RimProject.cpp b/ApplicationCode/ProjectDataModel/RimProject.cpp index d827014635..b483501e2e 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationCode/ProjectDataModel/RimProject.cpp @@ -767,11 +767,19 @@ bool RimProject::showPlotWindow() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimProject::removeResult(RimDefines::ResultCatType type, const QString & resultName) +void RimProject::reloadCompletionTypeResultsInAllViews() +{ + removeEclipseResultAndRedrawAllViews(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimProject::removeEclipseResultAndRedrawAllViews(RimDefines::ResultCatType type, const QString & resultName) { for (RimEclipseCase* eclipseCase : activeOilField()->analysisModels->cases) { - eclipseCase->removeResult(type, resultName); + eclipseCase->removeEclipseResultAndScheduleRedrawAllViews(type, resultName); } } diff --git a/ApplicationCode/ProjectDataModel/RimProject.h b/ApplicationCode/ProjectDataModel/RimProject.h index ec7d0bd2aa..a53f907dbc 100644 --- a/ApplicationCode/ProjectDataModel/RimProject.h +++ b/ApplicationCode/ProjectDataModel/RimProject.h @@ -110,7 +110,8 @@ public: bool show3DWindow() const; bool showPlotWindow() const; - void removeResult(RimDefines::ResultCatType type, const QString& resultName); + void reloadCompletionTypeResultsInAllViews(); + protected: // Overridden methods @@ -122,6 +123,7 @@ protected: private: void appendScriptItems(QMenu* menu, RimScriptCollection* scriptCollection); + void removeEclipseResultAndRedrawAllViews(RimDefines::ResultCatType type, const QString& resultName); private: caf::PdmField m_projectFileVersionString; diff --git a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp index a84ad3a221..ae46436586 100644 --- a/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp +++ b/ApplicationCode/ProjectDataModel/RimReservoirCellResultsStorage.cpp @@ -1406,12 +1406,12 @@ void RimReservoirCellResultsStorage::computeCompletionTypeForTimeStep(size_t tim { size_t completionTypeResultIndex = m_cellResults->findScalarResultIndex(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); - if (m_cellResults->cellScalarResults(completionTypeResultIndex).size() != timeStep) + if (m_cellResults->cellScalarResults(completionTypeResultIndex).size() < cellResults()->maxTimeStepCount()) { - m_cellResults->cellScalarResults(completionTypeResultIndex).resize(timeStep); + m_cellResults->cellScalarResults(completionTypeResultIndex).resize(cellResults()->maxTimeStepCount()); } - std::vector& completionTypeResult = m_cellResults->cellScalarResults(completionTypeResultIndex, 0); + std::vector& completionTypeResult = m_cellResults->cellScalarResults(completionTypeResultIndex, timeStep); size_t resultValues = m_ownerMainGrid->globalCellArray().size(); diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index 753a8ed448..d4c5d397d2 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -254,7 +254,7 @@ void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons this->firstAncestorOrThisOfTypeAsserted(proj); if (changedField == &showWellPath) { - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } else { diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index efca4e45d7..b027918dd9 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -218,7 +218,7 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths ) RimProject* proj; firstAncestorOrThisOfTypeAsserted(proj); - proj->removeResult(RimDefines::DYNAMIC_NATIVE, RimDefines::completionTypeResultName()); + proj->reloadCompletionTypeResultsInAllViews(); } diff --git a/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp b/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp index 6c6e758d06..663fccdfdb 100644 --- a/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigCompletionData.cpp @@ -26,7 +26,7 @@ //================================================================================================== /// //================================================================================================== -RigCompletionData::RigCompletionData(const QString wellName, const IJKCellIndex cellIndex) +RigCompletionData::RigCompletionData(const QString wellName, const IJKCellIndex& cellIndex) : m_wellName(wellName), m_cellIndex(cellIndex), m_saturation(HUGE_VAL), diff --git a/ApplicationCode/ReservoirDataModel/RigCompletionData.h b/ApplicationCode/ReservoirDataModel/RigCompletionData.h index 6560c207b3..528a824d5c 100644 --- a/ApplicationCode/ReservoirDataModel/RigCompletionData.h +++ b/ApplicationCode/ReservoirDataModel/RigCompletionData.h @@ -91,7 +91,7 @@ struct RigCompletionMetaData { class RigCompletionData : public cvf::Object { public: - RigCompletionData(const QString wellName, const IJKCellIndex cellIndex); + RigCompletionData(const QString wellName, const IJKCellIndex& cellIndex); ~RigCompletionData(); RigCompletionData(const RigCompletionData& other); diff --git a/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp index 0801838dfb..cc87ac523f 100644 --- a/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFishbonesGeometry.cpp @@ -39,16 +39,30 @@ RigFisbonesGeometry::RigFisbonesGeometry(RimFishbonesMultipleSubs* fishbonesSub) //-------------------------------------------------------------------------------------------------- std::vector> RigFisbonesGeometry::coordsForLateral(size_t subIndex, size_t lateralIndex) const { - CVF_ASSERT(subIndex < m_fishbonesSub->locationOfSubs().size()); CVF_ASSERT(lateralIndex < m_fishbonesSub->lateralLengths().size()); + bool found = false; + for (auto& sub : m_fishbonesSub->installedLateralIndices()) + { + if (sub.subIndex == subIndex) + { + auto it = std::find(sub.lateralIndices.begin(), sub.lateralIndices.end(), lateralIndex); + if (it != sub.lateralIndices.end()) + { + found = true; + break; + } + } + } + CVF_ASSERT(found); + cvf::Vec3d position; cvf::Vec3d lateralInitialDirection; cvf::Mat4d buildAngleRotationMatrix; computeLateralPositionAndOrientation(subIndex, lateralIndex, &position, &lateralInitialDirection, &buildAngleRotationMatrix); - return computeCoordsAlongLateral(m_fishbonesSub->locationOfSubs()[subIndex], m_fishbonesSub->lateralLengths()[lateralIndex], position, lateralInitialDirection, buildAngleRotationMatrix); + return computeCoordsAlongLateral(m_fishbonesSub->measuredDepth(subIndex), m_fishbonesSub->lateralLengths()[lateralIndex], position, lateralInitialDirection, buildAngleRotationMatrix); } //-------------------------------------------------------------------------------------------------- @@ -62,7 +76,7 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation(size_t subIndex, RigWellPath* rigWellPath = wellPath->wellPathGeometry(); CVF_ASSERT(rigWellPath); - double measuredDepth = m_fishbonesSub->locationOfSubs()[subIndex]; + double measuredDepth = m_fishbonesSub->measuredDepth(subIndex); cvf::Vec3d position = rigWellPath->interpolatedPointAlongWellPath(measuredDepth); diff --git a/ApplicationCode/Resources/CompletionsSymbol16x16.png b/ApplicationCode/Resources/CompletionsSymbol16x16.png new file mode 100644 index 0000000000..54e797f909 Binary files /dev/null and b/ApplicationCode/Resources/CompletionsSymbol16x16.png differ diff --git a/ApplicationCode/Resources/FishBoneGroup16x16.png b/ApplicationCode/Resources/FishBoneGroup16x16.png new file mode 100644 index 0000000000..0f38ea108c Binary files /dev/null and b/ApplicationCode/Resources/FishBoneGroup16x16.png differ diff --git a/ApplicationCode/Resources/FishBoneGroupFromFile16x16.png b/ApplicationCode/Resources/FishBoneGroupFromFile16x16.png new file mode 100644 index 0000000000..469ebc5300 Binary files /dev/null and b/ApplicationCode/Resources/FishBoneGroupFromFile16x16.png differ diff --git a/ApplicationCode/Resources/FishBoneLateralFromFile16x16.png b/ApplicationCode/Resources/FishBoneLateralFromFile16x16.png new file mode 100644 index 0000000000..dc0048c6ed Binary files /dev/null and b/ApplicationCode/Resources/FishBoneLateralFromFile16x16.png differ diff --git a/ApplicationCode/Resources/FishBones16x16.png b/ApplicationCode/Resources/FishBones16x16.png new file mode 100644 index 0000000000..192c5450f2 Binary files /dev/null and b/ApplicationCode/Resources/FishBones16x16.png differ diff --git a/ApplicationCode/Resources/PerforationInterval16x16.png b/ApplicationCode/Resources/PerforationInterval16x16.png new file mode 100644 index 0000000000..81dd3f61b5 Binary files /dev/null and b/ApplicationCode/Resources/PerforationInterval16x16.png differ diff --git a/ApplicationCode/Resources/PerforationIntervals16x16.png b/ApplicationCode/Resources/PerforationIntervals16x16.png new file mode 100644 index 0000000000..9d90602250 Binary files /dev/null and b/ApplicationCode/Resources/PerforationIntervals16x16.png differ diff --git a/ApplicationCode/Resources/ResInsight.qrc b/ApplicationCode/Resources/ResInsight.qrc index fdb6f200d5..612cb16b12 100644 --- a/ApplicationCode/Resources/ResInsight.qrc +++ b/ApplicationCode/Resources/ResInsight.qrc @@ -80,6 +80,13 @@ RightAxis16x16.png BottomAxis16x16.png Axes16x16.png + FishBones16x16.png + FishBoneGroup16x16.png + FishBoneGroupFromFile16x16.png + FishBoneLateralFromFile16x16.png + PerforationInterval16x16.png + PerforationIntervals16x16.png + CompletionsSymbol16x16.png WellAllocPlots16x16.png WellAllocPlot16x16.png WellFlowPlot16x16.png