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

View File

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

View File

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

View File

@ -422,8 +422,6 @@ std::vector<Rim3dView*> RimGeoMechCase::allSpecialViews() const
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
{
uiTreeOrdering.add( &m_mudWeightWindowParameters );
std::vector<PdmObjectHandle*> children;
geoMechViews.childObjects( &children );
@ -1143,6 +1141,9 @@ void RimGeoMechCase::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
m_initialPermeabilityType != RimGeoMechCase::InitialPermeabilityType::INITIAL_PERMEABILITY_PER_ELEMENT );
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" );
shearSlipIndicatorGroup->add( &m_waterDensityShearSlipIndicator );

View File

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

View File

@ -178,7 +178,11 @@ void RimWellLogExtractionCurve::setFromSimulationWellName( const QString& simWel
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::setCase( RimCase* rimCase )
{
disconnectCaseSignals( m_case.value() );
m_case = rimCase;
connectCaseSignals( rimCase );
clearGeneratedSimWellPaths();
}
@ -197,7 +201,9 @@ void RimWellLogExtractionCurve::setPropertiesFromView( Rim3dView* view )
{
if ( view )
{
disconnectCaseSignals( m_case.value() );
m_case = view->ownerCase();
connectCaseSignals( m_case );
}
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case.value() );
@ -763,6 +769,8 @@ void RimWellLogExtractionCurve::initAfterRead()
m_eclipseResultDefinition->setEclipseCase( eclipseCase );
m_geomResultDefinition->setGeoMechCase( geomCase );
connectCaseSignals( m_case.value() );
}
//--------------------------------------------------------------------------------------------------
@ -1101,3 +1109,33 @@ void RimWellLogExtractionCurve::setBranchIndex( int 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;
protected:
QString createCurveAutoName() override;
void onLoadDataAndUpdate( bool updateParentPlot ) override;
QString createCurveAutoName() 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 );
void extractData( bool* isUsingPseudoLength, bool performDataSmoothing = false, double smoothingThreshold = -1.0 );