WBS: Compute and show FG_MK_* only in reservoir (not shale).

This commit is contained in:
Kristian Bendiksen 2024-03-04 15:24:53 +01:00 committed by jonjenssen
parent 1217236d73
commit b8f9beab91
2 changed files with 38 additions and 13 deletions

View File

@ -49,6 +49,7 @@
#include <QDebug>
#include <QPolygonF>
#include <limits>
#include <type_traits>
const double RigGeoMechWellLogExtractor::PURE_WATER_DENSITY_GCM3 = 1.0; // g / cm^3
@ -739,7 +740,7 @@ void RigGeoMechWellLogExtractor::wellBoreFGShale( const RigWbsParameter& paramet
WbsParameterSource source = m_parameterSources.at( parameter );
if ( source == RigWbsParameter::DERIVED_FROM_K0FG )
{
wellBoreFGDerivedFromK0FG( RiaResultNames::wbsPPResult(), timeStepIndex, frameIndex, values );
wellBoreFGDerivedFromK0FG( RiaResultNames::wbsPPResult(), timeStepIndex, frameIndex, values, false );
}
else
{
@ -765,7 +766,11 @@ void RigGeoMechWellLogExtractor::wellBoreFGShale( const RigWbsParameter& paramet
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGeoMechWellLogExtractor::wellBoreFGDerivedFromK0FG( const QString& ppResult, int timeStepIndex, int frameIndex, std::vector<double>* values )
void RigGeoMechWellLogExtractor::wellBoreFGDerivedFromK0FG( const QString& ppResult,
int timeStepIndex,
int frameIndex,
std::vector<double>* values,
bool onlyForPPReservoir )
{
std::vector<double> PP0; // results
std::vector<double> K0_FG, OBG0; // parameters
@ -773,6 +778,23 @@ void RigGeoMechWellLogExtractor::wellBoreFGDerivedFromK0FG( const QString& ppRes
RigFemResultAddress ppAddr( RIG_WELLPATH_DERIVED, ppResult.toStdString(), "" );
wellPathScaledCurveData( ppAddr, 0, 0, &PP0, true );
if ( onlyForPPReservoir )
{
std::vector<double> PP( intersections().size(), std::numeric_limits<double>::infinity() );
std::vector<WbsParameterSource> ppSources =
calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(), timeStepIndex, frameIndex, &PP, false );
// Invalidate PP results from outside the reservoir zone.
#pragma omp parallel for
for ( int64_t intersectionIdx = 0; intersectionIdx < static_cast<int64_t>( intersections().size() ); ++intersectionIdx )
{
if ( !isValid( PP[intersectionIdx] ) || ppSources[intersectionIdx] != RigWbsParameter::GRID )
{
PP0[intersectionIdx] = std::numeric_limits<double>::infinity();
}
}
}
calculateWbsParameterForAllSegments( RigWbsParameter::K0_FG(), timeStepIndex, frameIndex, &K0_FG, true );
calculateWbsParameterForAllSegments( RigWbsParameter::OBG0(), 0, 0, &OBG0, true );
@ -800,7 +822,8 @@ void RigGeoMechWellLogExtractor::wellBoreFG_MatthewsKelly( const RigWbsParameter
{
values->resize( intersections().size(), std::numeric_limits<double>::infinity() );
WbsParameterSource source = m_parameterSources.at( parameter );
// Use FG_Shale source to avoid creating more options.
WbsParameterSource source = m_parameterSources.at( RigWbsParameter::FG_Shale() );
if ( source == RigWbsParameter::DERIVED_FROM_K0FG )
{
auto mapParameterToPPResult = []( const RigWbsParameter& parameter )
@ -810,8 +833,9 @@ void RigGeoMechWellLogExtractor::wellBoreFG_MatthewsKelly( const RigWbsParameter
return RiaResultNames::wbsPPResult();
};
QString ppResultName = mapParameterToPPResult( parameter );
wellBoreFGDerivedFromK0FG( ppResultName, timeStepIndex, frameIndex, values );
QString ppResultName = mapParameterToPPResult( parameter );
bool onlyForPPReservoir = true;
wellBoreFGDerivedFromK0FG( ppResultName, timeStepIndex, frameIndex, values, onlyForPPReservoir );
}
else
{
@ -829,22 +853,23 @@ void RigGeoMechWellLogExtractor::wellBoreFG_MatthewsKelly( const RigWbsParameter
curveData( SHMkAddr, timeStepIndex, frameIndex, &SH );
CVF_ASSERT( SH.size() == intersections().size() );
std::vector<double> PP( intersections().size(), std::numeric_limits<double>::infinity() );
std::vector<WbsParameterSource> ppSources =
calculateWbsParameterForAllSegments( RigWbsParameter::PP_Reservoir(), timeStepIndex, frameIndex, &PP, false );
double multiplier = m_userDefinedValues.at( parameter );
CVF_ASSERT( multiplier != std::numeric_limits<double>::infinity() );
#pragma omp parallel for
for ( int64_t intersectionIdx = 0; intersectionIdx < static_cast<int64_t>( intersections().size() ); ++intersectionIdx )
{
if ( !isValid( ( *values )[intersectionIdx] ) )
if ( !isValid( ( *values )[intersectionIdx] ) && ppSources[intersectionIdx] == RigWbsParameter::GRID &&
isValid( PP[intersectionIdx] ) && isValid( SH[intersectionIdx] ) )
{
if ( isValid( SH[intersectionIdx] ) )
{
( *values )[intersectionIdx] = SH[intersectionIdx] * multiplier;
}
( *values )[intersectionIdx] = SH[intersectionIdx] * multiplier;
}
}
}
values->front() = wbsCurveValuesAtMsl();
}
//--------------------------------------------------------------------------------------------------

View File

@ -131,7 +131,7 @@ private:
const QString& wbsPP0ResultName,
std::vector<double>* values );
void wellBoreFGDerivedFromK0FG( const QString& ppResult, int timeStepIndex, int frameIndex, std::vector<double>* values );
void wellBoreFGDerivedFromK0FG( const QString& ppResult, int timeStepIndex, int frameIndex, std::vector<double>* values, bool onlyForPPReservoir );
void wellBoreFG_MatthewsKelly( const RigWbsParameter& parameter, int timeStepIndex, int frameIndex, std::vector<double>* values );