mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6286 Mud Weight Window: Use initial overburden gradient from grid.
This commit is contained in:
parent
68ce7f590d
commit
e3628906c8
@ -77,7 +77,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
RimMudWeightWindowParameters::ParameterType::K0_FG,
|
||||
RimMudWeightWindowParameters::ParameterType::OBG0};
|
||||
|
||||
caf::ProgressInfo frameCountProgress( m_resultCollection->frameCount() * ( 4 + parameterTypes.size() ), "" );
|
||||
caf::ProgressInfo frameCountProgress( m_resultCollection->frameCount() * ( 5 + parameterTypes.size() ), "" );
|
||||
frameCountProgress.setProgressDescription( "Calculating Mud Weight Window" );
|
||||
|
||||
std::map<RimMudWeightWindowParameters::ParameterType, RigFemScalarResultFrames*> parameterFrames;
|
||||
@ -112,6 +112,13 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) );
|
||||
frameCountProgress.incrementProgress();
|
||||
|
||||
// Initial overburden gradient (ST.S33)
|
||||
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() );
|
||||
RigFemScalarResultFrames* obg0DataFrames =
|
||||
m_resultCollection->findOrLoadScalarResult( partIndex,
|
||||
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
|
||||
frameCountProgress.incrementProgress();
|
||||
|
||||
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() );
|
||||
|
||||
RigFemScalarResultFrames* mudWeightWindowFrames =
|
||||
@ -131,6 +138,9 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
|
||||
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
|
||||
|
||||
const bool OBG0FromGrid =
|
||||
m_resultCollection->getCalculationParameterAddress( RimMudWeightWindowParameters::ParameterType::OBG0 ).isEmpty();
|
||||
|
||||
float inf = std::numeric_limits<float>::infinity();
|
||||
|
||||
frameCountProgress.setNextProgressIncrement( 1u );
|
||||
@ -142,6 +152,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
const std::vector<float>& initialPorFrameData = porePressureDataFrames->frameData( 0 );
|
||||
|
||||
const std::vector<float>& stressFrameData = stressDataFrames->frameData( fIdx );
|
||||
const std::vector<float>& obg0FrameData = obg0DataFrames->frameData( 0 );
|
||||
|
||||
std::vector<float>& mudWeightWindowFrameData = mudWeightWindowFrames->frameData( fIdx );
|
||||
std::vector<float>& mudWeightMiddleFrameData = mudWeightMiddleFrames->frameData( fIdx );
|
||||
@ -203,10 +214,14 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
|
||||
double OBG0 = getValueForElement( RimMudWeightWindowParameters::ParameterType::OBG0,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
double OBG0 = 0.0;
|
||||
if ( !OBG0FromGrid )
|
||||
{
|
||||
OBG0 = getValueForElement( RimMudWeightWindowParameters::ParameterType::OBG0,
|
||||
parameterFrameData,
|
||||
parameterValues,
|
||||
elmIdx );
|
||||
}
|
||||
|
||||
int elmNodeCount = RigFemTypes::elementNodeCount( femPart->elementType( elmIdx ) );
|
||||
|
||||
@ -230,6 +245,12 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
|
||||
double porePressureBar = porFrameData[nodeIdx];
|
||||
double initialPorePressureBar = initialPorFrameData[nodeIdx];
|
||||
|
||||
// Initial overburden gradient
|
||||
if ( OBG0FromGrid )
|
||||
{
|
||||
OBG0 = obg0FrameData[nodeIdx];
|
||||
}
|
||||
|
||||
// FG is for sands, SFG for shale. Sands has valid PP, shale does not.
|
||||
bool isSand = ( porePressureBar != inf );
|
||||
|
||||
|
@ -121,6 +121,7 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf
|
||||
|
||||
m_airGapMudWeightWindow = 0.0;
|
||||
m_referenceLayerMudWeightWindow = 0;
|
||||
m_shMultiplierMudWeightWindow = 1.05;
|
||||
|
||||
m_resultCalculators.push_back(
|
||||
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorTimeLapse( *this ) ) );
|
||||
|
@ -43,6 +43,7 @@ void caf::AppEnum<RimMudWeightWindowParameters::SourceType>::setUp()
|
||||
{
|
||||
addItem( RimMudWeightWindowParameters::SourceType::FIXED, "FIXED", "Fixed" );
|
||||
addItem( RimMudWeightWindowParameters::SourceType::PER_ELEMENT, "PER_ELEMENT", "From element properties" );
|
||||
addItem( RimMudWeightWindowParameters::SourceType::GRID, "GRID", "Grid" );
|
||||
setDefault( RimMudWeightWindowParameters::SourceType::FIXED );
|
||||
}
|
||||
|
||||
@ -139,7 +140,8 @@ RimMudWeightWindowParameters::RimMudWeightWindowParameters( void )
|
||||
CAF_PDM_InitField( &m_K0_FGAddress, "K0_FGAddress", QString( "" ), "Value", "", "", "" );
|
||||
m_K0_FGAddress.uiCapability()->setUiEditorTypeName( caf::PdmUiListEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_obg0Type, "obg0SourceType", defaultSourceType, "Initial Overburden Gradient", "", "", "" );
|
||||
caf::AppEnum<SourceType> defaultOBG0SourceType = RimMudWeightWindowParameters::SourceType::GRID;
|
||||
CAF_PDM_InitField( &m_obg0Type, "obg0SourceType", defaultOBG0SourceType, "Initial Overburden Gradient", "", "", "" );
|
||||
CAF_PDM_InitField( &m_obg0Fixed, "obg0Fixed", 0.75, "Fixed Initial Overburden Gradient", "", "", "" );
|
||||
m_obg0Fixed.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
|
||||
|
||||
@ -389,7 +391,8 @@ void RimMudWeightWindowParameters::handleFieldChanged( RimGeoMechCase*
|
||||
|
||||
if ( rigCaseData && rigCaseData->femPartResults() )
|
||||
{
|
||||
if ( typeField->value() == RimMudWeightWindowParameters::SourceType::FIXED )
|
||||
if ( typeField->value() == RimMudWeightWindowParameters::SourceType::FIXED ||
|
||||
typeField->value() == RimMudWeightWindowParameters::SourceType::GRID )
|
||||
{
|
||||
rigCaseData->femPartResults()->setCalculationParameters( parameterType, "", fixedField->value() );
|
||||
}
|
||||
@ -409,7 +412,7 @@ void RimMudWeightWindowParameters::handleFieldChanged( RimGeoMechCase*
|
||||
.arg( title );
|
||||
RiaLogging::info( importMessage );
|
||||
// Set back to default value
|
||||
*typeField = RimMudWeightWindowParameters::SourceType::FIXED;
|
||||
*typeField = typeField->defaultValue();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -442,7 +445,6 @@ void RimMudWeightWindowParameters::defineUiOrdering( QString uiConfigName, caf::
|
||||
defineGroup( uiOrdering, "Well Azimuth", &m_wellAzimuthType, &m_wellAzimuthFixed, &m_wellAzimuthAddress );
|
||||
defineGroup( uiOrdering, "UCS", &m_UCSType, &m_UCSFixed, &m_UCSAddress );
|
||||
defineGroup( uiOrdering, "Poisson's Ratio", &m_poissonsRatioType, &m_poissonsRatioFixed, &m_poissonsRatioAddress );
|
||||
defineGroup( uiOrdering, "Initial Overburden Gradient", &m_obg0Type, &m_obg0Fixed, &m_obg0Address );
|
||||
|
||||
RimGeoMechCase* geoMechCase = nullptr;
|
||||
firstAncestorOrThisOfType( geoMechCase );
|
||||
@ -466,14 +468,18 @@ void RimMudWeightWindowParameters::defineUiOrdering( QString uiConfigName, caf::
|
||||
m_shMultiplier.uiCapability()->setUiHidden( m_fractureGradientCalculationType !=
|
||||
FractureGradientCalculationType::PROPORTIONAL_TO_SH );
|
||||
|
||||
m_K0_FGType.uiCapability()->setUiHidden( m_fractureGradientCalculationType !=
|
||||
FractureGradientCalculationType::DERIVED_FROM_K0FG );
|
||||
bool isDerivedFromK0_FG = m_fractureGradientCalculationType == FractureGradientCalculationType::DERIVED_FROM_K0FG;
|
||||
m_K0_FGType.uiCapability()->setUiHidden( !isDerivedFromK0_FG );
|
||||
m_K0_FGFixed.uiCapability()->setUiHidden(
|
||||
!( m_fractureGradientCalculationType == FractureGradientCalculationType::DERIVED_FROM_K0FG &&
|
||||
m_K0_FGType == RimMudWeightWindowParameters::SourceType::FIXED ) );
|
||||
!( isDerivedFromK0_FG && m_K0_FGType == RimMudWeightWindowParameters::SourceType::FIXED ) );
|
||||
m_K0_FGAddress.uiCapability()->setUiHidden(
|
||||
!( m_fractureGradientCalculationType == FractureGradientCalculationType::DERIVED_FROM_K0FG &&
|
||||
m_K0_FGType == RimMudWeightWindowParameters::SourceType::PER_ELEMENT ) );
|
||||
!( isDerivedFromK0_FG && m_K0_FGType == RimMudWeightWindowParameters::SourceType::PER_ELEMENT ) );
|
||||
|
||||
defineGroup( uiOrdering, "Initial Overburden Gradient", &m_obg0Type, &m_obg0Fixed, &m_obg0Address );
|
||||
m_obg0Type.uiCapability()->setUiHidden( !isDerivedFromK0_FG );
|
||||
m_obg0Fixed.uiCapability()->setUiHidden( true );
|
||||
m_obg0Address.uiCapability()->setUiHidden(
|
||||
!( isDerivedFromK0_FG && m_obg0Type == RimMudWeightWindowParameters::SourceType::PER_ELEMENT ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -524,9 +530,27 @@ QList<caf::PdmOptionItemInfo>
|
||||
|
||||
if ( geoMechCase != nullptr )
|
||||
{
|
||||
if ( fieldNeedingOptions == &m_wellDeviationAddress || fieldNeedingOptions == &m_wellAzimuthAddress ||
|
||||
fieldNeedingOptions == &m_UCSAddress || fieldNeedingOptions == &m_poissonsRatioAddress ||
|
||||
fieldNeedingOptions == &m_K0_FGAddress || fieldNeedingOptions == &m_obg0Address )
|
||||
if ( fieldNeedingOptions == &m_obg0Type )
|
||||
{
|
||||
std::vector<SourceType> sourceTypes = {SourceType::GRID, SourceType::PER_ELEMENT};
|
||||
for ( auto sourceType : sourceTypes )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( caf::AppEnum<SourceType>::uiText( sourceType ), sourceType ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_wellDeviationType || fieldNeedingOptions == &m_wellAzimuthType ||
|
||||
fieldNeedingOptions == &m_UCSType || fieldNeedingOptions == &m_poissonsRatioType ||
|
||||
fieldNeedingOptions == &m_K0_FGType )
|
||||
{
|
||||
std::vector<SourceType> sourceTypes = {SourceType::FIXED, SourceType::PER_ELEMENT};
|
||||
for ( auto sourceType : sourceTypes )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( caf::AppEnum<SourceType>::uiText( sourceType ), sourceType ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_wellDeviationAddress || fieldNeedingOptions == &m_wellAzimuthAddress ||
|
||||
fieldNeedingOptions == &m_UCSAddress || fieldNeedingOptions == &m_poissonsRatioAddress ||
|
||||
fieldNeedingOptions == &m_K0_FGAddress || fieldNeedingOptions == &m_obg0Address )
|
||||
{
|
||||
std::vector<std::string> elementProperties = geoMechCase->possibleElementPropertyFieldNames();
|
||||
|
||||
|
@ -35,7 +35,8 @@ public:
|
||||
enum class SourceType
|
||||
{
|
||||
FIXED = 0,
|
||||
PER_ELEMENT
|
||||
PER_ELEMENT,
|
||||
GRID
|
||||
};
|
||||
|
||||
enum class ParameterType
|
||||
|
Loading…
Reference in New Issue
Block a user