///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2021- 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 "RimStimPlanModelCalculator.h" #include "RimStimPlanModelPropertyCalculator.h" #include "RimStimPlanModelWellLogCalculator.h" #include "RiaStimPlanModelDefines.h" #include "cvfObject.h" #include class RigEclipseCaseData; class RimEclipseInputPropertyCollection; class RimEclipseResultDefinition; class RigResultAccessor; //================================================================================================== /// /// //================================================================================================== class RimStimPlanModelPressureCalculator : public RimStimPlanModelWellLogCalculator { public: RimStimPlanModelPressureCalculator( RimStimPlanModelCalculator* stimPlanModelCalculator ); bool isMatching( RiaDefines::CurveProperty curveProperty ) const override; static double pressureDifferenceInterpolationOffset(); static std::tuple, std::vector, std::vector> interpolateMissingValues( const std::vector& staticTvDepthValues, const std::vector& staticMeasuredDepthValues, const std::vector& measuredDepthValues, const std::vector& values ); protected: bool extractValuesForProperty( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, int timeStep, std::vector& values, std::vector& measuredDepthValues, std::vector& tvDepthValues, double& rkbDiff ) const override; bool extractPressureDataFromTable( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, std::vector& values, std::vector& measuredDepthValues, std::vector& tvDepthValues, double minimumTvd, double maximumTvd ) const; bool interpolateInitialPressureByEquilibrationRegion( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, int timeStep, const std::vector& measuredDepthValues, const std::vector& tvDepthValues, std::vector& values ) const; bool interpolatePressureDifferenceByEquilibrationRegion( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, int timeStep, const std::vector& measuredDepthValues, const std::vector& tvDepthValues, const std::vector& initialPressureValues, std::vector& values ) const; bool handleFaciesWithInitialPressure( const RimStimPlanModel* stimPlanModel, int timeStep, const std::vector& faciesValues, std::vector& values ) const; using DepthValuePair = std::pair; using DepthValuePairVector = std::vector; using EqlNumToDepthValuePairMap = std::map; static void sortAndRemoveDuplicates( DepthValuePairVector& depthValuePairs ); static bool buildPressureTablesPerEqlNum( const RimStimPlanModel* stimPlanModel, EqlNumToDepthValuePairMap& valuesPerEqlNum, const std::set& presentEqlNums ); static std::set findUniqueValues( const std::vector& values ); static double interpolatePressure( const DepthValuePairVector& depthValuePairs, double depth, int eqlNum ); static void binByDepthAndAverage( DepthValuePairVector& depthValuePairs ); };