mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2482 Add wellhead pipe piece to simulation wells.
This commit is contained in:
@@ -767,7 +767,7 @@ cvf::ref<cvf::Part> createStdLinePart(cvf::DrawableGeo* geometry,
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
|
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
|
// Get information on how to draw the pipe
|
||||||
|
|
||||||
@@ -775,6 +775,7 @@ void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* mod
|
|||||||
double pipeRadius = 1;
|
double pipeRadius = 1;
|
||||||
int pipeCrossSectionVxCount = 6;
|
int pipeCrossSectionVxCount = 6;
|
||||||
cvf::Color3f wellPipeColor = cvf::Color3f::GRAY;
|
cvf::Color3f wellPipeColor = cvf::Color3f::GRAY;
|
||||||
|
double characteristicCellSize = 0;
|
||||||
|
|
||||||
if ( m_rimCrossSection->type() == RimIntersection::CS_SIMULATION_WELL )
|
if ( m_rimCrossSection->type() == RimIntersection::CS_SIMULATION_WELL )
|
||||||
{
|
{
|
||||||
@@ -790,7 +791,7 @@ void RivIntersectionPartMgr::appendWellPipePartsToModel(cvf::ModelBasicList* mod
|
|||||||
wellPipeColor = simWellInView->wellPipeColor();
|
wellPipeColor = simWellInView->wellPipeColor();
|
||||||
|
|
||||||
createSourceInfoFunc = [&](size_t brIdx) { return new RivSimWellPipeSourceInfo(simWellInView, brIdx); };
|
createSourceInfoFunc = [&](size_t brIdx) { return new RivSimWellPipeSourceInfo(simWellInView, brIdx); };
|
||||||
|
characteristicCellSize = eclView->eclipseCase()->characteristicCellSize();
|
||||||
}
|
}
|
||||||
else if (m_rimCrossSection->type() == RimIntersection::CS_WELL_PATH)
|
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)[cIdx].transformPoint(scaleTransform->worldTransform());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(*cvfCoords)[0].z() += characteristicCellSize;
|
||||||
|
|
||||||
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
|
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
|
||||||
auto surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface();
|
auto surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface();
|
||||||
auto centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine();
|
auto centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine();
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasi
|
|||||||
|
|
||||||
characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize();
|
characteristicCellSize = rigReservoir->mainGrid()->characteristicIJCellSize();
|
||||||
|
|
||||||
m_rimWell->wellHeadTopBottomPosition(frameIndex, &wellHeadTop, &wellHeadBottom);
|
m_rimWell->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &wellHeadTop, &wellHeadBottom);
|
||||||
wellHeadTop = displayCordXf->transformToDisplayCoord(wellHeadTop);
|
wellHeadTop = displayCordXf->transformToDisplayCoord(wellHeadTop);
|
||||||
wellHeadBottom = displayCordXf->transformToDisplayCoord(wellHeadBottom);
|
wellHeadBottom = displayCordXf->transformToDisplayCoord(wellHeadBottom);
|
||||||
wellHeadTop.z() += characteristicCellSize;
|
wellHeadTop.z() += characteristicCellSize;
|
||||||
@@ -183,7 +183,7 @@ void RivWellConnectionsPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasi
|
|||||||
cvf::Vec3d otherWellHeadTop;
|
cvf::Vec3d otherWellHeadTop;
|
||||||
cvf::Vec3d otherWellHeadBottom;
|
cvf::Vec3d otherWellHeadBottom;
|
||||||
{
|
{
|
||||||
otherWell->wellHeadTopBottomPosition(frameIndex, &otherWellHeadTop, &otherWellHeadBottom);
|
otherWell->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &otherWellHeadTop, &otherWellHeadBottom);
|
||||||
otherWellHeadTop = displayCordXf->transformToDisplayCoord(otherWellHeadTop);
|
otherWellHeadTop = displayCordXf->transformToDisplayCoord(otherWellHeadTop);
|
||||||
otherWellHeadBottom = displayCordXf->transformToDisplayCoord(otherWellHeadBottom);
|
otherWellHeadBottom = displayCordXf->transformToDisplayCoord(otherWellHeadBottom);
|
||||||
otherWellHeadTop.z() += characteristicCellSize;
|
otherWellHeadTop.z() += characteristicCellSize;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void RivWellHeadPartMgr::buildWellHeadParts(size_t frameIndex)
|
|||||||
cvf::Vec3d whEndPos;
|
cvf::Vec3d whEndPos;
|
||||||
cvf::Vec3d whStartPos;
|
cvf::Vec3d whStartPos;
|
||||||
{
|
{
|
||||||
well->wellHeadTopBottomPosition(frameIndex, &whEndPos, &whStartPos);
|
well->wellHeadTopBottomPosition(static_cast<int>(frameIndex), &whEndPos, &whStartPos);
|
||||||
|
|
||||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
|
cvf::ref<caf::DisplayCoordTransform> transForm = m_rimReservoirView->displayCoordTransform();
|
||||||
whEndPos = transForm->transformToDisplayCoord(whEndPos);
|
whEndPos = transForm->transformToDisplayCoord(whEndPos);
|
||||||
|
|||||||
@@ -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_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)
|
for (size_t lIdx = 0; lIdx < lines.size(); ++lIdx)
|
||||||
{
|
{
|
||||||
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
|
std::vector<cvf::Vec3d>& polyLine = lines[lIdx];
|
||||||
|
|||||||
@@ -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;
|
RimEclipseView* m_rimReservoirView;
|
||||||
@@ -188,10 +188,24 @@ void RimSimWellInView::wellHeadTopBottomPosition(size_t frameIndex, cvf::Vec3d*
|
|||||||
|
|
||||||
RigEclipseCaseData* rigReservoir = m_rimReservoirView->eclipseCase()->eclipseCaseData();
|
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);
|
if (frameIndex >= 0)
|
||||||
const RigCell& whCell = rigReservoir->cellFromWellResultCell(wellResultFrame.wellHeadOrStartCell());
|
{
|
||||||
|
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()
|
// Match this position with pipe start position in RivWellPipesPartMgr::calculateWellPipeCenterline()
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) const;
|
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();
|
double pipeRadius();
|
||||||
caf::PdmField<bool> showWell;
|
caf::PdmField<bool> showWell;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user