#3779 Split RicMswCompletions into subclasses and move ICD-area and flow coefficient from segment to the icd completion class

This commit is contained in:
Gaute Lindkvist
2018-12-06 10:55:23 +01:00
parent 8fbc1d0953
commit 73be6b6b19
3 changed files with 213 additions and 88 deletions

View File

@@ -158,25 +158,15 @@ std::vector<std::shared_ptr<RicMswSubSegmentCellIntersection>>& 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;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -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<std::shared_ptr<RicMswSubSegment>> 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<RicMswCompletion> 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;

View File

@@ -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<RicMswICD> icd = std::static_pointer_cast<RicMswICD>(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<RicMswCompletion> icdCompletion(new RicMswCompletion(RigCompletionData::FISHBONES_ICD, QString("ICD")));
std::shared_ptr<RicMswFishbonesICD> icdCompletion(new RicMswFishbonesICD(QString("ICD")));
std::shared_ptr<RicMswSubSegment> 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<RicMswCompletion>(RigCompletionData::FISHBONES, label, lateralIndex));
location->addCompletion(std::make_shared<RicMswFishbones>(label, lateralIndex));
}
assignFishbonesLateralIntersections(
caseToApply, subs, location, &foundSubGridIntersections, maxSegmentLength);
@@ -2096,7 +2088,7 @@ RicWellPathExportCompletionDataFeatureImpl::createMainBoreSegments(
if (overlap > 0.0)
{
std::shared_ptr<RicMswCompletion> intervalCompletion(
new RicMswCompletion(RigCompletionData::PERFORATION, interval->name()));
new RicMswPerforation(interval->name()));
std::vector<RigCompletionData> completionData =
generatePerforationsCompdatValues(wellPath, {interval}, exportSettings);
assignPerforationIntervalIntersections(
@@ -2122,7 +2114,7 @@ void RicWellPathExportCompletionDataFeatureImpl::assignSuperValveCompletions(
{
std::shared_ptr<RicMswSegment> segment = mainBoreSegments[nMainSegment];
std::shared_ptr<RicMswCompletion> superValve;
std::shared_ptr<RicMswPerforationICD> superValve;
for (const RimPerforationInterval* interval : perforationIntervals)
{
std::vector<const RimWellPathValve*> 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<RicMswSubSegment> 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<RicMswSubSegment> 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<RicMswSegment> segment : mainBoreSegments)
{
std::shared_ptr<RicMswCompletion> superValve;
std::shared_ptr<RicMswPerforationICD> superValve;
for (auto completion : segment->completions())
{
if (completion->completionType() == RigCompletionData::PERFORATION_ICD)
std::shared_ptr<RicMswPerforationICD> valve = std::dynamic_pointer_cast<RicMswPerforationICD>(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<RicMswCompletion> fractureCompletion(new RicMswCompletion(RigCompletionData::FRACTURE, fracture->name()));
std::shared_ptr<RicMswFracture> fractureCompletion(new RicMswFracture(fracture->name()));
double position = fracture->fractureMD();
double width = fracture->fractureTemplate()->computeFractureWidth(fracture);