From df5c5fb2a8e6a634ebe300092b82d3e5a9a9f8ca Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 4 Dec 2019 11:24:41 +0100 Subject: [PATCH] #5161 Make the WBS parameter curves work right --- .../RicNewWellBoreStabilityPlotFeature.cpp | 4 +-- .../RigFemPartResultsCollection.cpp | 6 ++++ .../RigGeoMechWellLogExtractor.cpp | 24 +++++++------- .../ReservoirDataModel/RigWbsParameter.cpp | 31 +++++++++++++------ .../ReservoirDataModel/RigWbsParameter.h | 6 +++- 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp index 461275aacc..ebf2e5cb69 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellBoreStabilityPlotFeature.cpp @@ -248,9 +248,7 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi size_t i = 0; for ( const RigWbsParameter& param : parameters ) { - const QString& resultName = param.addressString( RigWbsParameter::LAS_FILE ); - - RigFemResultAddress resAddr( RIG_WELLPATH_DERIVED, resultName.toStdString(), "" ); + RigFemResultAddress resAddr( RIG_WELLPATH_DERIVED, param.name().toStdString(), "" ); RimWellLogExtractionCurve* curve = RicWellLogTools::addWellLogExtractionCurve( paramCurvesTrack, geoMechCase, nullptr, diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index af7339857a..1feb014e02 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -38,6 +38,7 @@ #include "RigFormationNames.h" #include "RigHexIntersectionTools.h" #include "RigStatisticsDataCache.h" +#include "RigWbsParameter.h" #include "RimMainPlotCollection.h" #include "RimProject.h" @@ -510,6 +511,11 @@ std::map> { fieldCompNames[result.toStdString()]; } + std::set wbsParameters = RigWbsParameter::allParameters(); + for ( const RigWbsParameter& parameter : wbsParameters ) + { + fieldCompNames[parameter.name().toStdString()]; + } } } diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp index 532858cfcd..e932be803c 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp @@ -106,7 +106,7 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int if ( !mds->empty() && !values->empty() ) { - std::vector*> dependentValues = { tvds, &interfaceShValuesDbl, &interfacePorePressuresDbl }; + std::vector*> dependentValues = {tvds, &interfaceShValuesDbl, &interfacePorePressuresDbl}; std::vector smoothOrFilterSegments = determineFilteringOrSmoothing( interfacePorePressuresDbl ); filterShortSegments( mds, values, &smoothOrFilterSegments, dependentValues ); @@ -309,6 +309,16 @@ std::vector } } } + + if ( parameter.normalizeByHydrostaticPP() ) + { +#pragma omp parallel for + for ( int64_t intersectionIdx = 0; intersectionIdx < (int64_t)m_intersections.size(); ++intersectionIdx ) + { + ( *outputValues )[intersectionIdx] /= hydroStaticPorePressureForSegment( intersectionIdx ); + } + } + return finalSourcesPerSegment; } @@ -463,12 +473,6 @@ std::vector sources = calculateWbsParameterForAllSegments( RigWbsParameter::SH(), frameIndex, values ); } - // Scaling -#pragma omp parallel for schedule( dynamic ) - for ( int64_t intersectionIdx = 0; intersectionIdx < (int64_t)m_intersections.size(); ++intersectionIdx ) - { - ( *values )[intersectionIdx] /= hydroStaticPorePressureForSegment( intersectionIdx ); - } return sources; } @@ -609,8 +613,7 @@ void RigGeoMechWellLogExtractor::wellBoreFGShale( int frameIndex, std::vector> sources = {{GRID, SourceAddress( "ST", "S33" )}}; - return RigWbsParameter( "OBG", sources ); + return RigWbsParameter( "OBG", true, sources ); } //-------------------------------------------------------------------------------------------------- @@ -216,7 +228,7 @@ RigWbsParameter RigWbsParameter::OBG() RigWbsParameter RigWbsParameter::OBG0() { std::vector> sources = {{GRID, SourceAddress( "ST", "S33", 0 )}}; - return RigWbsParameter( "OBG0", sources ); + return RigWbsParameter( "OBG0", true, sources ); } //-------------------------------------------------------------------------------------------------- @@ -225,7 +237,7 @@ RigWbsParameter RigWbsParameter::OBG0() RigWbsParameter RigWbsParameter::SH() { std::vector> sources = {{GRID, SourceAddress( "ST", "S3" )}}; - return RigWbsParameter( "SH", sources ); + return RigWbsParameter( "SH", true, sources ); } //-------------------------------------------------------------------------------------------------- @@ -234,6 +246,7 @@ RigWbsParameter RigWbsParameter::SH() RigWbsParameter RigWbsParameter::DF() { return RigWbsParameter( "DF", + false, {{LAS_FILE, SourceAddress( "DF" )}, {ELEMENT_PROPERTY_TABLE, SourceAddress( "DF" )}, {USER_DEFINED, SourceAddress()}} ); @@ -244,7 +257,7 @@ RigWbsParameter RigWbsParameter::DF() //-------------------------------------------------------------------------------------------------- RigWbsParameter RigWbsParameter::K0_FG() { - return RigWbsParameter( "K0_FG", {{LAS_FILE, SourceAddress( "K0_FG" )}, {USER_DEFINED, SourceAddress()}} ); + return RigWbsParameter( "K0_FG", false, {{LAS_FILE, SourceAddress( "K0_FG" )}, {USER_DEFINED, SourceAddress()}} ); } //-------------------------------------------------------------------------------------------------- @@ -252,7 +265,7 @@ RigWbsParameter RigWbsParameter::K0_FG() //-------------------------------------------------------------------------------------------------- RigWbsParameter RigWbsParameter::K0_SH() { - return RigWbsParameter( "K0_SH", {{LAS_FILE, SourceAddress( "K0_SH" )}, {USER_DEFINED, SourceAddress()}} ); + return RigWbsParameter( "K0_SH", false, {{LAS_FILE, SourceAddress( "K0_SH" )}, {USER_DEFINED, SourceAddress()}} ); } //-------------------------------------------------------------------------------------------------- @@ -260,7 +273,7 @@ RigWbsParameter RigWbsParameter::K0_SH() //-------------------------------------------------------------------------------------------------- RigWbsParameter RigWbsParameter::FG_Shale() { - RigWbsParameter param( "FG Shale", {{MATTHEWS_KELLY, SourceAddress()}, {PROPORTIONAL_TO_SH, SourceAddress()}} ); + RigWbsParameter param( "FG Shale", true, {{MATTHEWS_KELLY, SourceAddress()}, {PROPORTIONAL_TO_SH, SourceAddress()}} ); param.setOptionsExclusive( true ); return param; } diff --git a/ApplicationCode/ReservoirDataModel/RigWbsParameter.h b/ApplicationCode/ReservoirDataModel/RigWbsParameter.h index b51288c98c..9b2322de16 100644 --- a/ApplicationCode/ReservoirDataModel/RigWbsParameter.h +++ b/ApplicationCode/ReservoirDataModel/RigWbsParameter.h @@ -45,12 +45,15 @@ public: using SourceVector = std::vector>; public: - RigWbsParameter( const QString& name = "", const SourceVector& validSources = {} ); + RigWbsParameter( const QString& name = "", + bool normalizeByHydroStaticPP = false, + const SourceVector& validSources = {} ); const QString& name() const; std::vector sources() const; QString addressString( Source source ) const; RigFemResultAddress femAddress( Source source ) const; + bool normalizeByHydrostaticPP() const; bool exclusiveOptions() const; void setOptionsExclusive( bool exclusive ); @@ -98,5 +101,6 @@ private: private: QString m_name; std::vector> m_sources; + bool m_normalizeByHydroStaticPP; bool m_exclusiveOptions; // Options are exclusive rather than order of preference };