//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- double RimSimWellInView::pipeRadius() { RimEclipseView* reservoirView; firstAncestorOrThisOfTypeAsserted(reservoirView); RigEclipseCaseData* rigReservoir = reservoirView->eclipseCase()->eclipseCaseData(); double characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize(); double pipeRadius = reservoirView->wellCollection()->pipeScaleFactor() * this->pipeScaleFactor() * characteristicCellSize; return pipeRadius; }
//-------------------------------------------------------------------------------------------------- /// frameIndex = -1 will use the static well frame //-------------------------------------------------------------------------------------------------- void RimSimWellInView::wellHeadTopBottomPosition(int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom) { RimEclipseView* m_rimReservoirView; firstAncestorOrThisOfTypeAsserted(m_rimReservoirView); RigEclipseCaseData* rigReservoir = m_rimReservoirView->eclipseCase()->eclipseCaseData(); const RigWellResultFrame* wellResultFramePtr = nullptr; const RigCell* whCellPtr = nullptr; if (frameIndex >= 0) { if ( !this->simWellData()->hasAnyValidCells(frameIndex) ) return; wellResultFramePtr = &(this->simWellData()->wellResultFrame(frameIndex)); whCellPtr = &(rigReservoir->cellFromWellResultCell(wellResultFramePtr->wellHeadOrStartCell())); } else { wellResultFramePtr = &(this->simWellData()->staticWellCells()); whCellPtr = &(rigReservoir->cellFromWellResultCell(wellResultFramePtr->wellHeadOrStartCell())); } const RigWellResultFrame& wellResultFrame = *wellResultFramePtr; const RigCell& whCell = *whCellPtr; // Match this position with pipe start position in RivWellPipesPartMgr::calculateWellPipeCenterline() (*bottom) = whCell.faceCenter(cvf::StructGridInterface::NEG_K); // Compute well head based on the z position of the top of the K column the well head is part of (*top) = (*bottom); if ( m_rimReservoirView->wellCollection()->wellHeadPosition() == RimSimWellInViewCollection::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 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); // Modify position if top active cell is closer to sea than well head if ( kIndexWellHeadCell > k ) { top->z() = topCellPos.z(); } } else { // Position well head at top of active cells bounding box cvf::Vec3d activeCellsBoundingBoxMax = m_rimReservoirView->currentActiveCellInfo()->geometryBoundingBox().max(); top->z() = activeCellsBoundingBoxMax.z(); } }