diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp index 4d6d21eb9e..1f507a1284 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.cpp @@ -158,25 +158,15 @@ std::vector>& RicMswSubSegment //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicMswCompletion::RicMswCompletion(RigCompletionData::CompletionType completionType, - const QString& label, +RicMswCompletion::RicMswCompletion(const QString& label, size_t index /* = cvf::UNDEFINED_SIZE_T */, int branchNumber /*= 0*/) - : m_completionType(completionType) - , m_label(label) + : m_label(label) , m_index(index) , m_branchNumber(branchNumber) { } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigCompletionData::CompletionType RicMswCompletion::completionType() const -{ - return m_completionType; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -241,6 +231,121 @@ void RicMswCompletion::setLabel(const QString& label) m_label = label; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicMswICD::RicMswICD(const QString& label, size_t index /*= cvf::UNDEFINED_SIZE_T*/, int branchNumber /*= cvf::UNDEFINED_INT*/) + : RicMswCompletion(label, index, branchNumber) + , m_flowCoefficient(0.0) + , m_area(0.0) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RicMswICD::flowCoefficient() const +{ + return m_flowCoefficient; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RicMswICD::area() const +{ + return m_area; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicMswICD::setFlowCoefficient(double icdFlowCoefficient) +{ + m_flowCoefficient = icdFlowCoefficient; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicMswICD::setArea(double icdArea) +{ + m_area = icdArea; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicMswFishbonesICD::RicMswFishbonesICD(const QString& label, + size_t index /*= cvf::UNDEFINED_SIZE_T*/, + int branchNumber /*= cvf::UNDEFINED_INT*/) + : RicMswICD(label, index, branchNumber) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigCompletionData::CompletionType RicMswFishbonesICD::completionType() const +{ + return RigCompletionData::FISHBONES_ICD; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicMswFracture::RicMswFracture(const QString& label, + size_t index /*= cvf::UNDEFINED_SIZE_T*/, + int branchNumber /*= cvf::UNDEFINED_INT*/) + : RicMswCompletion(label, index, branchNumber) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigCompletionData::CompletionType RicMswFracture::completionType() const +{ + return RigCompletionData::FRACTURE; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicMswPerforation::RicMswPerforation(const QString& label, + size_t index /*= cvf::UNDEFINED_SIZE_T*/, + int branchNumber /*= cvf::UNDEFINED_INT*/) + : RicMswCompletion(label, index, branchNumber) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigCompletionData::CompletionType RicMswPerforation::completionType() const +{ + return RigCompletionData::PERFORATION; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RicMswPerforationICD::RicMswPerforationICD(const QString& label, + size_t index /*= cvf::UNDEFINED_SIZE_T*/, + int branchNumber /*= cvf::UNDEFINED_INT*/) + : RicMswICD(label, index, branchNumber) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RigCompletionData::CompletionType RicMswPerforationICD::completionType() const +{ + return RigCompletionData::PERFORATION_ICD; +} + + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -260,8 +365,6 @@ RicMswSegment::RicMswSegment(const QString& label, , m_holeDiameter(RicMswExportInfo::defaultDoubleValue()) , m_openHoleRoughnessFactor(5.0e-5) , m_skinFactor(RicMswExportInfo::defaultDoubleValue()) - , m_icdFlowCoefficient(0.0) - , m_icdArea(0.0) , m_subIndex(subIndex) , m_segmentNumber(segmentNumber) { @@ -355,22 +458,6 @@ double RicMswSegment::skinFactor() const return m_skinFactor; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RicMswSegment::icdFlowCoefficient() const -{ - return m_icdFlowCoefficient; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -double RicMswSegment::icdArea() const -{ - return m_icdArea; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -443,22 +530,6 @@ void RicMswSegment::setSkinFactor(double skinFactor) m_skinFactor = skinFactor; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicMswSegment::setIcdFlowCoefficient(double icdFlowCoefficient) -{ - m_icdFlowCoefficient = icdFlowCoefficient; -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RicMswSegment::setIcdArea(double icdArea) -{ - m_icdArea = icdArea; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h index f9230f562e..369110387f 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h +++ b/ApplicationCode/Commands/CompletionExportCommands/RicMultiSegmentWellExportInfo.h @@ -97,9 +97,10 @@ private: class RicMswCompletion { public: - RicMswCompletion(RigCompletionData::CompletionType completionType, const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + RicMswCompletion(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + + virtual RigCompletionData::CompletionType completionType() const = 0; - RigCompletionData::CompletionType completionType() const; const QString& label() const; size_t index() const; int branchNumber() const; @@ -113,7 +114,6 @@ public: void setLabel(const QString& label); private: - RigCompletionData::CompletionType m_completionType; QString m_label; size_t m_index; int m_branchNumber; @@ -121,6 +121,73 @@ private: std::vector> m_subSegments; }; +class RicMswFishbones : public RicMswCompletion +{ +public: + RicMswFishbones(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT) + : RicMswCompletion(label, index, branchNumber) + {} + + RigCompletionData::CompletionType completionType() const override { return RigCompletionData::FISHBONES; } +}; + +//================================================================================================== +/// +//================================================================================================== +class RicMswICD : public RicMswCompletion +{ +public: + RicMswICD(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + double flowCoefficient() const; + double area() const; + void setFlowCoefficient(double icdFlowCoefficient); + void setArea(double icdArea); +private: + double m_flowCoefficient; + double m_area; +}; + +//================================================================================================== +/// +//================================================================================================== +class RicMswFishbonesICD : public RicMswICD +{ +public: + RicMswFishbonesICD(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + RigCompletionData::CompletionType completionType() const override; +}; + +//================================================================================================== +/// +//================================================================================================== +class RicMswFracture : public RicMswCompletion +{ +public: + RicMswFracture(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + RigCompletionData::CompletionType completionType() const override; +}; + +//================================================================================================== +/// +//================================================================================================== +class RicMswPerforation : public RicMswCompletion +{ +public: + RicMswPerforation(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + RigCompletionData::CompletionType completionType() const override; +}; + +//================================================================================================== +/// +//================================================================================================== +class RicMswPerforationICD : public RicMswICD +{ +public: + RicMswPerforationICD(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT); + RigCompletionData::CompletionType completionType() const override; +}; + + //================================================================================================== /// //================================================================================================== @@ -148,8 +215,6 @@ public: double holeDiameter() const; double openHoleRoughnessFactor() const; double skinFactor() const; - double icdFlowCoefficient() const; - double icdArea() const; size_t subIndex() const; int segmentNumber() const; @@ -162,8 +227,6 @@ public: void setHoleDiameter(double holeDiameter); void setOpenHoleRoughnessFactor(double roughnessFactor); void setSkinFactor(double skinFactor); - void setIcdFlowCoefficient(double icdFlowCoefficient); - void setIcdArea(double icdArea); void setSegmentNumber(int segmentNumber); void addCompletion(std::shared_ptr completion); @@ -183,8 +246,6 @@ private: double m_linerDiameter; double m_openHoleRoughnessFactor; double m_skinFactor; - double m_icdFlowCoefficient; - double m_icdArea; size_t m_subIndex; int m_segmentNumber; diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 71b88adc7f..2469dc7a50 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -995,27 +995,18 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWsegvalvTable(RifEclips foundValve = true; } - if (completion->completionType() == RigCompletionData::FISHBONES_ICD) + if (completion->completionType() == RigCompletionData::FISHBONES_ICD || + completion->completionType() == RigCompletionData::PERFORATION_ICD) { - if (!completion->subSegments().empty()) + std::shared_ptr icd = std::static_pointer_cast(completion); + if (!icd->subSegments().empty()) { - CVF_ASSERT(completion->subSegments().size() == 1u); + CVF_ASSERT(icd->subSegments().size() == 1u); + formatter.comment(icd->label()); formatter.add(exportInfo.wellPath()->name()); - formatter.add(completion->subSegments().front()->segmentNumber()); - formatter.add(location->icdFlowCoefficient()); - formatter.add(location->icdArea()); - formatter.rowCompleted(); - } - } - else - { - if (!completion->subSegments().empty()) - { - formatter.comment(completion->label()); - formatter.add(exportInfo.wellPath()->name()); - formatter.add(completion->subSegments().front()->segmentNumber()); - formatter.add(location->icdFlowCoefficient()); - formatter.add(QString("%1").arg(location->icdArea(), 8, 'g', 4)); + formatter.add(icd->subSegments().front()->segmentNumber()); + formatter.add(icd->flowCoefficient()); + formatter.add(QString("%1").arg(icd->area(), 8, 'g', 4)); formatter.rowCompleted(); } } @@ -1848,23 +1839,24 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMs location->setHoleDiameter(subs->holeDiameter(unitSystem)); location->setOpenHoleRoughnessFactor(subs->openHoleRoughnessFactor(unitSystem)); location->setSkinFactor(subs->skinFactor()); - location->setIcdFlowCoefficient(subs->icdFlowCoefficient()); - double icdOrificeRadius = subs->icdOrificeDiameter(unitSystem) / 2; - location->setIcdArea(icdOrificeRadius * icdOrificeRadius * cvf::PI_D * subs->icdCount()); location->setSourcePdmObject(subs); if (ssi == 0) { // Add completion for ICD - std::shared_ptr icdCompletion(new RicMswCompletion(RigCompletionData::FISHBONES_ICD, QString("ICD"))); + std::shared_ptr icdCompletion(new RicMswFishbonesICD(QString("ICD"))); std::shared_ptr icdSegment(new RicMswSubSegment(subEndMD, 0.1, subEndTVD, 0.0)); + icdCompletion->setFlowCoefficient(subs->icdFlowCoefficient()); + double icdOrificeRadius = subs->icdOrificeDiameter(unitSystem) / 2; + icdCompletion->setArea(icdOrificeRadius * icdOrificeRadius * cvf::PI_D * subs->icdCount()); + icdCompletion->addSubSegment(icdSegment); location->addCompletion(icdCompletion); for (size_t lateralIndex : sub.lateralIndices) { QString label = QString("Lateral %1").arg(lateralIndex); - location->addCompletion(std::make_shared(RigCompletionData::FISHBONES, label, lateralIndex)); + location->addCompletion(std::make_shared(label, lateralIndex)); } assignFishbonesLateralIntersections( caseToApply, subs, location, &foundSubGridIntersections, maxSegmentLength); @@ -2096,7 +2088,7 @@ RicWellPathExportCompletionDataFeatureImpl::createMainBoreSegments( if (overlap > 0.0) { std::shared_ptr intervalCompletion( - new RicMswCompletion(RigCompletionData::PERFORATION, interval->name())); + new RicMswPerforation(interval->name())); std::vector completionData = generatePerforationsCompdatValues(wellPath, {interval}, exportSettings); assignPerforationIntervalIntersections( @@ -2122,7 +2114,7 @@ void RicWellPathExportCompletionDataFeatureImpl::assignSuperValveCompletions( { std::shared_ptr segment = mainBoreSegments[nMainSegment]; - std::shared_ptr superValve; + std::shared_ptr superValve; for (const RimPerforationInterval* interval : perforationIntervals) { std::vector perforationValves; @@ -2142,14 +2134,14 @@ void RicWellPathExportCompletionDataFeatureImpl::assignSuperValveCompletions( if (segment->startMD() <= valveMD && valveMD < segment->endMD()) { QString valveLabel = QString("%1 #%2").arg("Combined Valve for segment").arg(nMainSegment + 2); - superValve.reset(new RicMswCompletion(RigCompletionData::PERFORATION_ICD, valveLabel)); + superValve.reset(new RicMswPerforationICD(valveLabel)); std::shared_ptr subSegment(new RicMswSubSegment(valveMD, 0.1, 0.0, 0.0)); superValve->addSubSegment(subSegment); } else if (overlap > 0.0 && !superValve) { QString valveLabel = QString("%1 #%2").arg("Combined Valve for segment").arg(nMainSegment + 2); - superValve.reset(new RicMswCompletion(RigCompletionData::PERFORATION_ICD, valveLabel)); + superValve.reset(new RicMswPerforationICD(valveLabel)); std::shared_ptr subSegment(new RicMswSubSegment(overlapStart, 0.1, 0.0, 0.0)); superValve->addSubSegment(subSegment); } @@ -2176,12 +2168,13 @@ void RicWellPathExportCompletionDataFeatureImpl::assignValveContributionsToSuper ValveContributionMap assignedRegularValves; for (std::shared_ptr segment : mainBoreSegments) { - std::shared_ptr superValve; + std::shared_ptr superValve; for (auto completion : segment->completions()) { - if (completion->completionType() == RigCompletionData::PERFORATION_ICD) + std::shared_ptr valve = std::dynamic_pointer_cast(completion); + if (valve) { - superValve = completion; + superValve = valve; break; } } @@ -2217,10 +2210,10 @@ void RicWellPathExportCompletionDataFeatureImpl::assignValveContributionsToSuper } } } - segment->setIcdArea(totalIcdArea); + superValve->setArea(totalIcdArea); if (coeffMeanCalc.validAggregatedWeight()) { - segment->setIcdFlowCoefficient(coeffMeanCalc.weightedMean()); + superValve->setFlowCoefficient(coeffMeanCalc.weightedMean()); } } @@ -2372,7 +2365,7 @@ void RicWellPathExportCompletionDataFeatureImpl::assignFractureIntersections(con { CVF_ASSERT(foundSubGridIntersections != nullptr); - std::shared_ptr fractureCompletion(new RicMswCompletion(RigCompletionData::FRACTURE, fracture->name())); + std::shared_ptr fractureCompletion(new RicMswFracture(fracture->name())); double position = fracture->fractureMD(); double width = fracture->fractureTemplate()->computeFractureWidth(fracture);