mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3442 UI For ICD/ICV parameters
This commit is contained in:
parent
d3db1a6075
commit
2414865dbe
@ -43,6 +43,8 @@ public:
|
||||
static double meterToInch(double meter) { return meter * feetPerMeter()*12.0; }
|
||||
static double inchToMeter(double inch) { return (inch / 12.0) * meterPerFeet(); }
|
||||
static double inchToFeet (double inch) { return (inch / 12.0); }
|
||||
static double mmToMeter(double mm) { return mm / 1000.0; }
|
||||
static double meterToMm(double meter) { return 1000.0 * meter; }
|
||||
|
||||
static double darcysConstant(UnitSystem unitSystem);
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimMultipleValveLocations.h"
|
||||
#include "RimWellPathValve.h"
|
||||
|
||||
#include "cafPdmUiDoubleValueEditor.h"
|
||||
#include "cafPdmUiListEditor.h"
|
||||
@ -272,33 +273,26 @@ double RimFishbonesMultipleSubs::icdOrificeDiameter(RiaEclipseUnitTools::UnitSys
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::inchToMeter(m_icdOrificeDiameter());
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_icdOrificeDiameter() / 1000;
|
||||
}
|
||||
}
|
||||
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(m_icdOrificeDiameter() / 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
return RiaEclipseUnitTools::inchToFeet(m_icdOrificeDiameter());
|
||||
}
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return 0.0;
|
||||
return RimWellPathValve::convertOrificeDiameter(m_icdOrificeDiameter(), wellPath->unitSystem(), unitSystem);
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesMultipleSubs::icdFlowCoefficient() const
|
||||
{
|
||||
return m_icdFlowCoefficient();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RimFishbonesMultipleSubs::icdCount() const
|
||||
{
|
||||
return m_icdCount();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -93,8 +93,8 @@ public:
|
||||
double skinFactor() const { return m_pipeProperties()->skinFactor(); }
|
||||
double openHoleRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
double icdOrificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
double icdFlowCoefficient() const { return m_icdFlowCoefficient(); }
|
||||
size_t icdCount() const { return m_icdCount(); }
|
||||
double icdFlowCoefficient() const;
|
||||
size_t icdCount() const;
|
||||
std::vector<double> lateralLengths() const;
|
||||
|
||||
void geometryUpdated();
|
||||
|
@ -52,6 +52,8 @@ RimWellPathValve::RimWellPathValve()
|
||||
m_multipleValveLocations.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
nameField()->uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitField(&m_orificeDiameter, "OrificeDiameter", 7.0, "Orifice Diameter [mm]", "", "", "");
|
||||
CAF_PDM_InitField(&m_flowCoefficient, "FlowCoefficient", 1.5, "Flow Coefficient", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -103,6 +105,77 @@ std::vector<double> RimWellPathValve::valveLocations() const
|
||||
return valveDepths;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathValve::orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
return convertOrificeDiameter(m_orificeDiameter(), wellPath->unitSystem(), unitSystem);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathValve::flowCoefficient() const
|
||||
{
|
||||
return m_flowCoefficient();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathValve::setUnitSpecificDefaults()
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
m_orificeDiameter = 7;
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
m_orificeDiameter = 0.28;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathValve::convertOrificeDiameter(double orificeDiameterWellPathUnits,
|
||||
RiaEclipseUnitTools::UnitSystem wellPathUnits,
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||
{
|
||||
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
if (wellPathUnits == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::inchToMeter(orificeDiameterWellPathUnits);
|
||||
}
|
||||
else
|
||||
{
|
||||
return RiaEclipseUnitTools::mmToMeter(orificeDiameterWellPathUnits);
|
||||
}
|
||||
}
|
||||
else if (unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
if (wellPathUnits == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(RiaEclipseUnitTools::mmToMeter(orificeDiameterWellPathUnits));
|
||||
}
|
||||
else
|
||||
{
|
||||
return RiaEclipseUnitTools::inchToFeet(orificeDiameterWellPathUnits);
|
||||
}
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -218,7 +291,7 @@ void RimWellPathValve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
|
||||
{
|
||||
uiOrdering.add(&m_type);
|
||||
|
||||
if (m_type() == RiaDefines::ICV)
|
||||
if (m_type() == RiaDefines::ICV || m_type() == RiaDefines::ICD)
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType(wellPath);
|
||||
@ -226,20 +299,39 @@ void RimWellPathValve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [m]");
|
||||
if (m_type() == RiaDefines::ICV)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [m]");
|
||||
}
|
||||
m_orificeDiameter.uiCapability()->setUiName("Orifice Diameter [mm]");
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [ft]");
|
||||
if (m_type() == RiaDefines::ICV)
|
||||
{
|
||||
m_measuredDepth.uiCapability()->setUiName("Measured Depth [ft]");
|
||||
}
|
||||
m_orificeDiameter.uiCapability()->setUiName("Orifice Diameter [in]");
|
||||
}
|
||||
}
|
||||
uiOrdering.add(&m_measuredDepth);
|
||||
if (m_type() == RiaDefines::ICV)
|
||||
{
|
||||
uiOrdering.add(&m_measuredDepth);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (m_type() == RiaDefines::ICD || m_type() == RiaDefines::AICD)
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Multiple Valve Locations");
|
||||
m_multipleValveLocations->uiOrdering(uiConfigName, *group);
|
||||
}
|
||||
|
||||
if (m_type() == RiaDefines::ICV || m_type() == RiaDefines::ICD)
|
||||
{
|
||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup("MSW Valve Parameters");
|
||||
group->add(&m_orificeDiameter);
|
||||
group->add(&m_flowCoefficient);
|
||||
}
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimWellPathComponentInterface.h"
|
||||
|
||||
@ -44,6 +46,13 @@ public:
|
||||
void setMeasuredDepthAndCount(double startMD, double spacing, int valveCount);
|
||||
void geometryUpdated();
|
||||
std::vector<double> valveLocations() const;
|
||||
double orificeDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
double flowCoefficient() const;
|
||||
void setUnitSpecificDefaults();
|
||||
|
||||
static double convertOrificeDiameter(double orificeDiameterUi,
|
||||
RiaEclipseUnitTools::UnitSystem wellPathUnitSystem,
|
||||
RiaEclipseUnitTools::UnitSystem wantedUnitSystem);
|
||||
|
||||
// Overrides from RimWellPathCompletionInterface
|
||||
bool isEnabled() const override;
|
||||
@ -53,7 +62,7 @@ public:
|
||||
cvf::Color3f defaultComponentColor() const override;
|
||||
double startMD() const override;
|
||||
double endMD() const override;
|
||||
|
||||
|
||||
private:
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
@ -66,6 +75,10 @@ private:
|
||||
caf::PdmField<double> m_measuredDepth;
|
||||
caf::PdmChildField<RimMultipleValveLocations*> m_multipleValveLocations;
|
||||
|
||||
// ICD and ICVs only
|
||||
caf::PdmField<double> m_orificeDiameter;
|
||||
caf::PdmField<double> m_flowCoefficient;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user