mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Wellcollection can control if well head label is positioned at top active cell for IJ column or top Z of active cells bounding box
p4#: 22190
This commit is contained in:
@@ -110,18 +110,44 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
||||
|
||||
// Compute well head based on the z position of the top of the K column the well head is part of
|
||||
cvf::Vec3d whEndPos = whStartPos;
|
||||
|
||||
if (m_rimReservoirView->wellCollection()->wellHeadPosition() == RimWellCollection::WELLHEAD_POS_TOP_COLUMN)
|
||||
{
|
||||
// Position well head at top active cell of IJ-column
|
||||
|
||||
size_t i, j, k;
|
||||
rigReservoir->mainGrid()->ijkFromCellIndex(whCell.mainGridCellIndex(), &i, &j, &k);
|
||||
size_t topCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, 0);
|
||||
|
||||
const RigCell& topCell = rigReservoir->mainGrid()->cell(topCellIndex);
|
||||
|
||||
cvf::Vec3d topCellPos = topCell.faceCenter(cvf::StructGridInterface::NEG_K);
|
||||
size_t kIndexWellHeadCell = k;
|
||||
k = 0;
|
||||
|
||||
size_t topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
|
||||
while(k < kIndexWellHeadCell && !m_rimReservoirView->currentActiveCellInfo()->isActive(topActiveCellIndex))
|
||||
{
|
||||
k++;
|
||||
topActiveCellIndex = rigReservoir->mainGrid()->cellIndexFromIJK(i, j, k);
|
||||
}
|
||||
|
||||
const RigCell& topActiveCell = rigReservoir->mainGrid()->cell(topActiveCellIndex);
|
||||
cvf::Vec3d topCellPos = topActiveCell.faceCenter(cvf::StructGridInterface::NEG_K);
|
||||
topCellPos -= rigReservoir->mainGrid()->displayModelOffset();
|
||||
topCellPos.transformPoint(m_scaleTransform->worldTransform());
|
||||
|
||||
whEndPos.z() = topCellPos.z();
|
||||
// Modify position if top active cell is closer to sea than well head
|
||||
if (kIndexWellHeadCell > k)
|
||||
{
|
||||
whEndPos.z() = topCellPos.z() + characteristicCellSize;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Position well head at top of active cells bounding box
|
||||
|
||||
cvf::Vec3d activeCellsBoundingBoxMax = m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max();
|
||||
activeCellsBoundingBoxMax -= rigReservoir->mainGrid()->displayModelOffset();
|
||||
activeCellsBoundingBoxMax.transformPoint(m_scaleTransform->worldTransform());
|
||||
|
||||
whEndPos.z() = activeCellsBoundingBoxMax.z();
|
||||
}
|
||||
|
||||
cvf::Vec3d arrowPosition = whEndPos;
|
||||
|
||||
Reference in New Issue
Block a user