#3631 Well Path Export. Use RKB for modeled well paths

This commit is contained in:
Bjørn Erik Jensen
2018-11-06 11:23:19 +01:00
parent eaec135019
commit 886487f45d
5 changed files with 31 additions and 15 deletions

View File

@@ -101,7 +101,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
EXP::writeWellPathGeometryToStream(*stream, &geometry, lateralName, mdStepSize);
EXP::writeWellPathGeometryToStream(*stream, wellPath, lateralName, mdStepSize);
}
}
}

View File

@@ -28,6 +28,8 @@
#include "RigWellPath.h"
#include "RimWellPath.h"
#include "RimModeledWellPath.h"
#include "RimWellPathGeometryDef.h"
#include "RimProject.h"
#include "RimDialogData.h"
@@ -57,7 +59,7 @@ void RicExportSelectedWellPathsFeature::exportWellPath(const RimWellPath* wellPa
auto filePtr = openFileForExport(folder, fileName);
auto stream = createOutputFileStream(*filePtr);
writeWellPathGeometryToStream(*stream, wellPath->wellPathGeometry(), wellPath->name(), mdStepSize, writeProjectInfo);
writeWellPathGeometryToStream(*stream, wellPath, wellPath->name(), mdStepSize, writeProjectInfo);
filePtr->close();
}
@@ -65,13 +67,16 @@ void RicExportSelectedWellPathsFeature::exportWellPath(const RimWellPath* wellPa
///
//--------------------------------------------------------------------------------------------------
void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStream& stream,
const RigWellPath* geometry,
const QString& wellName,
const RimWellPath* wellPath,
const QString& exportName,
double mdStepSize,
bool writeProjectInfo)
{
double currMd = geometry->measureDepths().front() - mdStepSize;
double endMd = geometry->measureDepths().back();
auto wellPathGeom = wellPath->wellPathGeometry();
if (!wellPathGeom) return;
double currMd = wellPathGeom->measureDepths().front() - mdStepSize;
double endMd = wellPathGeom->measureDepths().back();
RifEclipseDataTableFormatter formatter(stream);
formatter.setCommentPrefix("#");
@@ -83,15 +88,26 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
stream << endl;
}
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(wellName) << "'" << endl;
bool useMdRkb = false;
double rkb = 0.0;
{
const RimModeledWellPath* modeledWellPath = dynamic_cast<const RimModeledWellPath*>(wellPath);
if (modeledWellPath)
{
useMdRkb = true;
rkb = modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
}
}
stream << "WELLNAME: '" << caf::Utils::makeValidFileBasename(exportName) << "'" << endl;
auto numberFormat = RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 2);
formatter.header(
{
{"X", numberFormat, RIGHT},
{"Y", numberFormat, RIGHT},
{"TVD", numberFormat, RIGHT},
{"MD", numberFormat, RIGHT}
{"TVDMSL", numberFormat, RIGHT},
{useMdRkb ? "MDRKB" : "MDMSL", numberFormat, RIGHT}
});
while (currMd < endMd)
@@ -99,14 +115,14 @@ void RicExportSelectedWellPathsFeature::writeWellPathGeometryToStream(QTextStrea
currMd += mdStepSize;
if (currMd > endMd) currMd = endMd;
auto pt = geometry->interpolatedPointAlongWellPath(currMd);
auto pt = wellPathGeom->interpolatedPointAlongWellPath(currMd);
double tvd = -pt.z();
// Write to file
formatter.add(pt.x());
formatter.add(pt.y());
formatter.add(tvd);
formatter.add(currMd);
formatter.add(currMd + rkb);
formatter.rowCompleted("");
}
formatter.tableCompleted("", false);

View File

@@ -52,8 +52,8 @@ class RicExportSelectedWellPathsFeature : public caf::CmdFeature
static QFilePtr openFileForExport(const QString& folderName, const QString& fileName);
static QTextStreamPtr createOutputFileStream(QFile& file);
static void writeWellPathGeometryToStream(QTextStream& stream,
const RigWellPath* geometry,
const QString& wellName,
const RimWellPath* wellPath,
const QString& exportName,
double mdStepSize,
bool writeProjectInfo = true);

View File

@@ -113,7 +113,7 @@ void RimModeledWellPath::scheduleUpdateOfDependentVisualization()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathGeometryDef* RimModeledWellPath::geometryDefinition()
RimWellPathGeometryDef* RimModeledWellPath::geometryDefinition() const
{
return m_geometryDefinition;
}

View File

@@ -36,7 +36,7 @@ public:
void createWellPathGeometry();
void updateWellPathVisualization();
void scheduleUpdateOfDependentVisualization();
RimWellPathGeometryDef* geometryDefinition();
RimWellPathGeometryDef* geometryDefinition() const;
QString wellPlanText();
private: