#1518 Add option to chose between absolute or incremental calculations of length and depth when exporting completion data

This commit is contained in:
Bjørnar Grip Fjær 2017-05-23 15:51:07 +02:00
parent dbc775e6c2
commit bb8483a98b
3 changed files with 50 additions and 5 deletions

View File

@ -275,7 +275,7 @@ void RicWellPathExportCompletionDataFeature::generateWelsegsTable(RifEclipseOutp
formatter.add(firstLocation.trueVerticalDepth);
formatter.add(firstLocation.measuredDepth);
formatter.add("1*");
formatter.add("INC");
formatter.add(settings.lengthAndDepth().text());
formatter.add(settings.pressureDrop().text());
formatter.rowCompleted();
@ -298,16 +298,31 @@ void RicWellPathExportCompletionDataFeature::generateWelsegsTable(RifEclipseOutp
{
WellSegmentLocation previousLocation = firstLocation;
formatter.comment("Main stem");
double depth = 0;
double length = 0;
for (size_t i = 0; i < locations.size(); ++i)
{
const WellSegmentLocation& location = locations[i];
if (settings.lengthAndDepth() == RimExportCompletionDataSettings::INC)
{
depth = location.trueVerticalDepth - previousLocation.trueVerticalDepth;
length = location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex];
}
else
{
depth += location.trueVerticalDepth - previousLocation.trueVerticalDepth;
length += location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex];
}
formatter.comment(QString("Segment for sub %1").arg(location.subIndex));
formatter.add(location.segmentNumber).add(location.segmentNumber);
formatter.add(1); // All segments on main stem are branch 1
formatter.add(location.segmentNumber - 1); // All main stem segments are connected to the segment below them
formatter.add(location.fishbonesSubs->locationOfSubs()[location.subIndex] - previousLocation.fishbonesSubs->locationOfSubs()[previousLocation.subIndex]);
formatter.add(location.trueVerticalDepth - previousLocation.trueVerticalDepth);
formatter.add(length);
formatter.add(depth);
formatter.add(-1.0); // FIXME : Diam of main stem?
formatter.add(-1.0); // FIXME : Rough of main stem?
formatter.rowCompleted();
@ -326,14 +341,27 @@ void RicWellPathExportCompletionDataFeature::generateWelsegsTable(RifEclipseOutp
{
formatter.comment(QString("%1 : Sub index %2 - Lateral %3").arg(location.fishbonesSubs->name()).arg(location.subIndex).arg(lateral.lateralIndex));
double depth = 0;
double length = 0;
for (const WellSegmentLateralIntersection& intersection : lateral.intersections)
{
if (settings.lengthAndDepth() == RimExportCompletionDataSettings::INC)
{
depth = intersection.depth;
length = intersection.length;
}
else
{
depth += intersection.depth;
length += intersection.length;
}
formatter.add(intersection.segmentNumber);
formatter.add(intersection.segmentNumber);
formatter.add(lateral.branchNumber);
formatter.add(intersection.attachedSegmentNumber);
formatter.add(intersection.length);
formatter.add(intersection.depth);
formatter.add(length);
formatter.add(depth);
formatter.add(location.fishbonesSubs->tubingRadius());
formatter.add(location.fishbonesSubs->openHoleRoughnessFactor());
formatter.rowCompleted();

View File

@ -27,6 +27,14 @@ namespace caf {
addItem(RimExportCompletionDataSettings::HYDROSTATIC_FRICTION_ACCELERATION, "HFA", "Hydrostatic + Friction + Acceleration");
setDefault(RimExportCompletionDataSettings::HYDROSTATIC);
}
template<>
void RimExportCompletionDataSettings::LengthAndDepthEnum::setUp()
{
addItem(RimExportCompletionDataSettings::INC, "INC", "Incremental");
addItem(RimExportCompletionDataSettings::ABS, "ABS", "Absolute");
setDefault(RimExportCompletionDataSettings::INC);
}
}
CAF_PDM_SOURCE_INIT(RimExportCompletionDataSettings, "RimExportCompletionDataSettings");
@ -41,4 +49,5 @@ RimExportCompletionDataSettings::RimExportCompletionDataSettings()
CAF_PDM_InitField(&includeWpimult, "IncludeWPIMULT", true, "Include WPIMLUT", "", "", "");
CAF_PDM_InitField(&removeLateralsInMainBoreCells, "RemoveLateralsInMainBoreCells", false, "Remove Laterals in Main Bore Cells", "", "", "");
CAF_PDM_InitFieldNoDefault(&pressureDrop, "PressureDrop", "Pressure Drop", "", "", "");
CAF_PDM_InitFieldNoDefault(&lengthAndDepth, "LengthAndDepth", "Length and Depth", "", "", "");
}

View File

@ -39,9 +39,17 @@ public:
typedef caf::AppEnum<RimExportCompletionDataSettings::PressureDropType> PressureDropEnum;
enum LengthAndDepthType {
ABS,
INC
};
typedef caf::AppEnum<RimExportCompletionDataSettings::LengthAndDepthType> LengthAndDepthEnum;
RimExportCompletionDataSettings();
caf::PdmField<bool> includeWpimult;
caf::PdmField<bool> removeLateralsInMainBoreCells;
caf::PdmField<PressureDropEnum> pressureDrop;
caf::PdmField<LengthAndDepthEnum> lengthAndDepth;
};