#11663 Make sure non-Darcy data is computed

The computation of non-Darcy properties is expensive, so we cache the results. Make sure that the calling function calls this function before using the properties.
This commit is contained in:
Magne Sjaastad 2024-09-03 15:06:55 +02:00
parent fc2106edb0
commit a00bfea40b
3 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,8 @@ std::vector<RigCompletionData>
{ {
if ( fracture->isChecked() && static_cast<size_t>( fracture->branchIndex() ) == branchIndex ) if ( fracture->isChecked() && static_cast<size_t>( fracture->branchIndex() ) == branchIndex )
{ {
fracture->ensureValidNonDarcyProperties();
fractures.push_back( fracture ); fractures.push_back( fracture );
} }
} }

View File

@ -789,6 +789,8 @@ bool RicWellPathExportMswCompletionsImpl::generateFracturesMswExportInfo( RimEcl
// Check if fractures are to be assigned to current main bore segment // Check if fractures are to be assigned to current main bore segment
for ( RimWellPathFracture* fracture : fractures ) for ( RimWellPathFracture* fracture : fractures )
{ {
fracture->ensureValidNonDarcyProperties();
double fractureStartMD = fracture->fractureMD(); double fractureStartMD = fracture->fractureMD();
if ( fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH ) if ( fracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
{ {

View File

@ -316,6 +316,10 @@ const NonDarcyData& RimFracture::nonDarcyProperties() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimFracture::ensureValidNonDarcyProperties() void RimFracture::ensureValidNonDarcyProperties()
{ {
// The computation of non-Darcy properties is expensive, so we cache the results.
// Make sure that the calling function calls this function before using the properties.
// https://github.com/OPM/ResInsight/issues/11663
if ( m_cachedFractureProperties.isDirty() ) if ( m_cachedFractureProperties.isDirty() )
{ {
NonDarcyData props; NonDarcyData props;