mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve MSW export including multi lateral wells
Based on branch https://github.com/OPM/ResInsight/tree/system-msw-refactor - Move completion settings to property of well path - Rename to RimFishbones - Export implicit COMPSEGS for fishbones main bore - Add valve for each branch - Increase version number to be able to handle import of legacy project files
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Checks: 'google-readability-braces-around-statements,google-readability-casting,google-readability-function-size,google-readability-namespace-comments,google-readability-todo,modernize-avoid-bind,modernize-avoid-c-arrays,modernize-concat-nested-namespaces,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-loop-convert,modernize-make-shared,modernize-make-unique,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-uncaught-exceptions,modernize-use-using,readability-avoid-const-params-in-decls,readability-braces-around-statements,readability-const-return-type,readability-container-size-empty,readability-deleted-default,readability-delete-null-pointer,readability-else-after-return,readability-function-size,readability-identifier-naming,readability-implicit-bool-conversion,readability-inconsistent-declaration-parameter-name,readability-isolate-declaration,readability-magic-numbers,readability-misleading-indentation,readability-misplaced-array-index,readability-named-parameter,readability-non-const-parameter,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-member-init,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-simplify-subscript-expr,readability-static-accessed-through-instance,readability-static-definition-in-anonymous-namespace,readability-string-compare,readability-uniqueptr-delete-release,readability-uppercase-literal-suffix'
|
||||
@@ -2,13 +2,14 @@
|
||||
set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesMultipleSubs.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbones.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPathCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFracture.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.h
|
||||
@@ -38,13 +39,14 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPathAicdParameters.h
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimCompletionCellIntersectionCalc.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesMultipleSubs.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbones.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishbonesPipeProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFishboneWellPathCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimImportedFishboneLaterals.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimImportedFishboneLateralsCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPerforationCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimPerforationInterval.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletions.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCompletionSettings.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimEllipseFractureTemplate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFracture.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureContainment.cpp
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFishbones.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
@@ -38,33 +38,34 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <random>
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFishbonesMultipleSubs, "FishbonesMultipleSubs" );
|
||||
CAF_PDM_SOURCE_INIT( RimFishbones, "FishbonesMultipleSubs" );
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void AppEnum<RimFishbonesMultipleSubs::LocationType>::setUp()
|
||||
void AppEnum<RimFishbones::LocationType>::setUp()
|
||||
{
|
||||
addItem( RimFishbonesMultipleSubs::FB_SUB_COUNT_END, "FB_SUB_COUNT", "Start/End/Number of Subs" );
|
||||
addItem( RimFishbonesMultipleSubs::FB_SUB_SPACING_END, "FB_SUB_SPACING", "Start/End/Spacing" );
|
||||
addItem( RimFishbonesMultipleSubs::FB_SUB_USER_DEFINED, "FB_SUB_CUSTOM", "User Specification" );
|
||||
setDefault( RimFishbonesMultipleSubs::FB_SUB_COUNT_END );
|
||||
addItem( RimFishbones::FB_SUB_COUNT_END, "FB_SUB_COUNT", "Start/End/Number of Subs" );
|
||||
addItem( RimFishbones::FB_SUB_SPACING_END, "FB_SUB_SPACING", "Start/End/Spacing" );
|
||||
addItem( RimFishbones::FB_SUB_USER_DEFINED, "FB_SUB_CUSTOM", "User Specification" );
|
||||
setDefault( RimFishbones::FB_SUB_COUNT_END );
|
||||
}
|
||||
|
||||
template <>
|
||||
void AppEnum<RimFishbonesMultipleSubs::LateralsOrientationType>::setUp()
|
||||
void AppEnum<RimFishbones::LateralsOrientationType>::setUp()
|
||||
{
|
||||
addItem( RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_FIXED, "FB_LATERAL_ORIENTATION_FIXED", "Fixed Angle" );
|
||||
addItem( RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_RANDOM, "FB_LATERAL_ORIENTATION_RANDOM", "Random Angle" );
|
||||
setDefault( RimFishbonesMultipleSubs::FB_LATERAL_ORIENTATION_RANDOM );
|
||||
addItem( RimFishbones::FB_LATERAL_ORIENTATION_FIXED, "FB_LATERAL_ORIENTATION_FIXED", "Fixed Angle" );
|
||||
addItem( RimFishbones::FB_LATERAL_ORIENTATION_RANDOM, "FB_LATERAL_ORIENTATION_RANDOM", "Random Angle" );
|
||||
setDefault( RimFishbones::FB_LATERAL_ORIENTATION_RANDOM );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
|
||||
RimFishbones::RimFishbones()
|
||||
{
|
||||
CAF_PDM_InitObject( "FishbonesMultipleSubs", ":/FishBoneGroup16x16.png", "", "" );
|
||||
|
||||
@@ -72,7 +73,7 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
|
||||
m_isActive.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_name, "Name", "Name", "", "", "" );
|
||||
m_name.registerGetMethod( this, &RimFishbonesMultipleSubs::generatedName );
|
||||
m_name.registerGetMethod( this, &RimFishbones::generatedName );
|
||||
m_name.uiCapability()->setUiReadOnly( true );
|
||||
m_name.xmlCapability()->setIOWritable( false );
|
||||
|
||||
@@ -163,14 +164,14 @@ RimFishbonesMultipleSubs::RimFishbonesMultipleSubs()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishbonesMultipleSubs::~RimFishbonesMultipleSubs()
|
||||
RimFishbones::~RimFishbones()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFishbonesMultipleSubs::isActive() const
|
||||
bool RimFishbones::isActive() const
|
||||
{
|
||||
return m_isActive;
|
||||
}
|
||||
@@ -178,10 +179,10 @@ bool RimFishbonesMultipleSubs::isActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFishbonesMultipleSubs::generatedName() const
|
||||
QString RimFishbones::generatedName() const
|
||||
{
|
||||
caf::PdmChildArrayField<RimFishbonesMultipleSubs*>* container =
|
||||
dynamic_cast<caf::PdmChildArrayField<RimFishbonesMultipleSubs*>*>( this->parentField() );
|
||||
caf::PdmChildArrayField<RimFishbones*>* container =
|
||||
dynamic_cast<caf::PdmChildArrayField<RimFishbones*>*>( this->parentField() );
|
||||
CVF_ASSERT( container );
|
||||
|
||||
size_t index = container->index( this );
|
||||
@@ -191,7 +192,7 @@ QString RimFishbonesMultipleSubs::generatedName() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::setMeasuredDepthAndCount( double startMD, double spacing, int subCount )
|
||||
void RimFishbones::setMeasuredDepthAndCount( double startMD, double spacing, int subCount )
|
||||
{
|
||||
double endMD = startMD + spacing * subCount;
|
||||
m_valveLocations->initFields( RimMultipleValveLocations::VALVE_SPACING, startMD, endMD, spacing, subCount, {} );
|
||||
@@ -203,7 +204,7 @@ void RimFishbonesMultipleSubs::setMeasuredDepthAndCount( double startMD, double
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::measuredDepth( size_t subIndex ) const
|
||||
double RimFishbones::measuredDepth( size_t subIndex ) const
|
||||
{
|
||||
return m_valveLocations->measuredDepth( subIndex );
|
||||
}
|
||||
@@ -211,7 +212,7 @@ double RimFishbonesMultipleSubs::measuredDepth( size_t subIndex ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::rotationAngle( size_t index ) const
|
||||
double RimFishbones::rotationAngle( size_t index ) const
|
||||
{
|
||||
if ( m_subsOrientationMode == FB_LATERAL_ORIENTATION_FIXED )
|
||||
{
|
||||
@@ -228,7 +229,7 @@ double RimFishbonesMultipleSubs::rotationAngle( size_t index ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::exitAngle() const
|
||||
double RimFishbones::exitAngle() const
|
||||
{
|
||||
return m_lateralExitAngle;
|
||||
}
|
||||
@@ -236,7 +237,7 @@ double RimFishbonesMultipleSubs::exitAngle() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::buildAngle() const
|
||||
double RimFishbones::buildAngle() const
|
||||
{
|
||||
return m_lateralBuildAngle;
|
||||
}
|
||||
@@ -244,7 +245,7 @@ double RimFishbonesMultipleSubs::buildAngle() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::tubingDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
double RimFishbones::tubingDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
@@ -277,7 +278,7 @@ double RimFishbonesMultipleSubs::tubingDiameter( RiaDefines::EclipseUnitSystem u
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::effectiveDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
double RimFishbones::effectiveDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
{
|
||||
double innerRadius = tubingDiameter( unitSystem ) / 2;
|
||||
double outerRadius = holeDiameter( unitSystem ) / 2;
|
||||
@@ -294,7 +295,7 @@ double RimFishbonesMultipleSubs::effectiveDiameter( RiaDefines::EclipseUnitSyste
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::openHoleRoughnessFactor( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
double RimFishbones::openHoleRoughnessFactor( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
@@ -314,7 +315,7 @@ double RimFishbonesMultipleSubs::openHoleRoughnessFactor( RiaDefines::EclipseUni
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::icdOrificeDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
double RimFishbones::icdOrificeDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted( wellPath );
|
||||
@@ -324,7 +325,7 @@ double RimFishbonesMultipleSubs::icdOrificeDiameter( RiaDefines::EclipseUnitSyst
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::icdFlowCoefficient() const
|
||||
double RimFishbones::icdFlowCoefficient() const
|
||||
{
|
||||
return m_icdFlowCoefficient();
|
||||
}
|
||||
@@ -332,7 +333,7 @@ double RimFishbonesMultipleSubs::icdFlowCoefficient() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimFishbonesMultipleSubs::icdCount() const
|
||||
size_t RimFishbones::icdCount() const
|
||||
{
|
||||
return m_icdCount();
|
||||
}
|
||||
@@ -340,7 +341,7 @@ size_t RimFishbonesMultipleSubs::icdCount() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimFishbonesMultipleSubs::lateralLengths() const
|
||||
std::vector<double> RimFishbones::lateralLengths() const
|
||||
{
|
||||
QStringList items = m_lateralLength().split( ' ' );
|
||||
double currentLength = 0.0;
|
||||
@@ -367,7 +368,7 @@ std::vector<double> RimFishbonesMultipleSubs::lateralLengths() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::geometryUpdated()
|
||||
void RimFishbones::geometryUpdated()
|
||||
{
|
||||
computeRotationAngles();
|
||||
computeSubLateralIndices();
|
||||
@@ -384,7 +385,7 @@ void RimFishbonesMultipleSubs::geometryUpdated()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d> RimFishbonesMultipleSubs::coordsForLateral( size_t subIndex, size_t lateralIndex ) const
|
||||
std::vector<cvf::Vec3d> RimFishbones::coordsForLateral( size_t subIndex, size_t lateralIndex ) const
|
||||
{
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD =
|
||||
m_rigFishbonesGeometry->coordsForLateral( subIndex, lateralIndex );
|
||||
@@ -401,8 +402,7 @@ std::vector<cvf::Vec3d> RimFishbonesMultipleSubs::coordsForLateral( size_t subIn
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<std::pair<cvf::Vec3d, double>> RimFishbonesMultipleSubs::coordsAndMDForLateral( size_t subIndex,
|
||||
size_t lateralIndex ) const
|
||||
std::vector<std::pair<cvf::Vec3d, double>> RimFishbones::coordsAndMDForLateral( size_t subIndex, size_t lateralIndex ) const
|
||||
{
|
||||
return m_rigFishbonesGeometry->coordsForLateral( subIndex, lateralIndex );
|
||||
}
|
||||
@@ -410,7 +410,7 @@ std::vector<std::pair<cvf::Vec3d, double>> RimFishbonesMultipleSubs::coordsAndMD
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::recomputeLateralLocations()
|
||||
void RimFishbones::recomputeLateralLocations()
|
||||
{
|
||||
computeRangesAndLocations();
|
||||
computeRotationAngles();
|
||||
@@ -419,7 +419,7 @@ void RimFishbonesMultipleSubs::recomputeLateralLocations()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::setUnitSystemSpecificDefaults()
|
||||
void RimFishbones::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType( wellPath );
|
||||
@@ -450,7 +450,7 @@ void RimFishbonesMultipleSubs::setUnitSystemSpecificDefaults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::WellPathComponentType RimFishbonesMultipleSubs::componentType() const
|
||||
RiaDefines::WellPathComponentType RimFishbones::componentType() const
|
||||
{
|
||||
return RiaDefines::WellPathComponentType::FISHBONES;
|
||||
}
|
||||
@@ -458,7 +458,7 @@ RiaDefines::WellPathComponentType RimFishbonesMultipleSubs::componentType() cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFishbonesMultipleSubs::componentLabel() const
|
||||
QString RimFishbones::componentLabel() const
|
||||
{
|
||||
return generatedName();
|
||||
}
|
||||
@@ -466,7 +466,7 @@ QString RimFishbonesMultipleSubs::componentLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFishbonesMultipleSubs::componentTypeLabel() const
|
||||
QString RimFishbones::componentTypeLabel() const
|
||||
{
|
||||
return "Fishbones";
|
||||
}
|
||||
@@ -474,7 +474,7 @@ QString RimFishbonesMultipleSubs::componentTypeLabel() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimFishbonesMultipleSubs::defaultComponentColor() const
|
||||
cvf::Color3f RimFishbones::defaultComponentColor() const
|
||||
{
|
||||
return fishbonesColor();
|
||||
}
|
||||
@@ -482,7 +482,7 @@ cvf::Color3f RimFishbonesMultipleSubs::defaultComponentColor() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::startMD() const
|
||||
double RimFishbones::startMD() const
|
||||
{
|
||||
double measuredDepth = 0.0;
|
||||
if ( !m_valveLocations->valveLocations().empty() )
|
||||
@@ -496,7 +496,7 @@ double RimFishbonesMultipleSubs::startMD() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::endMD() const
|
||||
double RimFishbones::endMD() const
|
||||
{
|
||||
double measuredDepth = 0.0;
|
||||
if ( !m_valveLocations->valveLocations().empty() )
|
||||
@@ -510,9 +510,7 @@ double RimFishbonesMultipleSubs::endMD() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
void RimFishbones::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_subsOrientationMode )
|
||||
{
|
||||
@@ -530,7 +528,7 @@ void RimFishbonesMultipleSubs::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimFishbonesMultipleSubs::userDescriptionField()
|
||||
caf::PdmFieldHandle* RimFishbones::userDescriptionField()
|
||||
{
|
||||
return &m_name;
|
||||
}
|
||||
@@ -538,7 +536,7 @@ caf::PdmFieldHandle* RimFishbonesMultipleSubs::userDescriptionField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmFieldHandle* RimFishbonesMultipleSubs::objectToggleField()
|
||||
caf::PdmFieldHandle* RimFishbones::objectToggleField()
|
||||
{
|
||||
return &m_isActive;
|
||||
}
|
||||
@@ -546,7 +544,7 @@ caf::PdmFieldHandle* RimFishbonesMultipleSubs::objectToggleField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::computeRangesAndLocations()
|
||||
void RimFishbones::computeRangesAndLocations()
|
||||
{
|
||||
m_valveLocations->computeRangesAndLocations();
|
||||
geometryUpdated();
|
||||
@@ -555,7 +553,7 @@ void RimFishbonesMultipleSubs::computeRangesAndLocations()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
void RimFishbones::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
@@ -637,7 +635,7 @@ void RimFishbonesMultipleSubs::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::initAfterRead()
|
||||
void RimFishbones::initAfterRead()
|
||||
{
|
||||
initValveLocationFromLegacyData();
|
||||
|
||||
@@ -651,20 +649,17 @@ void RimFishbonesMultipleSubs::initAfterRead()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox RimFishbonesMultipleSubs::boundingBoxInDomainCoords() const
|
||||
cvf::BoundingBox RimFishbones::boundingBoxInDomainCoords() const
|
||||
{
|
||||
cvf::BoundingBox bb;
|
||||
|
||||
for ( auto& sub : installedLateralIndices() )
|
||||
for ( const auto& [subIndex, lateralIndex] : installedLateralIndices() )
|
||||
{
|
||||
for ( size_t lateralIndex : sub.lateralIndices )
|
||||
{
|
||||
std::vector<cvf::Vec3d> coords = coordsForLateral( sub.subIndex, lateralIndex );
|
||||
std::vector<cvf::Vec3d> coords = coordsForLateral( subIndex, lateralIndex );
|
||||
|
||||
for ( auto c : coords )
|
||||
{
|
||||
bb.add( c );
|
||||
}
|
||||
for ( const auto& c : coords )
|
||||
{
|
||||
bb.add( c );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,7 +669,7 @@ cvf::BoundingBox RimFishbonesMultipleSubs::boundingBoxInDomainCoords() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFishbonesMultipleSubs::isEnabled() const
|
||||
bool RimFishbones::isEnabled() const
|
||||
{
|
||||
RimFishbonesCollection* collection;
|
||||
this->firstAncestorOrThisOfTypeAsserted( collection );
|
||||
@@ -685,13 +680,13 @@ bool RimFishbonesMultipleSubs::isEnabled() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::computeRotationAngles()
|
||||
void RimFishbones::computeRotationAngles()
|
||||
{
|
||||
std::vector<double> vals;
|
||||
|
||||
for ( size_t i = 0; i < m_valveLocations->valveLocations().size(); i++ )
|
||||
{
|
||||
vals.push_back( RimFishbonesMultipleSubs::randomValueFromRange( 0, 360 ) );
|
||||
vals.push_back( RimFishbones::randomValueFromRange( 0, 360 ) );
|
||||
}
|
||||
|
||||
m_installationRotationAngles = vals;
|
||||
@@ -700,56 +695,39 @@ void RimFishbonesMultipleSubs::computeRotationAngles()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::computeSubLateralIndices()
|
||||
void RimFishbones::computeSubLateralIndices()
|
||||
{
|
||||
m_subLateralIndices.clear();
|
||||
std::vector<SubAndLateralIndex> subLateralCandidates;
|
||||
for ( size_t subIndex = 0; subIndex < m_valveLocations->valveLocations().size(); ++subIndex )
|
||||
{
|
||||
SubLateralIndex subLateralIndex;
|
||||
subLateralIndex.subIndex = subIndex;
|
||||
|
||||
for ( int lateralIndex = 0; lateralIndex < m_lateralCountPerSub(); ++lateralIndex )
|
||||
{
|
||||
subLateralIndex.lateralIndices.push_back( lateralIndex );
|
||||
subLateralCandidates.push_back( std::make_pair( subIndex, lateralIndex ) );
|
||||
}
|
||||
m_subLateralIndices.push_back( subLateralIndex );
|
||||
}
|
||||
|
||||
std::mt19937 randomEngine( m_randomSeed() );
|
||||
std::shuffle( subLateralCandidates.begin(), subLateralCandidates.end(), randomEngine );
|
||||
|
||||
double numLaterals = static_cast<double>( m_valveLocations->valveLocations().size() * m_lateralCountPerSub );
|
||||
int numToRemove = static_cast<int>( std::round( ( 1 - m_lateralInstallSuccessFraction ) * numLaterals ) );
|
||||
srand( m_randomSeed() );
|
||||
while ( numToRemove > 0 )
|
||||
{
|
||||
int subIndexToRemove;
|
||||
do
|
||||
{
|
||||
subIndexToRemove = rand() % m_subLateralIndices.size();
|
||||
} while ( m_subLateralIndices[subIndexToRemove].lateralIndices.empty() );
|
||||
int lateralIndexToRemove = rand() % m_subLateralIndices[subIndexToRemove].lateralIndices.size();
|
||||
m_subLateralIndices[subIndexToRemove].lateralIndices.erase(
|
||||
m_subLateralIndices[subIndexToRemove].lateralIndices.begin() + lateralIndexToRemove );
|
||||
--numToRemove;
|
||||
}
|
||||
m_subLateralIndices =
|
||||
std::vector<SubAndLateralIndex>( subLateralCandidates.begin(), subLateralCandidates.begin() + numLaterals );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimFishbonesMultipleSubs::randomValueFromRange( int min, int max )
|
||||
int RimFishbones::randomValueFromRange( int min, int max )
|
||||
{
|
||||
// See http://www.cplusplus.com/reference/cstdlib/rand/
|
||||
|
||||
int range = abs( max - min );
|
||||
int randomNumberInRange = rand() % range;
|
||||
|
||||
int randomValue = min + randomNumberInRange;
|
||||
|
||||
return randomValue;
|
||||
std::default_random_engine generator;
|
||||
std::uniform_int_distribution<int> distribution( min, max );
|
||||
return distribution( generator );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::initialiseObsoleteFields()
|
||||
void RimFishbones::initialiseObsoleteFields()
|
||||
{
|
||||
CAF_PDM_InitField( &m_subsLocationMode_OBSOLETE,
|
||||
"SubsLocationMode",
|
||||
@@ -785,7 +763,7 @@ void RimFishbonesMultipleSubs::initialiseObsoleteFields()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesMultipleSubs::initValveLocationFromLegacyData()
|
||||
void RimFishbones::initValveLocationFromLegacyData()
|
||||
{
|
||||
RimMultipleValveLocations::LocationType locationType = RimMultipleValveLocations::VALVE_UNDEFINED;
|
||||
if ( m_subsLocationMode_OBSOLETE() == FB_SUB_COUNT_END )
|
||||
@@ -43,21 +43,13 @@ class RimMultipleValveLocations;
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
struct SubLateralIndex
|
||||
{
|
||||
size_t subIndex;
|
||||
std::vector<size_t> lateralIndices;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimFishbonesMultipleSubs : public caf::PdmObject, public Rim3dPropertiesInterface, public RimWellPathComponentInterface
|
||||
class RimFishbones : public caf::PdmObject, public Rim3dPropertiesInterface, public RimWellPathComponentInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
using SubAndLateralIndex = std::pair<size_t, size_t>;
|
||||
|
||||
enum LocationType
|
||||
{
|
||||
FB_SUB_COUNT_END,
|
||||
@@ -73,8 +65,8 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
RimFishbonesMultipleSubs();
|
||||
~RimFishbonesMultipleSubs() override;
|
||||
RimFishbones();
|
||||
~RimFishbones() override;
|
||||
|
||||
bool isActive() const;
|
||||
QString generatedName() const;
|
||||
@@ -102,7 +94,7 @@ public:
|
||||
|
||||
void geometryUpdated();
|
||||
|
||||
const std::vector<SubLateralIndex>& installedLateralIndices() const { return m_subLateralIndices; };
|
||||
const std::vector<SubAndLateralIndex>& installedLateralIndices() const { return m_subLateralIndices; };
|
||||
std::vector<cvf::Vec3d> coordsForLateral( size_t subIndex, size_t lateralIndex ) const;
|
||||
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMDForLateral( size_t subIndex, size_t lateralIndex ) const;
|
||||
void recomputeLateralLocations();
|
||||
@@ -173,7 +165,7 @@ private:
|
||||
caf::PdmField<uint> m_randomSeed;
|
||||
|
||||
std::unique_ptr<RigFisbonesGeometry> m_rigFishbonesGeometry;
|
||||
std::vector<SubLateralIndex> m_subLateralIndices;
|
||||
std::vector<SubAndLateralIndex> m_subLateralIndices;
|
||||
|
||||
// Moved to RimMultipleValveLocations
|
||||
caf::PdmField<caf::AppEnum<LocationType>> m_subsLocationMode_OBSOLETE;
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFishbones.h"
|
||||
#include "RimImportedFishboneLateralsCollection.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
@@ -46,21 +46,22 @@ RimFishbonesCollection::RimFishbonesCollection()
|
||||
nameField()->uiCapability()->setUiHidden( true );
|
||||
this->setName( "Fishbones" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fishbonesSubs, "FishbonesSubs", "fishbonesSubs", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_fishbones, "FishbonesSubs", "fishbonesSubs", "", "", "" );
|
||||
|
||||
m_fishbonesSubs.uiCapability()->setUiHidden( true );
|
||||
m_fishbones.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellPathCollection, "WellPathCollection", "Imported Laterals", "", "", "" );
|
||||
m_wellPathCollection = new RimFishboneWellPathCollection;
|
||||
m_wellPathCollection = new RimImportedFishboneLateralsCollection;
|
||||
m_wellPathCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_startMD, "StartMD", HUGE_VAL, "Start MD", "", "", "" );
|
||||
CAF_PDM_InitField( &m_mainBoreDiameter, "MainBoreDiameter", 0.216, "Main Bore Diameter", "", "", "" );
|
||||
CAF_PDM_InitField( &m_skinFactor, "MainBoreSkinFactor", 0., "Main Bore Skin Factor [0..1]", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters = new RimMswCompletionParameters( false );
|
||||
m_mswParameters.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters_OBSOLETE, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters_OBSOLETE = new RimMswCompletionParameters( false );
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_mswParameters_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
manuallyModifiedStartMD = false;
|
||||
|
||||
// Moved to RimMswCompletionParameters and obsoleted
|
||||
@@ -77,7 +78,7 @@ RimFishbonesCollection::RimFishbonesCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishboneWellPathCollection* RimFishbonesCollection::wellPathCollection() const
|
||||
RimImportedFishboneLateralsCollection* RimFishbonesCollection::wellPathCollection() const
|
||||
{
|
||||
CVF_ASSERT( m_wellPathCollection );
|
||||
|
||||
@@ -135,8 +136,6 @@ void RimFishbonesCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiO
|
||||
wellGroup->add( &m_startMD );
|
||||
wellGroup->add( &m_mainBoreDiameter );
|
||||
wellGroup->add( &m_skinFactor );
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup( "Multi Segment Well Options" );
|
||||
m_mswParameters->uiOrdering( uiConfigName, *mswGroup );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -147,29 +146,29 @@ void RimFishbonesCollection::initAfterRead()
|
||||
{
|
||||
if ( m_linerDiameter_OBSOLETE() != m_linerDiameter_OBSOLETE.defaultValue() )
|
||||
{
|
||||
m_mswParameters->setLinerDiameter( m_linerDiameter_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setLinerDiameter( m_linerDiameter_OBSOLETE() );
|
||||
}
|
||||
if ( m_roughnessFactor_OBSOLETE() != m_roughnessFactor_OBSOLETE.defaultValue() )
|
||||
{
|
||||
m_mswParameters->setRoughnessFactor( m_roughnessFactor_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setRoughnessFactor( m_roughnessFactor_OBSOLETE() );
|
||||
}
|
||||
if ( m_pressureDrop_OBSOLETE() != m_pressureDrop_OBSOLETE.defaultValue() )
|
||||
{
|
||||
m_mswParameters->setPressureDrop( m_pressureDrop_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setPressureDrop( m_pressureDrop_OBSOLETE() );
|
||||
}
|
||||
if ( m_lengthAndDepth_OBSOLETE() != m_lengthAndDepth_OBSOLETE.defaultValue() )
|
||||
{
|
||||
m_mswParameters->setLengthAndDepth( m_lengthAndDepth_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setLengthAndDepth( m_lengthAndDepth_OBSOLETE() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesCollection::appendFishbonesSubs( RimFishbonesMultipleSubs* subs )
|
||||
void RimFishbonesCollection::appendFishbonesSubs( RimFishbones* subs )
|
||||
{
|
||||
subs->fishbonesColor = nextFishbonesColor();
|
||||
m_fishbonesSubs.push_back( subs );
|
||||
m_fishbones.push_back( subs );
|
||||
|
||||
subs->setUnitSystemSpecificDefaults();
|
||||
subs->recomputeLateralLocations();
|
||||
@@ -178,17 +177,17 @@ void RimFishbonesCollection::appendFishbonesSubs( RimFishbonesMultipleSubs* subs
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimFishbonesCollection::mswParameters() const
|
||||
bool RimFishbonesCollection::hasFishbones() const
|
||||
{
|
||||
return m_mswParameters;
|
||||
return !m_fishbones.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::activeFishbonesSubs() const
|
||||
std::vector<RimFishbones*> RimFishbonesCollection::activeFishbonesSubs() const
|
||||
{
|
||||
std::vector<RimFishbonesMultipleSubs*> active;
|
||||
std::vector<RimFishbones*> active;
|
||||
|
||||
if ( isChecked() )
|
||||
{
|
||||
@@ -207,9 +206,9 @@ std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::activeFishbonesSu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimFishbonesMultipleSubs*> RimFishbonesCollection::allFishbonesSubs() const
|
||||
std::vector<RimFishbones*> RimFishbonesCollection::allFishbonesSubs() const
|
||||
{
|
||||
return m_fishbonesSubs.childObjects();
|
||||
return m_fishbones.childObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -231,7 +230,7 @@ cvf::Color3f RimFishbonesCollection::nextFishbonesColor() const
|
||||
|
||||
QColor qFishbonesColor;
|
||||
|
||||
int newIndex = static_cast<int>( m_fishbonesSubs.size() );
|
||||
int newIndex = static_cast<int>( m_fishbones.size() );
|
||||
|
||||
if ( qWellPathColor.lightnessF() < 0.5 )
|
||||
{
|
||||
@@ -252,15 +251,15 @@ void RimFishbonesCollection::recalculateStartMD()
|
||||
{
|
||||
double minStartMD = HUGE_VAL;
|
||||
|
||||
for ( const RimFishbonesMultipleSubs* sub : m_fishbonesSubs() )
|
||||
for ( const RimFishbones* sub : m_fishbones() )
|
||||
{
|
||||
for ( auto& index : sub->installedLateralIndices() )
|
||||
for ( const auto& subAndLateralIndex : sub->installedLateralIndices() )
|
||||
{
|
||||
minStartMD = std::min( minStartMD, sub->measuredDepth( index.subIndex ) - 13.0 );
|
||||
minStartMD = std::min( minStartMD, sub->measuredDepth( subAndLateralIndex.first ) - 13.0 );
|
||||
}
|
||||
}
|
||||
|
||||
for ( const RimFishboneWellPath* wellPath : m_wellPathCollection->wellPaths() )
|
||||
for ( const RimImportedFishboneLaterals* wellPath : m_wellPathCollection->wellPaths() )
|
||||
{
|
||||
if ( wellPath->measuredDepths().size() > 0 )
|
||||
{
|
||||
@@ -282,6 +281,21 @@ double RimFishbonesCollection::startMD() const
|
||||
return m_startMD;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesCollection::endMD() const
|
||||
{
|
||||
double endMD = m_startMD;
|
||||
if ( !m_fishbones.empty() )
|
||||
{
|
||||
auto lastFishbone = m_fishbones.childObjects().back();
|
||||
CVF_ASSERT( lastFishbone );
|
||||
endMD = lastFishbone->endMD();
|
||||
}
|
||||
return endMD;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -322,5 +336,4 @@ void RimFishbonesCollection::setUnitSystemSpecificDefaults()
|
||||
|
||||
m_wellPathCollection->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
class RimFishbonesMultipleSubs;
|
||||
class RimFishboneWellPathCollection;
|
||||
class RimFishbones;
|
||||
class RimImportedFishboneLateralsCollection;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@@ -44,15 +44,16 @@ class RimFishbonesCollection : public RimCheckableNamedObject
|
||||
public:
|
||||
RimFishbonesCollection();
|
||||
|
||||
RimFishboneWellPathCollection* wellPathCollection() const;
|
||||
void appendFishbonesSubs( RimFishbonesMultipleSubs* subs );
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
RimImportedFishboneLateralsCollection* wellPathCollection() const;
|
||||
void appendFishbonesSubs( RimFishbones* subs );
|
||||
|
||||
std::vector<RimFishbonesMultipleSubs*> activeFishbonesSubs() const;
|
||||
std::vector<RimFishbonesMultipleSubs*> allFishbonesSubs() const;
|
||||
bool hasFishbones() const;
|
||||
std::vector<RimFishbones*> activeFishbonesSubs() const;
|
||||
std::vector<RimFishbones*> allFishbonesSubs() const;
|
||||
|
||||
void recalculateStartMD();
|
||||
double startMD() const;
|
||||
double endMD() const;
|
||||
double mainBoreSkinFactor() const { return m_skinFactor; }
|
||||
double mainBoreDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const;
|
||||
void setUnitSystemSpecificDefaults();
|
||||
@@ -66,18 +67,18 @@ private:
|
||||
cvf::Color3f nextFishbonesColor() const;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> m_fishbonesSubs;
|
||||
caf::PdmChildField<RimFishboneWellPathCollection*> m_wellPathCollection;
|
||||
caf::PdmChildArrayField<RimFishbones*> m_fishbones;
|
||||
caf::PdmChildField<RimImportedFishboneLateralsCollection*> m_wellPathCollection;
|
||||
|
||||
caf::PdmField<double> m_startMD;
|
||||
caf::PdmField<double> m_skinFactor;
|
||||
caf::PdmField<double> m_mainBoreDiameter;
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
bool manuallyModifiedStartMD;
|
||||
caf::PdmField<double> m_startMD;
|
||||
caf::PdmField<double> m_skinFactor;
|
||||
caf::PdmField<double> m_mainBoreDiameter;
|
||||
bool manuallyModifiedStartMD;
|
||||
|
||||
caf::PdmField<double> m_linerDiameter_OBSOLETE;
|
||||
caf::PdmField<double> m_roughnessFactor_OBSOLETE;
|
||||
|
||||
caf::PdmField<RimMswCompletionParameters::PressureDropEnum> m_pressureDrop_OBSOLETE;
|
||||
caf::PdmField<RimMswCompletionParameters::LengthAndDepthEnum> m_lengthAndDepth_OBSOLETE;
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimImportedFishboneLaterals.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "cafPdmUiListEditor.h"
|
||||
#include "cafPdmUiTextEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFishboneWellPath, "WellPathCompletion" );
|
||||
CAF_PDM_SOURCE_INIT( RimImportedFishboneLaterals, "WellPathCompletion" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishboneWellPath::RimFishboneWellPath()
|
||||
RimImportedFishboneLaterals::RimImportedFishboneLaterals()
|
||||
{
|
||||
CAF_PDM_InitObject( "WellPathCompletion", ":/FishBoneLateralFromFile16x16.png", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_coordinates, "Coordinates", "Coordinates", "", "", "" );
|
||||
@@ -41,7 +41,7 @@ RimFishboneWellPath::RimFishboneWellPath()
|
||||
userDescriptionField()->uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_displayCoordinates, "DisplayCoordinates", "Coordinates", "", "", "" );
|
||||
m_displayCoordinates.registerGetMethod( this, &RimFishboneWellPath::displayCoordinates );
|
||||
m_displayCoordinates.registerGetMethod( this, &RimImportedFishboneLaterals::displayCoordinates );
|
||||
m_displayCoordinates.uiCapability()->setUiReadOnly( true );
|
||||
m_displayCoordinates.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
|
||||
m_displayCoordinates.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::LabelPosType::TOP );
|
||||
@@ -52,14 +52,14 @@ RimFishboneWellPath::RimFishboneWellPath()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishboneWellPath::~RimFishboneWellPath()
|
||||
RimImportedFishboneLaterals::~RimImportedFishboneLaterals()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPath::setCoordinates( std::vector<cvf::Vec3d> coordinates )
|
||||
void RimImportedFishboneLaterals::setCoordinates( std::vector<cvf::Vec3d> coordinates )
|
||||
{
|
||||
m_coordinates = coordinates;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ void RimFishboneWellPath::setCoordinates( std::vector<cvf::Vec3d> coordinates )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPath::setMeasuredDepths( std::vector<double> measuredDepths )
|
||||
void RimImportedFishboneLaterals::setMeasuredDepths( std::vector<double> measuredDepths )
|
||||
{
|
||||
m_measuredDepths = measuredDepths;
|
||||
}
|
||||
@@ -75,9 +75,9 @@ void RimFishboneWellPath::setMeasuredDepths( std::vector<double> measuredDepths
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPath::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
void RimImportedFishboneLaterals::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType( proj );
|
||||
@@ -87,7 +87,7 @@ void RimFishboneWellPath::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
void RimImportedFishboneLaterals::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
uiOrdering.add( &m_displayCoordinates );
|
||||
}
|
||||
@@ -95,7 +95,7 @@ void RimFishboneWellPath::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimFishboneWellPath::displayCoordinates() const
|
||||
QString RimImportedFishboneLaterals::displayCoordinates() const
|
||||
{
|
||||
CVF_ASSERT( m_coordinates().size() == m_measuredDepths().size() );
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimFishboneWellPath : public RimCheckableNamedObject
|
||||
class RimImportedFishboneLaterals : public RimCheckableNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFishboneWellPath();
|
||||
~RimFishboneWellPath() override;
|
||||
RimImportedFishboneLaterals();
|
||||
~RimImportedFishboneLaterals() override;
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
@@ -17,11 +17,11 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimImportedFishboneLateralsCollection.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimImportedFishboneLaterals.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
@@ -30,12 +30,14 @@
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFishboneWellPathCollection, "WellPathCompletionCollection" );
|
||||
// The more general term WellPathCompletionCollection was unfortunately used in this more specific case of fishbones
|
||||
// In order to preserve compatibility, the old keyword is kept as an alias, but could be removed in the future.
|
||||
CAF_PDM_SOURCE_INIT( RimImportedFishboneLateralsCollection, "FishboneWellPathCollection", "WellPathCompletionCollection" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFishboneWellPathCollection::RimFishboneWellPathCollection()
|
||||
RimImportedFishboneLateralsCollection::RimImportedFishboneLateralsCollection()
|
||||
{
|
||||
CAF_PDM_InitObject( "WellPathCompletions", ":/FishBoneGroupFromFile16x16.png", "", "" );
|
||||
|
||||
@@ -55,7 +57,7 @@ RimFishboneWellPathCollection::RimFishboneWellPathCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPathCollection::importCompletionsFromFile( const QStringList& filePaths )
|
||||
void RimImportedFishboneLateralsCollection::importCompletionsFromFile( const QStringList& filePaths )
|
||||
{
|
||||
RifWellPathImporter wellPathImporter;
|
||||
|
||||
@@ -66,7 +68,7 @@ void RimFishboneWellPathCollection::importCompletionsFromFile( const QStringList
|
||||
for ( size_t i = 0; i < wellDataCount; ++i )
|
||||
{
|
||||
RifWellPathImporter::WellData wellData = wellPathImporter.readWellData( filePath, i );
|
||||
RimFishboneWellPath* wellCompletion = new RimFishboneWellPath();
|
||||
RimImportedFishboneLaterals* wellCompletion = new RimImportedFishboneLaterals();
|
||||
wellCompletion->setName( wellData.m_name );
|
||||
wellCompletion->setCoordinates( wellData.m_wellPathGeometry->uniqueWellPathPoints() );
|
||||
wellCompletion->setMeasuredDepths( wellData.m_wellPathGeometry->uniqueMeasuredDepths() );
|
||||
@@ -85,9 +87,9 @@ void RimFishboneWellPathCollection::importCompletionsFromFile( const QStringList
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPathCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
void RimImportedFishboneLateralsCollection::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted( proj );
|
||||
@@ -97,11 +99,11 @@ void RimFishboneWellPathCollection::fieldChangedByUi( const caf::PdmFieldHandle*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<const RimFishboneWellPath*> RimFishboneWellPathCollection::wellPaths() const
|
||||
std::vector<const RimImportedFishboneLaterals*> RimImportedFishboneLateralsCollection::wellPaths() const
|
||||
{
|
||||
std::vector<const RimFishboneWellPath*> paths;
|
||||
std::vector<const RimImportedFishboneLaterals*> paths;
|
||||
|
||||
for ( const RimFishboneWellPath* path : m_wellPaths )
|
||||
for ( const RimImportedFishboneLaterals* path : m_wellPaths )
|
||||
{
|
||||
paths.push_back( path );
|
||||
}
|
||||
@@ -112,7 +114,7 @@ std::vector<const RimFishboneWellPath*> RimFishboneWellPathCollection::wellPaths
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPathCollection::setUnitSystemSpecificDefaults()
|
||||
void RimImportedFishboneLateralsCollection::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_pipeProperties->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
@@ -120,7 +122,7 @@ void RimFishboneWellPathCollection::setUnitSystemSpecificDefaults()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPathCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
void RimImportedFishboneLateralsCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* wellPropertiesGroup = uiOrdering.addNewGroup( "Well Properties" );
|
||||
m_pipeProperties->uiOrdering( uiConfigName, *wellPropertiesGroup );
|
||||
@@ -129,7 +131,7 @@ void RimFishboneWellPathCollection::defineUiOrdering( QString uiConfigName, caf:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishboneWellPathCollection::appendCompletion( RimFishboneWellPath* completion )
|
||||
void RimImportedFishboneLateralsCollection::appendCompletion( RimImportedFishboneLaterals* completion )
|
||||
{
|
||||
m_wellPaths.push_back( completion );
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishbonesPipeProperties.h"
|
||||
#include "RimImportedFishboneLaterals.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
@@ -35,19 +35,19 @@
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimFishboneWellPathCollection : public RimCheckableNamedObject
|
||||
class RimImportedFishboneLateralsCollection : public RimCheckableNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFishboneWellPathCollection();
|
||||
RimImportedFishboneLateralsCollection();
|
||||
|
||||
void importCompletionsFromFile( const QStringList& filePaths );
|
||||
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
std::vector<const RimFishboneWellPath*> wellPaths() const;
|
||||
double holeDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
std::vector<const RimImportedFishboneLaterals*> wellPaths() const;
|
||||
double holeDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const
|
||||
{
|
||||
return m_pipeProperties->holeDiameter( unitSystem );
|
||||
}
|
||||
@@ -59,9 +59,9 @@ protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
|
||||
private:
|
||||
void appendCompletion( RimFishboneWellPath* completion );
|
||||
void appendCompletion( RimImportedFishboneLaterals* completion );
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimFishboneWellPath*> m_wellPaths;
|
||||
caf::PdmChildField<RimFishbonesPipeProperties*> m_pipeProperties;
|
||||
caf::PdmChildArrayField<RimImportedFishboneLaterals*> m_wellPaths;
|
||||
caf::PdmChildField<RimFishbonesPipeProperties*> m_pipeProperties;
|
||||
};
|
||||
@@ -102,6 +102,33 @@ RimMswCompletionParameters::~RimMswCompletionParameters()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimMswCompletionParameters::isDefault() const
|
||||
{
|
||||
return m_refMDType() == ReferenceMDEnum() && m_refMD() == m_refMD.defaultValue() &&
|
||||
m_linerDiameter() == m_linerDiameter.defaultValue() &&
|
||||
m_roughnessFactor() == m_roughnessFactor.defaultValue() && m_pressureDrop == PressureDropEnum() &&
|
||||
m_enforceMaxSegmentLength() == m_enforceMaxSegmentLength.defaultValue() &&
|
||||
m_maxSegmentLength() == m_maxSegmentLength.defaultValue();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters& RimMswCompletionParameters::operator=( const RimMswCompletionParameters& rhs )
|
||||
{
|
||||
m_refMDType = rhs.m_refMDType();
|
||||
m_refMD = rhs.m_refMD();
|
||||
m_linerDiameter = rhs.m_linerDiameter();
|
||||
m_roughnessFactor = rhs.m_roughnessFactor();
|
||||
m_pressureDrop = rhs.m_pressureDrop();
|
||||
m_enforceMaxSegmentLength = rhs.m_enforceMaxSegmentLength();
|
||||
m_maxSegmentLength = rhs.m_maxSegmentLength();
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -54,6 +54,9 @@ public:
|
||||
RimMswCompletionParameters( bool enableReferenceDepth = true );
|
||||
~RimMswCompletionParameters() override;
|
||||
|
||||
bool isDefault() const;
|
||||
RimMswCompletionParameters& operator=( const RimMswCompletionParameters& rhs );
|
||||
|
||||
ReferenceMDType referenceMDType() const;
|
||||
double manualReferenceMD() const;
|
||||
double linerDiameter( RiaDefines::EclipseUnitSystem unitSystem ) const;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFishbones.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathValve.h"
|
||||
@@ -356,8 +356,8 @@ void RimMultipleValveLocations::fieldChangedByUi( const caf::PdmFieldHandle* cha
|
||||
{
|
||||
if ( parentCompletion )
|
||||
{
|
||||
RimFishbonesMultipleSubs* fishbones = dynamic_cast<RimFishbonesMultipleSubs*>( parentCompletion );
|
||||
RimWellPathValve* valve = dynamic_cast<RimWellPathValve*>( parentCompletion );
|
||||
RimFishbones* fishbones = dynamic_cast<RimFishbones*>( parentCompletion );
|
||||
RimWellPathValve* valve = dynamic_cast<RimWellPathValve*>( parentCompletion );
|
||||
if ( fishbones )
|
||||
{
|
||||
fishbones->recomputeLateralLocations();
|
||||
|
||||
@@ -60,10 +60,10 @@ RimPerforationCollection::RimPerforationCollection()
|
||||
CAF_PDM_InitFieldNoDefault( &m_perforations, "Perforations", "Perforations", "", "", "" );
|
||||
m_perforations.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters = new RimMswCompletionParameters;
|
||||
m_mswParameters.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters_OBSOLETE, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters_OBSOLETE = new RimMswCompletionParameters;
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_nonDarcyParameters, "NonDarcyParameters", "Non-Darcy Parameters", "", "", "" );
|
||||
m_nonDarcyParameters = new RimNonDarcyPerforationParameters();
|
||||
@@ -82,9 +82,9 @@ RimPerforationCollection::~RimPerforationCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimPerforationCollection::mswParameters() const
|
||||
bool RimPerforationCollection::hasPerforations() const
|
||||
{
|
||||
return m_mswParameters;
|
||||
return !m_perforations.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -95,14 +95,6 @@ const RimNonDarcyPerforationParameters* RimPerforationCollection::nonDarcyParame
|
||||
return m_nonDarcyParameters;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationCollection::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -190,7 +182,7 @@ std::vector<const RimPerforationInterval*> RimPerforationCollection::activePerfo
|
||||
void RimPerforationCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup( "Multi Segment Well Options" );
|
||||
m_mswParameters->uiOrdering( uiConfigName, *mswGroup );
|
||||
m_mswParameters_OBSOLETE->uiOrdering( uiConfigName, *mswGroup );
|
||||
m_nonDarcyParameters->uiOrdering( uiConfigName, uiOrdering );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -212,4 +204,4 @@ void RimPerforationCollection::fieldChangedByUi( const caf::PdmFieldHandle* chan
|
||||
{
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,9 +50,8 @@ public:
|
||||
RimPerforationCollection();
|
||||
~RimPerforationCollection() override;
|
||||
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
bool hasPerforations() const;
|
||||
const RimNonDarcyPerforationParameters* nonDarcyParameters() const;
|
||||
void setUnitSystemSpecificDefaults();
|
||||
void appendPerforation( RimPerforationInterval* perforation );
|
||||
std::vector<const RimPerforationInterval*> perforations() const;
|
||||
std::vector<const RimPerforationInterval*> activePerforations() const;
|
||||
@@ -65,6 +64,7 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimPerforationInterval*> m_perforations;
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
caf::PdmChildField<RimNonDarcyPerforationParameters*> m_nonDarcyParameters;
|
||||
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,377 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- 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 "RimWellPathCompletionSettings.h"
|
||||
|
||||
#include "RiaStdStringTools.h"
|
||||
#include "RimMswCompletionParameters.h"
|
||||
|
||||
#include "cafPdmDoubleStringValidator.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiOrdering.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void RimWellPathCompletionSettings::WellTypeEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletionSettings::OIL, "OIL", "Oil" );
|
||||
addItem( RimWellPathCompletionSettings::GAS, "GAS", "Gas" );
|
||||
addItem( RimWellPathCompletionSettings::WATER, "WATER", "Water" );
|
||||
addItem( RimWellPathCompletionSettings::LIQUID, "LIQUID", "Liquid" );
|
||||
|
||||
setDefault( RimWellPathCompletionSettings::OIL );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletionSettings::GasInflowEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletionSettings::STANDARD_EQ, "STD", "Standard" );
|
||||
addItem( RimWellPathCompletionSettings::RUSSELL_GOODRICH, "R-G", "Russell-Goodrich" );
|
||||
addItem( RimWellPathCompletionSettings::DRY_GAS_PSEUDO_PRESSURE, "P-P", "Dry Gas Pseudo-Pressure" );
|
||||
addItem( RimWellPathCompletionSettings::GENERALIZED_PSEUDO_PRESSURE, "GPP", "Generalized Pseudo-Pressure" );
|
||||
|
||||
setDefault( RimWellPathCompletionSettings::STANDARD_EQ );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletionSettings::AutomaticWellShutInEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletionSettings::ISOLATE_FROM_FORMATION, "SHUT", "Isolate from Formation" );
|
||||
addItem( RimWellPathCompletionSettings::STOP_ABOVE_FORMATION, "STOP", "Stop above Formation" );
|
||||
|
||||
setDefault( RimWellPathCompletionSettings::STOP_ABOVE_FORMATION );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletionSettings::HydrostaticDensityEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletionSettings::SEGMENTED, "SEG", "Segmented" );
|
||||
addItem( RimWellPathCompletionSettings::AVERAGED, "AVG", "Averaged" );
|
||||
|
||||
setDefault( RimWellPathCompletionSettings::SEGMENTED );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellPathCompletionSettings, "WellPathCompletionSettings" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathCompletionSettings::RimWellPathCompletionSettings()
|
||||
{
|
||||
CAF_PDM_InitObject( "Completion Settings", ":/CompletionsSymbol16x16.png", "", "" );
|
||||
CAF_PDM_InitField( &m_wellNameForExport, "WellNameForExport", QString(), "Well Name", "", "", "" );
|
||||
m_wellNameForExport.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_wellGroupName, "WellGroupNameForExport", QString(), "Well Group Name", "", "", "" );
|
||||
CAF_PDM_InitField( &m_referenceDepth, "ReferenceDepthForExport", QString(), "Reference Depth for BHP", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_preferredFluidPhase, "WellTypeForExport", "Preferred Fluid Phase", "", "", "" );
|
||||
CAF_PDM_InitField( &m_drainageRadiusForPI, "DrainageRadiusForPI", QString( "0.0" ), "Drainage Radius for PI", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_gasInflowEquation, "GasInflowEq", "Gas Inflow Equation", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_automaticWellShutIn, "AutoWellShutIn", "Automatic well shut-in", "", "", "" );
|
||||
CAF_PDM_InitField( &m_allowWellCrossFlow, "AllowWellCrossFlow", true, "Allow Well Cross-Flow", "", "", "" );
|
||||
CAF_PDM_InitField( &m_wellBoreFluidPVTTable, "WellBoreFluidPVTTable", 0, "Wellbore Fluid PVT table", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_hydrostaticDensity, "HydrostaticDensity", "Hydrostatic Density", "", "", "" );
|
||||
CAF_PDM_InitField( &m_fluidInPlaceRegion, "FluidInPlaceRegion", 0, "Fluid In-Place Region", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters = new RimMswCompletionParameters( false );
|
||||
m_mswParameters.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathCompletionSettings::RimWellPathCompletionSettings( const RimWellPathCompletionSettings& rhs )
|
||||
: RimWellPathCompletionSettings()
|
||||
{
|
||||
*this = rhs;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathCompletionSettings& RimWellPathCompletionSettings::operator=( const RimWellPathCompletionSettings& rhs )
|
||||
{
|
||||
m_wellNameForExport = rhs.m_wellNameForExport;
|
||||
m_wellGroupName = rhs.m_wellGroupName;
|
||||
m_referenceDepth = rhs.m_referenceDepth;
|
||||
m_preferredFluidPhase = rhs.m_preferredFluidPhase;
|
||||
m_drainageRadiusForPI = rhs.m_drainageRadiusForPI;
|
||||
m_gasInflowEquation = rhs.m_gasInflowEquation;
|
||||
m_automaticWellShutIn = rhs.m_automaticWellShutIn;
|
||||
m_allowWellCrossFlow = rhs.m_allowWellCrossFlow;
|
||||
m_wellBoreFluidPVTTable = rhs.m_wellBoreFluidPVTTable;
|
||||
m_hydrostaticDensity = rhs.m_hydrostaticDensity;
|
||||
m_fluidInPlaceRegion = rhs.m_fluidInPlaceRegion;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::setWellNameForExport( const QString& name )
|
||||
{
|
||||
auto n = name;
|
||||
m_wellNameForExport = n.remove( ' ' );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::updateWellPathNameHasChanged( const QString& newWellPathName,
|
||||
const QString& previousWellPathName )
|
||||
{
|
||||
if ( m_wellNameForExport().isEmpty() || m_wellNameForExport == previousWellPathName )
|
||||
{
|
||||
m_wellNameForExport = newWellPathName;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::wellNameForExport() const
|
||||
{
|
||||
return formatStringForExport( m_wellNameForExport() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::wellGroupNameForExport() const
|
||||
{
|
||||
return formatStringForExport( m_wellGroupName, "1*" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::referenceDepthForExport() const
|
||||
{
|
||||
std::string refDepth = m_referenceDepth.v().toStdString();
|
||||
if ( RiaStdStringTools::isNumber( refDepth, '.' ) )
|
||||
{
|
||||
return m_referenceDepth.v();
|
||||
}
|
||||
return "1*";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::wellTypeNameForExport() const
|
||||
{
|
||||
switch ( m_preferredFluidPhase.v() )
|
||||
{
|
||||
case OIL:
|
||||
return "OIL";
|
||||
case GAS:
|
||||
return "GAS";
|
||||
case WATER:
|
||||
return "WATER";
|
||||
case LIQUID:
|
||||
return "LIQ";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::drainageRadiusForExport() const
|
||||
{
|
||||
return m_drainageRadiusForPI();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::gasInflowEquationForExport() const
|
||||
{
|
||||
return m_gasInflowEquation().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::automaticWellShutInForExport() const
|
||||
{
|
||||
return m_automaticWellShutIn().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::allowWellCrossFlowForExport() const
|
||||
{
|
||||
return m_allowWellCrossFlow() ? "YES" : "NO";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::wellBoreFluidPVTForExport() const
|
||||
{
|
||||
return QString( "%1" ).arg( m_wellBoreFluidPVTTable() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::hydrostaticDensityForExport() const
|
||||
{
|
||||
return m_hydrostaticDensity().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::fluidInPlaceRegionForExport() const
|
||||
{
|
||||
return QString( "%1" ).arg( m_fluidInPlaceRegion() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimWellPathCompletionSettings::mswParameters() const
|
||||
{
|
||||
return m_mswParameters();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters* RimWellPathCompletionSettings::mswParameters()
|
||||
{
|
||||
return m_mswParameters();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QRegExp RimWellPathCompletionSettings::wellNameForExportRegExp()
|
||||
{
|
||||
QRegExp rx( "[\\w\\-\\_]{1,8}" );
|
||||
return rx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* compExportGroup = uiOrdering.addNewGroup( "Completion Export Parameters" );
|
||||
compExportGroup->add( &m_wellNameForExport );
|
||||
compExportGroup->add( &m_wellGroupName );
|
||||
compExportGroup->add( &m_referenceDepth );
|
||||
compExportGroup->add( &m_preferredFluidPhase );
|
||||
compExportGroup->add( &m_drainageRadiusForPI );
|
||||
compExportGroup->add( &m_gasInflowEquation );
|
||||
compExportGroup->add( &m_automaticWellShutIn );
|
||||
compExportGroup->add( &m_allowWellCrossFlow );
|
||||
compExportGroup->add( &m_wellBoreFluidPVTTable );
|
||||
compExportGroup->add( &m_hydrostaticDensity );
|
||||
compExportGroup->add( &m_fluidInPlaceRegion );
|
||||
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup( "Multi Segment Well Options" );
|
||||
m_mswParameters->uiOrdering( uiConfigName, *mswGroup );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_referenceDepth )
|
||||
{
|
||||
if ( !RiaStdStringTools::isNumber( m_referenceDepth.v().toStdString(), '.' ) )
|
||||
{
|
||||
if ( !RiaStdStringTools::isNumber( m_referenceDepth.v().toStdString(), ',' ) )
|
||||
{
|
||||
// Remove invalid input text
|
||||
m_referenceDepth = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wrong decimal sign entered, replace , by .
|
||||
auto text = m_referenceDepth.v();
|
||||
m_referenceDepth = text.replace( ',', '.' );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletionSettings::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
caf::PdmUiLineEditorAttribute* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||
if ( field == &m_wellNameForExport && lineEditorAttr )
|
||||
{
|
||||
QRegExpValidator* validator = new QRegExpValidator( nullptr );
|
||||
validator->setRegExp( wellNameForExportRegExp() );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_drainageRadiusForPI && lineEditorAttr )
|
||||
{
|
||||
caf::PdmDoubleStringValidator* validator = new caf::PdmDoubleStringValidator( "1*" );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_wellBoreFluidPVTTable && lineEditorAttr )
|
||||
{
|
||||
// Positive integer
|
||||
QIntValidator* validator = new QIntValidator( 0, std::numeric_limits<int>::max(), nullptr );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_fluidInPlaceRegion && lineEditorAttr )
|
||||
{
|
||||
// Any integer
|
||||
QIntValidator* validator =
|
||||
new QIntValidator( -std::numeric_limits<int>::max(), std::numeric_limits<int>::max(), nullptr );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletionSettings::formatStringForExport( const QString& text, const QString& defaultValue ) const
|
||||
{
|
||||
if ( text.isEmpty() ) return defaultValue;
|
||||
if ( text.contains( ' ' ) ) return QString( "'%1'" ).arg( text );
|
||||
return text;
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021- 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 "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
class RimMswCompletionParameters;
|
||||
class RimWellPathCompletionsLegacy;
|
||||
|
||||
class RimWellPathCompletionSettings : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum WellType
|
||||
{
|
||||
OIL,
|
||||
GAS,
|
||||
WATER,
|
||||
LIQUID
|
||||
};
|
||||
typedef caf::AppEnum<WellType> WellTypeEnum;
|
||||
|
||||
enum GasInflowEquation
|
||||
{
|
||||
STANDARD_EQ,
|
||||
RUSSELL_GOODRICH,
|
||||
DRY_GAS_PSEUDO_PRESSURE,
|
||||
GENERALIZED_PSEUDO_PRESSURE
|
||||
};
|
||||
typedef caf::AppEnum<GasInflowEquation> GasInflowEnum;
|
||||
|
||||
enum AutomaticWellShutIn
|
||||
{
|
||||
ISOLATE_FROM_FORMATION,
|
||||
STOP_ABOVE_FORMATION
|
||||
};
|
||||
typedef caf::AppEnum<AutomaticWellShutIn> AutomaticWellShutInEnum;
|
||||
|
||||
enum HydrostaticDensity
|
||||
{
|
||||
SEGMENTED,
|
||||
AVERAGED
|
||||
};
|
||||
typedef caf::AppEnum<HydrostaticDensity> HydrostaticDensityEnum;
|
||||
|
||||
public:
|
||||
RimWellPathCompletionSettings();
|
||||
RimWellPathCompletionSettings( const RimWellPathCompletionSettings& rhs );
|
||||
RimWellPathCompletionSettings& operator=( const RimWellPathCompletionSettings& rhs );
|
||||
|
||||
void setWellNameForExport( const QString& name );
|
||||
void updateWellPathNameHasChanged( const QString& newWellPathName, const QString& previousWellPathName );
|
||||
QString wellNameForExport() const;
|
||||
QString wellGroupNameForExport() const;
|
||||
QString referenceDepthForExport() const;
|
||||
QString wellTypeNameForExport() const;
|
||||
|
||||
QString drainageRadiusForExport() const;
|
||||
QString gasInflowEquationForExport() const;
|
||||
QString automaticWellShutInForExport() const;
|
||||
QString allowWellCrossFlowForExport() const;
|
||||
QString wellBoreFluidPVTForExport() const;
|
||||
QString hydrostaticDensityForExport() const;
|
||||
QString fluidInPlaceRegionForExport() const;
|
||||
void setUnitSystemSpecificDefaults();
|
||||
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
RimMswCompletionParameters* mswParameters();
|
||||
|
||||
static QRegExp wellNameForExportRegExp();
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
|
||||
private:
|
||||
QString formatStringForExport( const QString& text, const QString& defaultText = "" ) const;
|
||||
|
||||
private:
|
||||
friend class RimWellPathCompletions;
|
||||
|
||||
caf::PdmField<QString> m_wellNameForExport;
|
||||
caf::PdmField<QString> m_wellGroupName;
|
||||
|
||||
caf::PdmField<QString> m_referenceDepth;
|
||||
caf::PdmField<WellTypeEnum> m_preferredFluidPhase;
|
||||
caf::PdmField<QString> m_drainageRadiusForPI;
|
||||
caf::PdmField<GasInflowEnum> m_gasInflowEquation;
|
||||
caf::PdmField<AutomaticWellShutInEnum> m_automaticWellShutIn;
|
||||
caf::PdmField<bool> m_allowWellCrossFlow;
|
||||
caf::PdmField<int> m_wellBoreFluidPVTTable;
|
||||
caf::PdmField<HydrostaticDensityEnum> m_hydrostaticDensity;
|
||||
caf::PdmField<int> m_fluidInPlaceRegion;
|
||||
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
};
|
||||
@@ -20,13 +20,15 @@
|
||||
|
||||
#include "RiaStdStringTools.h"
|
||||
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbones.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimImportedFishboneLateralsCollection.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelCollection.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathComponentInterface.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
@@ -39,58 +41,8 @@
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include <QRegExpValidator>
|
||||
#include <cmath>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Internal constants
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
#define DOUBLE_INF std::numeric_limits<double>::infinity()
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void RimWellPathCompletions::WellTypeEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletions::OIL, "OIL", "Oil" );
|
||||
addItem( RimWellPathCompletions::GAS, "GAS", "Gas" );
|
||||
addItem( RimWellPathCompletions::WATER, "WATER", "Water" );
|
||||
addItem( RimWellPathCompletions::LIQUID, "LIQUID", "Liquid" );
|
||||
|
||||
setDefault( RimWellPathCompletions::OIL );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletions::GasInflowEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletions::STANDARD_EQ, "STD", "Standard" );
|
||||
addItem( RimWellPathCompletions::RUSSELL_GOODRICH, "R-G", "Russell-Goodrich" );
|
||||
addItem( RimWellPathCompletions::DRY_GAS_PSEUDO_PRESSURE, "P-P", "Dry Gas Pseudo-Pressure" );
|
||||
addItem( RimWellPathCompletions::GENERALIZED_PSEUDO_PRESSURE, "GPP", "Generalized Pseudo-Pressure" );
|
||||
|
||||
setDefault( RimWellPathCompletions::STANDARD_EQ );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletions::AutomaticWellShutInEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletions::ISOLATE_FROM_FORMATION, "SHUT", "Isolate from Formation" );
|
||||
addItem( RimWellPathCompletions::STOP_ABOVE_FORMATION, "STOP", "Stop above Formation" );
|
||||
|
||||
setDefault( RimWellPathCompletions::STOP_ABOVE_FORMATION );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimWellPathCompletions::HydrostaticDensityEnum::setUp()
|
||||
{
|
||||
addItem( RimWellPathCompletions::SEGMENTED, "SEG", "Segmented" );
|
||||
addItem( RimWellPathCompletions::AVERAGED, "AVG", "Averaged" );
|
||||
|
||||
setDefault( RimWellPathCompletions::SEGMENTED );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellPathCompletions, "WellPathCompletions" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -116,19 +68,34 @@ RimWellPathCompletions::RimWellPathCompletions()
|
||||
m_stimPlanModelCollection = new RimStimPlanModelCollection;
|
||||
m_stimPlanModelCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_wellNameForExport, "WellNameForExport", QString(), "Well Name", "", "", "" );
|
||||
m_wellNameForExport.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_wellGroupName, "WellGroupNameForExport", QString(), "Well Group Name", "", "", "" );
|
||||
CAF_PDM_InitField( &m_referenceDepth, "ReferenceDepthForExport", QString(), "Reference Depth for BHP", "", "", "" );
|
||||
CAF_PDM_InitField( &m_preferredFluidPhase, "WellTypeForExport", WellTypeEnum(), "Preferred Fluid Phase", "", "", "" );
|
||||
CAF_PDM_InitField( &m_drainageRadiusForPI, "DrainageRadiusForPI", QString( "0.0" ), "Drainage Radius for PI", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_gasInflowEquation, "GasInflowEq", "Gas Inflow Equation", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_automaticWellShutIn, "AutoWellShutIn", "Automatic well shut-in", "", "", "" );
|
||||
CAF_PDM_InitField( &m_allowWellCrossFlow, "AllowWellCrossFlow", true, "Allow Well Cross-Flow", "", "", "" );
|
||||
CAF_PDM_InitField( &m_wellBoreFluidPVTTable, "WellBoreFluidPVTTable", 0, "Wellbore Fluid PVT table", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_hydrostaticDensity, "HydrostaticDensity", "Hydrostatic Density", "", "", "" );
|
||||
CAF_PDM_InitField( &m_fluidInPlaceRegion, "FluidInPlaceRegion", 0, "Fluid In-Place Region", "", "", "" );
|
||||
CAF_PDM_InitField( &m_wellNameForExport_OBSOLETE, "WellNameForExport", QString(), "Well Name", "", "", "" );
|
||||
m_wellNameForExport_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_wellGroupName_OBSOLETE, "WellGroupNameForExport", QString(), "Well Group Name", "", "", "" );
|
||||
m_wellGroupName_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_referenceDepth_OBSOLETE, "ReferenceDepthForExport", QString(), "Reference Depth for BHP", "", "", "" );
|
||||
m_referenceDepth_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitFieldNoDefault( &m_preferredFluidPhase_OBSOLETE, "WellTypeForExport", "Preferred Fluid Phase", "", "", "" );
|
||||
m_preferredFluidPhase_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_drainageRadiusForPI_OBSOLETE,
|
||||
"DrainageRadiusForPI",
|
||||
QString( "0.0" ),
|
||||
"Drainage Radius for PI",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
m_drainageRadiusForPI_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitFieldNoDefault( &m_gasInflowEquation_OBSOLETE, "GasInflowEq", "Gas Inflow Equation", "", "", "" );
|
||||
m_gasInflowEquation_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitFieldNoDefault( &m_automaticWellShutIn_OBSOLETE, "AutoWellShutIn", "Automatic well shut-in", "", "", "" );
|
||||
m_automaticWellShutIn_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_allowWellCrossFlow_OBSOLETE, "AllowWellCrossFlow", true, "Allow Well Cross-Flow", "", "", "" );
|
||||
m_allowWellCrossFlow_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_wellBoreFluidPVTTable_OBSOLETE, "WellBoreFluidPVTTable", 0, "Wellbore Fluid PVT table", "", "", "" );
|
||||
m_wellBoreFluidPVTTable_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitFieldNoDefault( &m_hydrostaticDensity_OBSOLETE, "HydrostaticDensity", "Hydrostatic Density", "", "", "" );
|
||||
m_hydrostaticDensity_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
CAF_PDM_InitField( &m_fluidInPlaceRegion_OBSOLETE, "FluidInPlaceRegion", 0, "Fluid In-Place Region", "", "", "" );
|
||||
m_fluidInPlaceRegion_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -151,75 +118,6 @@ RimPerforationCollection* RimWellPathCompletions::perforationCollection() const
|
||||
return m_perforationCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletions::setWellNameForExport( const QString& name )
|
||||
{
|
||||
auto n = name;
|
||||
m_wellNameForExport = n.remove( ' ' );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletions::updateWellPathNameHasChanged( const QString& newWellPathName,
|
||||
const QString& previousWellPathName )
|
||||
{
|
||||
if ( m_wellNameForExport == previousWellPathName )
|
||||
{
|
||||
m_wellNameForExport = newWellPathName;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::wellNameForExport() const
|
||||
{
|
||||
return formatStringForExport( m_wellNameForExport() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::wellGroupNameForExport() const
|
||||
{
|
||||
return formatStringForExport( m_wellGroupName, "1*" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::referenceDepthForExport() const
|
||||
{
|
||||
std::string refDepth = m_referenceDepth.v().toStdString();
|
||||
if ( RiaStdStringTools::isNumber( refDepth, '.' ) )
|
||||
{
|
||||
return m_referenceDepth.v();
|
||||
}
|
||||
return "1*";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::wellTypeNameForExport() const
|
||||
{
|
||||
switch ( m_preferredFluidPhase.v() )
|
||||
{
|
||||
case OIL:
|
||||
return "OIL";
|
||||
case GAS:
|
||||
return "GAS";
|
||||
case WATER:
|
||||
return "WATER";
|
||||
case LIQUID:
|
||||
return "LIQ";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -250,6 +148,30 @@ std::vector<RimWellPathValve*> RimWellPathCompletions::valves() const
|
||||
return allValves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathFracture*> RimWellPathCompletions::allFractures() const
|
||||
{
|
||||
if ( m_fractureCollection->isChecked() )
|
||||
{
|
||||
return m_fractureCollection->allFractures();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathFracture*> RimWellPathCompletions::activeFractures() const
|
||||
{
|
||||
if ( m_fractureCollection->isChecked() )
|
||||
{
|
||||
return m_fractureCollection->activeFractures();
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -257,15 +179,15 @@ std::vector<const RimWellPathComponentInterface*> RimWellPathCompletions::allCom
|
||||
{
|
||||
std::vector<const RimWellPathComponentInterface*> completions;
|
||||
|
||||
for ( const RimWellPathFracture* fracture : fractureCollection()->allFractures() )
|
||||
for ( const RimWellPathFracture* fracture : m_fractureCollection->allFractures() )
|
||||
{
|
||||
completions.push_back( fracture );
|
||||
}
|
||||
for ( const RimFishbonesMultipleSubs* fishbones : fishbonesCollection()->allFishbonesSubs() )
|
||||
for ( const RimFishbones* fishbones : m_fishbonesCollection->allFishbonesSubs() )
|
||||
{
|
||||
completions.push_back( fishbones );
|
||||
}
|
||||
for ( const RimPerforationInterval* perforation : perforationCollection()->perforations() )
|
||||
for ( const RimPerforationInterval* perforation : m_perforationCollection->perforations() )
|
||||
{
|
||||
completions.push_back( perforation );
|
||||
}
|
||||
@@ -284,70 +206,14 @@ std::vector<const RimWellPathComponentInterface*> RimWellPathCompletions::allCom
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPathCompletions::hasCompletions() const
|
||||
{
|
||||
if ( !fractureCollection()->allFractures().empty() || !stimPlanModelCollection()->allStimPlanModels().empty() )
|
||||
if ( !m_fractureCollection->allFractures().empty() || !m_stimPlanModelCollection->allStimPlanModels().empty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return !fishbonesCollection()->allFishbonesSubs().empty() ||
|
||||
!fishbonesCollection()->wellPathCollection()->wellPaths().empty() ||
|
||||
!perforationCollection()->perforations().empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::drainageRadiusForExport() const
|
||||
{
|
||||
return m_drainageRadiusForPI();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::gasInflowEquationForExport() const
|
||||
{
|
||||
return m_gasInflowEquation().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::automaticWellShutInForExport() const
|
||||
{
|
||||
return m_automaticWellShutIn().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::allowWellCrossFlowForExport() const
|
||||
{
|
||||
return m_allowWellCrossFlow() ? "YES" : "NO";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::wellBoreFluidPVTForExport() const
|
||||
{
|
||||
return QString( "%1" ).arg( m_wellBoreFluidPVTTable() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::hydrostaticDensityForExport() const
|
||||
{
|
||||
return m_hydrostaticDensity().text();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::fluidInPlaceRegionForExport() const
|
||||
{
|
||||
return QString( "%1" ).arg( m_fluidInPlaceRegion() );
|
||||
return !m_fishbonesCollection->allFishbonesSubs().empty() ||
|
||||
!m_fishbonesCollection->wellPathCollection()->wellPaths().empty() ||
|
||||
!m_perforationCollection->perforations().empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -356,17 +222,6 @@ QString RimWellPathCompletions::fluidInPlaceRegionForExport() const
|
||||
void RimWellPathCompletions::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_fishbonesCollection->setUnitSystemSpecificDefaults();
|
||||
m_fractureCollection->setUnitSystemSpecificDefaults();
|
||||
m_perforationCollection->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QRegExp RimWellPathCompletions::wellNameForExportRegExp()
|
||||
{
|
||||
QRegExp rx( "[\\w\\-\\_]{1,8}" );
|
||||
return rx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -374,18 +229,7 @@ QRegExp RimWellPathCompletions::wellNameForExportRegExp()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletions::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* compExportGroup = uiOrdering.addNewGroup( "Completion Export Parameters" );
|
||||
compExportGroup->add( &m_wellNameForExport );
|
||||
compExportGroup->add( &m_wellGroupName );
|
||||
compExportGroup->add( &m_referenceDepth );
|
||||
compExportGroup->add( &m_preferredFluidPhase );
|
||||
compExportGroup->add( &m_drainageRadiusForPI );
|
||||
compExportGroup->add( &m_gasInflowEquation );
|
||||
compExportGroup->add( &m_automaticWellShutIn );
|
||||
compExportGroup->add( &m_allowWellCrossFlow );
|
||||
compExportGroup->add( &m_wellBoreFluidPVTTable );
|
||||
compExportGroup->add( &m_hydrostaticDensity );
|
||||
compExportGroup->add( &m_fluidInPlaceRegion );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -395,23 +239,23 @@ void RimWellPathCompletions::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTre
|
||||
{
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
|
||||
if ( !perforationCollection()->perforations().empty() )
|
||||
if ( !m_perforationCollection->perforations().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_perforationCollection );
|
||||
}
|
||||
|
||||
if ( !fishbonesCollection()->allFishbonesSubs().empty() ||
|
||||
!fishbonesCollection()->wellPathCollection()->wellPaths().empty() )
|
||||
if ( !m_fishbonesCollection->allFishbonesSubs().empty() ||
|
||||
!m_fishbonesCollection->wellPathCollection()->wellPaths().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_fishbonesCollection );
|
||||
}
|
||||
|
||||
if ( !fractureCollection()->allFractures().empty() )
|
||||
if ( !m_fractureCollection->allFractures().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_fractureCollection );
|
||||
}
|
||||
|
||||
if ( !stimPlanModelCollection()->allStimPlanModels().empty() )
|
||||
if ( !m_stimPlanModelCollection->allStimPlanModels().empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_stimPlanModelCollection );
|
||||
}
|
||||
@@ -420,69 +264,32 @@ void RimWellPathCompletions::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTre
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletions::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
void RimWellPathCompletions::initAfterRead()
|
||||
{
|
||||
if ( changedField == &m_referenceDepth )
|
||||
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2020.10.1.2" ) )
|
||||
{
|
||||
if ( !RiaStdStringTools::isNumber( m_referenceDepth.v().toStdString(), '.' ) )
|
||||
{
|
||||
if ( !RiaStdStringTools::isNumber( m_referenceDepth.v().toStdString(), ',' ) )
|
||||
{
|
||||
// Remove invalid input text
|
||||
m_referenceDepth = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wrong decimal sign entered, replace , by .
|
||||
auto text = m_referenceDepth.v();
|
||||
m_referenceDepth = text.replace( ',', '.' );
|
||||
}
|
||||
}
|
||||
}
|
||||
std::vector<RimWellPath*> wellPathHierarchy;
|
||||
this->allAncestorsOrThisOfType( wellPathHierarchy );
|
||||
RimWellPath* topLevelWellPath = wellPathHierarchy.back();
|
||||
auto settings = topLevelWellPath->completionSettings();
|
||||
|
||||
applyToSettings( settings );
|
||||
};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathCompletions::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
void RimWellPathCompletions::applyToSettings( gsl::not_null<RimWellPathCompletionSettings*> settings )
|
||||
{
|
||||
caf::PdmUiLineEditorAttribute* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
|
||||
if ( field == &m_wellNameForExport && lineEditorAttr )
|
||||
{
|
||||
QRegExpValidator* validator = new QRegExpValidator( nullptr );
|
||||
validator->setRegExp( wellNameForExportRegExp() );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_drainageRadiusForPI && lineEditorAttr )
|
||||
{
|
||||
caf::PdmDoubleStringValidator* validator = new caf::PdmDoubleStringValidator( "1*" );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_wellBoreFluidPVTTable && lineEditorAttr )
|
||||
{
|
||||
// Positive integer
|
||||
QIntValidator* validator = new QIntValidator( 0, std::numeric_limits<int>::max(), nullptr );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
else if ( field == &m_fluidInPlaceRegion && lineEditorAttr )
|
||||
{
|
||||
// Any integer
|
||||
QIntValidator* validator =
|
||||
new QIntValidator( -std::numeric_limits<int>::max(), std::numeric_limits<int>::max(), nullptr );
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathCompletions::formatStringForExport( const QString& text, const QString& defaultValue ) const
|
||||
{
|
||||
if ( text.isEmpty() ) return defaultValue;
|
||||
if ( text.contains( ' ' ) ) return QString( "'%1'" ).arg( text );
|
||||
return text;
|
||||
settings->m_wellNameForExport = m_wellNameForExport_OBSOLETE;
|
||||
settings->m_referenceDepth = m_referenceDepth_OBSOLETE;
|
||||
settings->m_preferredFluidPhase = m_preferredFluidPhase_OBSOLETE;
|
||||
settings->m_drainageRadiusForPI = m_drainageRadiusForPI_OBSOLETE;
|
||||
settings->m_gasInflowEquation = m_gasInflowEquation_OBSOLETE;
|
||||
settings->m_automaticWellShutIn = m_automaticWellShutIn_OBSOLETE;
|
||||
settings->m_allowWellCrossFlow = m_allowWellCrossFlow_OBSOLETE;
|
||||
settings->m_wellBoreFluidPVTTable = m_wellBoreFluidPVTTable_OBSOLETE;
|
||||
settings->m_hydrostaticDensity = m_hydrostaticDensity_OBSOLETE;
|
||||
settings->m_fluidInPlaceRegion = m_fluidInPlaceRegion_OBSOLETE;
|
||||
}
|
||||
|
||||
@@ -18,16 +18,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimWellPathCompletionSettings.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "gsl/gsl"
|
||||
|
||||
class RimFishbonesCollection;
|
||||
class RimPerforationCollection;
|
||||
class RimWellPathFractureCollection;
|
||||
class RimWellPathComponentInterface;
|
||||
class RimWellPathValve;
|
||||
class RimStimPlanModelCollection;
|
||||
class RimWellPathComponentInterface;
|
||||
class RimWellPathFracture;
|
||||
class RimWellPathFractureCollection;
|
||||
class RimWellPathValve;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -37,38 +42,6 @@ class RimWellPathCompletions : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
enum WellType
|
||||
{
|
||||
OIL,
|
||||
GAS,
|
||||
WATER,
|
||||
LIQUID
|
||||
};
|
||||
typedef caf::AppEnum<WellType> WellTypeEnum;
|
||||
|
||||
enum GasInflowEquation
|
||||
{
|
||||
STANDARD_EQ,
|
||||
RUSSELL_GOODRICH,
|
||||
DRY_GAS_PSEUDO_PRESSURE,
|
||||
GENERALIZED_PSEUDO_PRESSURE
|
||||
};
|
||||
typedef caf::AppEnum<GasInflowEquation> GasInflowEnum;
|
||||
|
||||
enum AutomaticWellShutIn
|
||||
{
|
||||
ISOLATE_FROM_FORMATION,
|
||||
STOP_ABOVE_FORMATION
|
||||
};
|
||||
typedef caf::AppEnum<AutomaticWellShutIn> AutomaticWellShutInEnum;
|
||||
|
||||
enum HydrostaticDensity
|
||||
{
|
||||
SEGMENTED,
|
||||
AVERAGED
|
||||
};
|
||||
typedef caf::AppEnum<HydrostaticDensity> HydrostaticDensityEnum;
|
||||
|
||||
public:
|
||||
RimWellPathCompletions();
|
||||
|
||||
@@ -76,39 +49,22 @@ public:
|
||||
RimPerforationCollection* perforationCollection() const;
|
||||
RimWellPathFractureCollection* fractureCollection() const;
|
||||
RimStimPlanModelCollection* stimPlanModelCollection() const;
|
||||
std::vector<RimWellPathValve*> valves() const;
|
||||
|
||||
std::vector<const RimWellPathComponentInterface*> allCompletions() const;
|
||||
bool hasCompletions() const;
|
||||
void setUnitSystemSpecificDefaults();
|
||||
|
||||
void setWellNameForExport( const QString& name );
|
||||
void updateWellPathNameHasChanged( const QString& newWellPathName, const QString& previousWellPathName );
|
||||
QString wellNameForExport() const;
|
||||
QString wellGroupNameForExport() const;
|
||||
QString referenceDepthForExport() const;
|
||||
QString wellTypeNameForExport() const;
|
||||
bool hasCompletions() const;
|
||||
|
||||
QString drainageRadiusForExport() const;
|
||||
QString gasInflowEquationForExport() const;
|
||||
QString automaticWellShutInForExport() const;
|
||||
QString allowWellCrossFlowForExport() const;
|
||||
QString wellBoreFluidPVTForExport() const;
|
||||
QString hydrostaticDensityForExport() const;
|
||||
QString fluidInPlaceRegionForExport() const;
|
||||
|
||||
void setUnitSystemSpecificDefaults();
|
||||
static QRegExp wellNameForExportRegExp();
|
||||
std::vector<RimWellPathValve*> valves() const;
|
||||
std::vector<RimWellPathFracture*> allFractures() const;
|
||||
std::vector<RimWellPathFracture*> activeFractures() const;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
QString formatStringForExport( const QString& text, const QString& defaultText = "" ) const;
|
||||
void applyToSettings( gsl::not_null<RimWellPathCompletionSettings*> settings );
|
||||
|
||||
private:
|
||||
caf::PdmChildField<RimFishbonesCollection*> m_fishbonesCollection;
|
||||
@@ -116,16 +72,20 @@ private:
|
||||
caf::PdmChildField<RimWellPathFractureCollection*> m_fractureCollection;
|
||||
caf::PdmChildField<RimStimPlanModelCollection*> m_stimPlanModelCollection;
|
||||
|
||||
caf::PdmField<QString> m_wellNameForExport;
|
||||
caf::PdmField<QString> m_wellGroupName;
|
||||
private:
|
||||
/////////////////////
|
||||
// OBSOLETE FIELDS //
|
||||
/////////////////////
|
||||
caf::PdmField<QString> m_wellNameForExport_OBSOLETE;
|
||||
caf::PdmField<QString> m_wellGroupName_OBSOLETE;
|
||||
|
||||
caf::PdmField<QString> m_referenceDepth;
|
||||
caf::PdmField<WellTypeEnum> m_preferredFluidPhase;
|
||||
caf::PdmField<QString> m_drainageRadiusForPI;
|
||||
caf::PdmField<GasInflowEnum> m_gasInflowEquation;
|
||||
caf::PdmField<AutomaticWellShutInEnum> m_automaticWellShutIn;
|
||||
caf::PdmField<bool> m_allowWellCrossFlow;
|
||||
caf::PdmField<int> m_wellBoreFluidPVTTable;
|
||||
caf::PdmField<HydrostaticDensityEnum> m_hydrostaticDensity;
|
||||
caf::PdmField<int> m_fluidInPlaceRegion;
|
||||
caf::PdmField<QString> m_referenceDepth_OBSOLETE;
|
||||
caf::PdmField<RimWellPathCompletionSettings::WellTypeEnum> m_preferredFluidPhase_OBSOLETE;
|
||||
caf::PdmField<QString> m_drainageRadiusForPI_OBSOLETE;
|
||||
caf::PdmField<RimWellPathCompletionSettings::GasInflowEnum> m_gasInflowEquation_OBSOLETE;
|
||||
caf::PdmField<RimWellPathCompletionSettings::AutomaticWellShutInEnum> m_automaticWellShutIn_OBSOLETE;
|
||||
caf::PdmField<bool> m_allowWellCrossFlow_OBSOLETE;
|
||||
caf::PdmField<int> m_wellBoreFluidPVTTable_OBSOLETE;
|
||||
caf::PdmField<RimWellPathCompletionSettings::HydrostaticDensityEnum> m_hydrostaticDensity_OBSOLETE;
|
||||
caf::PdmField<int> m_fluidInPlaceRegion_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -38,10 +38,10 @@ RimWellPathFractureCollection::RimWellPathFractureCollection( void )
|
||||
setName( "Fractures" );
|
||||
nameField()->uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters = new RimMswCompletionParameters;
|
||||
m_mswParameters.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
CAF_PDM_InitFieldNoDefault( &m_mswParameters_OBSOLETE, "MswParameters", "Multi Segment Well Parameters", "", "", "" );
|
||||
m_mswParameters_OBSOLETE = new RimMswCompletionParameters;
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeHidden( true );
|
||||
m_mswParameters_OBSOLETE.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_refMDType_OBSOLETE, "RefMDType", std::numeric_limits<int>::max(), "Reference MD", "", "", "" );
|
||||
CAF_PDM_InitField( &m_refMD_OBSOLETE, "RefMD", std::numeric_limits<double>::infinity(), "", "", "", "" );
|
||||
@@ -59,9 +59,9 @@ RimWellPathFractureCollection::~RimWellPathFractureCollection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimWellPathFractureCollection::mswParameters() const
|
||||
bool RimWellPathFractureCollection::hasFractures() const
|
||||
{
|
||||
return m_mswParameters;
|
||||
return !m_fractures.empty();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -80,14 +80,6 @@ void RimWellPathFractureCollection::deleteFractures()
|
||||
m_fractures.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFractureCollection::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -122,8 +114,6 @@ std::vector<RimWellPathFracture*> RimWellPathFractureCollection::activeFractures
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFractureCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup( "Multi Segment Well Options" );
|
||||
m_mswParameters->uiOrdering( uiConfigName, *mswGroup );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
@@ -151,12 +141,12 @@ void RimWellPathFractureCollection::initAfterRead()
|
||||
{
|
||||
if ( m_refMDType_OBSOLETE() != std::numeric_limits<int>::max() )
|
||||
{
|
||||
m_mswParameters->setReferenceMDType( (RimMswCompletionParameters::ReferenceMDType)m_refMDType_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setReferenceMDType( (RimMswCompletionParameters::ReferenceMDType)m_refMDType_OBSOLETE() );
|
||||
}
|
||||
|
||||
if ( m_refMD_OBSOLETE() != std::numeric_limits<double>::infinity() )
|
||||
{
|
||||
m_mswParameters->setManualReferenceMD( m_refMD_OBSOLETE() );
|
||||
m_mswParameters_OBSOLETE->setManualReferenceMD( m_refMD_OBSOLETE() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,9 @@ public:
|
||||
RimWellPathFractureCollection( void );
|
||||
~RimWellPathFractureCollection( void ) override;
|
||||
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
void addFracture( RimWellPathFracture* fracture );
|
||||
void deleteFractures();
|
||||
void setUnitSystemSpecificDefaults();
|
||||
bool hasFractures() const;
|
||||
void addFracture( RimWellPathFracture* fracture );
|
||||
void deleteFractures();
|
||||
|
||||
std::vector<RimWellPathFracture*> allFractures() const;
|
||||
std::vector<RimWellPathFracture*> activeFractures() const;
|
||||
@@ -59,9 +58,10 @@ private:
|
||||
void initAfterRead() override;
|
||||
|
||||
private:
|
||||
caf::PdmChildArrayField<RimWellPathFracture*> m_fractures;
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
caf::PdmChildArrayField<RimWellPathFracture*> m_fractures;
|
||||
|
||||
caf::PdmField<int> m_refMDType_OBSOLETE;
|
||||
caf::PdmField<double> m_refMD_OBSOLETE;
|
||||
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters_OBSOLETE;
|
||||
};
|
||||
|
||||
@@ -452,6 +452,7 @@ QList<caf::PdmOptionItemInfo> RimWellPathValve::calculateValueOptions( const caf
|
||||
|
||||
RimProject* project = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted( project );
|
||||
|
||||
std::vector<RimValveTemplate*> allTemplates = project->allValveTemplates();
|
||||
for ( RimValveTemplate* valveTemplate : allTemplates )
|
||||
{
|
||||
@@ -484,8 +485,11 @@ void RimWellPathValve::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
}
|
||||
|
||||
RimPerforationInterval* perfInterval;
|
||||
this->firstAncestorOrThisOfTypeAsserted( perfInterval );
|
||||
perfInterval->updateAllReferringTracks();
|
||||
this->firstAncestorOrThisOfType( perfInterval );
|
||||
if ( perfInterval )
|
||||
{
|
||||
perfInterval->updateAllReferringTracks();
|
||||
}
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted( proj );
|
||||
@@ -509,35 +513,37 @@ void RimWellPathValve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
uiOrdering.add( &m_createValveTemplate, false );
|
||||
}
|
||||
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICV ||
|
||||
componentType() == RiaDefines::WellPathComponentType::ICD )
|
||||
if ( uiConfigName != "TemplateOnly" )
|
||||
{
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICV )
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICV ||
|
||||
componentType() == RiaDefines::WellPathComponentType::ICD )
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType( wellPath );
|
||||
if ( wellPath )
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICV )
|
||||
{
|
||||
if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType( wellPath );
|
||||
if ( wellPath )
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName( "Measured Depth [m]" );
|
||||
}
|
||||
else if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_FIELD )
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName( "Measured Depth [ft]" );
|
||||
if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_METRIC )
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName( "Measured Depth [m]" );
|
||||
}
|
||||
else if ( wellPath->unitSystem() == RiaDefines::EclipseUnitSystem::UNITS_FIELD )
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName( "Measured Depth [ft]" );
|
||||
}
|
||||
}
|
||||
uiOrdering.add( &m_measuredDepth, { true, 3, 1 } );
|
||||
}
|
||||
uiOrdering.add( &m_measuredDepth, { true, 3, 1 } );
|
||||
}
|
||||
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICD ||
|
||||
componentType() == RiaDefines::WellPathComponentType::AICD )
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Multiple Valve Locations" );
|
||||
m_multipleValveLocations->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
}
|
||||
|
||||
if ( componentType() == RiaDefines::WellPathComponentType::ICD ||
|
||||
componentType() == RiaDefines::WellPathComponentType::AICD )
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Multiple Valve Locations" );
|
||||
m_multipleValveLocations->uiOrdering( uiConfigName, *group );
|
||||
}
|
||||
|
||||
if ( m_valveTemplate() != nullptr )
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Parameters from Template" );
|
||||
|
||||
Reference in New Issue
Block a user