mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1077 Added option to draw simulation well pipes from center to center
This commit is contained in:
@@ -104,6 +104,39 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
|
||||
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(m_rimWell.p(), m_pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||
|
||||
RimEclipseWellCollection* wellColl = nullptr;
|
||||
m_rimWell->firstAncestorOrThisOfType(wellColl);
|
||||
if (wellColl && wellColl->wellPipeCoordType() == RimEclipseWellCollection::WELLPIPE_CELLCENTER)
|
||||
{
|
||||
// Compute coords based on connection centers
|
||||
// Loop over all well cells, and overwrite with cell center instead of interpolated coordinates
|
||||
|
||||
RigMainGrid* mainGrid = m_rimReservoirView->mainGrid();
|
||||
|
||||
for (size_t i = 0; i < pipeBranchesCellIds.size(); i++)
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& resPoints = pipeBranchesCellIds[i];
|
||||
for (size_t j = 0; j < resPoints.size(); j++)
|
||||
{
|
||||
if (resPoints[j].isCell())
|
||||
{
|
||||
size_t gridIndex = resPoints[j].m_gridIndex;
|
||||
size_t gridCellIndex = resPoints[j].m_gridCellIndex;
|
||||
|
||||
if (gridIndex < mainGrid->gridCount())
|
||||
{
|
||||
RigGridBase* rigGrid = mainGrid->gridByIndex(gridIndex);
|
||||
if (gridCellIndex < rigGrid->cellCount())
|
||||
{
|
||||
cvf::Vec3d center = rigGrid->cell(gridCellIndex).center();
|
||||
m_pipeBranchesCLCoords[i][j] = center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize();
|
||||
double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize;
|
||||
|
||||
|
||||
@@ -75,6 +75,17 @@ namespace caf
|
||||
}
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void RimEclipseWellCollection::WellPipeCoordEnum::setUp()
|
||||
{
|
||||
addItem(RimEclipseWellCollection::WELLPIPE_INTERPOLATED, "WELLPIPE_INTERPOLATED", "Interpolated");
|
||||
addItem(RimEclipseWellCollection::WELLPIPE_CELLCENTER, "WELLPIPE_CELLCENTER", "Cell Centers");
|
||||
setDefault(RimEclipseWellCollection::WELLPIPE_INTERPOLATED);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipseWellCollection, "Wells");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -99,6 +110,7 @@ RimEclipseWellCollection::RimEclipseWellCollection()
|
||||
CAF_PDM_InitField(&pipeRadiusScaleFactor, "WellPipeRadiusScale", 0.1, "Pipe radius scale", "", "", "");
|
||||
CAF_PDM_InitField(&pipeCrossSectionVertexCount, "WellPipeVertexCount", 12, "Pipe vertex count", "", "", "");
|
||||
pipeCrossSectionVertexCount.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitField(&wellPipeCoordType, "WellPipeCoordType", WellPipeCoordEnum(WELLPIPE_INTERPOLATED), "Well Pipe Coords", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&wellCellsToRangeFilterMode, "GlobalWellCellVisibility", WellCellsRangeFilterEnum(RANGE_ADD_NONE), "Add cells to range filter", "", "", "");
|
||||
CAF_PDM_InitField(&showWellCellFences, "ShowWellFences", false, "Use well fence", "", "", "");
|
||||
@@ -257,7 +269,8 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
|| &showWellHead == changedField
|
||||
|| &isAutoDetectingBranches == changedField
|
||||
|| &wellHeadPosition == changedField
|
||||
|| &wellLabelColor == changedField)
|
||||
|| &wellLabelColor == changedField
|
||||
|| &wellPipeCoordType == changedField)
|
||||
{
|
||||
if (m_reservoirView)
|
||||
{
|
||||
@@ -295,6 +308,7 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup("Well pipe");
|
||||
wellPipe->add(&wellPipeVisibility);
|
||||
wellPipe->add(&pipeRadiusScaleFactor);
|
||||
wellPipe->add(&wellPipeCoordType);
|
||||
|
||||
caf::PdmUiGroup* cellCenterSpheres = uiOrdering.addNewGroup("Well cell center spheres");
|
||||
cellCenterSpheres->add(&wellSphereVisibility);
|
||||
|
||||
@@ -80,6 +80,13 @@ public:
|
||||
};
|
||||
typedef caf::AppEnum<RimEclipseWellCollection::WellHeadPositionType> WellHeadPositionEnum;
|
||||
|
||||
enum WellPipeCoordType
|
||||
{
|
||||
WELLPIPE_CELLCENTER,
|
||||
WELLPIPE_INTERPOLATED
|
||||
};
|
||||
typedef caf::AppEnum<RimEclipseWellCollection::WellPipeCoordType> WellPipeCoordEnum;
|
||||
|
||||
|
||||
caf::PdmField<bool> showWellLabel;
|
||||
caf::PdmField<cvf::Color3f> wellLabelColor;
|
||||
@@ -94,6 +101,7 @@ public:
|
||||
caf::PdmField<WellVisibilityEnum> wellPipeVisibility;
|
||||
caf::PdmField<double> pipeRadiusScaleFactor;
|
||||
caf::PdmField<int> pipeCrossSectionVertexCount;
|
||||
caf::PdmField<WellPipeCoordEnum> wellPipeCoordType;
|
||||
|
||||
caf::PdmField<double> wellHeadScaleFactor;
|
||||
caf::PdmField<bool> showWellHead;
|
||||
|
||||
Reference in New Issue
Block a user