mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5161 Make the WBS parameter curves work right
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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<std::string, std::vector<std::string>>
|
||||
{
|
||||
fieldCompNames[result.toStdString()];
|
||||
}
|
||||
std::set<RigWbsParameter> wbsParameters = RigWbsParameter::allParameters();
|
||||
for ( const RigWbsParameter& parameter : wbsParameters )
|
||||
{
|
||||
fieldCompNames[parameter.name().toStdString()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int
|
||||
|
||||
if ( !mds->empty() && !values->empty() )
|
||||
{
|
||||
std::vector<std::vector<double>*> dependentValues = { tvds, &interfaceShValuesDbl, &interfacePorePressuresDbl };
|
||||
std::vector<std::vector<double>*> dependentValues = {tvds, &interfaceShValuesDbl, &interfacePorePressuresDbl};
|
||||
|
||||
std::vector<unsigned char> smoothOrFilterSegments = determineFilteringOrSmoothing( interfacePorePressuresDbl );
|
||||
filterShortSegments( mds, values, &smoothOrFilterSegments, dependentValues );
|
||||
@@ -309,6 +309,16 @@ std::vector<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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<RigGeoMechWellLogExtractor::WbsParameterSource>
|
||||
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<do
|
||||
{
|
||||
( *values )[intersectionIdx] = ( K0_FG[intersectionIdx] *
|
||||
( OBG0[intersectionIdx] - PP0[intersectionIdx] ) +
|
||||
PP0[intersectionIdx] ) /
|
||||
hydroStaticPorePressureForSegment( intersectionIdx );
|
||||
PP0[intersectionIdx] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -663,8 +666,7 @@ void RigGeoMechWellLogExtractor::wellBoreSH_MatthewsKelly( int frameIndex, std::
|
||||
{
|
||||
( *values )[intersectionIdx] = ( K0_SH[intersectionIdx] * ( OBG0[intersectionIdx] - PP0[intersectionIdx] ) +
|
||||
PP0[intersectionIdx] +
|
||||
DF[intersectionIdx] * ( PP[intersectionIdx] - PP0[intersectionIdx] ) ) /
|
||||
hydroStaticPorePressureForSegment( intersectionIdx );
|
||||
DF[intersectionIdx] * ( PP[intersectionIdx] - PP0[intersectionIdx] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,9 +39,10 @@ void RigWbsParameter::SourceEnum::setUp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigWbsParameter::RigWbsParameter( const QString& name, const SourceVector& sources )
|
||||
RigWbsParameter::RigWbsParameter( const QString& name, bool normalizeByHydroStaticPP, const SourceVector& sources )
|
||||
: m_name( name )
|
||||
, m_sources( sources )
|
||||
, m_normalizeByHydroStaticPP( normalizeByHydroStaticPP )
|
||||
, m_exclusiveOptions( false )
|
||||
{
|
||||
}
|
||||
@@ -90,6 +91,14 @@ RigFemResultAddress RigWbsParameter::femAddress( Source source ) const
|
||||
return RigFemResultAddress( posType, addr.primary.toStdString(), addr.secondary.toStdString() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigWbsParameter::normalizeByHydrostaticPP() const
|
||||
{
|
||||
return m_normalizeByHydroStaticPP;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -99,7 +108,7 @@ bool RigWbsParameter::exclusiveOptions() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Set options to be exclusive rathern than an order of preference
|
||||
/// Set options to be exclusive rather than an order of preference
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWbsParameter::setOptionsExclusive( bool exclusive )
|
||||
{
|
||||
@@ -165,7 +174,7 @@ RigWbsParameter RigWbsParameter::PP_Sand()
|
||||
SourceVector sources = {{GRID, SourceAddress( "POR-Bar" )},
|
||||
{LAS_FILE, SourceAddress( "POR" )},
|
||||
{ELEMENT_PROPERTY_TABLE, SourceAddress( "POR" )}};
|
||||
return RigWbsParameter( "PP", sources );
|
||||
return RigWbsParameter( "PP", true, sources );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -174,6 +183,7 @@ RigWbsParameter RigWbsParameter::PP_Sand()
|
||||
RigWbsParameter RigWbsParameter::PP_Shale()
|
||||
{
|
||||
return RigWbsParameter( "PP Shale",
|
||||
true,
|
||||
{{LAS_FILE, SourceAddress( "POR_Shale" )},
|
||||
{HYDROSTATIC, SourceAddress( "Hydrostatic" )},
|
||||
{USER_DEFINED, SourceAddress()}} );
|
||||
@@ -185,6 +195,7 @@ RigWbsParameter RigWbsParameter::PP_Shale()
|
||||
RigWbsParameter RigWbsParameter::poissonRatio()
|
||||
{
|
||||
return RigWbsParameter( "Poisson Ratio",
|
||||
false,
|
||||
{{LAS_FILE, SourceAddress( "POISSON_RATIO" )},
|
||||
{ELEMENT_PROPERTY_TABLE, SourceAddress( "RATIO" )},
|
||||
{USER_DEFINED, SourceAddress()}} );
|
||||
@@ -196,6 +207,7 @@ RigWbsParameter RigWbsParameter::poissonRatio()
|
||||
RigWbsParameter RigWbsParameter::UCS()
|
||||
{
|
||||
return RigWbsParameter( "UCS",
|
||||
false,
|
||||
{{LAS_FILE, SourceAddress( "UCS" )},
|
||||
{ELEMENT_PROPERTY_TABLE, SourceAddress( "RATIO" )},
|
||||
{USER_DEFINED, SourceAddress()}} );
|
||||
@@ -207,7 +219,7 @@ RigWbsParameter RigWbsParameter::UCS()
|
||||
RigWbsParameter RigWbsParameter::OBG()
|
||||
{
|
||||
std::vector<std::pair<Source, SourceAddress>> 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<std::pair<Source, SourceAddress>> 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<std::pair<Source, SourceAddress>> 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;
|
||||
}
|
||||
|
||||
@@ -45,12 +45,15 @@ public:
|
||||
using SourceVector = std::vector<std::pair<Source, SourceAddress>>;
|
||||
|
||||
public:
|
||||
RigWbsParameter( const QString& name = "", const SourceVector& validSources = {} );
|
||||
RigWbsParameter( const QString& name = "",
|
||||
bool normalizeByHydroStaticPP = false,
|
||||
const SourceVector& validSources = {} );
|
||||
|
||||
const QString& name() const;
|
||||
std::vector<Source> 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<std::pair<Source, SourceAddress>> m_sources;
|
||||
bool m_normalizeByHydroStaticPP;
|
||||
bool m_exclusiveOptions; // Options are exclusive rather than order of preference
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user