#6284 Mud Weight Window: Improve handling of non-reservoir elements.

This commit is contained in:
Kristian Bendiksen 2020-08-11 11:14:58 +02:00
parent e93c4e75f2
commit 02013f4816
5 changed files with 79 additions and 13 deletions

View File

@ -141,6 +141,22 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
const bool OBG0FromGrid = const bool OBG0FromGrid =
m_resultCollection->getCalculationParameterAddress( RimMudWeightWindowParameters::ParameterType::OBG0 ).isEmpty(); m_resultCollection->getCalculationParameterAddress( RimMudWeightWindowParameters::ParameterType::OBG0 ).isEmpty();
RimMudWeightWindowParameters::NonReservoirPorePressureType PP_NonReservoirType =
m_resultCollection->nonReservoirPorePressureTypeMudWeightWindow();
double hydrostaticMultiplier = m_resultCollection->hydrostaticMultiplierPPNonRes();
const QString& nonReservoirAddress = m_resultCollection->nonReservoirPorePressureAddressMudWeightWindow();
RigFemScalarResultFrames* nonReservoirResultFrames = nullptr;
if ( PP_NonReservoirType != RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC &&
!nonReservoirAddress.isEmpty() )
{
nonReservoirResultFrames =
m_resultCollection->findOrLoadScalarResult( partIndex,
RigFemResultAddress( RIG_ELEMENT,
nonReservoirAddress.toStdString(),
"" ) );
}
float inf = std::numeric_limits<float>::infinity(); float inf = std::numeric_limits<float>::infinity();
frameCountProgress.setNextProgressIncrement( 1u ); frameCountProgress.setNextProgressIncrement( 1u );
@ -173,6 +189,12 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
parameterFrameData[parameterType] = loadDataForFrame( parameterType, parameterFrames, fIdx ); parameterFrameData[parameterType] = loadDataForFrame( parameterType, parameterFrames, fIdx );
} }
std::vector<float> nonReservoirPP;
if ( nonReservoirResultFrames )
{
nonReservoirPP = nonReservoirResultFrames->frameData( 0 );
}
// Load stress // Load stress
RigFemResultAddress stressResAddr( RIG_ELEMENT_NODAL, "ST", "" ); RigFemResultAddress stressResAddr( RIG_ELEMENT_NODAL, "ST", "" );
std::vector<caf::Ten3f> vertexStressesFloat = m_resultCollection->tensors( stressResAddr, partIndex, fIdx ); std::vector<caf::Ten3f> vertexStressesFloat = m_resultCollection->tensors( stressResAddr, partIndex, fIdx );
@ -225,7 +247,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
int elmNodeCount = RigFemTypes::elementNodeCount( femPart->elementType( elmIdx ) ); int elmNodeCount = RigFemTypes::elementNodeCount( femPart->elementType( elmIdx ) );
if ( elmType == HEX8P ) if ( elmType == HEX8P || elmType == HEX8 )
{ {
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx ) for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
{ {
@ -242,8 +264,8 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodResIdx ); int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodResIdx );
// Pore pressure (unit: Bar) // Pore pressure (unit: Bar)
double porePressureBar = porFrameData[nodeIdx]; float porePressureBar = porFrameData[nodeIdx];
double initialPorePressureBar = initialPorFrameData[nodeIdx]; float initialPorePressureBar = initialPorFrameData[nodeIdx];
// Initial overburden gradient // Initial overburden gradient
if ( OBG0FromGrid ) if ( OBG0FromGrid )
@ -254,6 +276,24 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
// FG is for sands, SFG for shale. Sands has valid PP, shale does not. // FG is for sands, SFG for shale. Sands has valid PP, shale does not.
bool isSand = ( porePressureBar != inf ); bool isSand = ( porePressureBar != inf );
//
if ( porePressureBar == inf )
{
//
if ( PP_NonReservoirType ==
RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC )
{
porePressureBar = cellCenterHydroStaticPressure * hydrostaticMultiplier;
initialPorePressureBar = cellCenterHydroStaticPressure * hydrostaticMultiplier;
}
else if ( !nonReservoirPP.empty() )
{
// Get from element table
porePressureBar = nonReservoirPP[elmIdx];
initialPorePressureBar = nonReservoirPP[elmIdx];
}
}
caf::Ten3d segmentStress = caf::Ten3d( vertexStressesFloat[nodeIdx] ); caf::Ten3d segmentStress = caf::Ten3d( vertexStressesFloat[nodeIdx] );
cvf::Vec3d wellPathTangent = calculateWellPathTangent( wellPathAzimuth, wellPathDeviation ); cvf::Vec3d wellPathTangent = calculateWellPathTangent( wellPathAzimuth, wellPathDeviation );
@ -309,7 +349,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
else else
{ {
double SFG = sigmaCalculator.solveStassiDalia(); double SFG = sigmaCalculator.solveStassiDalia();
lowerLimit = std::max( porePressureBar, SFG ); lowerLimit = std::max( porePressureBar, static_cast<float>( SFG ) );
} }
} }

