mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash in RimWellPathValve when perforation is larger than wellpath
* This is the case with the Completions_msw Regression test
This commit is contained in:
parent
c51b938d03
commit
539914a541
@ -144,9 +144,13 @@ void RimMultipleValveLocations::computeRangesAndLocations()
|
|||||||
double firstWellPathMD = rigWellPathGeo->m_measuredDepths.front();
|
double firstWellPathMD = rigWellPathGeo->m_measuredDepths.front();
|
||||||
double lastWellPathMD = rigWellPathGeo->m_measuredDepths.back();
|
double lastWellPathMD = rigWellPathGeo->m_measuredDepths.back();
|
||||||
|
|
||||||
for (auto md : locationsFromStartSpacingAndCount(m_rangeStart, m_rangeValveSpacing, m_rangeValveCount))
|
double overlapStart = std::max(firstWellPathMD, m_rangeStart());
|
||||||
|
double overlapEnd = std::min(lastWellPathMD, m_rangeEnd());
|
||||||
|
double overlap = std::max(0.0, overlapEnd - overlapStart);
|
||||||
|
|
||||||
|
if (overlap)
|
||||||
{
|
{
|
||||||
if (md >= firstWellPathMD && md <= lastWellPathMD)
|
for (auto md : locationsFromStartSpacingAndCount(overlapStart, m_rangeValveSpacing, m_rangeValveCount))
|
||||||
{
|
{
|
||||||
validMeasuredDepths.push_back(md);
|
validMeasuredDepths.push_back(md);
|
||||||
}
|
}
|
||||||
@ -333,7 +337,7 @@ void RimMultipleValveLocations::fieldChangedByUi(const caf::PdmFieldHandle* chan
|
|||||||
}
|
}
|
||||||
else if (valve)
|
else if (valve)
|
||||||
{
|
{
|
||||||
valve->geometryUpdated();
|
valve->multipleValveGeometryUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -84,8 +84,10 @@ void RimWellPathValve::setMeasuredDepthAndCount(double startMD, double spacing,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPathValve::geometryUpdated()
|
void RimWellPathValve::multipleValveGeometryUpdated()
|
||||||
{
|
{
|
||||||
|
if (m_multipleValveLocations->valveLocations().empty()) return;
|
||||||
|
|
||||||
m_measuredDepth = m_multipleValveLocations->valveLocations().front();
|
m_measuredDepth = m_multipleValveLocations->valveLocations().front();
|
||||||
|
|
||||||
RimProject* proj;
|
RimProject* proj;
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
~RimWellPathValve() override;
|
~RimWellPathValve() override;
|
||||||
|
|
||||||
void setMeasuredDepthAndCount(double startMD, double spacing, int valveCount);
|
void setMeasuredDepthAndCount(double startMD, double spacing, int valveCount);
|
||||||
void geometryUpdated();
|
void multipleValveGeometryUpdated();
|
||||||
std::vector<double> valveLocations() const;
|
std::vector<double> valveLocations() const;
|
||||||
double orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
double orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||||
double flowCoefficient() const;
|
double flowCoefficient() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user