mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Refactor RimWellPath and RigWellPath
This commit is contained in:
@@ -36,8 +36,8 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellPathStimplanIntersector::RigWellPathStimplanIntersector( const RigWellPath* wellPathGeom,
|
||||
const RimFracture* rimFracture )
|
||||
RigWellPathStimplanIntersector::RigWellPathStimplanIntersector( gsl::not_null<const RigWellPath*> wellPathGeom,
|
||||
gsl::not_null<const RimFracture*> rimFracture )
|
||||
{
|
||||
std::vector<cvf::Vec3d> wellPathPoints =
|
||||
wellPathGeom->wellPathPointsIncludingInterpolatedIntersectionPoint( rimFracture->fractureMD() );
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "cvfMatrix4.h"
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -48,7 +50,8 @@ public:
|
||||
double computeLength() const { return cvf::Math::sqrt( hlength * hlength + vlength * vlength ); }
|
||||
};
|
||||
|
||||
RigWellPathStimplanIntersector( const RigWellPath* wellpathGeom, const RimFracture* rimFracture );
|
||||
RigWellPathStimplanIntersector( gsl::not_null<const RigWellPath*> wellpathGeom,
|
||||
gsl::not_null<const RimFracture*> rimFracture );
|
||||
|
||||
const std::map<size_t, WellCellIntersection>& intersections() const;
|
||||
|
||||
|
||||
@@ -522,9 +522,8 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( cons
|
||||
{
|
||||
auto wellMdCalculator = RigSimulationWellCoordsAndMD( pipeBranchesCLCoords[brIdx] );
|
||||
|
||||
cvf::ref<RigWellPath> newWellPath = new RigWellPath();
|
||||
newWellPath->m_measuredDepths = wellMdCalculator.measuredDepths();
|
||||
newWellPath->m_wellPathPoints = wellMdCalculator.wellPathPoints();
|
||||
cvf::ref<RigWellPath> newWellPath =
|
||||
new RigWellPath( wellMdCalculator.wellPathPoints(), wellMdCalculator.measuredDepths() );
|
||||
|
||||
m_simWellBranchCache[simWellSeachItem].push_back( newWellPath.p() );
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
RigEclipseWellLogExtractor::RigEclipseWellLogExtractor( const RigEclipseCaseData* aCase,
|
||||
const RigWellPath* wellpath,
|
||||
const std::string& wellCaseErrorMsgName )
|
||||
RigEclipseWellLogExtractor::RigEclipseWellLogExtractor( gsl::not_null<const RigEclipseCaseData*> aCase,
|
||||
gsl::not_null<const RigWellPath*> wellpath,
|
||||
const std::string& wellCaseErrorMsgName )
|
||||
: RigWellLogExtractor( wellpath, wellCaseErrorMsgName )
|
||||
, m_caseData( aCase )
|
||||
{
|
||||
@@ -55,13 +55,13 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
|
||||
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
|
||||
|
||||
if ( m_wellPath->m_wellPathPoints.empty() ) return;
|
||||
if ( m_wellPathGeometry->wellPathPoints().empty() ) return;
|
||||
|
||||
for ( size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp )
|
||||
for ( size_t wpp = 0; wpp < m_wellPathGeometry->wellPathPoints().size() - 1; ++wpp )
|
||||
{
|
||||
std::vector<HexIntersectionInfo> intersections;
|
||||
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
|
||||
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp + 1];
|
||||
cvf::Vec3d p1 = m_wellPathGeometry->wellPathPoints()[wpp];
|
||||
cvf::Vec3d p2 = m_wellPathGeometry->wellPathPoints()[wpp + 1];
|
||||
|
||||
cvf::BoundingBox bb;
|
||||
|
||||
@@ -96,19 +96,19 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
// Inserting the intersections in this map will remove identical intersections
|
||||
// and sort them according to MD, CellIdx, Leave/enter
|
||||
|
||||
double md1 = m_wellPath->m_measuredDepths[wpp];
|
||||
double md2 = m_wellPath->m_measuredDepths[wpp + 1];
|
||||
double md1 = m_wellPathGeometry->measuredDepths()[wpp];
|
||||
double md2 = m_wellPathGeometry->measuredDepths()[wpp + 1];
|
||||
|
||||
insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections );
|
||||
}
|
||||
|
||||
if ( uniqueIntersections.empty() && m_wellPath->m_wellPathPoints.size() > 1 )
|
||||
if ( uniqueIntersections.empty() && m_wellPathGeometry->wellPathPoints().size() > 1 )
|
||||
{
|
||||
// When entering this function, all well path points are either completely outside the grid
|
||||
// or all well path points are inside one cell
|
||||
|
||||
cvf::Vec3d firstPoint = m_wellPath->m_wellPathPoints.front();
|
||||
cvf::Vec3d lastPoint = m_wellPath->m_wellPathPoints.back();
|
||||
cvf::Vec3d firstPoint = m_wellPathGeometry->wellPathPoints().front();
|
||||
cvf::Vec3d lastPoint = m_wellPathGeometry->wellPathPoints().back();
|
||||
|
||||
{
|
||||
cvf::BoundingBox bb;
|
||||
@@ -137,7 +137,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
isEntering,
|
||||
cvf::StructGridInterface::NO_FACE,
|
||||
globalCellIndex );
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPath->m_measuredDepths.front(),
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().front(),
|
||||
globalCellIndex,
|
||||
isEntering );
|
||||
|
||||
@@ -149,7 +149,7 @@ void RigEclipseWellLogExtractor::calculateIntersection()
|
||||
|
||||
bool isEntering = false;
|
||||
HexIntersectionInfo info( lastPoint, isEntering, cvf::StructGridInterface::NO_FACE, globalCellIndex );
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPath->m_measuredDepths.back(),
|
||||
RigMDCellIdxEnterLeaveKey enterLeaveKey( m_wellPathGeometry->measuredDepths().back(),
|
||||
globalCellIndex,
|
||||
isEntering );
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class BoundingBox;
|
||||
class RigEclipseWellLogExtractor : public RigWellLogExtractor
|
||||
{
|
||||
public:
|
||||
RigEclipseWellLogExtractor( const RigEclipseCaseData* aCase,
|
||||
const RigWellPath* wellpath,
|
||||
RigEclipseWellLogExtractor( gsl::not_null<const RigEclipseCaseData*> aCase,
|
||||
gsl::not_null<const RigWellPath*> wellpath,
|
||||
const std::string& wellCaseErrorMsgName );
|
||||
|
||||
void curveData( const RigResultAccessor* resultAccessor, std::vector<double>* values );
|
||||
|
||||
@@ -80,12 +80,12 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation( size_t subI
|
||||
RimWellPath* wellPath = nullptr;
|
||||
m_fishbonesSub->firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
|
||||
RigWellPath* rigWellPath = wellPath->wellPathGeometry();
|
||||
CVF_ASSERT( rigWellPath );
|
||||
auto wellPathGeometry = wellPath->wellPathGeometry();
|
||||
if ( !wellPathGeometry ) return;
|
||||
|
||||
double measuredDepth = m_fishbonesSub->measuredDepth( subIndex );
|
||||
|
||||
cvf::Vec3d position = rigWellPath->interpolatedPointAlongWellPath( measuredDepth );
|
||||
cvf::Vec3d position = wellPathGeometry->interpolatedPointAlongWellPath( measuredDepth );
|
||||
|
||||
cvf::Mat4d buildAngleMat;
|
||||
cvf::Vec3d lateralDirection;
|
||||
@@ -94,7 +94,7 @@ void RigFisbonesGeometry::computeLateralPositionAndOrientation( size_t subI
|
||||
cvf::Vec3d lateralInitialDirection = cvf::Vec3d::Z_AXIS;
|
||||
cvf::Vec3d p1 = cvf::Vec3d::UNDEFINED;
|
||||
cvf::Vec3d p2 = cvf::Vec3d::UNDEFINED;
|
||||
rigWellPath->twoClosestPoints( position, &p1, &p2 );
|
||||
wellPathGeometry->twoClosestPoints( position, &p1, &p2 );
|
||||
|
||||
CVF_ASSERT( !p1.isUndefined() && !p2.isUndefined() );
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ const double RigGeoMechWellLogExtractor::GRAVITY_ACCEL = 9.81; // m /
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGeoMechWellLogExtractor::RigGeoMechWellLogExtractor( RigGeoMechCaseData* aCase,
|
||||
const RigWellPath* wellpath,
|
||||
const std::string& wellCaseErrorMsgName )
|
||||
RigGeoMechWellLogExtractor::RigGeoMechWellLogExtractor( gsl::not_null<RigGeoMechCaseData*> aCase,
|
||||
gsl::not_null<const RigWellPath*> wellpath,
|
||||
const std::string& wellCaseErrorMsgName )
|
||||
: RigWellLogExtractor( wellpath, wellCaseErrorMsgName )
|
||||
, m_caseData( aCase )
|
||||
{
|
||||
@@ -118,7 +118,7 @@ QString RigGeoMechWellLogExtractor::curveData( const RigFemResultAddress& resAdd
|
||||
|
||||
if ( resAddr.resultPosType == RIG_WELLPATH_DERIVED )
|
||||
{
|
||||
if ( m_wellPath->rkbDiff() == HUGE_VAL )
|
||||
if ( m_wellPathGeometry->rkbDiff() == HUGE_VAL )
|
||||
{
|
||||
RiaLogging::error( "Well path has an invalid datum elevation and we cannot estimate TVDRKB. No well bore "
|
||||
"stability curves created." );
|
||||
@@ -276,7 +276,7 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
std::vector<float> tvdRKBs;
|
||||
for ( double tvdValue : m_intersectionTVDs )
|
||||
{
|
||||
tvdRKBs.push_back( tvdValue + m_wellPath->rkbDiff() );
|
||||
tvdRKBs.push_back( tvdValue + m_wellPathGeometry->rkbDiff() );
|
||||
}
|
||||
RigFemResultAddress elementPropertyAddr = parameter.femAddress( RigWbsParameter::ELEMENT_PROPERTY_TABLE );
|
||||
elementPropertyValuesInput = &( resultCollection->resultValues( elementPropertyAddr, 0, frameIndex ) );
|
||||
@@ -970,11 +970,11 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
|
||||
const RigFemPart* femPart = m_caseData->femParts()->part( 0 );
|
||||
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
|
||||
|
||||
for ( size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp )
|
||||
for ( size_t wpp = 0; wpp < m_wellPathGeometry->wellPathPoints().size() - 1; ++wpp )
|
||||
{
|
||||
std::vector<HexIntersectionInfo> intersections;
|
||||
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
|
||||
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp + 1];
|
||||
cvf::Vec3d p1 = m_wellPathGeometry->wellPathPoints()[wpp];
|
||||
cvf::Vec3d p2 = m_wellPathGeometry->wellPathPoints()[wpp + 1];
|
||||
|
||||
cvf::BoundingBox bb;
|
||||
|
||||
@@ -1011,8 +1011,8 @@ void RigGeoMechWellLogExtractor::calculateIntersection()
|
||||
// Inserting the intersections in this map will remove identical intersections
|
||||
// and sort them according to MD, CellIdx, Leave/enter
|
||||
|
||||
double md1 = m_wellPath->m_measuredDepths[wpp];
|
||||
double md2 = m_wellPath->m_measuredDepths[wpp + 1];
|
||||
double md1 = m_wellPathGeometry->measuredDepths()[wpp];
|
||||
double md2 = m_wellPathGeometry->measuredDepths()[wpp + 1];
|
||||
|
||||
insertIntersectionsInMap( intersections, p1, md1, p2, md2, &uniqueIntersections );
|
||||
}
|
||||
@@ -1068,7 +1068,7 @@ cvf::Vec3d RigGeoMechWellLogExtractor::calculateWellPathTangent( int64_t
|
||||
if ( calculationType == TangentFollowWellPathSegments )
|
||||
{
|
||||
cvf::Vec3d segmentStart, segmentEnd;
|
||||
m_wellPath->twoClosestPoints( m_intersections[intersectionIdx], &segmentStart, &segmentEnd );
|
||||
m_wellPathGeometry->twoClosestPoints( m_intersections[intersectionIdx], &segmentStart, &segmentEnd );
|
||||
return ( segmentEnd - segmentStart ).getNormalized();
|
||||
}
|
||||
else
|
||||
@@ -1374,7 +1374,7 @@ double RigGeoMechWellLogExtractor::hydroStaticPorePressureForIntersection( size_
|
||||
double waterDensityGCM3 ) const
|
||||
{
|
||||
double trueVerticalDepth = m_intersectionTVDs[intersectionIdx];
|
||||
double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff();
|
||||
double effectiveDepthMeters = trueVerticalDepth + m_wellPathGeometry->rkbDiff();
|
||||
return hydroStaticPorePressureAtDepth( effectiveDepthMeters, waterDensityGCM3 );
|
||||
}
|
||||
|
||||
@@ -1385,7 +1385,7 @@ double RigGeoMechWellLogExtractor::hydroStaticPorePressureForSegment( size_t int
|
||||
{
|
||||
cvf::Vec3f centroid = cellCentroid( intersectionIdx );
|
||||
double trueVerticalDepth = -centroid.z();
|
||||
double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff();
|
||||
double effectiveDepthMeters = trueVerticalDepth + m_wellPathGeometry->rkbDiff();
|
||||
return hydroStaticPorePressureAtDepth( effectiveDepthMeters, waterDensityGCM3 );
|
||||
}
|
||||
|
||||
@@ -1405,9 +1405,9 @@ double RigGeoMechWellLogExtractor::hydroStaticPorePressureAtDepth( double effect
|
||||
double RigGeoMechWellLogExtractor::wbsCurveValuesAtMsl() const
|
||||
{
|
||||
double waterDensityGCM3 = m_userDefinedValues.at( RigWbsParameter::waterDensity() );
|
||||
double waterDepth = std::abs( wellPathData()->wellPathPoints().front().z() );
|
||||
double waterDepth = std::abs( m_wellPathGeometry->wellPathPoints().front().z() );
|
||||
|
||||
double rkbDiff = wellPathData()->rkbDiff();
|
||||
double rkbDiff = m_wellPathGeometry->rkbDiff();
|
||||
if ( rkbDiff == std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
rkbDiff = 0.0;
|
||||
|
||||
@@ -58,8 +58,8 @@ public:
|
||||
using WbsParameterSourceEnum = RigWbsParameter::SourceEnum;
|
||||
|
||||
public:
|
||||
RigGeoMechWellLogExtractor( RigGeoMechCaseData* aCase,
|
||||
const RigWellPath* wellpath,
|
||||
RigGeoMechWellLogExtractor( gsl::not_null<RigGeoMechCaseData*> aCase,
|
||||
gsl::not_null<const RigWellPath*> wellpath,
|
||||
const std::string& wellCaseErrorMsgName );
|
||||
|
||||
void performCurveDataSmoothing( int frameIndex,
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellLogExtractor::RigWellLogExtractor( const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName )
|
||||
: m_wellPath( wellpath )
|
||||
RigWellLogExtractor::RigWellLogExtractor( gsl::not_null<const RigWellPath*> wellpath,
|
||||
const std::string& wellCaseErrorMsgName )
|
||||
: m_wellPathGeometry( wellpath )
|
||||
, m_wellCaseErrorMsgName( wellCaseErrorMsgName )
|
||||
{
|
||||
}
|
||||
@@ -97,9 +98,9 @@ const std::vector<size_t>& RigWellLogExtractor::intersectedCellsGlobIdx() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigWellPath* RigWellLogExtractor::wellPathData() const
|
||||
const RigWellPath* RigWellLogExtractor::wellPathGeometry() const
|
||||
{
|
||||
return m_wellPath.p();
|
||||
return m_wellPathGeometry.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -202,14 +203,15 @@ void RigWellLogExtractor::populateReturnArrays( std::map<RigMDCellIdxEnterLeaveK
|
||||
{
|
||||
// Needs wellpath start point in front
|
||||
HexIntersectionInfo firstLeavingPoint = it->second;
|
||||
firstLeavingPoint.m_intersectionPoint = m_wellPath->m_wellPathPoints[0];
|
||||
firstLeavingPoint.m_intersectionPoint = m_wellPathGeometry->wellPathPoints()[0];
|
||||
firstLeavingPoint.m_face = cvf::StructGridInterface::NO_FACE;
|
||||
firstLeavingPoint.m_isIntersectionEntering = true;
|
||||
|
||||
sortedUniqueIntersections.insert( std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPath->m_measuredDepths[0],
|
||||
true,
|
||||
firstLeavingPoint.m_hexIndex ),
|
||||
firstLeavingPoint ) );
|
||||
sortedUniqueIntersections.insert(
|
||||
std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPathGeometry->measuredDepths()[0],
|
||||
true,
|
||||
firstLeavingPoint.m_hexIndex ),
|
||||
firstLeavingPoint ) );
|
||||
}
|
||||
|
||||
// Add an intersection for the well endpoint possibly inside the last cell.
|
||||
@@ -221,12 +223,14 @@ void RigWellLogExtractor::populateReturnArrays( std::map<RigMDCellIdxEnterLeaveK
|
||||
{
|
||||
// Needs wellpath end point at end
|
||||
HexIntersectionInfo lastEnterPoint = rit->second;
|
||||
lastEnterPoint.m_intersectionPoint = m_wellPath->m_wellPathPoints.back();
|
||||
lastEnterPoint.m_intersectionPoint = m_wellPathGeometry->wellPathPoints().back();
|
||||
lastEnterPoint.m_isIntersectionEntering = false;
|
||||
lastEnterPoint.m_face = cvf::StructGridInterface::NO_FACE;
|
||||
|
||||
sortedUniqueIntersections.insert(
|
||||
std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPath->m_measuredDepths.back(), false, lastEnterPoint.m_hexIndex ),
|
||||
std::make_pair( RigMDEnterLeaveCellIdxKey( m_wellPathGeometry->measuredDepths().back(),
|
||||
false,
|
||||
lastEnterPoint.m_hexIndex ),
|
||||
lastEnterPoint ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,14 +59,14 @@ class RigWellPath;
|
||||
class RigWellLogExtractor : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigWellLogExtractor( const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName );
|
||||
RigWellLogExtractor( gsl::not_null<const RigWellPath*> wellpath, const std::string& wellCaseErrorMsgName );
|
||||
~RigWellLogExtractor() override;
|
||||
|
||||
const std::vector<double>& cellIntersectionMDs() const;
|
||||
const std::vector<double>& cellIntersectionTVDs() const;
|
||||
const std::vector<size_t>& intersectedCellsGlobIdx() const;
|
||||
|
||||
const RigWellPath* wellPathData() const;
|
||||
const RigWellPath* wellPathGeometry() const;
|
||||
|
||||
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfosAlongWellPath() const;
|
||||
|
||||
@@ -90,7 +90,7 @@ protected:
|
||||
std::vector<size_t> m_intersectedCellsGlobIdx;
|
||||
std::vector<cvf::StructGridInterface::FaceType> m_intersectedCellFaces;
|
||||
|
||||
cvf::cref<RigWellPath> m_wellPath;
|
||||
cvf::cref<RigWellPath> m_wellPathGeometry;
|
||||
|
||||
std::vector<double> m_intersectionMeasuredDepths;
|
||||
std::vector<double> m_intersectionTVDs;
|
||||
|
||||
@@ -31,6 +31,99 @@ RigWellPath::RigWellPath()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellPath::RigWellPath( const RigWellPath& rhs )
|
||||
: m_wellPathPoints( rhs.m_wellPathPoints )
|
||||
, m_measuredDepths( rhs.m_measuredDepths )
|
||||
, m_hasDatumElevation( rhs.m_hasDatumElevation )
|
||||
, m_datumElevation( rhs.m_datumElevation )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellPath::RigWellPath( const std::vector<cvf::Vec3d>& wellPathPoints, const std::vector<double>& measuredDepths )
|
||||
: m_wellPathPoints( wellPathPoints )
|
||||
, m_measuredDepths( measuredDepths )
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWellPath& RigWellPath::operator=( const RigWellPath& rhs )
|
||||
{
|
||||
m_wellPathPoints = rhs.m_wellPathPoints;
|
||||
m_measuredDepths = rhs.m_measuredDepths;
|
||||
m_hasDatumElevation = rhs.m_hasDatumElevation;
|
||||
m_datumElevation = rhs.m_datumElevation;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<cvf::Vec3d>& RigWellPath::wellPathPoints() const
|
||||
{
|
||||
return m_wellPathPoints;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>& RigWellPath::measuredDepths() const
|
||||
{
|
||||
return m_measuredDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigWellPath::trueVerticalDepths() const
|
||||
{
|
||||
std::vector<double> tvds;
|
||||
for ( const cvf::Vec3d& point : m_wellPathPoints )
|
||||
{
|
||||
tvds.push_back( std::fabs( point.z() ) );
|
||||
}
|
||||
return tvds;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPath::setWellPathPoints( const std::vector<cvf::Vec3d>& wellPathPoints )
|
||||
{
|
||||
m_wellPathPoints = wellPathPoints;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPath::setMeasuredDepths( const std::vector<double>& measuredDepths )
|
||||
{
|
||||
m_measuredDepths = measuredDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPath::addWellPathPoint( const cvf::Vec3d& wellPathPoint )
|
||||
{
|
||||
m_wellPathPoints.push_back( wellPathPoint );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPath::addMeasuredDepth( double measuredDepth )
|
||||
{
|
||||
m_measuredDepths.push_back( measuredDepth );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -399,26 +492,3 @@ std::vector<cvf::Vec3d> RigWellPath::clipPolylineStartAboveZ( const std::vector<
|
||||
|
||||
return clippedPolyLine;
|
||||
}
|
||||
|
||||
const std::vector<cvf::Vec3d>& RigWellPath::wellPathPoints() const
|
||||
{
|
||||
return m_wellPathPoints;
|
||||
}
|
||||
|
||||
const std::vector<double>& RigWellPath::measureDepths() const
|
||||
{
|
||||
return m_measuredDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigWellPath::trueVerticalDepths() const
|
||||
{
|
||||
std::vector<double> tvds;
|
||||
for ( const cvf::Vec3d& point : m_wellPathPoints )
|
||||
{
|
||||
tvds.push_back( std::fabs( point.z() ) );
|
||||
}
|
||||
return tvds;
|
||||
}
|
||||
|
||||
@@ -35,14 +35,21 @@ class BoundingBox;
|
||||
class RigWellPath : public cvf::Object
|
||||
{
|
||||
public:
|
||||
std::vector<cvf::Vec3d> m_wellPathPoints;
|
||||
std::vector<double> m_measuredDepths;
|
||||
RigWellPath();
|
||||
RigWellPath( const std::vector<cvf::Vec3d>& wellPathPoints, const std::vector<double>& measuredDepths );
|
||||
RigWellPath( const RigWellPath& rhs );
|
||||
RigWellPath& operator=( const RigWellPath& rhs );
|
||||
|
||||
const std::vector<cvf::Vec3d>& wellPathPoints() const;
|
||||
const std::vector<double>& measureDepths() const;
|
||||
const std::vector<double>& measuredDepths() const;
|
||||
std::vector<double> trueVerticalDepths() const;
|
||||
|
||||
RigWellPath();
|
||||
void setWellPathPoints( const std::vector<cvf::Vec3d>& wellPathPoints );
|
||||
void setMeasuredDepths( const std::vector<double>& measuredDepths );
|
||||
|
||||
void addWellPathPoint( const cvf::Vec3d& wellPathPoint );
|
||||
void addMeasuredDepth( double measuredDepth );
|
||||
|
||||
void setDatumElevation( double value );
|
||||
bool hasDatumElevation() const;
|
||||
double datumElevation() const;
|
||||
@@ -69,6 +76,9 @@ public:
|
||||
size_t* indexToFirstVisibleSegment );
|
||||
|
||||
private:
|
||||
std::vector<cvf::Vec3d> m_wellPathPoints;
|
||||
std::vector<double> m_measuredDepths;
|
||||
|
||||
bool m_hasDatumElevation;
|
||||
double m_datumElevation;
|
||||
};
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPathGeometryExporter::exportWellPathGeometry( const RimWellPath* wellPath,
|
||||
double mdStepSize,
|
||||
std::vector<double>& xValues,
|
||||
std::vector<double>& yValues,
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues,
|
||||
bool& useMdRkb )
|
||||
void RigWellPathGeometryExporter::exportWellPathGeometry( gsl::not_null<const RimWellPath*> wellPath,
|
||||
double mdStepSize,
|
||||
std::vector<double>& xValues,
|
||||
std::vector<double>& yValues,
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues,
|
||||
bool& useMdRkb )
|
||||
{
|
||||
auto wellPathGeom = wellPath->wellPathGeometry();
|
||||
if ( !wellPathGeom ) return;
|
||||
@@ -41,7 +41,7 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( const RimWellPath* w
|
||||
useMdRkb = false;
|
||||
double rkbOffset = 0.0;
|
||||
{
|
||||
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>( wellPath );
|
||||
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>( wellPath.get() );
|
||||
if ( modeledWellPath )
|
||||
{
|
||||
useMdRkb = true;
|
||||
@@ -55,13 +55,13 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( const RimWellPath* w
|
||||
}
|
||||
}
|
||||
}
|
||||
exportWellPathGeometry( wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues );
|
||||
exportWellPathGeometry( *wellPathGeom, mdStepSize, rkbOffset, xValues, yValues, tvdValues, mdValues );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellPathGeometryExporter::exportWellPathGeometry( const RigWellPath* wellPathGeom,
|
||||
void RigWellPathGeometryExporter::exportWellPathGeometry( const RigWellPath& wellPathGeom,
|
||||
double mdStepSize,
|
||||
double rkbOffset,
|
||||
std::vector<double>& xValues,
|
||||
@@ -69,8 +69,8 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( const RigWellPath* w
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues )
|
||||
{
|
||||
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
|
||||
double endMd = wellPathGeom->measureDepths().back();
|
||||
double currMd = wellPathGeom.measuredDepths().front() - mdStepSize;
|
||||
double endMd = wellPathGeom.measuredDepths().back();
|
||||
|
||||
bool isFirst = true;
|
||||
double prevMd = 0.0;
|
||||
@@ -80,7 +80,7 @@ void RigWellPathGeometryExporter::exportWellPathGeometry( const RigWellPath* w
|
||||
currMd += mdStepSize;
|
||||
if ( currMd > endMd ) currMd = endMd;
|
||||
|
||||
auto pt = wellPathGeom->interpolatedPointAlongWellPath( currMd );
|
||||
auto pt = wellPathGeom.interpolatedPointAlongWellPath( currMd );
|
||||
double tvd = -pt.z();
|
||||
|
||||
// The change in measured depth (MD) must be greater or equal to change in
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <gsl/gsl>
|
||||
|
||||
#include <vector>
|
||||
|
||||
class RimWellPath;
|
||||
@@ -29,15 +31,15 @@ class RigWellPath;
|
||||
class RigWellPathGeometryExporter
|
||||
{
|
||||
public:
|
||||
static void exportWellPathGeometry( const RimWellPath* wellPath,
|
||||
double mdStepSize,
|
||||
std::vector<double>& xValues,
|
||||
std::vector<double>& yValues,
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues,
|
||||
bool& useMdRkb );
|
||||
static void exportWellPathGeometry( gsl::not_null<const RimWellPath*> wellPath,
|
||||
double mdStepSize,
|
||||
std::vector<double>& xValues,
|
||||
std::vector<double>& yValues,
|
||||
std::vector<double>& tvdValues,
|
||||
std::vector<double>& mdValues,
|
||||
bool& useMdRkb );
|
||||
|
||||
static void exportWellPathGeometry( const RigWellPath* wellPath,
|
||||
static void exportWellPathGeometry( const RigWellPath& wellPath,
|
||||
double mdStepSize,
|
||||
double rkbOffset,
|
||||
std::vector<double>& xValues,
|
||||
|
||||
@@ -43,9 +43,7 @@ std::vector<WellPathCellIntersectionInfo>
|
||||
|
||||
if ( pathCoords.size() < 2 ) return intersectionInfos;
|
||||
|
||||
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath;
|
||||
dummyWellPath->m_wellPathPoints = pathCoords;
|
||||
dummyWellPath->m_measuredDepths = pathMds;
|
||||
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath( pathCoords, pathMds );
|
||||
|
||||
std::string errorIdName = ( wellPathName + " " + caseData->ownerCase()->caseUserDescription() ).toStdString();
|
||||
|
||||
@@ -90,19 +88,17 @@ std::set<size_t> RigWellPathIntersectionTools::findIntersectedGlobalCellIndices(
|
||||
|
||||
if ( caseData )
|
||||
{
|
||||
cvf::ref<RigWellPath> dummyWellPath = new RigWellPath;
|
||||
cvf::ref<RigWellPath> dummyWellPath;
|
||||
|
||||
if ( measuredDepths.size() == coords.size() )
|
||||
{
|
||||
dummyWellPath->m_wellPathPoints = coords;
|
||||
dummyWellPath->m_measuredDepths = measuredDepths;
|
||||
dummyWellPath = new RigWellPath( coords, measuredDepths );
|
||||
}
|
||||
else
|
||||
{
|
||||
RigSimulationWellCoordsAndMD helper( coords );
|
||||
|
||||
dummyWellPath->m_wellPathPoints = helper.wellPathPoints();
|
||||
dummyWellPath->m_measuredDepths = helper.measuredDepths();
|
||||
dummyWellPath = new RigWellPath( helper.wellPathPoints(), helper.measuredDepths() );
|
||||
}
|
||||
|
||||
globalCellIndices = findIntersectedGlobalCellIndicesForWellPath( caseData, dummyWellPath.p() );
|
||||
|
||||
Reference in New Issue
Block a user