diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp index bee301d7ee..0d0d7db423 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp @@ -114,19 +114,25 @@ void RimEllipseFractureTemplate::fractureTriangleGeometry( std::vector RimEllipseFractureTemplate::fractureBorderPolygon() const +std::vector RimEllipseFractureTemplate::fractureBorderPolygon( double wellPathDepthAtFracture ) const { std::vector polygon; std::vector nodeCoords; std::vector triangleIndices; - fractureTriangleGeometry( &nodeCoords, &triangleIndices, -1.0 ); + fractureTriangleGeometry( &nodeCoords, &triangleIndices, wellPathDepthAtFracture ); for ( size_t i = 1; i < nodeCoords.size(); i++ ) { @@ -179,8 +185,8 @@ cvf::cref RimEllipseFractureTemplate::createFractureGrid( doubl { double X1 = -halfLength + i * cellSizeX; double X2 = -halfLength + ( i + 1 ) * cellSizeX; - double Y1 = -height / 2 + j * cellSizeZ; - double Y2 = -height / 2 + ( j + 1 ) * cellSizeZ; + double Y1 = -height / 2 + j * cellSizeZ + wellPathDepthAtFracture; + double Y2 = -height / 2 + ( j + 1 ) * cellSizeZ + wellPathDepthAtFracture; std::vector cellPolygon; cellPolygon.push_back( cvf::Vec3d( X1, Y1, 0.0 ) ); @@ -190,7 +196,7 @@ cvf::cref RimEllipseFractureTemplate::createFractureGrid( doubl double cond = conductivity(); - std::vector ellipseFracPolygon = fractureBorderPolygon(); + std::vector ellipseFracPolygon = fractureBorderPolygon( wellPathDepthAtFracture ); std::vector ellipseFracPolygonDouble; for ( const auto& v : ellipseFracPolygon ) ellipseFracPolygonDouble.push_back( static_cast( v ) ); @@ -471,3 +477,12 @@ void RimEllipseFractureTemplate::defineUiOrdering( QString uiConfigName, caf::Pd RimFractureTemplate::defineUiOrdering( uiConfigName, uiOrdering ); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::pair RimEllipseFractureTemplate::wellPathDepthAtFractureRange() const +{ + double scaledHalfHeight = height() * m_heightScaleFactor / 2.0; + return std::make_pair( -scaledHalfHeight, scaledHalfHeight ); +} diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h b/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h index 3c9eaf60c3..3f174aec0c 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h @@ -49,6 +49,8 @@ public: std::vector* polygonIndices, double wellPathDepthAtFracture ) const override; + std::pair wellPathDepthAtFractureRange() const override; + void changeUnits(); cvf::cref createFractureGrid( double wellPathDepthAtFracture ) const override; void setDefaultValuesFromUnit(); @@ -74,10 +76,8 @@ private: QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; - void onLoadDataAndUpdateGeometryHasChanged() override; - - void createFractureGridAndAssignConductivities(); - std::vector fractureBorderPolygon() const; + void onLoadDataAndUpdateGeometryHasChanged() override; + std::vector fractureBorderPolygon( double wellPathDepthAtFracture ) const; WellFractureIntersectionData wellFractureIntersectionData( const RimFracture* fractureInstance ) const override; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFracture.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFracture.cpp index aa98dcfb6a..b7cd2cbaf1 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFracture.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFracture.cpp @@ -737,13 +737,10 @@ void RimFracture::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& ui m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden( false ); m_stimPlanTimeIndexToPlot.uiCapability()->setUiReadOnly( true ); - - m_wellPathDepthAtFracture.uiCapability()->setUiHidden( false ); } else { m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden( true ); - m_wellPathDepthAtFracture.uiCapability()->setUiHidden( true ); } } else @@ -784,11 +781,9 @@ void RimFracture::defineEditorAttribute( const caf::PdmFieldHandle* field, caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast( attribute ); if ( myAttr ) { - RimStimPlanFractureTemplate* stimPlanFracTemplate = - dynamic_cast( fractureTemplate() ); - if ( stimPlanFracTemplate ) + if ( fractureTemplate() ) { - auto [minimum, maximum] = stimPlanFracTemplate->wellPathDepthAtFractureRange(); + auto [minimum, maximum] = fractureTemplate()->wellPathDepthAtFractureRange(); myAttr->m_minimum = minimum; myAttr->m_maximum = maximum; } @@ -865,6 +860,10 @@ void RimFracture::setFractureTemplate( RimFractureTemplate* fractureTemplate ) m_stimPlanTimeIndexToPlot = stimPlanFracTemplate->activeTimeStepIndex(); m_wellPathDepthAtFracture = stimPlanFracTemplate->wellPathDepthAtFracture(); } + else + { + m_wellPathDepthAtFracture = 0.0; + } if ( fractureTemplate->orientationType() == RimFractureTemplate::AZIMUTH ) { diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.h b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.h index 6d6e31c5d4..3af6ead3d1 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplate.h @@ -136,6 +136,8 @@ public: FracConductivityEnum conductivityType() const; double perforationLength() const; + virtual std::pair wellPathDepthAtFractureRange() const = 0; + virtual void fractureTriangleGeometry( std::vector* nodeCoords, std::vector* triangleIndices, double wellPathDepthAtFracture ) const = 0; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h index 9f0523a09a..26e8e01e0c 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h @@ -62,7 +62,7 @@ public: void updateFilePathsFromProjectPath( const QString& newProjectPath, const QString& oldProjectPath ); double wellPathDepthAtFracture() const; - std::pair wellPathDepthAtFractureRange() const; + std::pair wellPathDepthAtFractureRange() const override; // Fracture geometry cvf::cref createFractureGrid( double wellPathDepthAtFracture ) const override;