///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020- Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaStimPlanModelDefines.h" #include "RimCheckableNamedObject.h" #include "RimExtractionConfiguration.h" #include "RimPerforationInterval.h" #include "RimWellPathComponentInterface.h" #include "Well/RigWellLogExtractor.h" #include "cafPdmChildField.h" #include "cafPdmFieldCvfVec3d.h" #include "cafPdmProxyValueField.h" #include "cafPdmPtrField.h" class RimEclipseCase; class RimWellPath; class RimModeledWellPath; class RimElasticProperties; class RigEclipseCaseData; class RimAnnotationCollectionBase; class RimUserDefinedPolylinesAnnotation; class RimFaciesProperties; class RimStimPlanModelTemplate; class RimTextAnnotation; class RimStimPlanModelCalculator; class RimColorLegend; #include //================================================================================================== /// /// //================================================================================================== class RimStimPlanModel : public RimCheckableNamedObject, public RimWellPathComponentInterface { CAF_PDM_HEADER_INIT; public: enum class ExtractionType { TRUE_VERTICAL_THICKNESS, TRUE_STRATIGRAPHIC_THICKNESS, }; enum class FractureOrientation { ALONG_WELL_PATH, TRANSVERSE_WELL_PATH, AZIMUTH }; enum class MissingValueStrategy { DEFAULT_VALUE, LINEAR_INTERPOLATION, OTHER_CURVE_PROPERTY, CELLS_ABOVE, CELLS_BELOW }; enum class BurdenStrategy { DEFAULT_VALUE, GRADIENT }; RimStimPlanModel(); ~RimStimPlanModel() override; void setMD( double md ); int timeStep() const; void setTimeStep( int timeStep ); void setEclipseCase( RimEclipseCase* eclipseCase ); RimEclipseCase* eclipseCaseForProperty( RiaDefines::CurveProperty curveProperty ) const; void setEclipseCaseAndTimeStep( RimEclipseCase* eclipseCase, int timeStep ); cvf::Vec3d anchorPosition() const; cvf::Vec3d thicknessDirection() const; void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; cvf::Vec3d fracturePosition() const; double defaultPorosity() const; double defaultPermeability() const; double defaultFaciesValue() const; double verticalStress() const; double verticalStressGradient() const; double stressDepth() const; double overburdenHeight() const; double underburdenHeight() const; double defaultOverburdenPorosity() const; double defaultUnderburdenPorosity() const; double defaultOverburdenPermeability() const; double defaultUnderburdenPermeability() const; QString overburdenFormation() const; QString overburdenFacies() const; QString underburdenFormation() const; QString underburdenFacies() const; double referenceTemperature() const; double referenceTemperatureGradient() const; double referenceTemperatureDepth() const; bool useDetailedFluidLoss() const; double perforationLength() const; FractureOrientation fractureOrientation() const; double formationDip() const; bool hasBarrier() const; double distanceToBarrier() const; double barrierDip() const; int wellPenetrationLayer() const; // RimWellPathCompletionsInterface overrides. RiaDefines::WellPathComponentType componentType() const override; QString componentLabel() const override; QString componentTypeLabel() const override; cvf::Color3f defaultComponentColor() const override; double startMD() const override; double endMD() const override; void applyOffset( double offsetMD ) override; bool isEnabled() const override; RimWellPath* wellPath() const; void loadDataAndUpdate(); void resetAnchorPositionAndThicknessDirection(); RimModeledWellPath* thicknessDirectionWellPath() const; void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath ); double getDefaultValueForProperty( RiaDefines::CurveProperty ) const; bool hasDefaultValueForProperty( RiaDefines::CurveProperty ) const; RiaDefines::CurveProperty getDefaultPropertyForMissingValues( RiaDefines::CurveProperty curveProperty ) const; double getDefaultForMissingOverburdenValue( RiaDefines::CurveProperty curveProperty ) const; double getDefaultForMissingUnderburdenValue( RiaDefines::CurveProperty curveProperty ) const; double getDefaultForMissingValue( RiaDefines::CurveProperty curveProperty ) const; double getOverburdenGradient( RiaDefines::CurveProperty curveProperty ) const; double getUnderburdenGradient( RiaDefines::CurveProperty curveProperty ) const; void setStimPlanModelTemplate( RimStimPlanModelTemplate* stimPlanModelTemplate ); RimStimPlanModelTemplate* stimPlanModelTemplate() const; void updateReferringPlots(); std::shared_ptr calculator() const; std::deque missingValueStrategies( RiaDefines::CurveProperty curveProperty ) const; RimStimPlanModel::BurdenStrategy burdenStrategy( RiaDefines::CurveProperty curveProperty ) const; RiaDefines::ResultCatType eclipseResultCategory( RiaDefines::CurveProperty curveProperty ) const; QString eclipseResultVariable( RiaDefines::CurveProperty curveProperty ) const; std::deque extractionConfigurations( RiaDefines::CurveProperty curveProperty ) const; RimEclipseCase* eclipseCaseForType( RimExtractionConfiguration::EclipseCaseType ) const; static double findFaciesValue( const RimColorLegend& colorLegend, const QString& name ); bool isScaledByNetToGross( RiaDefines::CurveProperty curveProperty ) const; QString pressureDate() const; QString unitForProperty( RiaDefines::CurveProperty curveProperty ) const; static cvf::Vec3d projectVectorIntoFracturePlane( const cvf::Vec3d& position, const cvf::Vec3d& fractureDirectionNormal, const cvf::Vec3d& direction ); protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; void initAfterRead() override; private: void updatePositionFromMeasuredDepth(); void updateThicknessDirection(); void updateDistanceToBarrierAndDip(); void updateThicknessDirectionWellPathName(); void updatePerforationInterval(); cvf::Vec3d computeFractureDirectionNormal( RimWellPath* wellPath, const cvf::Vec3d& position ) const; RigEclipseCaseData* getEclipseCaseData() const; void updateBarrierProperties(); void addBarrierAnnotation( const cvf::Vec3d& startPosition, const cvf::Vec3d& endPosition, const QString& barrierText ); void clearBarrierAnnotation(); RimAnnotationCollectionBase* annotationCollection(); void updateViewsAndPlots(); void stimPlanModelTemplateChanged( const caf::SignalEmitter* emitter ); void hideOtherFaults( const QString& targetFaultName ); void showAllFaults(); RimColorLegend* getFaciesColorLegend() const; void updateExtractionDepthBoundaries(); static bool useStaticEclipseCase( RiaDefines::CurveProperty curveProperty ); cvf::Vec3d anchorPositionForUi() const; protected: caf::PdmField m_MD; caf::PdmPtrField m_eclipseCase; caf::PdmField m_timeStep; caf::PdmPtrField m_initialPressureEclipseCase; caf::PdmPtrField m_staticEclipseCase; caf::PdmField> m_extractionType; caf::PdmField m_extractionOffsetTop; caf::PdmField m_extractionOffsetBottom; caf::PdmField m_extractionDepthTop; caf::PdmField m_extractionDepthBottom; caf::PdmField m_anchorPosition; caf::PdmProxyValueField m_anchorPositionForUi; caf::PdmField m_thicknessDirection; caf::PdmField m_originalThicknessDirection; caf::PdmField m_boundingBoxVertical; caf::PdmField m_boundingBoxHorizontal; caf::PdmPtrField m_thicknessDirectionWellPath; caf::PdmField m_relativePermeabilityFactorDefault; caf::PdmField m_poroElasticConstantDefault; caf::PdmField m_thermalExpansionCoeffientDefault; caf::PdmField m_useDetailedFluidLoss; caf::PdmPtrField m_stimPlanModelTemplate; caf::PdmField m_editStimPlanModelTemplate; caf::PdmField> m_fractureOrientation; caf::PdmField m_azimuthAngle; caf::PdmField m_perforationLength; caf::PdmField m_formationDip; caf::PdmField m_autoComputeBarrier; caf::PdmField m_hasBarrier; caf::PdmField m_distanceToBarrier; caf::PdmField m_barrierDip; caf::PdmField m_wellPenetrationLayer; caf::PdmPtrField m_barrierTextAnnotation; caf::PdmField m_barrierFaultName; caf::PdmField m_showOnlyBarrierFault; caf::PdmField m_showAllFaults; caf::PdmPtrField m_perforationInterval; std::shared_ptr m_calculator; };