mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7116 Add extrapolation for missing elastic properties.
Also improve error message.
This commit is contained in:
parent
c174bf947c
commit
6481813eeb
@ -247,18 +247,21 @@ bool RimStimPlanModelElasticPropertyCalculator::calculate( RiaDefines::CurveProp
|
|||||||
{
|
{
|
||||||
const RigElasticProperties& rigElasticProperties = elasticProperties->propertiesForFacies( faciesKey );
|
const RigElasticProperties& rigElasticProperties = elasticProperties->propertiesForFacies( faciesKey );
|
||||||
double scale = elasticProperties->getPropertyScaling( formationName, faciesName, curveProperty );
|
double scale = elasticProperties->getPropertyScaling( formationName, faciesName, curveProperty );
|
||||||
double val = rigElasticProperties.getValueForPorosity( curveProperty, porosity, scale );
|
auto [val, isExtrapolated] = rigElasticProperties.getValueForPorosity( curveProperty, porosity, scale );
|
||||||
if ( std::isinf( val ) )
|
if ( isExtrapolated )
|
||||||
{
|
{
|
||||||
|
QString propertyName = caf::AppEnum<RiaDefines::CurveProperty>( curveProperty ).uiText();
|
||||||
RiaLogging::error(
|
RiaLogging::error(
|
||||||
QString( "Elastic property interpolation failed. Formation='%1', "
|
QString( "Elastic property '%1' outside porosity range [%2, %3] for formation='%4', "
|
||||||
"facies='%2', depth=%3, porosity=%4. Property defined for porosity range: [%5, %6]" )
|
"facies='%5', depth=%6, porosity=%7. Extrapolated value: %8" )
|
||||||
|
.arg( propertyName )
|
||||||
|
.arg( rigElasticProperties.porosityMin() )
|
||||||
|
.arg( rigElasticProperties.porosityMax() )
|
||||||
.arg( formationName )
|
.arg( formationName )
|
||||||
.arg( faciesName )
|
.arg( faciesName )
|
||||||
.arg( tvDepthValues[i] )
|
.arg( tvDepthValues[i] )
|
||||||
.arg( porosity )
|
.arg( porosity )
|
||||||
.arg( rigElasticProperties.porosityMin() )
|
.arg( val ) );
|
||||||
.arg( rigElasticProperties.porosityMax() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -272,19 +275,23 @@ bool RimStimPlanModelElasticPropertyCalculator::calculate( RiaDefines::CurveProp
|
|||||||
elasticProperties->propertiesForFacies( ntgFaciesKey );
|
elasticProperties->propertiesForFacies( ntgFaciesKey );
|
||||||
double ntgScale =
|
double ntgScale =
|
||||||
elasticProperties->getPropertyScaling( formationName, netToGrossFaciesName, curveProperty );
|
elasticProperties->getPropertyScaling( formationName, netToGrossFaciesName, curveProperty );
|
||||||
double ntgValue = rigNtgElasticProperties.getValueForPorosity( curveProperty, porosity, ntgScale );
|
auto [ntgValue, isExtrapolated] =
|
||||||
val = val * netToGross + ( 1.0 - netToGross ) * ntgValue;
|
rigNtgElasticProperties.getValueForPorosity( curveProperty, porosity, ntgScale );
|
||||||
if ( std::isinf( val ) )
|
val = val * netToGross + ( 1.0 - netToGross ) * ntgValue;
|
||||||
|
if ( std::isinf( val ) || isExtrapolated )
|
||||||
{
|
{
|
||||||
RiaLogging::error( QString( "Elastic property (NTG) interpolation failed. Formation='%1', "
|
QString propertyName = caf::AppEnum<RiaDefines::CurveProperty>( curveProperty ).uiText();
|
||||||
"facies='%2', depth=%3, porosity=%4. Property defined for "
|
RiaLogging::error(
|
||||||
"porosity range: [%5, %6]" )
|
QString( "Elastic property '%1' outside porosity range [%2, %3] for formation='%4', "
|
||||||
.arg( formationName )
|
"facies='%5', depth=%6, porosity=%7 (NTG). Extrapolated value: %8" )
|
||||||
.arg( netToGrossFaciesName )
|
.arg( propertyName )
|
||||||
.arg( tvDepthValues[i] )
|
.arg( rigNtgElasticProperties.porosityMin() )
|
||||||
.arg( porosity )
|
.arg( rigNtgElasticProperties.porosityMax() )
|
||||||
.arg( rigNtgElasticProperties.porosityMin() )
|
.arg( formationName )
|
||||||
.arg( rigNtgElasticProperties.porosityMax() ) );
|
.arg( netToGrossFaciesName )
|
||||||
|
.arg( tvDepthValues[i] )
|
||||||
|
.arg( porosity )
|
||||||
|
.arg( val ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,8 @@ const std::vector<double>& RigElasticProperties::getVector( RiaDefines::CurvePro
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
double RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
std::pair<double, bool>
|
||||||
|
RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale ) const
|
||||||
{
|
{
|
||||||
const std::vector<double>& unscaledValues = getVector( property );
|
const std::vector<double>& unscaledValues = getVector( property );
|
||||||
std::vector<double> scaledValues;
|
std::vector<double> scaledValues;
|
||||||
@ -157,5 +158,8 @@ double RigElasticProperties::getValueForPorosity( RiaDefines::CurveProperty prop
|
|||||||
scaledValues.push_back( unscaled * scale );
|
scaledValues.push_back( unscaled * scale );
|
||||||
}
|
}
|
||||||
|
|
||||||
return RiaInterpolationTools::linear( m_porosity, scaledValues, porosity );
|
bool isExtrapolated = porosity > porosityMax() || porosity < porosityMin();
|
||||||
|
double value =
|
||||||
|
RiaInterpolationTools::linear( m_porosity, scaledValues, porosity, RiaInterpolationTools::ExtrapolationMode::CLOSEST );
|
||||||
|
return std::make_pair( value, isExtrapolated );
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,8 @@ public:
|
|||||||
|
|
||||||
size_t numValues() const;
|
size_t numValues() const;
|
||||||
double getValue( RiaDefines::CurveProperty property, size_t index, double scale = 1.0 ) const;
|
double getValue( RiaDefines::CurveProperty property, size_t index, double scale = 1.0 ) const;
|
||||||
double getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale = 1.0 ) const;
|
std::pair<double, bool>
|
||||||
|
getValueForPorosity( RiaDefines::CurveProperty property, double porosity, double scale = 1.0 ) const;
|
||||||
|
|
||||||
const std::vector<double>& porosity() const;
|
const std::vector<double>& porosity() const;
|
||||||
double porosityMin() const;
|
double porosityMin() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user