#3014 and #3022 Well Bore Stability: LAS and element table input and cleaned up extraction code.

This commit is contained in:
Gaute Lindkvist
2018-09-03 11:24:35 +02:00
parent b4e2a58327
commit 4c84bbb8a3
11 changed files with 392 additions and 59 deletions

View File

@@ -45,6 +45,7 @@
#include "RimTools.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellPath.h"
#include "cafUtils.h"
@@ -220,6 +221,9 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep(std::vector<double
else if (geomExtractor.notNull())
{
*measuredDepthValues = geomExtractor->measuredDepth();
RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles(wellPath, geomExtractor.p());
m_geomResultDefinition->loadResult();
geomExtractor->setRkbDiff(rkbDiff());
geomExtractor->curveData(m_geomResultDefinition->resultAddress(), timeStep, values);

View File

@@ -47,11 +47,14 @@
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellLogCurve.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPlotTools.h"
#include "RiuLineSegmentQwtPlotCurve.h"
#include "RiuWellLogTrack.h"
@@ -396,8 +399,11 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
measuredDepthValues = geomExtractor->measuredDepth();
tvDepthValues = geomExtractor->trueVerticalDepth();
m_geomResultDefinition->loadResult();
findAndLoadWbsParametersFromLasFiles(m_wellPath(), geomExtractor.p());
geomExtractor->setRkbDiff(rkbDiff());
m_geomResultDefinition->loadResult();
geomExtractor->curveData(m_geomResultDefinition->resultAddress(), m_timeStep, &values);
}
@@ -462,6 +468,43 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate(bool updateParentPlot)
}
}
//--------------------------------------------------------------------------------------------------
/// Search well path for LAS-files containing Well Bore Stability data and set them in the extractor.
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles(const RimWellPath* wellPath, RigGeoMechWellLogExtractor* geomExtractor)
{
std::vector<std::pair<double, double>> logFileMudWeights = RimWellLogFile::findMdAndChannelValuesForWellPath(wellPath, "PP");
if (!logFileMudWeights.empty())
{
// Log file pressures come in SG units (g / cm^3).
// We need SI as input (kg / m^3), so multiply by 1000:
for (auto& mudWeight : logFileMudWeights)
{
mudWeight.second *= 1000.0;
}
geomExtractor->setWellLogMdAndMudWeightKgPerM3(logFileMudWeights);
}
std::vector<std::pair<double, double>> logFileUcs = RimWellLogFile::findMdAndChannelValuesForWellPath(wellPath, "UCS");
if (!logFileUcs.empty())
{
// TODO: UCS is typically in MPa, but not necessarily.
// We need to at least give a warning if the units don't match
// ... and preferable do a conversion.
for (auto& ucsValue : logFileUcs)
{
ucsValue.second *= 10.0; // MPa -> Bar
}
geomExtractor->setWellLogMdAndUcsBar(logFileUcs);
}
std::vector<std::pair<double, double>> logFilePoissonRatio = RimWellLogFile::findMdAndChannelValuesForWellPath(wellPath, "POISSON_RATIO");
if (!logFilePoissonRatio.empty())
{
geomExtractor->setWellLogMdAndPoissonRatio(logFilePoissonRatio);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -26,6 +26,7 @@
#include "cafPdmPtrField.h"
#include "cafPdmChildField.h"
class RigGeoMechWellLogExtractor;
class RigWellPath;
class RimCase;
class RimEclipseResultDefinition;
@@ -78,6 +79,7 @@ public:
void setBranchDetection(bool branchDetection);
void setBranchIndex(int index);
static void findAndLoadWbsParametersFromLasFiles(const RimWellPath* wellPath, RigGeoMechWellLogExtractor* geomExtractor);
protected:
virtual QString createCurveAutoName() override;
virtual void onLoadDataAndUpdate(bool updateParentPlot) override;

View File

@@ -259,6 +259,33 @@ void RimWellLogFile::updateFilePathsFromProjectPath(const QString& newProjectPat
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::pair<double, double>> RimWellLogFile::findMdAndChannelValuesForWellPath(const RimWellPath* wellPath, const QString& channelName)
{
CVF_ASSERT(wellPath);
std::vector<RimWellLogFile*> wellLogFiles;
wellPath->descendantsIncludingThisOfType(wellLogFiles);
for (RimWellLogFile* wellLogFile : wellLogFiles)
{
RigWellLogFile* fileData = wellLogFile->wellLogFileData();
std::vector<double> channelValues = fileData->values(channelName);
if (!channelValues.empty())
{
std::vector<double> depthValues = fileData->depthValues();
CVF_ASSERT(depthValues.size() == channelValues.size());
std::vector<std::pair<double, double>> depthValuePairs;
for (size_t i = 0; i < depthValues.size(); ++i)
{
depthValuePairs.push_back(std::make_pair(depthValues[i], channelValues[i]));
}
return depthValuePairs;
}
}
return std::vector<std::pair<double, double>>();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -31,6 +31,7 @@
class RimWellLogFileChannel;
class RimWellPath;
class QString;
@@ -74,6 +75,8 @@ public:
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
static std::vector<std::pair<double, double>> findMdAndChannelValuesForWellPath(const RimWellPath* wellPath, const QString& channelName);
private:
virtual void setupBeforeSave() override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;