mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 00:42:12 -05:00
#3468 Add new valve completions to perforation intervals.
This commit is contained in:
1 parent
ce2430ac2d
commit
cfbe6a1a24
14 files changed
+453
-14
No files matched your search
@@ -25,6 +25,7 @@ ${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathComponentInterface.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.h
|
||||
)
|
||||
|
||||
|
||||
@@ -53,6 +54,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimNonDarcyPerforationParameters.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathValve.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathValve.h"
|
||||
|
||||
#include "cafPdmUiDateEditor.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
@@ -51,6 +52,9 @@ RimPerforationInterval::RimPerforationInterval()
|
||||
CAF_PDM_InitField(&m_useCustomEndDate, "UseCustomEndDate", false, "Custom End Date", "", "", "");
|
||||
CAF_PDM_InitField(&m_endDate, "EndDate", QDateTime::currentDateTime(), "End Date", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_valves, "Valves", "Valves", "", "", "");
|
||||
m_valves.uiCapability()->setUiHidden(true);
|
||||
|
||||
nameField()->uiCapability()->setUiReadOnly(true);
|
||||
|
||||
m_startMD.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
@@ -205,6 +209,27 @@ void RimPerforationInterval::setUnitSystemSpecificDefaults()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPerforationInterval::addValve(RimWellPathValve* valve)
|
||||
{
|
||||
m_valves.push_back(valve);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathValve*> RimPerforationInterval::valves() const
|
||||
{
|
||||
std::vector<RimWellPathValve*> allValves;
|
||||
for (RimWellPathValve* valve : m_valves())
|
||||
{
|
||||
allValves.push_back(valve);
|
||||
}
|
||||
return allValves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -26,10 +26,13 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include <QDate>
|
||||
|
||||
class RimWellPathValve;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
@@ -60,12 +63,15 @@ public:
|
||||
|
||||
void setUnitSystemSpecificDefaults();
|
||||
|
||||
void addValve(RimWellPathValve* valve);
|
||||
std::vector<RimWellPathValve*> valves() const;
|
||||
|
||||
// RimWellPathCompletionInterface overrides
|
||||
RiaDefines::WellPathComponentType componentType() const override;
|
||||
double startMD() const;
|
||||
double endMD() const;
|
||||
QString componentLabel() const override;
|
||||
QString componentTypeLabel() const override;
|
||||
RiaDefines::WellPathComponentType componentType() const override;
|
||||
double startMD() const;
|
||||
double endMD() const;
|
||||
QString componentLabel() const override;
|
||||
QString componentTypeLabel() const override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
@@ -86,5 +92,7 @@ private:
|
||||
caf::PdmField< bool > m_useCustomEndDate;
|
||||
caf::PdmField< QDateTime > m_endDate;
|
||||
|
||||
caf::PdmChildArrayField<RimWellPathValve*> m_valves;
|
||||
|
||||
caf::PdmField< bool > m_startOfHistory_OBSOLETE;
|
||||
};
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "RimWellPathFractureCollection.h"
|
||||
#include "RimWellPathFracture.h"
|
||||
#include "RimWellPathComponentInterface.h"
|
||||
#include "RimWellPathValve.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
@@ -169,6 +170,16 @@ RimWellPathFractureCollection* RimWellPathCompletions::fractureCollection() cons
|
||||
return m_fractureCollection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RimWellPathValve*> RimWellPathCompletions::valves() const
|
||||
{
|
||||
std::vector<RimWellPathValve*> allValves;
|
||||
this->descendantsIncludingThisOfType(allValves);
|
||||
return allValves;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -189,6 +200,12 @@ std::vector<const RimWellPathComponentInterface*> RimWellPathCompletions::allCom
|
||||
completions.push_back(perforation);
|
||||
}
|
||||
|
||||
std::vector<RimWellPathValve*> allValves = valves();
|
||||
for (const RimWellPathValve* valve : allValves)
|
||||
{
|
||||
completions.push_back(valve);
|
||||
}
|
||||
|
||||
return completions;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class RimFishbonesCollection;
|
||||
class RimPerforationCollection;
|
||||
class RimWellPathFractureCollection;
|
||||
class RimWellPathComponentInterface;
|
||||
|
||||
class RimWellPathValve;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
RimFishbonesCollection* fishbonesCollection() const;
|
||||
RimPerforationCollection* perforationCollection() const;
|
||||
RimWellPathFractureCollection* fractureCollection() const;
|
||||
std::vector<RimWellPathValve*> valves() const;
|
||||
|
||||
std::vector<const RimWellPathComponentInterface*> allCompletions() const;
|
||||
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - 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 "RimWellPathValve.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathValve, "WellPathValve");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathValve::RimWellPathValve()
|
||||
{
|
||||
CAF_PDM_InitObject("WellPathValve", ":/PerforationInterval16x16.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_type, "CompletionType", "Type ", "", "", "");
|
||||
CAF_PDM_InitField(&m_measuredDepth, "StartMeasuredDepth", 0.0, "Start MD", "", "", "");
|
||||
m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
nameField()->uiCapability()->setUiReadOnly(true);
|
||||
m_type = RiaDefines::ICD;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathValve::~RimWellPathValve()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::setMeasuredDepth(double measuredDepth)
|
||||
{
|
||||
m_measuredDepth = measuredDepth;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::WellPathComponentType RimWellPathValve::componentType() const
|
||||
{
|
||||
return m_type();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathValve::startMD() const
|
||||
{
|
||||
return m_measuredDepth;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathValve::endMD() const
|
||||
{
|
||||
return m_measuredDepth + 0.5;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathValve::componentLabel() const
|
||||
{
|
||||
return m_type().uiText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellPathValve::componentTypeLabel() const
|
||||
{
|
||||
return m_type().uiText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimWellPathValve::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &m_type)
|
||||
{
|
||||
std::set<RiaDefines::WellPathComponentType> supportedTypes = { RiaDefines::ICD, RiaDefines::AICD, RiaDefines::ICV };
|
||||
for (RiaDefines::WellPathComponentType type : supportedTypes)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(CompletionTypeEnum::uiText(type), type));
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted(proj);
|
||||
proj->reloadCompletionTypeResultsInAllViews();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_type);
|
||||
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [m]");
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [ft]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_measuredDepth);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
|
||||
{
|
||||
if (field == &m_measuredDepth)
|
||||
{
|
||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
|
||||
|
||||
if (myAttr)
|
||||
{
|
||||
double minimumValue = 0.0, maximumValue = 0.0;
|
||||
|
||||
RimPerforationInterval* perforationInterval = nullptr;
|
||||
this->firstAncestorOrThisOfType(perforationInterval);
|
||||
|
||||
if (perforationInterval)
|
||||
{
|
||||
minimumValue = perforationInterval->startMD();
|
||||
maximumValue = perforationInterval->endMD();
|
||||
}
|
||||
else
|
||||
{
|
||||
RimWellPath* rimWellPath = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(rimWellPath);
|
||||
RigWellPath* wellPathGeo = rimWellPath->wellPathGeometry();
|
||||
if (!wellPathGeo) return;
|
||||
|
||||
if (wellPathGeo->m_measuredDepths.size() > 2)
|
||||
{
|
||||
minimumValue = wellPathGeo->measureDepths().front();
|
||||
maximumValue = wellPathGeo->measureDepths().back();
|
||||
}
|
||||
}
|
||||
myAttr->m_minimum = minimumValue;
|
||||
myAttr->m_maximum = maximumValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
QString fullName = componentLabel() + QString(" %1").arg(m_measuredDepth());
|
||||
this->setName(fullName);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2018 - 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 "RimCheckableNamedObject.h"
|
||||
#include "RimWellPathComponentInterface.h"
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cvfBase.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
class RimWellPath;
|
||||
|
||||
class RimWellPathValve : public RimCheckableNamedObject, public RimWellPathComponentInterface
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
typedef caf::AppEnum<RiaDefines::WellPathComponentType> CompletionTypeEnum;
|
||||
|
||||
RimWellPathValve();
|
||||
~RimWellPathValve();
|
||||
|
||||
void setMeasuredDepth(double measuredDepth);
|
||||
|
||||
// Overrides from RimWellPathCompletionInterface
|
||||
RiaDefines::WellPathComponentType componentType() const override;
|
||||
double startMD() const override;
|
||||
double endMD() const override;
|
||||
QString componentLabel() const override;
|
||||
QString componentTypeLabel() const override;
|
||||
|
||||
private:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||
|
||||
private:
|
||||
caf::PdmField<CompletionTypeEnum> m_type;
|
||||
caf::PdmField<double> m_measuredDepth;
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user