#9507 Fix normalize by Hydrostatic Pressure for pore pressure

This commit is contained in:
Magne Sjaastad 2023-08-18 10:24:54 +02:00
parent 3030e9f4af
commit 1b886c1a1e
3 changed files with 15 additions and 2 deletions

View File

@ -52,6 +52,16 @@ RigFemPartResultCalculatorBarConverted::~RigFemPartResultCalculatorBarConverted(
//--------------------------------------------------------------------------------------------------
bool RigFemPartResultCalculatorBarConverted::isMatching( const RigFemResultAddress& resVarAddr ) const
{
if ( resVarAddr.normalizeByHydrostaticPressure() )
{
// Normalize by hydrostatic pressure is done in RigFemPartResultCalculatorNormalized
// Return false here to avoid double normalization
//
// https: // github.com/OPM/ResInsight/issues/9507
return false;
}
// TODO: split in multiple classes??
if ( m_fieldName == "POR-Bar" )
{

View File

@ -115,7 +115,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalized::calculate( int p
size_t resultCount = srcFrameData.size();
dstFrameData.resize( resultCount );
if ( unscaledResult.resultPosType == RIG_ELEMENT_NODAL )
if ( unscaledResult.resultPosType == RIG_ELEMENT_NODAL || unscaledResult.resultPosType == RIG_NODAL )
{
#pragma omp parallel for schedule( dynamic )
for ( int elmIdx = 0; elmIdx < femPart->elementCount(); ++elmIdx )

View File

@ -850,7 +850,10 @@ RigFemScalarResultFrames* RigFemPartResultsCollection::calculateDerivedResult( i
{
for ( const auto& calculator : m_resultCalculators )
{
if ( calculator->isMatching( resVarAddr ) ) return calculator->calculate( partIndex, resVarAddr );
if ( calculator->isMatching( resVarAddr ) )
{
return calculator->calculate( partIndex, resVarAddr );
}
}
if ( resVarAddr.fieldName == "ST" && resVarAddr.componentName.empty() )