View File

@ -123,6 +123,8 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
m_airGapMudWeightWindow = 0.0; m_airGapMudWeightWindow = 0.0;
m_referenceLayerMudWeightWindow = 0; m_referenceLayerMudWeightWindow = 0;
m_shMultiplierMudWeightWindow = 1.05; m_shMultiplierMudWeightWindow = 1.05;
m_nonReservoirPorePressureAddressMudWeightWindow = "";
m_hydrostaticMultiplierPPNonResMudWeightWindow = 1.0;
m_resultCalculators.push_back( m_resultCalculators.push_back(
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorTimeLapse( *this ) ) ); std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorTimeLapse( *this ) ) );
@ -1722,6 +1724,14 @@ RimMudWeightWindowParameters::NonReservoirPorePressureType
return m_nonReservoirPorePressureTypeMudWeightWindow; return m_nonReservoirPorePressureTypeMudWeightWindow;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const QString& RigFemPartResultsCollection::nonReservoirPorePressureAddressMudWeightWindow() const
{
return m_nonReservoirPorePressureAddressMudWeightWindow;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1757,7 +1767,8 @@ void RigFemPartResultsCollection::setMudWeightWindowParameters(
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType, RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
double shMultiplier, double shMultiplier,
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType, RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
double hydrostaticMultiplierPPNonRes ) double hydrostaticMultiplierPPNonRes,
const QString& nonReservoirPorePressureAddress )
{ {
m_airGapMudWeightWindow = airGap; m_airGapMudWeightWindow = airGap;
m_upperLimitParameterMudWeightWindow = upperLimit; m_upperLimitParameterMudWeightWindow = upperLimit;
@ -1767,6 +1778,7 @@ void RigFemPartResultsCollection::setMudWeightWindowParameters(
m_shMultiplierMudWeightWindow = shMultiplier; m_shMultiplierMudWeightWindow = shMultiplier;
m_nonReservoirPorePressureTypeMudWeightWindow = nonReservoirPorePressureType; m_nonReservoirPorePressureTypeMudWeightWindow = nonReservoirPorePressureType;
m_hydrostaticMultiplierPPNonResMudWeightWindow = hydrostaticMultiplierPPNonRes; m_hydrostaticMultiplierPPNonResMudWeightWindow = hydrostaticMultiplierPPNonRes;
m_nonReservoirPorePressureAddressMudWeightWindow = nonReservoirPorePressureAddress;
// Invalidate dependent results // Invalidate dependent results
for ( auto result : mudWeightWindowResults() ) for ( auto result : mudWeightWindowResults() )

View File

@ -95,13 +95,15 @@ public:
RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType, RimMudWeightWindowParameters::FractureGradientCalculationType fgCalculationType,
double shMultiplier, double shMultiplier,
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType, RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureType,
double hydroStaticMultiplierPPNonRes ); double hydroStaticMultiplierPPNonRes,
const QString& nonReservoirPorePressureAddress );
double airGapMudWeightWindow() const; double airGapMudWeightWindow() const;
double shMultiplierMudWeightWindow() const; double shMultiplierMudWeightWindow() const;
double hydrostaticMultiplierPPNonRes() const; double hydrostaticMultiplierPPNonRes() const;
RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureTypeMudWeightWindow() const; RimMudWeightWindowParameters::NonReservoirPorePressureType nonReservoirPorePressureTypeMudWeightWindow() const;
const QString& nonReservoirPorePressureAddressMudWeightWindow() const;
RimMudWeightWindowParameters::UpperLimitType upperLimitParameterMudWeightWindow() const; RimMudWeightWindowParameters::UpperLimitType upperLimitParameterMudWeightWindow() const;
RimMudWeightWindowParameters::LowerLimitType lowerLimitParameterMudWeightWindow() const; RimMudWeightWindowParameters::LowerLimitType lowerLimitParameterMudWeightWindow() const;
@ -217,6 +219,7 @@ private:
RimMudWeightWindowParameters::NonReservoirPorePressureType m_nonReservoirPorePressureTypeMudWeightWindow; RimMudWeightWindowParameters::NonReservoirPorePressureType m_nonReservoirPorePressureTypeMudWeightWindow;
double m_hydrostaticMultiplierPPNonResMudWeightWindow; double m_hydrostaticMultiplierPPNonResMudWeightWindow;
QString m_nonReservoirPorePressureAddressMudWeightWindow;
std::map<RimMudWeightWindowParameters::ParameterType, QString> parameterAddresses; std::map<RimMudWeightWindowParameters::ParameterType, QString> parameterAddresses;
std::map<RimMudWeightWindowParameters::ParameterType, double> parameterValues; std::map<RimMudWeightWindowParameters::ParameterType, double> parameterValues;

View File

@ -92,7 +92,7 @@ void caf::AppEnum<RimMudWeightWindowParameters::FractureGradientCalculationType>
template <> template <>
void caf::AppEnum<RimMudWeightWindowParameters::NonReservoirPorePressureType>::setUp() void caf::AppEnum<RimMudWeightWindowParameters::NonReservoirPorePressureType>::setUp()
{ {
addItem( RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC, "PORE_PRESSURE", "Pore Pressure" ); addItem( RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC, "HYDROSTATIC", "Hydrostatic" );
addItem( RimMudWeightWindowParameters::NonReservoirPorePressureType::PER_ELEMENT, addItem( RimMudWeightWindowParameters::NonReservoirPorePressureType::PER_ELEMENT,
"PER_ELEMENT", "PER_ELEMENT",
"From element properties" ); "From element properties" );
@ -189,6 +189,8 @@ RimMudWeightWindowParameters::RimMudWeightWindowParameters( void )
"Data source for Non-Reservoir Pore Pressure", "Data source for Non-Reservoir Pore Pressure",
"" ); "" );
CAF_PDM_InitField( &m_userDefinedPPNonReservoir, "UserPPNonReservoir", 1.0, " Multiplier of hydrostatic PP", "", "", "" ); CAF_PDM_InitField( &m_userDefinedPPNonReservoir, "UserPPNonReservoir", 1.0, " Multiplier of hydrostatic PP", "", "", "" );
CAF_PDM_InitField( &m_porePressureNonReservoirAddress, "PPNonReservoirAddress", QString( "" ), "Value", "", "", "" );
m_porePressureNonReservoirAddress.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_referenceLayer, "ReferenceLayer", -1, "Reference Layer", "", "", "" ); CAF_PDM_InitField( &m_referenceLayer, "ReferenceLayer", -1, "Reference Layer", "", "", "" );
} }
@ -385,7 +387,7 @@ void RimMudWeightWindowParameters::fieldChangedByUi( const caf::PdmFieldHandle*
else if ( changedField == &m_airGap || changedField == &m_upperLimitType || changedField == &m_lowerLimitType || else if ( changedField == &m_airGap || changedField == &m_upperLimitType || changedField == &m_lowerLimitType ||
changedField == &m_referenceLayer || changedField == &m_fractureGradientCalculationType || changedField == &m_referenceLayer || changedField == &m_fractureGradientCalculationType ||
changedField == &m_shMultiplier || changedField == &m_porePressureNonReservoirSource || changedField == &m_shMultiplier || changedField == &m_porePressureNonReservoirSource ||
changedField == &m_userDefinedPPNonReservoir ) changedField == &m_userDefinedPPNonReservoir || changedField == &m_porePressureNonReservoirAddress )
{ {
RigGeoMechCaseData* rigCaseData = geoMechCase->geoMechData(); RigGeoMechCaseData* rigCaseData = geoMechCase->geoMechData();
if ( rigCaseData && rigCaseData->femPartResults() ) if ( rigCaseData && rigCaseData->femPartResults() )
@ -397,7 +399,8 @@ void RimMudWeightWindowParameters::fieldChangedByUi( const caf::PdmFieldHandle*
m_fractureGradientCalculationType.value(), m_fractureGradientCalculationType.value(),
m_shMultiplier, m_shMultiplier,
m_porePressureNonReservoirSource.value(), m_porePressureNonReservoirSource.value(),
m_userDefinedPPNonReservoir ); m_userDefinedPPNonReservoir,
m_porePressureNonReservoirAddress );
geoMechCase->updateConnectedViews(); geoMechCase->updateConnectedViews();
} }
} }
@ -504,6 +507,11 @@ void RimMudWeightWindowParameters::defineUiOrdering( QString uiConfigName, caf::
m_obg0Fixed.uiCapability()->setUiHidden( true ); m_obg0Fixed.uiCapability()->setUiHidden( true );
m_obg0Address.uiCapability()->setUiHidden( m_obg0Address.uiCapability()->setUiHidden(
!( isDerivedFromK0_FG && m_obg0Type == RimMudWeightWindowParameters::SourceType::PER_ELEMENT ) ); !( isDerivedFromK0_FG && m_obg0Type == RimMudWeightWindowParameters::SourceType::PER_ELEMENT ) );
bool ppNonResPerElement =
( m_porePressureNonReservoirSource == RimMudWeightWindowParameters::NonReservoirPorePressureType::PER_ELEMENT );
m_userDefinedPPNonReservoir.uiCapability()->setUiHidden( ppNonResPerElement );
m_porePressureNonReservoirAddress.uiCapability()->setUiHidden( !ppNonResPerElement );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -574,7 +582,8 @@ QList<caf::PdmOptionItemInfo>
} }
else if ( fieldNeedingOptions == &m_wellDeviationAddress || fieldNeedingOptions == &m_wellAzimuthAddress || else if ( fieldNeedingOptions == &m_wellDeviationAddress || fieldNeedingOptions == &m_wellAzimuthAddress ||
fieldNeedingOptions == &m_UCSAddress || fieldNeedingOptions == &m_poissonsRatioAddress || fieldNeedingOptions == &m_UCSAddress || fieldNeedingOptions == &m_poissonsRatioAddress ||
fieldNeedingOptions == &m_K0_FGAddress || fieldNeedingOptions == &m_obg0Address ) fieldNeedingOptions == &m_K0_FGAddress || fieldNeedingOptions == &m_obg0Address ||
fieldNeedingOptions == &m_porePressureNonReservoirAddress )
{ {
std::vector<std::string> elementProperties = geoMechCase->possibleElementPropertyFieldNames(); std::vector<std::string> elementProperties = geoMechCase->possibleElementPropertyFieldNames();

View File

@ -154,5 +154,7 @@ private:
caf::PdmField<caf::AppEnum<FractureGradientCalculationType>> m_fractureGradientCalculationType; caf::PdmField<caf::AppEnum<FractureGradientCalculationType>> m_fractureGradientCalculationType;
caf::PdmField<caf::AppEnum<NonReservoirPorePressureType>> m_porePressureNonReservoirSource; caf::PdmField<caf::AppEnum<NonReservoirPorePressureType>> m_porePressureNonReservoirSource;
caf::PdmField<QString> m_porePressureNonReservoirAddress;
caf::PdmField<int> m_referenceLayer; caf::PdmField<int> m_referenceLayer;
}; };