#2482 Add wellhead pipe piece to simulation wells.

This commit is contained in:
Jacob Støren 2018-02-28 17:18:48 +01:00
parent 6a33735479
commit 5087085635
6 changed files with 41 additions and 11 deletions

View File

@ -767,7 +767,7 @@ cvf::ref<cvf::Part> createStdLinePart(cvf::DrawableGeo* geometry,
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
{
if (m_rimCrossSection.isNull()) return;
if (m_rimCrossSection.isNull() || m_crossSectionGenerator.isNull()) return;
// Get information on how to draw the pipe
@ -775,6 +775,7 @@ void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* mod
double pipeRadius = 1;
int pipeCrossSectionVxCount = 6;
cvf::Color3f wellPipeColor = cvf::Color3f::GRAY;
double characteristicCellSize = 0;
if ( m_rimCrossSection->type() == RimIntersection::CS_SIMULATION_WELL )
{
@ -790,7 +791,7 @@ void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* mod
wellPipeColor = simWellInView->wellPipeColor();
createSourceInfoFunc = [&](size_t brIdx) { return new RivSimWellPipeSourceInfo(simWellInView, brIdx); };
characteristicCellSize = eclView->eclipseCase()->characteristicCellSize();
}
else if (m_rimCrossSection->type() == RimIntersection::CS_WELL_PATH)
{
@ -854,6 +855,8 @@ void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* mod
(*cvfCoords)[cIdx].transformPoint(scaleTransform->worldTransform());
}
(*cvfCoords)[0].z() += characteristicCellSize;
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
auto surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface();
auto centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine();

View File

@ -96,7 +96,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasi
characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize();
m_rimWell->wellHeadTopBottomPosition(frameIndex, &wellHeadTop, &wellHeadBottom);
m_rimWell->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &wellHeadTop, &wellHeadBottom);
wellHeadTop = displayCordXf->transformToDisplayCoord(wellHeadTop);
wellHeadBottom = displayCordXf->transformToDisplayCoord(wellHeadBottom);
wellHeadTop.z() += characteristicCellSize;
@ -183,7 +183,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasi
cvf::Vec3d otherWellHeadTop;
cvf::Vec3d otherWellHeadBottom;
{
otherWell->wellHeadTopBottomPosition(frameIndex, &otherWellHeadTop, &otherWellHeadBottom);
otherWell->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &otherWellHeadTop, &otherWellHeadBottom);
otherWellHeadTop = displayCordXf->transformToDisplayCoord(otherWellHeadTop);
otherWellHeadBottom = displayCordXf->transformToDisplayCoord(otherWellHeadBottom);
otherWellHeadTop.z() += characteristicCellSize;

View File

@ -88,7 +88,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
cvf::Vec3d whEndPos;
cvf::Vec3d whStartPos;
{
well->wellHeadTopBottomPosition(frameIndex, &whEndPos, &whStartPos);
well->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &whEndPos, &whStartPos);
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
whEndPos = transForm->transformToDisplayCoord(whEndPos);

View File

@ -435,6 +435,19 @@ std::vector< std::vector <cvf::Vec3d> > RimIntersection::polyLines(double * hori
if (type == CS_WELL_PATH || type == CS_SIMULATION_WELL)
{
if (type == CS_SIMULATION_WELL && simulationWell())
{
cvf::Vec3d top, bottom;
simulationWell->wellHeadTopBottomPosition(-1, &top, &bottom);
for ( size_t lIdx = 0; lIdx < lines.size(); ++lIdx )
{
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
polyLine.insert(polyLine.begin(), top);
}
}
for (size_t lIdx = 0; lIdx < lines.size(); ++lIdx)
{
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];

View File

@ -178,9 +178,9 @@ void RimSimWellInView::calculateWellPipeDynamicCenterLine(size_t
}
//--------------------------------------------------------------------------------------------------
///
/// frameIndex = -1 will use the static well frame
//--------------------------------------------------------------------------------------------------
void RimSimWellInView::wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom)
void RimSimWellInView::wellHeadTopBottomPosition(int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom)
{
RimEclipseView* m_rimReservoirView;
@ -188,10 +188,24 @@ void RimSimWellInView::wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d*
RigEclipseCaseData* rigReservoir = m_rimReservoirView->eclipseCase()->eclipseCaseData();
if ( !this->simWellData()->hasAnyValidCells(frameIndex) ) return;
const RigWellResultFrame* wellResultFramePtr = nullptr;
const RigCell* whCellPtr = nullptr;
const RigWellResultFrame& wellResultFrame = this->simWellData()->wellResultFrame(frameIndex);
const RigCell& whCell = rigReservoir->cellFromWellResultCell(wellResultFrame.wellHeadOrStartCell());
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()

View File

@ -71,7 +71,7 @@ public:
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) const;
void wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom);
void wellHeadTopBottomPosition(int frameIndex, cvf::Vec3d* top, cvf::Vec3d* bottom);
double pipeRadius();
caf::PdmField<bool> showWell;