mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 09:00:14 -06:00
#12609 Python: Add functions to build valves from Python
This commit is contained in:
1 parent
ed246bb1fc
commit
13f6a57782
15 files changed
+398
-55
No files matched your search
@@ -23,6 +23,8 @@
|
|||||||
#include "RimStimPlanModelTemplateCollection.h"
|
#include "RimStimPlanModelTemplateCollection.h"
|
||||||
#include "RimValveTemplateCollection.h"
|
#include "RimValveTemplateCollection.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
#include "cvfAssert.h"
|
#include "cvfAssert.h"
|
||||||
@@ -34,7 +36,7 @@ CAF_PDM_SOURCE_INIT( RimCompletionTemplateCollection, "CompletionTemplateCollect
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimCompletionTemplateCollection::RimCompletionTemplateCollection()
|
RimCompletionTemplateCollection::RimCompletionTemplateCollection()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Completion Templates", ":/CompletionsSymbol16x16.png" );
|
CAF_PDM_InitScriptableObject( "Completion Templates", ":/CompletionsSymbol16x16.png" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_fractureTemplates, "FractureTemplates", "" );
|
CAF_PDM_InitFieldNoDefault( &m_fractureTemplates, "FractureTemplates", "" );
|
||||||
m_fractureTemplates = new RimFractureTemplateCollection;
|
m_fractureTemplates = new RimFractureTemplateCollection;
|
||||||
@@ -43,7 +45,7 @@ RimCompletionTemplateCollection::RimCompletionTemplateCollection()
|
|||||||
CAF_PDM_InitFieldNoDefault( &m_stimPlanModelTemplates, "StimPlanModelTemplates", "" );
|
CAF_PDM_InitFieldNoDefault( &m_stimPlanModelTemplates, "StimPlanModelTemplates", "" );
|
||||||
m_stimPlanModelTemplates = new RimStimPlanModelTemplateCollection;
|
m_stimPlanModelTemplates = new RimStimPlanModelTemplateCollection;
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_valveTemplates, "ValveTemplates", "" );
|
CAF_PDM_InitScriptableFieldNoDefault( &m_valveTemplates, "ValveTemplates", "" );
|
||||||
m_valveTemplates = new RimValveTemplateCollection;
|
m_valveTemplates = new RimValveTemplateCollection;
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_fractureGroupStatisticsCollection, "FractureGroupStatisticsCollection", "" );
|
CAF_PDM_InitFieldNoDefault( &m_fractureGroupStatisticsCollection, "FractureGroupStatisticsCollection", "" );
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ RimPerforationInterval::RimPerforationInterval()
|
|||||||
CAF_PDM_InitField( &m_useCustomEndDate, "UseCustomEndDate", false, "Custom End Date" );
|
CAF_PDM_InitField( &m_useCustomEndDate, "UseCustomEndDate", false, "Custom End Date" );
|
||||||
CAF_PDM_InitField( &m_endDate, "EndDate", QDateTime::currentDateTime(), "End Date" );
|
CAF_PDM_InitField( &m_endDate, "EndDate", QDateTime::currentDateTime(), "End Date" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_valves, "Valves", "Valves" );
|
CAF_PDM_InitScriptableFieldNoDefault( &m_valves, "Valves", "Valves" );
|
||||||
|
|
||||||
nameField()->uiCapability()->setUiReadOnly( true );
|
nameField()->uiCapability()->setUiReadOnly( true );
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
#include "RimWellPathAicdParameters.h"
|
#include "RimWellPathAicdParameters.h"
|
||||||
#include "RimWellPathValve.h"
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
#include "cafPdmUiTreeOrdering.h"
|
#include "cafPdmUiTreeOrdering.h"
|
||||||
|
|
||||||
#include "opm/input/eclipse/Parser/ParserKeywords/W.hpp"
|
#include "opm/input/eclipse/Parser/ParserKeywords/W.hpp"
|
||||||
@@ -32,7 +34,7 @@ CAF_PDM_SOURCE_INIT( RimValveTemplate, "ValveTemplate" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimValveTemplate::RimValveTemplate()
|
RimValveTemplate::RimValveTemplate()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Valve Template", ":/ICDValve16x16.png" );
|
CAF_PDM_InitScriptableObject( "Valve Template", ":/ICDValve16x16.png" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_valveTemplateUnit,
|
CAF_PDM_InitField( &m_valveTemplateUnit,
|
||||||
"UnitSystem",
|
"UnitSystem",
|
||||||
@@ -46,10 +48,10 @@ RimValveTemplate::RimValveTemplate()
|
|||||||
|
|
||||||
setName( fullLabel() );
|
setName( fullLabel() );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_orificeDiameter, "OrificeDiameter", 8.0, "Orifice Diameter [mm]" );
|
CAF_PDM_InitScriptableField( &m_orificeDiameter, "OrificeDiameter", 8.0, "Orifice Diameter [mm]" );
|
||||||
CAF_PDM_InitField( &m_flowCoefficient, "FlowCoefficient", 0.7, "Flow Coefficient" );
|
CAF_PDM_InitScriptableField( &m_flowCoefficient, "FlowCoefficient", 0.7, "Flow Coefficient" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameters, "AICDParameters", "AICD Parameters" );
|
CAF_PDM_InitScriptableFieldWithScriptKeywordNoDefault( &m_aicdParameters, "AICDParameters", "AicdParameters", "AICD Parameters" );
|
||||||
m_aicdParameters = new RimWellPathAicdParameters;
|
m_aicdParameters = new RimWellPathAicdParameters;
|
||||||
m_aicdParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
m_aicdParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimValveTemplate.h"
|
#include "RimValveTemplate.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimValveTemplateCollection, "ValveTemplateCollection" );
|
CAF_PDM_SOURCE_INIT( RimValveTemplateCollection, "ValveTemplateCollection" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -28,9 +31,9 @@ CAF_PDM_SOURCE_INIT( RimValveTemplateCollection, "ValveTemplateCollection" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimValveTemplateCollection::RimValveTemplateCollection()
|
RimValveTemplateCollection::RimValveTemplateCollection()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "Valve Templates", ":/ICDValve16x16.png" );
|
CAF_PDM_InitScriptableObject( "Valve Templates", ":/ICDValve16x16.png" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_valveDefinitions, "ValveDefinitions", "" );
|
CAF_PDM_InitScriptableFieldNoDefault( &m_valveDefinitions, "ValveDefinitions", "" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_defaultUnitsForValveTemplates, "ValveUnits", "Default unit system for valve templates" );
|
CAF_PDM_InitScriptableFieldNoDefault( &m_defaultUnitsForValveTemplates, "ValveUnits", "Default unit system for valve templates" );
|
||||||
m_defaultUnitsForValveTemplates = RiaDefines::EclipseUnitSystem::UNITS_METRIC;
|
m_defaultUnitsForValveTemplates = RiaDefines::EclipseUnitSystem::UNITS_METRIC;
|
||||||
addDefaultValveTemplates();
|
addDefaultValveTemplates();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@
|
|||||||
#include "RimWellPathValve.h"
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
#include "cafPdmDoubleStringValidator.h"
|
#include "cafPdmDoubleStringValidator.h"
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
#include "cafPdmUiDoubleValueEditor.h"
|
#include "cafPdmUiDoubleValueEditor.h"
|
||||||
#include "cafPdmUiGroup.h"
|
#include "cafPdmUiGroup.h"
|
||||||
#include "cafPdmUiLineEditor.h"
|
#include "cafPdmUiLineEditor.h"
|
||||||
@@ -35,51 +37,65 @@ CAF_PDM_SOURCE_INIT( RimWellPathAicdParameters, "WellPathAicdParameters" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellPathAicdParameters::RimWellPathAicdParameters()
|
RimWellPathAicdParameters::RimWellPathAicdParameters()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "RimWellPathAicdParameters" );
|
CAF_PDM_InitScriptableObject( "RimWellPathAicdParameters" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_deviceOpen, "DeviceOpen", true, "Device Open?" );
|
CAF_PDM_InitScriptableField( &m_deviceOpen, "DeviceOpen", true, "Device Open?" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameterFields[AICD_STRENGTH], "StrengthAICD", "Strength of AICD" );
|
CAF_PDM_InitScriptableFieldWithScriptKeywordNoDefault( &m_aicdParameterFields[AICD_STRENGTH],
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameterFields[AICD_DENSITY_CALIB_FLUID],
|
"StrengthAICD",
|
||||||
"DensityCalibrationFluid",
|
"StrengthAicd",
|
||||||
"Calibration Fluid Density (kg/m^3)" );
|
"Strength of AICD" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameterFields[AICD_VISCOSITY_CALIB_FLUID],
|
CAF_PDM_InitScriptableFieldNoDefault( &m_aicdParameterFields[AICD_DENSITY_CALIB_FLUID],
|
||||||
"ViscosityCalibrationFluid",
|
"DensityCalibrationFluid",
|
||||||
"Calibration Fluid Viscosity (cP)" );
|
"Calibration Fluid Density (kg/m^3)" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameterFields[AICD_VOL_FLOW_EXP], "VolumeFlowRateExponent", "Volume Flow Rate Exponent" );
|
CAF_PDM_InitScriptableFieldNoDefault( &m_aicdParameterFields[AICD_VISCOSITY_CALIB_FLUID],
|
||||||
CAF_PDM_InitFieldNoDefault( &m_aicdParameterFields[AICD_VISOSITY_FUNC_EXP], "ViscosityFunctionExponent", "Viscosity Function Exponent" );
|
"ViscosityCalibrationFluid",
|
||||||
|
"Calibration Fluid Viscosity (cP)" );
|
||||||
|
CAF_PDM_InitScriptableFieldNoDefault( &m_aicdParameterFields[AICD_VOL_FLOW_EXP], "VolumeFlowRateExponent", "Volume Flow Rate Exponent" );
|
||||||
|
CAF_PDM_InitScriptableFieldNoDefault( &m_aicdParameterFields[AICD_VISOSITY_FUNC_EXP],
|
||||||
|
"ViscosityFunctionExponent",
|
||||||
|
"Viscosity Function Exponent" );
|
||||||
|
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_CRITICAL_WATER_IN_LIQUID_FRAC],
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_CRITICAL_WATER_IN_LIQUID_FRAC],
|
||||||
"CriticalWaterLiquidFractionEmul",
|
"CriticalWaterLiquidFractionEmul",
|
||||||
QString( "1*" ),
|
QString( "1*" ),
|
||||||
"Critical Water in Liquid Fraction for emulsions" );
|
"Critical Water in Liquid Fraction for emulsions" );
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EMULSION_VISC_TRANS_REGION],
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EMULSION_VISC_TRANS_REGION],
|
||||||
"ViscosityTransitionRegionEmul",
|
"ViscosityTransitionRegionEmul",
|
||||||
QString( "1*" ),
|
QString( "1*" ),
|
||||||
"Emulsion Viscosity Transition Region" );
|
"Emulsion Viscosity Transition Region" );
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_MAX_RATIO_EMULSION_VISC],
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_MAX_RATIO_EMULSION_VISC],
|
||||||
"MaxRatioOfEmulsionVisc",
|
"MaxRatioOfEmulsionVisc",
|
||||||
QString( "1*" ),
|
QString( "1*" ),
|
||||||
"Max Ratio of Emulsion to Continuous Viscosity" );
|
"Max Ratio of Emulsion to Continuous Viscosity" );
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_MAX_FLOW_RATE], "MaxFlowRate", QString( "1*" ), "Max Flow Rate for AICD Device (m^3 / day)" );
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_MAX_FLOW_RATE],
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_OIL_FRAC_DENSITY], "ExponentOilDensity", QString( "1*" ), "Density Exponent of Oil Fraction" );
|
"MaxFlowRate",
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_WATER_FRAC_DENSITY],
|
QString( "1*" ),
|
||||||
"ExponentWaterDensity",
|
"Max Flow Rate for AICD Device (m^3 / day)" );
|
||||||
QString( "1*" ),
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_OIL_FRAC_DENSITY],
|
||||||
"Density Exponent of Water Fraction" );
|
"ExponentOilDensity",
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_GAS_FRAC_DENSITY], "ExponentGasDensity", QString( "1*" ), "Density Exponent of Gas Fraction" );
|
QString( "1*" ),
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_OIL_FRAC_VISCOSITY],
|
"Density Exponent of Oil Fraction" );
|
||||||
"ExponentOilViscosity",
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_WATER_FRAC_DENSITY],
|
||||||
QString( "1*" ),
|
"ExponentWaterDensity",
|
||||||
"Viscosity Exponent of Oil Fraction" );
|
QString( "1*" ),
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_WATER_FRAC_VISCOSITY],
|
"Density Exponent of Water Fraction" );
|
||||||
"ExponentWaterViscosity",
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_GAS_FRAC_DENSITY],
|
||||||
QString( "1*" ),
|
"ExponentGasDensity",
|
||||||
"Viscosity Exponent of Water Fraction" );
|
QString( "1*" ),
|
||||||
CAF_PDM_InitField( &m_aicdParameterFields[AICD_EXP_GAS_FRAC_VISCOSITY],
|
"Density Exponent of Gas Fraction" );
|
||||||
"ExponentGasViscosity",
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_OIL_FRAC_VISCOSITY],
|
||||||
QString( "1*" ),
|
"ExponentOilViscosity",
|
||||||
"Viscosity Exponent of Gas Fraction" );
|
QString( "1*" ),
|
||||||
|
"Viscosity Exponent of Oil Fraction" );
|
||||||
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_WATER_FRAC_VISCOSITY],
|
||||||
|
"ExponentWaterViscosity",
|
||||||
|
QString( "1*" ),
|
||||||
|
"Viscosity Exponent of Water Fraction" );
|
||||||
|
CAF_PDM_InitScriptableField( &m_aicdParameterFields[AICD_EXP_GAS_FRAC_VISCOSITY],
|
||||||
|
"ExponentGasViscosity",
|
||||||
|
QString( "1*" ),
|
||||||
|
"Viscosity Exponent of Gas Fraction" );
|
||||||
|
|
||||||
std::vector<caf::PdmFieldHandle*> allFields = fields();
|
std::vector<caf::PdmFieldHandle*> allFields = fields();
|
||||||
for ( caf::PdmFieldHandle* field : allFields )
|
for ( caf::PdmFieldHandle* field : allFields )
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include "CompletionCommands/RicNewValveTemplateFeature.h"
|
#include "CompletionCommands/RicNewValveTemplateFeature.h"
|
||||||
|
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmObjectScriptingCapability.h"
|
||||||
#include "cafPdmUiDoubleSliderEditor.h"
|
#include "cafPdmUiDoubleSliderEditor.h"
|
||||||
#include "cafPdmUiToolButtonEditor.h"
|
#include "cafPdmUiToolButtonEditor.h"
|
||||||
|
|
||||||
@@ -44,10 +46,10 @@ CAF_PDM_SOURCE_INIT( RimWellPathValve, "WellPathValve" );
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RimWellPathValve::RimWellPathValve()
|
RimWellPathValve::RimWellPathValve()
|
||||||
{
|
{
|
||||||
CAF_PDM_InitObject( "WellPathValve", ":/ICDValve16x16.png" );
|
CAF_PDM_InitScriptableObject( "WellPathValve", ":/ICDValve16x16.png" );
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault( &m_valveTemplate, "ValveTemplate", "Valve Template" );
|
CAF_PDM_InitFieldNoDefault( &m_valveTemplate, "ValveTemplate", "Valve Template" );
|
||||||
CAF_PDM_InitField( &m_measuredDepth, "StartMeasuredDepth", 0.0, "Start MD" );
|
CAF_PDM_InitScriptableField( &m_measuredDepth, "StartMeasuredDepth", 0.0, "Start MD" );
|
||||||
CAF_PDM_InitFieldNoDefault( &m_multipleValveLocations, "ValveLocations", "Valve Locations" );
|
CAF_PDM_InitFieldNoDefault( &m_multipleValveLocations, "ValveLocations", "Valve Locations" );
|
||||||
CAF_PDM_InitField( &m_editValveTemplate, "EditTemplate", false, "Edit" );
|
CAF_PDM_InitField( &m_editValveTemplate, "EditTemplate", false, "Edit" );
|
||||||
CAF_PDM_InitField( &m_createValveTemplate, "CreateTemplate", false, "Create" );
|
CAF_PDM_InitField( &m_createValveTemplate, "CreateTemplate", false, "Create" );
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "RimCase.h"
|
#include "RimCase.h"
|
||||||
#include "RimColorLegend.h"
|
#include "RimColorLegend.h"
|
||||||
#include "RimColorLegendCollection.h"
|
#include "RimColorLegendCollection.h"
|
||||||
|
#include "RimCompletionTemplateCollection.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
#include "RimFaultInView.h"
|
#include "RimFaultInView.h"
|
||||||
#include "RimFaultInViewCollection.h"
|
#include "RimFaultInViewCollection.h"
|
||||||
@@ -40,6 +41,7 @@
|
|||||||
#include "RimSeismicDataCollection.h"
|
#include "RimSeismicDataCollection.h"
|
||||||
#include "RimSeismicDifferenceData.h"
|
#include "RimSeismicDifferenceData.h"
|
||||||
#include "RimSurfaceCollection.h"
|
#include "RimSurfaceCollection.h"
|
||||||
|
#include "RimValveTemplateCollection.h"
|
||||||
#include "RimViewWindow.h"
|
#include "RimViewWindow.h"
|
||||||
#include "RimWellLogLasFile.h"
|
#include "RimWellLogLasFile.h"
|
||||||
#include "RimWellPath.h"
|
#include "RimWellPath.h"
|
||||||
@@ -574,6 +576,20 @@ RimWellPath* RimTools::firstWellPath()
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimValveTemplateCollection* RimTools::valveTemplateCollection()
|
||||||
|
{
|
||||||
|
auto proj = RimProject::current();
|
||||||
|
if ( !proj ) return nullptr;
|
||||||
|
|
||||||
|
auto oilField = proj->activeOilField();
|
||||||
|
if ( !oilField ) return nullptr;
|
||||||
|
|
||||||
|
auto compColl = oilField->completionTemplateCollection();
|
||||||
|
return compColl ? compColl->valveTemplateCollection() : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class PdmObjectHandle;
|
|||||||
class RimGeoMechCase;
|
class RimGeoMechCase;
|
||||||
class RimEclipseCase;
|
class RimEclipseCase;
|
||||||
class RimWellPathCollection;
|
class RimWellPathCollection;
|
||||||
|
class RimValveTemplateCollection;
|
||||||
class RimCase;
|
class RimCase;
|
||||||
class RimWellPath;
|
class RimWellPath;
|
||||||
class RimSurfaceCollection;
|
class RimSurfaceCollection;
|
||||||
@@ -77,6 +78,8 @@ public:
|
|||||||
static RimWellPathCollection* wellPathCollection();
|
static RimWellPathCollection* wellPathCollection();
|
||||||
static RimWellPath* firstWellPath();
|
static RimWellPath* firstWellPath();
|
||||||
|
|
||||||
|
static RimValveTemplateCollection* valveTemplateCollection();
|
||||||
|
|
||||||
static RimSurfaceCollection* surfaceCollection();
|
static RimSurfaceCollection* surfaceCollection();
|
||||||
static RimPolygonCollection* polygonCollection();
|
static RimPolygonCollection* polygonCollection();
|
||||||
static RimAutomationSettings* automationSettings();
|
static RimAutomationSettings* automationSettings();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ set(SOURCE_GROUP_HEADER_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimcFishbonesCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcFishbonesCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcPolygonCollection.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcPolygonCollection.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcRegularSurface.h
|
${CMAKE_CURRENT_LIST_DIR}/RimcRegularSurface.h
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimcPerforationInterval.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(SOURCE_GROUP_SOURCE_FILES
|
set(SOURCE_GROUP_SOURCE_FILES
|
||||||
@@ -66,6 +67,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RimcFishbonesCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcFishbonesCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcPolygonCollection.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcPolygonCollection.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimcRegularSurface.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimcRegularSurface.cpp
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/RimcPerforationInterval.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2025- Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RimcPerforationInterval.h"
|
||||||
|
|
||||||
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimPerforationCollection.h"
|
||||||
|
#include "RimPerforationInterval.h"
|
||||||
|
#include "RimTools.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
#include "RimWellPathValve.h"
|
||||||
|
|
||||||
|
#include "cafPdmAbstractFieldScriptingCapability.h"
|
||||||
|
#include "cafPdmFieldScriptingCapability.h"
|
||||||
|
|
||||||
|
#include <expected>
|
||||||
|
|
||||||
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimPerforationInterval, RimcPerforationInterval_addValve, "AddValve" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimcPerforationInterval_addValve::RimcPerforationInterval_addValve( caf::PdmObjectHandle* self )
|
||||||
|
: caf::PdmObjectCreationMethod( self )
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Add StimPlan Fracture", "", "", "Add StimPlan Fracture" );
|
||||||
|
|
||||||
|
CAF_PDM_InitScriptableField( &m_startMd, "StartMd", 0.0, "Start Measured Depth" );
|
||||||
|
CAF_PDM_InitScriptableField( &m_endMd, "EndMd", 0.0, "End Measured Depth" );
|
||||||
|
CAF_PDM_InitScriptableField( &m_valveCount, "ValveCount", 1, "Valve Count" );
|
||||||
|
CAF_PDM_InitScriptableFieldNoDefault( &m_template, "Template", "", "", "", "Valve Template" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::expected<caf::PdmObjectHandle*, QString> RimcPerforationInterval_addValve::execute()
|
||||||
|
{
|
||||||
|
auto perfInterval = self<RimPerforationInterval>();
|
||||||
|
|
||||||
|
if ( m_startMd() > m_endMd() ) return std::unexpected( "Start MD must be smaller that end MD." );
|
||||||
|
if ( m_valveCount() < 1 ) return std::unexpected( "Valve count must be larger than zero" );
|
||||||
|
|
||||||
|
RimWellPathValve* valve = new RimWellPathValve;
|
||||||
|
|
||||||
|
valve->setValveTemplate( m_template() );
|
||||||
|
perfInterval->addValve( valve );
|
||||||
|
|
||||||
|
double spacing = std::abs( m_startMd() - m_endMd() ) / m_valveCount();
|
||||||
|
|
||||||
|
valve->setMeasuredDepthAndCount( m_startMd(), spacing, m_valveCount() );
|
||||||
|
valve->applyValveLabelAndIcon();
|
||||||
|
|
||||||
|
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
|
||||||
|
|
||||||
|
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||||
|
wellPathCollection->scheduleRedrawAffectedViews();
|
||||||
|
|
||||||
|
return valve;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimcPerforationInterval_addValve::classKeywordReturnedType() const
|
||||||
|
{
|
||||||
|
return RimWellPathValve::classKeywordStatic();
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2025- Equinor ASA
|
||||||
|
//
|
||||||
|
// ResInsight is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
//
|
||||||
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||||
|
// for more details.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "cafPdmField.h"
|
||||||
|
#include "cafPdmObjectHandle.h"
|
||||||
|
#include "cafPdmObjectMethod.h"
|
||||||
|
#include "cafPdmPtrField.h"
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class RimValveTemplate;
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimcPerforationInterval_addValve : public caf::PdmObjectCreationMethod
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimcPerforationInterval_addValve( caf::PdmObjectHandle* self );
|
||||||
|
|
||||||
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
||||||
|
QString classKeywordReturnedType() const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
caf::PdmPtrField<RimValveTemplate*> m_template;
|
||||||
|
caf::PdmField<double> m_startMd;
|
||||||
|
caf::PdmField<double> m_endMd;
|
||||||
|
caf::PdmField<int> m_valveCount;
|
||||||
|
};
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "RimSummaryCase.h"
|
#include "RimSummaryCase.h"
|
||||||
#include "RimSurfaceCollection.h"
|
#include "RimSurfaceCollection.h"
|
||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
|
#include "RimValveTemplateCollection.h"
|
||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
@@ -319,3 +320,36 @@ QString RimProject_wellPathCollection::classKeywordReturnedType() const
|
|||||||
{
|
{
|
||||||
return RimWellPathCollection::classKeywordStatic();
|
return RimWellPathCollection::classKeywordStatic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimProject, RimProject_valveTemplates, "valveTemplates" );
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
RimProject_valveTemplates::RimProject_valveTemplates( caf::PdmObjectHandle* self )
|
||||||
|
: PdmObjectMethod( self, PdmObjectMethod::NullPointerType::NULL_IS_INVALID, PdmObjectMethod::ResultType::PERSISTENT_TRUE )
|
||||||
|
{
|
||||||
|
CAF_PDM_InitObject( "Get Valve Template Collection", "", "", "Get Valve Template Collection" );
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
std::expected<caf::PdmObjectHandle*, QString> RimProject_valveTemplates::execute()
|
||||||
|
{
|
||||||
|
auto valveTemplateCollection = RimTools::valveTemplateCollection();
|
||||||
|
if ( !valveTemplateCollection )
|
||||||
|
{
|
||||||
|
return std::unexpected( "No valve template collection found." );
|
||||||
|
}
|
||||||
|
|
||||||
|
return valveTemplateCollection;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimProject_valveTemplates::classKeywordReturnedType() const
|
||||||
|
{
|
||||||
|
return RimValveTemplateCollection::classKeywordStatic();
|
||||||
|
}
|
||||||
@@ -113,3 +113,17 @@ public:
|
|||||||
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
||||||
QString classKeywordReturnedType() const override;
|
QString classKeywordReturnedType() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//==================================================================================================
|
||||||
|
///
|
||||||
|
//==================================================================================================
|
||||||
|
class RimProject_valveTemplates : public caf::PdmObjectMethod
|
||||||
|
{
|
||||||
|
CAF_PDM_HEADER_INIT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
RimProject_valveTemplates( caf::PdmObjectHandle* self );
|
||||||
|
|
||||||
|
std::expected<caf::PdmObjectHandle*, QString> execute() override;
|
||||||
|
QString classKeywordReturnedType() const override;
|
||||||
|
};
|
||||||
@@ -31,7 +31,20 @@ target = geometry.append_well_target(coord)
|
|||||||
coord = [1054.28, 250, -50]
|
coord = [1054.28, 250, -50]
|
||||||
target = geometry.append_well_target(coord)
|
target = geometry.append_well_target(coord)
|
||||||
|
|
||||||
well_path.append_perforation_interval(3300, 3350, 0.2, 0.76)
|
perforation = well_path.append_perforation_interval(3300, 3350, 0.2, 0.76)
|
||||||
|
|
||||||
|
# Make some changes to the AICD parameters of the valve template
|
||||||
|
valve_templates = resinsight.project.valve_templates()
|
||||||
|
aicd_template = valve_templates.valve_definitions()[0]
|
||||||
|
aicd_parameters = aicd_template.aicd_parameters()
|
||||||
|
aicd_parameters.max_flow_rate = "899.43"
|
||||||
|
aicd_parameters.density_calibration_fluid = "45.5"
|
||||||
|
aicd_parameters.update()
|
||||||
|
|
||||||
|
# Add a valve to the perforation interval
|
||||||
|
valve = perforation.add_valve(
|
||||||
|
template=aicd_template, start_md=3310, end_md=3340, valve_count=2
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Update skin factor of the perforation
|
# Update skin factor of the perforation
|
||||||
|
|||||||
@@ -116,3 +116,108 @@ def test_10k_intersection_trajectory_properties(rips_instance, initialize_test):
|
|||||||
assert "azimuth" in result
|
assert "azimuth" in result
|
||||||
assert "inclination" in result
|
assert "inclination" in result
|
||||||
assert "dogleg" in result
|
assert "dogleg" in result
|
||||||
|
|
||||||
|
|
||||||
|
def test_10k_intersection_add_well_perforation_interval_with_valves(
|
||||||
|
rips_instance, initialize_test
|
||||||
|
):
|
||||||
|
case_root_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC"
|
||||||
|
case_path = case_root_path + "/TEST10K_FLT_LGR_NNC.EGRID"
|
||||||
|
case = rips_instance.project.load_case(path=case_path)
|
||||||
|
assert len(case.grids()) == 2
|
||||||
|
well_path_files = [
|
||||||
|
case_root_path + "/wellpath_a.dev",
|
||||||
|
]
|
||||||
|
|
||||||
|
well_path_names = rips_instance.project.import_well_paths(well_path_files)
|
||||||
|
assert len(well_path_names) == 1
|
||||||
|
wells = rips_instance.project.well_paths()
|
||||||
|
well_path = wells[0]
|
||||||
|
|
||||||
|
result = well_path.trajectory_properties(resampling_interval=10.0)
|
||||||
|
|
||||||
|
measured_depths = result["measured_depth"]
|
||||||
|
|
||||||
|
start_md = measured_depths[len(measured_depths) - 3]
|
||||||
|
end_md = measured_depths[len(measured_depths) - 2]
|
||||||
|
diameter = 0.25
|
||||||
|
skin_factor = 0.1
|
||||||
|
|
||||||
|
perf_interval = well_path.append_perforation_interval(
|
||||||
|
start_md, end_md, diameter, skin_factor
|
||||||
|
)
|
||||||
|
|
||||||
|
assert perf_interval.start_measured_depth == start_md
|
||||||
|
assert perf_interval.end_measured_depth == end_md
|
||||||
|
assert perf_interval.diameter == diameter
|
||||||
|
assert perf_interval.skin_factor == skin_factor
|
||||||
|
|
||||||
|
valve_templates = rips_instance.project.valve_templates()
|
||||||
|
assert len(valve_templates.valve_definitions()) == 3
|
||||||
|
|
||||||
|
assert len(perf_interval.valves()) == 0
|
||||||
|
|
||||||
|
valve_start_md = start_md + 1
|
||||||
|
valve_end_md = end_md - 1
|
||||||
|
valve_count = 1
|
||||||
|
valve = perf_interval.add_valve(
|
||||||
|
template=valve_templates.valve_definitions()[0],
|
||||||
|
start_md=valve_start_md,
|
||||||
|
end_md=valve_end_md,
|
||||||
|
valve_count=valve_count,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert valve
|
||||||
|
assert valve.name == "1 AICD: 2451 - 2459"
|
||||||
|
|
||||||
|
assert len(perf_interval.valves()) == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_10k_intersection_add_well_perforation_interval_with_invalid_valves(
|
||||||
|
rips_instance, initialize_test
|
||||||
|
):
|
||||||
|
case_root_path = dataroot.PATH + "/TEST10K_FLT_LGR_NNC"
|
||||||
|
case_path = case_root_path + "/TEST10K_FLT_LGR_NNC.EGRID"
|
||||||
|
case = rips_instance.project.load_case(path=case_path)
|
||||||
|
assert len(case.grids()) == 2
|
||||||
|
well_path_files = [
|
||||||
|
case_root_path + "/wellpath_a.dev",
|
||||||
|
]
|
||||||
|
|
||||||
|
well_path_names = rips_instance.project.import_well_paths(well_path_files)
|
||||||
|
assert len(well_path_names) == 1
|
||||||
|
wells = rips_instance.project.well_paths()
|
||||||
|
well_path = wells[0]
|
||||||
|
|
||||||
|
result = well_path.trajectory_properties(resampling_interval=10.0)
|
||||||
|
|
||||||
|
measured_depths = result["measured_depth"]
|
||||||
|
|
||||||
|
start_md = measured_depths[len(measured_depths) - 3]
|
||||||
|
end_md = measured_depths[len(measured_depths) - 2]
|
||||||
|
diameter = 0.25
|
||||||
|
skin_factor = 0.1
|
||||||
|
|
||||||
|
perf_interval = well_path.append_perforation_interval(
|
||||||
|
start_md, end_md, diameter, skin_factor
|
||||||
|
)
|
||||||
|
|
||||||
|
valve_templates = rips_instance.project.valve_templates()
|
||||||
|
|
||||||
|
with pytest.raises(rips.RipsError):
|
||||||
|
# end_md < start_md
|
||||||
|
valve = perf_interval.add_valve(
|
||||||
|
template=valve_templates.valve_definitions()[0],
|
||||||
|
start_md=1000,
|
||||||
|
end_md=800,
|
||||||
|
valve_count=1,
|
||||||
|
)
|
||||||
|
|
||||||
|
with pytest.raises(rips.RipsError):
|
||||||
|
# zero valves
|
||||||
|
valve = perf_interval.add_valve(
|
||||||
|
template=valve_templates.valve_definitions()[0],
|
||||||
|
start_md=400,
|
||||||
|
end_md=800,
|
||||||
|
valve_count=0,
|
||||||
|
)
|
||||||
Reference in new issue
Block a user