Tie-in valve improvements (#13661)

Support (bool, something) pairs as tuples on python side.
Support custom outlet valve md
Add python test for custom outlet valve md
Use tie-in depth as default for custom valve md
Standalone valve creation and display updates
Update MSW valve export
Add valve open/shut flag.
Add python examples
This commit is contained in:
JJ authored and GitHub committed 2026-03-06 12:01:14 +01:00
1 parent f47de8457c
commit 24be78f105
34 files changed
+1139 -157

No files matched your search

@@ -39,11 +39,13 @@
#include "RimStimPlanModel.h"
#include "RimThermalFractureTemplate.h"
#include "RimTools.h"
#include "RimValveCollection.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletionSettings.h"
#include "RimWellPathFracture.h"
#include "RimWellPathTieIn.h"
#include "RimWellPathValve.h"
#include "RigDoglegTools.h"
#include "RigStimPlanModelTools.h"
@@ -727,3 +729,140 @@ QString RimcWellPath_parentBranch::classKeywordReturnedType() const
{
return RimWellPath::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimcWellPath_enableOutletValve, "EnableOutletValve" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcWellPath_enableOutletValve::RimcWellPath_enableOutletValve( caf::PdmObjectHandle* self )
: PdmObjectMethod( self, PdmObjectMethod::NullPointerType::NULL_IS_VALID, PdmObjectMethod::ResultType::PERSISTENT_TRUE )
{
CAF_PDM_InitObject( "Enable Outlet Valve", "", "", "Enable Outlet Valve" );
CAF_PDM_InitScriptableFieldNoDefault( &m_enabled, "Enable", "Enable" );
CAF_PDM_InitScriptableFieldNoDefault( &m_template, "IcvTemplate", "IcvTemplate" );
CAF_PDM_InitScriptableField( &m_useCustomMd, "UseCustomValveMd", false, "Use Custom Valve Md" );
CAF_PDM_InitScriptableField( &m_customMd, "CustomValveMd", 0.0, "Outlet Valve Custom Md" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimcWellPath_enableOutletValve::execute()
{
auto wellPath = self<RimWellPath>();
RimWellPathValve* valve = nullptr;
if ( wellPath->isTopLevelWellPath() ) return nullptr;
if ( auto tieIn = wellPath->wellPathTieIn() )
{
tieIn->setEnableBranchValveAtConnection( m_enabled() );
if ( m_enabled() )
{
if ( m_useCustomMd() )
{
tieIn->setBranchValveMeasuredDepth( m_customMd() );
}
else
{
tieIn->useDefaultBranchValveMeasuredDepth();
}
if ( m_template() and ( m_template->type() == RiaDefines::WellPathComponentType::ICV ) )
{
tieIn->setBranchValveTemplate( m_template() );
}
valve = tieIn->outletValve();
}
tieIn->updateConnectedEditors();
}
return valve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimcWellPath_enableOutletValve::classKeywordReturnedType() const
{
return RimWellPathValve::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimcWellPath_tieIn, "TieIn" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcWellPath_tieIn::RimcWellPath_tieIn( caf::PdmObjectHandle* self )
: PdmObjectMethod( self, PdmObjectMethod::NullPointerType::NULL_IS_VALID, PdmObjectMethod::ResultType::PERSISTENT_TRUE )
{
CAF_PDM_InitObject( "Well Path Tie-In", "", "", "Well Path Tie-In Settings" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimcWellPath_tieIn::execute()
{
if ( auto wellPath = self<RimWellPath>() )
{
return wellPath->wellPathTieIn();
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimcWellPath_tieIn::classKeywordReturnedType() const
{
return RimWellPathTieIn::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimcWellPath_addIcvValve, "AddIcvValve" );
//--------------------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------------------
RimcWellPath_addIcvValve::RimcWellPath_addIcvValve( caf::PdmObjectHandle* self )
: caf::PdmObjectCreationMethod( self )
{
CAF_PDM_InitObject( "Add ICV Valve", "", "", "Add ICV Valve" );
CAF_PDM_InitScriptableField( &m_measuredDepth, "MeasuredDepth", 0.0, "Measured Depth" );
}
//--------------------------------------------------------------------------------------------------
//
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimcWellPath_addIcvValve::execute()
{
if ( auto wellPath = self<RimWellPath>() )
{
auto valve = wellPath->valveCollection()->addIcvValve( m_measuredDepth );
if ( valve )
{
if ( auto wellPathCollection = RimTools::wellPathCollection() )
{
wellPathCollection->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews();
}
return valve;
}
}
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimcWellPath_addIcvValve::classKeywordReturnedType() const
{
return RimWellPathValve::classKeywordStatic();
}