mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#10826 Fault Reactivation: improve pore pressure eclipse extraction.
This commit is contained in:
@@ -17,21 +17,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimFaultReactivationDataAccessorPorePressure.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFaciesProperties.h"
|
||||
#include "RimFaultReactivationDataAccessorWellLogExtraction.h"
|
||||
#include "RimFaultReactivationEnums.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "RigEclipseWellLogExtractor.h"
|
||||
#include "RigFaultReactivationModel.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -62,16 +67,32 @@ RimFaultReactivationDataAccessorPorePressure::~RimFaultReactivationDataAccessorP
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultReactivationDataAccessorPorePressure::updateResultAccessor()
|
||||
{
|
||||
if ( m_caseData )
|
||||
{
|
||||
RigEclipseResultAddress resVarAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "PRESSURE" );
|
||||
m_eclipseCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->ensureKnownResultLoaded( resVarAddress );
|
||||
if ( !m_caseData ) return;
|
||||
|
||||
m_resultAccessor = RigResultAccessorFactory::createFromResultAddress( m_caseData,
|
||||
0,
|
||||
RiaDefines::PorosityModelType::MATRIX_MODEL,
|
||||
m_timeStep,
|
||||
resVarAddress );
|
||||
RigEclipseResultAddress resVarAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "PRESSURE" );
|
||||
m_eclipseCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->ensureKnownResultLoaded( resVarAddress );
|
||||
|
||||
m_resultAccessor =
|
||||
RigResultAccessorFactory::createFromResultAddress( m_caseData, 0, RiaDefines::PorosityModelType::MATRIX_MODEL, m_timeStep, resVarAddress );
|
||||
|
||||
auto [faultTopPosition, faultBottomPosition] = m_model->faultTopBottom();
|
||||
auto faultNormal = m_model->faultNormal();
|
||||
double distanceFromFault = 1.0;
|
||||
|
||||
for ( auto gridPart : m_model->allGridParts() )
|
||||
{
|
||||
double sign = m_model->normalPointsAt() == gridPart ? 1.0 : -1.0;
|
||||
std::vector<cvf::Vec3d> wellPoints =
|
||||
RimFaultReactivationDataAccessorWellLogExtraction::generateWellPoints( faultTopPosition,
|
||||
faultBottomPosition,
|
||||
sign * faultNormal * distanceFromFault );
|
||||
cvf::ref<RigWellPath> wellPath =
|
||||
new RigWellPath( wellPoints, RimFaultReactivationDataAccessorWellLogExtraction::generateMds( wellPoints ) );
|
||||
m_wellPaths[gridPart] = wellPath;
|
||||
|
||||
std::string errorName = "fault reactivation data access";
|
||||
cvf::ref<RigEclipseWellLogExtractor> extractor = new RigEclipseWellLogExtractor( m_caseData, wellPath.p(), errorName );
|
||||
m_extractors[gridPart] = extractor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,24 +116,30 @@ double RimFaultReactivationDataAccessorPorePressure::valueAtPosition( const cvf:
|
||||
{
|
||||
if ( ( m_mainGrid != nullptr ) && m_resultAccessor.notNull() )
|
||||
{
|
||||
auto cellIdx = m_mainGrid->findReservoirCellIndexFromPoint( position );
|
||||
if ( cellIdx != cvf::UNDEFINED_SIZE_T )
|
||||
{
|
||||
double value = m_resultAccessor->cellScalar( cellIdx );
|
||||
if ( !std::isinf( value ) )
|
||||
{
|
||||
return 100000.0 * value; // return in pascal, not bar
|
||||
}
|
||||
}
|
||||
CAF_ASSERT( m_extractors.find( gridPart ) != m_extractors.end() );
|
||||
auto extractor = m_extractors.find( gridPart )->second;
|
||||
|
||||
// Extract values along well path
|
||||
std::vector<double> values;
|
||||
extractor->curveData( m_resultAccessor.p(), &values );
|
||||
|
||||
auto intersections = extractor->intersections();
|
||||
|
||||
CAF_ASSERT( m_wellPaths.find( gridPart ) != m_wellPaths.end() );
|
||||
auto wellPath = m_wellPaths.find( gridPart )->second;
|
||||
|
||||
// Insert top of overburden point
|
||||
intersections.insert( intersections.begin(), wellPath->wellPathPoints().front() );
|
||||
values.insert( values.begin(), std::numeric_limits<double>::infinity() );
|
||||
|
||||
// Insert bottom of underburden point
|
||||
intersections.push_back( wellPath->wellPathPoints().back() );
|
||||
values.push_back( std::numeric_limits<double>::infinity() );
|
||||
|
||||
auto [value, pos] =
|
||||
RimFaultReactivationDataAccessorWellLogExtraction::calculatePorBar( intersections, values, position, m_defaultPorePressureGradient );
|
||||
return RiaEclipseUnitTools::barToPascal( value );
|
||||
}
|
||||
|
||||
return calculatePorePressure( std::abs( position.z() ), m_defaultPorePressureGradient );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFaultReactivationDataAccessorPorePressure::calculatePorePressure( double depth, double gradient )
|
||||
{
|
||||
return gradient * 9.81 * depth * 1000.0;
|
||||
return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user