mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "RicMultiSegmentWellExportInfo.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
#include "RimMswCompletionParameters.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
@@ -477,8 +479,8 @@ RicMswExportInfo::RicMswExportInfo(const RimWellPath* wellPath,
|
||||
, m_initialMD(initialMD)
|
||||
, m_unitSystem(unitSystem)
|
||||
, m_topWellBoreVolume(RicMswExportInfo::defaultDoubleValue())
|
||||
, m_linerDiameter(0.15)
|
||||
, m_roughnessFactor(5.0e-5)
|
||||
, m_linerDiameter(RimMswCompletionParameters::defaultLinerDiameter(unitSystem))
|
||||
, m_roughnessFactor(RimMswCompletionParameters::defaultRoughnessFactor(unitSystem))
|
||||
, m_lengthAndDepthText(lengthAndDepthText)
|
||||
, m_pressureDropText(pressureDropText)
|
||||
, m_hasSubGridIntersections(false)
|
||||
|
||||
@@ -448,7 +448,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse
|
||||
|
||||
{
|
||||
formatter.comment("Main stem");
|
||||
|
||||
double prevMD = exportInfo.initialMD();
|
||||
double prevTVD = exportInfo.initialTVD();
|
||||
for (const RicMswSegment& location : exportInfo.wellSegmentLocations())
|
||||
{
|
||||
double depth = 0;
|
||||
@@ -456,8 +457,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse
|
||||
|
||||
if (exportInfo.lengthAndDepthText() == QString("INC"))
|
||||
{
|
||||
depth = location.deltaTVD();
|
||||
length = location.deltaMD();
|
||||
depth = location.endTVD() - prevTVD;
|
||||
length = location.endMD() - prevMD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -478,6 +479,8 @@ void RicWellPathExportCompletionDataFeatureImpl::generateWelsegsTable(RifEclipse
|
||||
formatter.add(exportInfo.linerDiameter());
|
||||
formatter.add(exportInfo.roughnessFactor());
|
||||
formatter.rowCompleted();
|
||||
prevMD = location.endMD();
|
||||
prevTVD = location.endTVD();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -628,7 +631,6 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(RifEclipse
|
||||
bool isSubGridIntersection = !intersection.gridName().isEmpty();
|
||||
if (isSubGridIntersection == exportSubGridIntersections)
|
||||
{
|
||||
double relativeStartLength = segment.startMD() - startMD;
|
||||
if (exportSubGridIntersections)
|
||||
{
|
||||
formatter.add(intersection.gridName());
|
||||
@@ -636,8 +638,15 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(RifEclipse
|
||||
cvf::Vec3st ijk = intersection.gridLocalCellIJK();
|
||||
formatter.addZeroBasedCellIndex(ijk.x()).addZeroBasedCellIndex(ijk.y()).addZeroBasedCellIndex(ijk.z());
|
||||
formatter.add(completion.branchNumber());
|
||||
formatter.add(relativeStartLength);
|
||||
formatter.add(relativeStartLength + segment.deltaMD());
|
||||
|
||||
double startLength = segment.startMD();
|
||||
if (exportInfo.lengthAndDepthText() == QString("INC"))
|
||||
{
|
||||
startLength -= startMD;
|
||||
}
|
||||
formatter.add(startLength);
|
||||
formatter.add(startLength + segment.deltaMD());
|
||||
|
||||
formatter.rowCompleted();
|
||||
}
|
||||
}
|
||||
@@ -1248,10 +1257,10 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMs
|
||||
RicMswExportInfo exportInfo(wellPath,
|
||||
unitSystem,
|
||||
wellPath->fishbonesCollection()->startMD(),
|
||||
wellPath->fishbonesCollection()->lengthAndDepth().text(),
|
||||
wellPath->fishbonesCollection()->pressureDrop().text());
|
||||
exportInfo.setLinerDiameter(wellPath->fishbonesCollection()->linerDiameter(unitSystem));
|
||||
exportInfo.setRoughnessFactor(wellPath->fishbonesCollection()->roughnessFactor(unitSystem));
|
||||
wellPath->fishbonesCollection()->mswParameters()->lengthAndDepth().text(),
|
||||
wellPath->fishbonesCollection()->mswParameters()->pressureDrop().text());
|
||||
exportInfo.setLinerDiameter(wellPath->fishbonesCollection()->mswParameters()->linerDiameter(unitSystem));
|
||||
exportInfo.setRoughnessFactor(wellPath->fishbonesCollection()->mswParameters()->roughnessFactor(unitSystem));
|
||||
|
||||
bool foundSubGridIntersections = false;
|
||||
double startMD = wellPath->fishbonesCollection()->startMD();
|
||||
@@ -1276,7 +1285,7 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFishbonesMs
|
||||
|
||||
// Add completion for ICD
|
||||
RicMswCompletion icdCompletion(RigCompletionData::ICD, QString("ICD"));
|
||||
RicMswSubSegment icdSegment(endMD, 0.1, -endPosition.z(), 0.0);
|
||||
RicMswSubSegment icdSegment(endMD, 0.1, endTVD, 0.0);
|
||||
icdCompletion.addSubSegment(icdSegment);
|
||||
location.addCompletion(icdCompletion);
|
||||
|
||||
@@ -1342,14 +1351,24 @@ RicMswExportInfo RicWellPathExportCompletionDataFeatureImpl::generateFracturesMs
|
||||
std::vector<WellPathCellIntersectionInfo> intersections =
|
||||
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(caseToApply->eclipseCaseData(), coords, mds);
|
||||
|
||||
double initialMD = mds.front();
|
||||
|
||||
if (!intersections.empty())
|
||||
double initialMD = 0.0;
|
||||
if (wellPath->fractureCollection()->referenceMDType() == RimWellPathFractureCollection::MANUAL_REFERENCE_MD)
|
||||
{
|
||||
initialMD = wellPath->fractureCollection()->manualReferenceMD();
|
||||
}
|
||||
else if (!intersections.empty())
|
||||
{
|
||||
initialMD = intersections.front().startMD;
|
||||
}
|
||||
|
||||
RicMswExportInfo exportInfo(wellPath, unitSystem, initialMD, QString("INC"), QString("HF-"));
|
||||
RicMswExportInfo exportInfo(wellPath,
|
||||
unitSystem,
|
||||
initialMD,
|
||||
wellPath->fractureCollection()->mswParameters()->lengthAndDepth().text(),
|
||||
wellPath->fractureCollection()->mswParameters()->pressureDrop().text());
|
||||
|
||||
exportInfo.setLinerDiameter(wellPath->fractureCollection()->mswParameters()->linerDiameter(unitSystem));
|
||||
exportInfo.setRoughnessFactor(wellPath->fractureCollection()->mswParameters()->roughnessFactor(unitSystem));
|
||||
|
||||
bool foundSubGridIntersections = false;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.h
|
||||
)
|
||||
|
||||
|
||||
@@ -48,6 +49,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimStimPlanFractureTemplate.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathFracture.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathFractureCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Rim3dWellLogCurveCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimMswCompletionParameters.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
||||
@@ -32,25 +32,6 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
namespace caf {
|
||||
template<>
|
||||
void RimFishbonesCollection::PressureDropEnum::setUp()
|
||||
{
|
||||
addItem(RimFishbonesCollection::HYDROSTATIC, "H--", "Hydrostatic");
|
||||
addItem(RimFishbonesCollection::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction");
|
||||
addItem(RimFishbonesCollection::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
|
||||
setDefault(RimFishbonesCollection::HYDROSTATIC);
|
||||
}
|
||||
|
||||
template<>
|
||||
void RimFishbonesCollection::LengthAndDepthEnum::setUp()
|
||||
{
|
||||
addItem(RimFishbonesCollection::INC, "INC", "Incremental");
|
||||
addItem(RimFishbonesCollection::ABS, "ABS", "Absolute");
|
||||
setDefault(RimFishbonesCollection::INC);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimFishbonesCollection, "FishbonesCollection");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -71,16 +52,23 @@ RimFishbonesCollection::RimFishbonesCollection()
|
||||
m_wellPathCollection = new RimFishboneWellPathCollection;
|
||||
m_wellPathCollection.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_startMD, "StartMD", HUGE_VAL, "Start MD", "", "", "");
|
||||
|
||||
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_InitField(&m_linerDiameter, "LinerDiameter", 0.152, "Liner Inner Diameter", "", "", "");
|
||||
CAF_PDM_InitField(&m_roughnessFactor, "RoughnessFactor", 1e-05, "Roughness Factor", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_pressureDrop, "PressureDrop", "Pressure Drop", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "");
|
||||
m_mswParameters = new RimMswCompletionParameters;
|
||||
manuallyModifiedStartMD = false;
|
||||
|
||||
// Moved to RimMswCompletionParameters and obsoleted
|
||||
CAF_PDM_InitField(&m_linerDiameter_OBSOLETE, "LinerDiameter", 0.152, "Liner Inner Diameter", "", "", "");
|
||||
CAF_PDM_InitField(&m_roughnessFactor_OBSOLETE, "RoughnessFactor", 1e-05, "Roughness Factor", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_pressureDrop_OBSOLETE, "PressureDrop", "Pressure Drop", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_lengthAndDepth_OBSOLETE, "LengthAndDepth", "Length and Depth", "", "", "");
|
||||
m_linerDiameter_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_roughnessFactor_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_pressureDrop_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_lengthAndDepth_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -129,15 +117,11 @@ void RimFishbonesCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
{
|
||||
m_startMD.uiCapability()->setUiName("Start MD [m]");
|
||||
m_mainBoreDiameter.uiCapability()->setUiName("Main Bore Diameter [m]");
|
||||
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [m]");
|
||||
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [m]");
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
m_startMD.uiCapability()->setUiName("Start MD [ft]");
|
||||
m_mainBoreDiameter.uiCapability()->setUiName("Main Bore Diameter [ft]");
|
||||
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [ft]");
|
||||
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [ft]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,12 +130,32 @@ void RimFishbonesCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
wellGroup->add(&m_startMD);
|
||||
wellGroup->add(&m_mainBoreDiameter);
|
||||
wellGroup->add(&m_skinFactor);
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Well Properties");
|
||||
m_mswParameters->uiOrdering(uiConfigName, *mswGroup);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Wells");
|
||||
mswGroup->add(&m_linerDiameter);
|
||||
mswGroup->add(&m_roughnessFactor);
|
||||
mswGroup->add(&m_pressureDrop);
|
||||
mswGroup->add(&m_lengthAndDepth);
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFishbonesCollection::initAfterRead()
|
||||
{
|
||||
if (m_linerDiameter_OBSOLETE() != m_linerDiameter_OBSOLETE.defaultValue())
|
||||
{
|
||||
m_mswParameters->setLinerDiameter(m_linerDiameter_OBSOLETE());
|
||||
}
|
||||
if (m_roughnessFactor_OBSOLETE() != m_roughnessFactor_OBSOLETE.defaultValue())
|
||||
{
|
||||
m_mswParameters->setRoughnessFactor(m_roughnessFactor_OBSOLETE());
|
||||
}
|
||||
if (m_pressureDrop_OBSOLETE() != m_pressureDrop_OBSOLETE.defaultValue())
|
||||
{
|
||||
m_mswParameters->setPressureDrop(m_pressureDrop_OBSOLETE());
|
||||
}
|
||||
if (m_lengthAndDepth_OBSOLETE() != m_lengthAndDepth_OBSOLETE.defaultValue())
|
||||
{
|
||||
m_mswParameters->setLengthAndDepth(m_lengthAndDepth_OBSOLETE());
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -166,6 +170,14 @@ void RimFishbonesCollection::appendFishbonesSubs(RimFishbonesMultipleSubs* subs)
|
||||
subs->recomputeLateralLocations();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimFishbonesCollection::mswParameters() const
|
||||
{
|
||||
return m_mswParameters;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -228,6 +240,14 @@ void RimFishbonesCollection::recalculateStartMD()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesCollection::startMD() const
|
||||
{
|
||||
return m_startMD;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -246,41 +266,6 @@ double RimFishbonesCollection::mainBoreDiameter(RiaEclipseUnitTools::UnitSystem
|
||||
return m_mainBoreDiameter();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesCollection::linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::feetToMeter(m_linerDiameter());
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(m_linerDiameter());
|
||||
}
|
||||
return m_linerDiameter();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFishbonesCollection::roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::feetToMeter(m_roughnessFactor());
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(m_roughnessFactor());
|
||||
}
|
||||
return m_roughnessFactor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -294,17 +279,14 @@ void RimFishbonesCollection::setUnitSystemSpecificDefaults()
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
m_mainBoreDiameter = 0.216;
|
||||
m_linerDiameter = 0.152;
|
||||
m_roughnessFactor = 1e-05;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mainBoreDiameter = 0.708;
|
||||
m_linerDiameter = 0.5;
|
||||
m_roughnessFactor = 3.28e-05;
|
||||
}
|
||||
|
||||
m_wellPathCollection->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimMswCompletionParameters.h"
|
||||
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
|
||||
@@ -41,43 +42,25 @@ class RimFishbonesCollection : public RimCheckableNamedObject
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum PressureDropType {
|
||||
HYDROSTATIC,
|
||||
HYDROSTATIC_FRICTION,
|
||||
HYDROSTATIC_FRICTION_ACCELERATION
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<PressureDropType> PressureDropEnum;
|
||||
|
||||
enum LengthAndDepthType {
|
||||
ABS,
|
||||
INC
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<LengthAndDepthType> LengthAndDepthEnum;
|
||||
|
||||
RimFishbonesCollection();
|
||||
|
||||
RimFishboneWellPathCollection* wellPathCollection() const;
|
||||
void appendFishbonesSubs(RimFishbonesMultipleSubs* subs);
|
||||
|
||||
RimFishboneWellPathCollection* wellPathCollection() const;
|
||||
void appendFishbonesSubs(RimFishbonesMultipleSubs* subs);
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
caf::PdmChildArrayField<RimFishbonesMultipleSubs*> fishbonesSubs;
|
||||
|
||||
void recalculateStartMD();
|
||||
double startMD() const { return m_startMD; }
|
||||
double startMD() const;
|
||||
double mainBoreSkinFactor() const { return m_skinFactor; }
|
||||
double mainBoreDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
double linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
double roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
|
||||
PressureDropEnum pressureDrop() const { return m_pressureDrop(); }
|
||||
LengthAndDepthEnum lengthAndDepth() const { return m_lengthAndDepth(); }
|
||||
|
||||
double mainBoreDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
void setUnitSystemSpecificDefaults();
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
virtual void initAfterRead() override;
|
||||
|
||||
private:
|
||||
cvf::Color3f nextFishbonesColor() const;
|
||||
@@ -88,11 +71,12 @@ private:
|
||||
caf::PdmField<double> m_startMD;
|
||||
caf::PdmField<double> m_skinFactor;
|
||||
caf::PdmField<double> m_mainBoreDiameter;
|
||||
caf::PdmField<double> m_linerDiameter;
|
||||
caf::PdmField<double> m_roughnessFactor;
|
||||
|
||||
caf::PdmField<PressureDropEnum> m_pressureDrop;
|
||||
caf::PdmField<LengthAndDepthEnum> m_lengthAndDepth;
|
||||
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RimMswCompletionParameters.h"
|
||||
|
||||
#include "RimWellPath.h"
|
||||
|
||||
|
||||
namespace caf {
|
||||
template<>
|
||||
void RimMswCompletionParameters::PressureDropEnum::setUp()
|
||||
{
|
||||
addItem(RimMswCompletionParameters::HYDROSTATIC, "H--", "Hydrostatic");
|
||||
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION, "HF-", "Hydrostatic + Friction");
|
||||
addItem(RimMswCompletionParameters::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
|
||||
setDefault(RimMswCompletionParameters::HYDROSTATIC);
|
||||
}
|
||||
|
||||
template<>
|
||||
void RimMswCompletionParameters::LengthAndDepthEnum::setUp()
|
||||
{
|
||||
addItem(RimMswCompletionParameters::INC, "INC", "Incremental");
|
||||
addItem(RimMswCompletionParameters::ABS, "ABS", "Absolute");
|
||||
setDefault(RimMswCompletionParameters::INC);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimMswCompletionParameters, "RimMswCompletionParameters");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters::RimMswCompletionParameters()
|
||||
{
|
||||
CAF_PDM_InitObject("MSW Completion Parameters", ":/CompletionsSymbol16x16.png", "", "");
|
||||
CAF_PDM_InitField(&m_linerDiameter, "LinerDiameter", std::numeric_limits<double>::infinity(), "Liner Inner Diameter", "", "", "");
|
||||
CAF_PDM_InitField(&m_roughnessFactor, "RoughnessFactor", std::numeric_limits<double>::infinity(), "Roughness Factor", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_pressureDrop, "PressureDrop", "Pressure Drop", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters::~RimMswCompletionParameters()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimMswCompletionParameters::linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::feetToMeter(m_linerDiameter());
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(m_linerDiameter());
|
||||
}
|
||||
return m_linerDiameter();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimMswCompletionParameters::defaultLinerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||
{
|
||||
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return 0.152;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimMswCompletionParameters::roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfTypeAsserted(wellPath);
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD && unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return RiaEclipseUnitTools::feetToMeter(m_roughnessFactor());
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC && unitSystem == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
return RiaEclipseUnitTools::meterToFeet(m_roughnessFactor());
|
||||
}
|
||||
return m_roughnessFactor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimMswCompletionParameters::defaultRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||
{
|
||||
if (unitSystem == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
return 1.0e-5;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 3.28e-5;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters::PressureDropEnum RimMswCompletionParameters::pressureDrop() const
|
||||
{
|
||||
return m_pressureDrop();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimMswCompletionParameters::LengthAndDepthEnum RimMswCompletionParameters::lengthAndDepth() const
|
||||
{
|
||||
return m_lengthAndDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::setLinerDiameter(double diameter)
|
||||
{
|
||||
m_linerDiameter = diameter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::setRoughnessFactor(double roughnessFactor)
|
||||
{
|
||||
m_roughnessFactor = roughnessFactor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::setPressureDrop(PressureDropType pressureDropType)
|
||||
{
|
||||
m_pressureDrop = pressureDropType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::setLengthAndDepth(LengthAndDepthType lengthAndDepthType)
|
||||
{
|
||||
m_lengthAndDepth = lengthAndDepthType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_METRIC)
|
||||
{
|
||||
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [m]");
|
||||
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [m]");
|
||||
}
|
||||
else if (wellPath->unitSystem() == RiaEclipseUnitTools::UNITS_FIELD)
|
||||
{
|
||||
m_linerDiameter.uiCapability()->setUiName("Liner Inner Diameter [ft]");
|
||||
m_roughnessFactor.uiCapability()->setUiName("Roughness Factor [ft]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_linerDiameter);
|
||||
uiOrdering.add(&m_roughnessFactor);
|
||||
uiOrdering.add(&m_pressureDrop);
|
||||
uiOrdering.add(&m_lengthAndDepth);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::initAfterRead()
|
||||
{
|
||||
if (m_linerDiameter() == std::numeric_limits<double>::infinity() &&
|
||||
m_roughnessFactor() == std::numeric_limits<double>::infinity())
|
||||
{
|
||||
setUnitSystemSpecificDefaults();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimMswCompletionParameters::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
RimWellPath* wellPath;
|
||||
firstAncestorOrThisOfType(wellPath);
|
||||
if (wellPath)
|
||||
{
|
||||
m_linerDiameter = defaultLinerDiameter(wellPath->unitSystem());
|
||||
m_roughnessFactor = defaultRoughnessFactor(wellPath->unitSystem());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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 "RiaEclipseUnitTools.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmUiGroup.h"
|
||||
|
||||
class RimMswCompletionParameters : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
enum PressureDropType {
|
||||
HYDROSTATIC,
|
||||
HYDROSTATIC_FRICTION,
|
||||
HYDROSTATIC_FRICTION_ACCELERATION
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<PressureDropType> PressureDropEnum;
|
||||
|
||||
enum LengthAndDepthType {
|
||||
ABS,
|
||||
INC
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<LengthAndDepthType> LengthAndDepthEnum;
|
||||
|
||||
RimMswCompletionParameters();
|
||||
~RimMswCompletionParameters();
|
||||
|
||||
double linerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
static double defaultLinerDiameter(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
double roughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
static double defaultRoughnessFactor(RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||
PressureDropEnum pressureDrop() const;
|
||||
LengthAndDepthEnum lengthAndDepth() const;
|
||||
void setLinerDiameter(double diameter);
|
||||
void setRoughnessFactor(double roughnessFactor);
|
||||
void setPressureDrop(PressureDropType pressureDropType);
|
||||
void setLengthAndDepth(LengthAndDepthType lengthAndDepthType);
|
||||
|
||||
|
||||
void setUnitSystemSpecificDefaults();
|
||||
|
||||
protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void initAfterRead() override;
|
||||
|
||||
private:
|
||||
caf::PdmField<double> m_linerDiameter;
|
||||
caf::PdmField<double> m_roughnessFactor;
|
||||
|
||||
caf::PdmField<PressureDropEnum> m_pressureDrop;
|
||||
caf::PdmField<LengthAndDepthEnum> m_lengthAndDepth;
|
||||
};
|
||||
@@ -119,6 +119,7 @@ bool RimWellPathCompletions::hasCompletions() const
|
||||
void RimWellPathCompletions::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_fishbonesCollection->setUnitSystemSpecificDefaults();
|
||||
m_fractureCollection->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -24,6 +24,15 @@
|
||||
#include "cafPdmObject.h"
|
||||
|
||||
|
||||
namespace caf {
|
||||
template<>
|
||||
void RimWellPathFractureCollection::ReferenceMDEnum::setUp()
|
||||
{
|
||||
addItem(RimWellPathFractureCollection::AUTO_REFERENCE_MD, "GridIntersectionRefMD", "Use depth where the well path meets grid");
|
||||
addItem(RimWellPathFractureCollection::MANUAL_REFERENCE_MD, "ManualRefMD", "Set Manually");
|
||||
setDefault(RimWellPathFractureCollection::AUTO_REFERENCE_MD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathFractureCollection, "WellPathFractureCollection");
|
||||
@@ -40,6 +49,11 @@ RimWellPathFractureCollection::RimWellPathFractureCollection(void)
|
||||
|
||||
setName("Fractures");
|
||||
nameField()->uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_refMDType, "RefMDType", "Reference Depth", "", "", "");
|
||||
CAF_PDM_InitField(&m_refMD, "RefMD", 0.0, "Reference MD", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_mswParameters, "MswParameters", "Multi Segment Well Parameters", "", "", "");
|
||||
m_mswParameters = new RimMswCompletionParameters;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -49,6 +63,14 @@ RimWellPathFractureCollection::~RimWellPathFractureCollection()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimMswCompletionParameters* RimWellPathFractureCollection::mswParameters() const
|
||||
{
|
||||
return m_mswParameters;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -57,6 +79,48 @@ void RimWellPathFractureCollection::deleteFractures()
|
||||
fractures.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFractureCollection::setUnitSystemSpecificDefaults()
|
||||
{
|
||||
m_mswParameters->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathFractureCollection::ReferenceMDType RimWellPathFractureCollection::referenceMDType() const
|
||||
{
|
||||
return m_refMDType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathFractureCollection::manualReferenceMD() const
|
||||
{
|
||||
if (m_refMDType == AUTO_REFERENCE_MD)
|
||||
{
|
||||
return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
return m_refMD;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFractureCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
caf::PdmUiGroup* mswGroup = uiOrdering.addNewGroup("Multi Segment Well Properties");
|
||||
|
||||
mswGroup->add(&m_refMDType);
|
||||
mswGroup->add(&m_refMD);
|
||||
m_refMD.uiCapability()->setUiHidden(m_refMDType == AUTO_REFERENCE_MD);
|
||||
|
||||
m_mswParameters->uiOrdering(uiConfigName, *mswGroup);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimMswCompletionParameters.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
@@ -33,16 +35,34 @@ class RimWellPathFracture;
|
||||
class RimWellPathFractureCollection : public RimCheckableNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum ReferenceMDType
|
||||
{
|
||||
AUTO_REFERENCE_MD = 0,
|
||||
MANUAL_REFERENCE_MD
|
||||
};
|
||||
|
||||
typedef caf::AppEnum<ReferenceMDType> ReferenceMDEnum;
|
||||
|
||||
RimWellPathFractureCollection(void);
|
||||
virtual ~RimWellPathFractureCollection(void);
|
||||
|
||||
void deleteFractures();
|
||||
const RimMswCompletionParameters* mswParameters() const;
|
||||
void deleteFractures();
|
||||
void setUnitSystemSpecificDefaults();
|
||||
ReferenceMDType referenceMDType() const;
|
||||
double manualReferenceMD() const;
|
||||
|
||||
public:
|
||||
caf::PdmChildArrayField<RimWellPathFracture*> fractures;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
caf::PdmField<ReferenceMDEnum> m_refMDType;
|
||||
caf::PdmField<double> m_refMD;
|
||||
caf::PdmChildField<RimMswCompletionParameters*> m_mswParameters;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user