Merge pull request #6405 from OPM/mud-weight-window-fixes

Mud weight window fixes
This commit is contained in:
Kristian Bendiksen 2020-09-01 08:57:09 +02:00 committed by GitHub
commit dd1b5fa7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 23 deletions

View File

@ -85,9 +85,11 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
for ( auto parameterType : parameterTypes ) for ( auto parameterType : parameterTypes )
{ {
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); auto task =
frameCountProgress.task( "Loading parameter: " +
caf::AppEnum<RimMudWeightWindowParameters::ParameterType>::uiText( parameterType ),
m_resultCollection->frameCount() );
loadParameterFramesOrValue( parameterType, partIndex, parameterFrames, parameterValues ); loadParameterFramesOrValue( parameterType, partIndex, parameterFrames, parameterValues );
frameCountProgress.incrementProgress();
} }
double airGap = m_resultCollection->airGapMudWeightWindow(); double airGap = m_resultCollection->airGapMudWeightWindow();
@ -101,25 +103,30 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
m_resultCollection->lowerLimitParameterMudWeightWindow(); m_resultCollection->lowerLimitParameterMudWeightWindow();
// Pore pressure // Pore pressure
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); RigFemScalarResultFrames* porePressureDataFrames = nullptr;
RigFemScalarResultFrames* porePressureDataFrames = {
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "" ) ); auto task = frameCountProgress.task( "Loading POR-Bar.", m_resultCollection->frameCount() );
frameCountProgress.incrementProgress(); porePressureDataFrames =
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( RIG_ELEMENT_NODAL, "POR-Bar", "" ) );
}
// Stress (ST.S3) // Stress (ST.S3)
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); RigFemScalarResultFrames* stressDataFrames = nullptr;
RigFemScalarResultFrames* stressDataFrames = {
m_resultCollection->findOrLoadScalarResult( partIndex, RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) ); auto task = frameCountProgress.task( "Loading ST.S3", m_resultCollection->frameCount() );
frameCountProgress.incrementProgress(); stressDataFrames =
m_resultCollection->findOrLoadScalarResult( partIndex,
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S3" ) );
}
// Initial overburden gradient (ST.S33) // Initial overburden gradient (ST.S33)
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); RigFemScalarResultFrames* obg0DataFrames = nullptr;
RigFemScalarResultFrames* obg0DataFrames = {
m_resultCollection->findOrLoadScalarResult( partIndex, auto task = frameCountProgress.task( "Loading ST.S33", m_resultCollection->frameCount() );
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) ); obg0DataFrames =
frameCountProgress.incrementProgress(); m_resultCollection->findOrLoadScalarResult( partIndex,
RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) );
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); }
RigFemScalarResultFrames* mudWeightWindowFrames = RigFemScalarResultFrames* mudWeightWindowFrames =
m_resultCollection->createScalarResult( partIndex, m_resultCollection->createScalarResult( partIndex,
@ -133,7 +140,6 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
RigFemScalarResultFrames* lowerMudWeightLimitFrames = RigFemScalarResultFrames* lowerMudWeightLimitFrames =
m_resultCollection->createScalarResult( partIndex, m_resultCollection->createScalarResult( partIndex,
RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "LMWL" ) ); RigFemResultAddress( resVarAddr.resultPosType, resVarAddr.fieldName, "LMWL" ) );
frameCountProgress.incrementProgress();
const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex ); const RigFemPart* femPart = m_resultCollection->parts()->part( partIndex );
const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid(); const RigFemPartGrid* femPartGrid = femPart->getOrCreateStructGrid();
@ -150,6 +156,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
if ( PP_NonReservoirType != RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC && if ( PP_NonReservoirType != RimMudWeightWindowParameters::NonReservoirPorePressureType::HYDROSTATIC &&
!nonReservoirAddress.isEmpty() ) !nonReservoirAddress.isEmpty() )
{ {
auto task = frameCountProgress.task( "Loading non-reservoir pore pressure.", m_resultCollection->frameCount() );
nonReservoirResultFrames = nonReservoirResultFrames =
m_resultCollection->findOrLoadScalarResult( partIndex, m_resultCollection->findOrLoadScalarResult( partIndex,
RigFemResultAddress( RIG_ELEMENT, RigFemResultAddress( RIG_ELEMENT,
@ -160,6 +167,7 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorMudWeightWindow::calculate(
float inf = std::numeric_limits<float>::infinity(); float inf = std::numeric_limits<float>::infinity();
frameCountProgress.setNextProgressIncrement( 1u ); frameCountProgress.setNextProgressIncrement( 1u );
frameCountProgress.setProgressDescription( "Calculating Mud Weight Window." );
int frameCount = stressDataFrames->frameCount(); int frameCount = stressDataFrames->frameCount();
for ( int fIdx = 0; fIdx < frameCount; ++fIdx ) for ( int fIdx = 0; fIdx < frameCount; ++fIdx )

View File

@ -42,7 +42,8 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimCase, "Case", "RimCase" );
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimCase::RimCase() RimCase::RimCase()
: m_isInActiveDestruction( false ) : settingsChanged( this )
, m_isInActiveDestruction( false )
{ {
CAF_PDM_InitScriptableObjectWithNameAndComment( "Case", ":/Case48x48.png", "", "", "Case", "The ResInsight base class for Cases" ); CAF_PDM_InitScriptableObjectWithNameAndComment( "Case", ":/Case48x48.png", "", "", "Case", "The ResInsight base class for Cases" );

View File

@ -81,6 +81,8 @@ public:
Rim2dIntersectionViewCollection* intersectionViewCollection(); Rim2dIntersectionViewCollection* intersectionViewCollection();
caf::Signal<> settingsChanged;
protected: protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override; bool* useOptionsOnly ) override;

View File

@ -422,8 +422,6 @@ std::vector<Rim3dView*> RimGeoMechCase::allSpecialViews() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimGeoMechCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ ) void RimGeoMechCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
{ {
uiTreeOrdering.add( &m_mudWeightWindowParameters );
std::vector<PdmObjectHandle*> children; std::vector<PdmObjectHandle*> children;
geoMechViews.childObjects( &children ); geoMechViews.childObjects( &children );
@ -1143,6 +1141,9 @@ void RimGeoMechCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
m_initialPermeabilityType != RimGeoMechCase::InitialPermeabilityType::INITIAL_PERMEABILITY_PER_ELEMENT ); m_initialPermeabilityType != RimGeoMechCase::InitialPermeabilityType::INITIAL_PERMEABILITY_PER_ELEMENT );
permeabilityGroup->add( &m_permeabilityExponent ); permeabilityGroup->add( &m_permeabilityExponent );
caf::PdmUiGroup* mudWeightWindowGroup = uiOrdering.addNewGroup( "Mud Weight Window" );
m_mudWeightWindowParameters->uiOrdering( uiConfigName, *mudWeightWindowGroup );
caf::PdmUiGroup* shearSlipIndicatorGroup = uiOrdering.addNewGroup( "Shear Slip Indicator" ); caf::PdmUiGroup* shearSlipIndicatorGroup = uiOrdering.addNewGroup( "Shear Slip Indicator" );
shearSlipIndicatorGroup->add( &m_waterDensityShearSlipIndicator ); shearSlipIndicatorGroup->add( &m_waterDensityShearSlipIndicator );

View File

@ -415,6 +415,7 @@ void RimMudWeightWindowParameters::fieldChangedByUi( const caf::PdmFieldHandle*
m_userDefinedPPNonReservoir, m_userDefinedPPNonReservoir,
m_porePressureNonReservoirAddress ); m_porePressureNonReservoirAddress );
geoMechCase->updateConnectedViews(); geoMechCase->updateConnectedViews();
geoMechCase->settingsChanged.send();
} }
} }
} }
@ -474,6 +475,7 @@ void RimMudWeightWindowParameters::handleFieldChanged( RimGeoMechCase*
} }
geoMechCase->updateConnectedViews(); geoMechCase->updateConnectedViews();
geoMechCase->settingsChanged.send();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -178,7 +178,11 @@ void RimWellLogExtractionCurve::setFromSimulationWellName( const QString& simWel
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::setCase( RimCase* rimCase ) void RimWellLogExtractionCurve::setCase( RimCase* rimCase )
{ {
disconnectCaseSignals( m_case.value() );
m_case = rimCase; m_case = rimCase;
connectCaseSignals( rimCase );
clearGeneratedSimWellPaths(); clearGeneratedSimWellPaths();
} }
@ -197,7 +201,9 @@ void RimWellLogExtractionCurve::setPropertiesFromView( Rim3dView* view )
{ {
if ( view ) if ( view )
{ {
disconnectCaseSignals( m_case.value() );
m_case = view->ownerCase(); m_case = view->ownerCase();
connectCaseSignals( m_case );
} }
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() ); RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
@ -763,6 +769,8 @@ void RimWellLogExtractionCurve::initAfterRead()
m_eclipseResultDefinition->setEclipseCase( eclipseCase ); m_eclipseResultDefinition->setEclipseCase( eclipseCase );
m_geomResultDefinition->setGeoMechCase( geomCase ); m_geomResultDefinition->setGeoMechCase( geomCase );
connectCaseSignals( m_case.value() );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -1101,3 +1109,33 @@ void RimWellLogExtractionCurve::setBranchIndex( int index )
{ {
m_branchIndex = index; m_branchIndex = index;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::connectCaseSignals( RimCase* rimCase )
{
if ( rimCase )
{
rimCase->settingsChanged.connect( this, &RimWellLogExtractionCurve::onCaseSettingsChanged );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::disconnectCaseSignals( RimCase* rimCase )
{
if ( rimCase != nullptr )
{
rimCase->settingsChanged.disconnect( this );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::onCaseSettingsChanged( const caf::SignalEmitter* emitter )
{
loadDataAndUpdate( true );
}

View File

@ -94,8 +94,12 @@ public:
RiaDefines::PhaseType phaseType() const override; RiaDefines::PhaseType phaseType() const override;
protected: protected:
QString createCurveAutoName() override; QString createCurveAutoName() override;
void onLoadDataAndUpdate( bool updateParentPlot ) override; void onLoadDataAndUpdate( bool updateParentPlot ) override;
void onCaseSettingsChanged( const caf::SignalEmitter* emitter );
void connectCaseSignals( RimCase* rimCase );
void disconnectCaseSignals( RimCase* rimCase );
virtual void performDataExtraction( bool* isUsingPseudoLength ); virtual void performDataExtraction( bool* isUsingPseudoLength );
void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 ); void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 );