#3160 Use cell centre depth for well bore stability curves

This commit is contained in:
Gaute Lindkvist 2018-07-10 12:45:32 +02:00
parent 06e3ca238a
commit be63eb5aef
2 changed files with 25 additions and 3 deletions

View File

@ -165,6 +165,7 @@ void RigGeoMechWellLogExtractor::wellPathScaledCurveData(const RigFemResultAddre
CVF_ASSERT(values);
const RigFemPart* femPart = m_caseData->femParts()->part(0);
const RigFemPartGrid* femPartGrid = femPart->structGrid();
const std::vector<cvf::Vec3f>& nodeCoords = femPart->nodes().coordinates;
RigFemPartResultsCollection* resultCollection = m_caseData->femPartResults();
@ -199,7 +200,11 @@ void RigGeoMechWellLogExtractor::wellPathScaledCurveData(const RigFemResultAddre
if (!(elmType == HEX8 || elmType == HEX8P)) continue;
double trueVerticalDepth = -m_intersections[intersectionIdx].z();
const int* elmNodeIndices = femPart->connectivities(elmIdx);
cvf::Vec3f centroid = cellCentroid(elmNodeIndices, nodeCoords);
double trueVerticalDepth = -centroid.z();
double effectiveDepth = trueVerticalDepth + m_rkbDiff;
double hydroStaticPorePressure = effectiveDepth * 9.81 / 100.0;
@ -259,7 +264,10 @@ void RigGeoMechWellLogExtractor::wellBoreWallCurveData(const RigFemResultAddress
if (!(elmType == HEX8 || elmType == HEX8P)) continue;
double trueVerticalDepth = -m_intersections[intersectionIdx].z();
const int* elmNodeIndices = femPart->connectivities(elmIdx);
cvf::Vec3f centroid = cellCentroid(elmNodeIndices, nodeCoords);
double trueVerticalDepth = -centroid.z();
double porePressure = trueVerticalDepth * 9.81 / 100.0;
if (!porePressures.empty())
{
@ -287,7 +295,7 @@ void RigGeoMechWellLogExtractor::wellBoreWallCurveData(const RigFemResultAddress
CVF_ASSERT(resAddr.fieldName == RiaDefines::wellPathSFGResultName().toStdString());
resultValue = sigmaCalculator.solveStassiDalia();
}
double effectiveDepth = -m_intersections[intersectionIdx].z() + m_rkbDiff;
double effectiveDepth = trueVerticalDepth + m_rkbDiff;
if (effectiveDepth > 1.0e-8)
{
resultValue *= 100.0 / (effectiveDepth * 9.81);
@ -545,3 +553,16 @@ caf::Ten3d RigGeoMechWellLogExtractor::transformTensorToWellPathOrientation(cons
return tensor.rotated(rotationMatrix.toMatrix3());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3f RigGeoMechWellLogExtractor::cellCentroid(const int* elmNodeIndices, const std::vector<cvf::Vec3f>& nodeCoords)
{
cvf::Vec3f centroid(0.0, 0.0, 0.0);
for (int i = 0; i < 8; ++i)
{
centroid += nodeCoords[elmNodeIndices[i]];
}
return centroid / 8.0;
}

View File

@ -69,6 +69,7 @@ private:
static caf::Ten3d transformTensorToWellPathOrientation(const cvf::Vec3d& wellPathTangent,
const caf::Ten3d& wellPathTensor);
static cvf::Vec3f cellCentroid(const int* elmNodeIndices, const std::vector<cvf::Vec3f>& nodeCoords);
cvf::ref<RigGeoMechCaseData> m_caseData;
double m_rkbDiff;
};