///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2023 - 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 "RigGriddedPart3d.h" #include "RimFaultReactivationDataAccessor.h" #include "RimFaultReactivationEnums.h" #include "cvfObject.h" #include class RigWellPath; class RigEclipseWellLogExtractor; class RigEclipseCaseData; class RigResultAccessor; class RigGriddedPart3d; //================================================================================================== /// /// //================================================================================================== class RimFaultReactivationDataAccessorWellLogExtraction { public: RimFaultReactivationDataAccessorWellLogExtraction(); ~RimFaultReactivationDataAccessorWellLogExtraction(); static std::pair calculatePorBar( const RigFaultReactivationModel& model, RimFaultReactivation::GridPart gridPart, const std::vector& intersections, std::vector& values, const cvf::Vec3d& position, RimFaultReactivation::ElementSets elementSet, double gradient ); static std::pair calculateTemperature( const std::vector& intersections, std::vector& values, const cvf::Vec3d& position, double seabedTemperature ); static std::pair>, std::map>> createEclipseWellPathExtractors( const RigFaultReactivationModel& model, RigEclipseCaseData& eclipseCaseData, double seabedDepth ); static std::vector generateWellPoints( const cvf::Vec3d& faultTopPosition, const cvf::Vec3d& faultBottomPosition, double seabedDepth, double bottomDepth, const cvf::Vec3d& offset ); static std::vector generateMds( const std::vector& points ); static std::pair, std::vector> extractValuesAndIntersections( const RigResultAccessor& resultAccessor, RigEclipseWellLogExtractor& extractor, const RigWellPath& wellPath ); static std::pair findIntersectionsForTvd( const std::vector& intersections, double tvd ); static std::pair findElementSetForPoint( const RigGriddedPart3d& part, const cvf::Vec3d& point, const std::map>& elementSets ); protected: static std::pair findOverburdenAndUnderburdenIndex( const std::vector& values ); static double computeValueWithGradient( const std::vector& intersections, const std::vector& values, int i1, int i2, double gradient ); static void fillInMissingValuesWithGradient( const std::vector& intersections, std::vector& values, double gradient ); static void fillInMissingValuesWithTopValue( const std::vector& intersections, std::vector& values, double topValue ); static std::pair findValueAndPosition( const std::vector& intersections, const std::vector& values, const cvf::Vec3d& position ); static double computeGradient( double depth1, double value1, double depth2, double value2 ); static std::vector extractDepthValues( const std::vector& intersections ); static void insertUnderburdenValues( const std::vector& intersections, std::vector& values, int firstUnderburdenIndex, double bottomValue ); static void insertOverburdenValues( const std::vector& intersections, std::vector& values, int lastOverburdenIndex, double topValue ); static double computeMinimumDistance( const cvf::Vec3d& position, const std::vector& positions ); static double calculatePorePressure( double depth, double gradient ); };