#3095 Add PP, OBG and SH to well path derived extraction curves.

This commit is contained in:
Gaute Lindkvist 2018-06-22 15:30:20 +02:00
parent 6cd5ae9e22
commit fab83846e6
3 changed files with 72 additions and 5 deletions

View File

@ -487,6 +487,9 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
fieldCompNames["Azimuth"];
fieldCompNames["FractureGradient"];
fieldCompNames["Inclination"];
fieldCompNames["PP"];
fieldCompNames["OBG"];
fieldCompNames["SH"];
fieldCompNames["ShearFailureGradient"];
}
}

View File

@ -62,7 +62,12 @@ void RigGeoMechWellLogExtractor::curveData(const RigFemResultAddress& resAddr, i
{
if (resAddr.fieldName == "FractureGradient" || resAddr.fieldName == "ShearFailureGradient")
{
wellPathDerivedCurveData(resAddr, frameIndex, values);
wellBoreWallCurveData(resAddr, frameIndex, values);
return;
}
else if (resAddr.fieldName == "PP" || resAddr.fieldName == "OBG" || resAddr.fieldName == "SH")
{
wellPathScaledCurveData(resAddr, frameIndex, values);
return;
}
else if (resAddr.fieldName == "Azimuth" || resAddr.fieldName == "Inclination")
@ -70,6 +75,7 @@ void RigGeoMechWellLogExtractor::curveData(const RigFemResultAddress& resAddr, i
wellPathAngles(resAddr, values);
return;
}
}
if (!resAddr.isValid()) return;
@ -142,7 +148,64 @@ void RigGeoMechWellLogExtractor::wellPathAngles(const RigFemResultAddress& resAd
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGeoMechWellLogExtractor::wellPathDerivedCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values)
void RigGeoMechWellLogExtractor::wellPathScaledCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values)
{
CVF_ASSERT(values);
const RigFemPart* femPart = m_caseData->femParts()->part(0);
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
RigFemPartResultsCollection* resultCollection = m_caseData->femPartResults();
std::string nativeFieldName;
std::string nativeCompName;
double scalingFactor = 1000 * 9.81 / 1.0e5;
if (resAddr.fieldName == "PP")
{
nativeFieldName = "POR-Bar"; // More likely to be in memory than POR
}
else if (resAddr.fieldName == "OBG")
{
nativeFieldName = "ST";
nativeCompName = "S33";
}
else if (resAddr.fieldName == "SH")
{
nativeFieldName = "ST";
nativeCompName = "S3";
}
RigFemResultAddress nativeAddr(RIG_ELEMENT_NODAL, nativeFieldName, nativeCompName);
std::vector<float> unscaledResult = resultCollection->resultValues(nativeAddr, 0, frameIndex);
values->resize(m_intersections.size(), 0.0f);
#pragma omp parallel for
for (int64_t intersectionIdx = 0; intersectionIdx < (int64_t)m_intersections.size(); ++intersectionIdx)
{
size_t elmIdx = m_intersectedCellsGlobIdx[intersectionIdx];
RigElementType elmType = femPart->elementType(elmIdx);
if (!(elmType == HEX8 || elmType == HEX8P)) continue;
double trueVerticalDepth = -m_intersections[intersectionIdx].z();
double effectiveDepth = trueVerticalDepth + m_rkbDiff;
double hydroStaticPorePressure = effectiveDepth * 9.81 / 100.0;
double unscaledValue = static_cast<double>(interpolateGridResultValue<float>(nativeAddr.resultPosType, unscaledResult, intersectionIdx, false));
if (resAddr.fieldName == "PP" && (unscaledValue == std::numeric_limits<float>::infinity() ||
unscaledValue == -std::numeric_limits<float>::infinity()))
{
unscaledValue = hydroStaticPorePressure;
}
double scaledValue = unscaledValue / (scalingFactor * effectiveDepth);
(*values)[intersectionIdx] = scaledValue;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGeoMechWellLogExtractor::wellBoreWallCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values)
{
// TODO: Read in these values:
const double poissonRatio = 0.25; // TODO: Read this in.

View File

@ -50,12 +50,13 @@ public:
RigGeoMechWellLogExtractor(RigGeoMechCaseData* aCase, const RigWellPath* wellpath, const std::string& wellCaseErrorMsgName);
void curveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values );
void wellPathAngles(const RigFemResultAddress& resAddr, std::vector<double>* values);
void wellPathDerivedCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values);
const RigGeoMechCaseData* caseData();
void setRkbDiff(double rkbDiff);
private:
void wellPathAngles(const RigFemResultAddress& resAddr, std::vector<double>* values);
void wellPathScaledCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values);
void wellBoreWallCurveData(const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values);
template<typename T>
T interpolateGridResultValue(RigFemResultPosEnum resultPosType, const std::vector<T>& gridResultValues, int64_t intersectionIdx, bool averageNodeElementResults) const;