#2150 Fracture : Duplicate fracture geometry for along well pipe fractures

This commit is contained in:
Magne Sjaastad 2018-01-17 08:57:34 +01:00
parent 673ae6b1ff
commit 1523ce55f0

View File

@ -393,14 +393,12 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart(const RimE
cvf::Mat4d frMx = m_rimFracture->transformMatrix(); cvf::Mat4d frMx = m_rimFracture->transformMatrix();
cvf::BoundingBox frBBox; cvf::BoundingBox frBBox;
std::vector<cvf::Vec3d> borderPolygonGlobCs;
std::vector<cvf::Vec3d> borderPolygonLocalCsd; std::vector<cvf::Vec3d> borderPolygonLocalCsd;
for (const auto& pv: borderPolygonLocalCS) for (const auto& pv: borderPolygonLocalCS)
{ {
cvf::Vec3d pvd(pv); cvf::Vec3d pvd(pv);
borderPolygonLocalCsd.push_back(pvd); borderPolygonLocalCsd.push_back(pvd);
pvd.transformPoint(frMx); pvd.transformPoint(frMx);
borderPolygonGlobCs.push_back(pvd);
frBBox.add(pvd); frBBox.add(pvd);
} }
@ -437,7 +435,6 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart(const RimE
} }
cvf::Vec3d fractureNormal = cvf::Vec3d(frMx.col(2)); cvf::Vec3d fractureNormal = cvf::Vec3d(frMx.col(2));
cvf::Vec3d maskOffset = fractureNormal * 0.01 * frBBox.radius();
for (const std::vector<cvf::Vec3d>& eclCellPolygon : eclCellPolygons) for (const std::vector<cvf::Vec3d>& eclCellPolygon : eclCellPolygons)
{ {
// Clip Eclipse cell polygon with fracture border // Clip Eclipse cell polygon with fracture border
@ -469,12 +466,7 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createContainmentMaskPart(const RimE
for (size_t idx: triangleIndices) for (size_t idx: triangleIndices)
{ {
maskTriangles.push_back( cvf::Vec3f( displCoordTrans->transformToDisplayCoord(clippedPolygon[idx] + maskOffset)) ); maskTriangles.push_back( cvf::Vec3f( displCoordTrans->transformToDisplayCoord(clippedPolygon[idx]) ) );
}
for (size_t idx: triangleIndices)
{
maskTriangles.push_back( cvf::Vec3f( displCoordTrans->transformToDisplayCoord(clippedPolygon[idx] - maskOffset)) );
} }
} }
} }
@ -677,32 +669,35 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
if (part.notNull()) parts.push_back(part.p()); if (part.notNull()) parts.push_back(part.p());
} }
double offsetDistanceToCenterLine = 1.0; double distanceToCenterLine = 1.0;
{ {
RimWellPathCollection* wellPathColl = nullptr; RimWellPathCollection* wellPathColl = nullptr;
m_rimFracture->firstAncestorOrThisOfType(wellPathColl); m_rimFracture->firstAncestorOrThisOfType(wellPathColl);
if (wellPathColl) if (wellPathColl)
{ {
offsetDistanceToCenterLine = wellPathColl->wellPathRadiusScaleFactor() * characteristicCellSize; distanceToCenterLine = wellPathColl->wellPathRadiusScaleFactor() * characteristicCellSize;
} }
RimSimWellInView* simWell = nullptr; RimSimWellInView* simWell = nullptr;
m_rimFracture->firstAncestorOrThisOfType(simWell); m_rimFracture->firstAncestorOrThisOfType(simWell);
if (simWell) if (simWell)
{ {
offsetDistanceToCenterLine = simWell->pipeRadius(); distanceToCenterLine = simWell->pipeRadius();
} }
} }
// Make sure the distance is slightly smaller than the pipe radius to make the pipe is visible through the fracture // Make sure the distance is slightly smaller than the pipe radius to make the pipe is visible through the fracture
offsetDistanceToCenterLine *= 0.7; distanceToCenterLine *= 0.1;
auto fractureMatrix = m_rimFracture->transformMatrix(); auto fractureMatrix = m_rimFracture->transformMatrix();
cvf::Vec3d fractureNormal = offsetDistanceToCenterLine * cvf::Vec3d(fractureMatrix.col(2));
if (m_rimFracture->fractureTemplate() && m_rimFracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
{
cvf::Vec3d partTranslation = distanceToCenterLine * cvf::Vec3d(fractureMatrix.col(2));
{ {
cvf::Mat4d m = cvf::Mat4d::fromTranslation(fractureNormal); cvf::Mat4d m = cvf::Mat4d::fromTranslation(partTranslation);
cvf::ref<cvf::Transform> partTransform = new cvf::Transform; cvf::ref<cvf::Transform> partTransform = new cvf::Transform;
partTransform->setLocalTransform(m); partTransform->setLocalTransform(m);
@ -715,7 +710,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
} }
{ {
cvf::Mat4d m = cvf::Mat4d::fromTranslation(-fractureNormal); cvf::Mat4d m = cvf::Mat4d::fromTranslation(-partTranslation);
cvf::ref<cvf::Transform> partTransform = new cvf::Transform; cvf::ref<cvf::Transform> partTransform = new cvf::Transform;
partTransform->setLocalTransform(m); partTransform->setLocalTransform(m);
@ -728,18 +723,33 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
model->addPart(part.p()); model->addPart(part.p());
} }
} }
}
else
{
for (auto& part : parts)
{
model->addPart(part.p());
}
}
if (m_rimFracture->fractureTemplate()->fractureContainment()->isEnabled()) if (m_rimFracture->fractureTemplate()->fractureContainment()->isEnabled())
{ {
// Position the containment mask outside the fracture parts // Position the containment mask outside the fracture parts
// Always duplicate the containment mask parts
auto originalPart = createContainmentMaskPart(eclView); auto originalPart = createContainmentMaskPart(eclView);
if (originalPart.notNull()) if (originalPart.notNull())
{ {
auto containmentPartNormal = 1.5 * fractureNormal; double scaleFactor = 0.03;
if (m_rimFracture->fractureTemplate() && m_rimFracture->fractureTemplate()->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
{
scaleFactor = 1.5 * distanceToCenterLine;
}
cvf::Vec3d partTranslation = scaleFactor * cvf::Vec3d(fractureMatrix.col(2));
{ {
cvf::Mat4d m = cvf::Mat4d::fromTranslation(containmentPartNormal); cvf::Mat4d m = cvf::Mat4d::fromTranslation(partTranslation);
cvf::ref<cvf::Transform> partTransform = new cvf::Transform; cvf::ref<cvf::Transform> partTransform = new cvf::Transform;
partTransform->setLocalTransform(m); partTransform->setLocalTransform(m);
@ -749,7 +759,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
} }
{ {
cvf::Mat4d m = cvf::Mat4d::fromTranslation(-containmentPartNormal); cvf::Mat4d m = cvf::Mat4d::fromTranslation(-partTranslation);
cvf::ref<cvf::Transform> partTransform = new cvf::Transform; cvf::ref<cvf::Transform> partTransform = new cvf::Transform;
partTransform->setLocalTransform(m); partTransform->setLocalTransform(m);