mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1112 Made conveninece methods to calculate well pipe centerline, and added possibility to do it pr timestep.
This commit is contained in:
@@ -82,7 +82,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts()
|
|||||||
m_pipeBranchesCLCoords.clear();
|
m_pipeBranchesCLCoords.clear();
|
||||||
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||||
|
|
||||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(m_rimWell.p(), m_pipeBranchesCLCoords, pipeBranchesCellIds);
|
m_rimWell->calculateWellPipeStaticCenterLine(m_pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||||
|
|
||||||
double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize();
|
double characteristicCellSize = m_rimReservoirView->mainGrid()->characteristicIJCellSize();
|
||||||
double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize;
|
double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "RimIntersectionCollection.h"
|
#include "RimIntersectionCollection.h"
|
||||||
|
|
||||||
#include "cvfMath.h"
|
#include "cvfMath.h"
|
||||||
|
#include "RigSimulationWellCenterLineCalculator.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(RimEclipseWell, "Well");
|
CAF_PDM_SOURCE_INIT(RimEclipseWell, "Well");
|
||||||
|
|
||||||
@@ -114,6 +115,25 @@ caf::PdmFieldHandle* RimEclipseWell::objectToggleField()
|
|||||||
return &showWell;
|
return &showWell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseWell::calculateWellPipeStaticCenterLine(std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
|
{
|
||||||
|
RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline(this, pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimEclipseWell::calculateWellPipeDynamicCenterLine(size_t timeStepIdx,
|
||||||
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
|
{
|
||||||
|
RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(this, timeStepIdx, pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
// Include to make Pdm work for cvf::Color
|
// Include to make Pdm work for cvf::Color
|
||||||
#include "cafPdmFieldCvfColor.h"
|
#include "cafPdmFieldCvfColor.h"
|
||||||
|
|
||||||
class RigSingleWellResultsData;
|
#include "RigSingleWellResultsData.h"
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@@ -57,8 +57,12 @@ public:
|
|||||||
virtual caf::PdmFieldHandle* userDescriptionField();
|
virtual caf::PdmFieldHandle* userDescriptionField();
|
||||||
virtual caf::PdmFieldHandle* objectToggleField();
|
virtual caf::PdmFieldHandle* objectToggleField();
|
||||||
|
|
||||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
void calculateWellPipeStaticCenterLine( std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
||||||
|
|
||||||
|
void calculateWellPipeDynamicCenterLine(size_t timeStepIdx,
|
||||||
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
||||||
|
|
||||||
caf::PdmField<bool> showWell;
|
caf::PdmField<bool> showWell;
|
||||||
|
|
||||||
@@ -73,6 +77,10 @@ public:
|
|||||||
caf::PdmField<cvf::Color3f> wellPipeColor;
|
caf::PdmField<cvf::Color3f> wellPipeColor;
|
||||||
caf::PdmField<double> pipeRadiusScaleFactor;
|
caf::PdmField<double> pipeRadiusScaleFactor;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
|
||||||
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::ref<RigSingleWellResultsData> m_wellResults;
|
cvf::ref<RigSingleWellResultsData> m_wellResults;
|
||||||
size_t m_resultWellIndex;
|
size_t m_resultWellIndex;
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ void RimIntersection::updateWellCenterline() const
|
|||||||
{
|
{
|
||||||
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
std::vector< std::vector <RigWellResultPoint> > pipeBranchesCellIds;
|
||||||
|
|
||||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(simulationWell(), m_wellBranchCenterlines, pipeBranchesCellIds);
|
simulationWell->calculateWellPipeStaticCenterLine(m_wellBranchCenterlines, pipeBranchesCellIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
/// The returned CellIds is one less than the number of centerline points,
|
/// The returned CellIds is one less than the number of centerline points,
|
||||||
/// and are describing the lines between the points, starting with the first line
|
/// and are describing the lines between the points, starting with the first line
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(RimEclipseWell* rimWell,
|
void RigSimulationWellCenterLineCalculator::calculateWellPipeStaticCenterline(RimEclipseWell* rimWell,
|
||||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
{
|
{
|
||||||
@@ -74,6 +74,45 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterline(RimEclip
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RigSimulationWellCenterLineCalculator::calculateWellPipeDynamicCenterline(RimEclipseWell* rimWell,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds)
|
||||||
|
{
|
||||||
|
bool isAutoDetectBranches = false;
|
||||||
|
RigEclipseCaseData* eclipseCaseData = NULL;
|
||||||
|
RigSingleWellResultsData* wellResults = NULL;
|
||||||
|
|
||||||
|
{
|
||||||
|
CVF_ASSERT(rimWell);
|
||||||
|
RimEclipseView* eclipseView;
|
||||||
|
rimWell->firstAncestorOrThisOfType(eclipseView);
|
||||||
|
CVF_ASSERT(eclipseView);
|
||||||
|
|
||||||
|
isAutoDetectBranches = eclipseView->wellCollection()->isAutoDetectingBranches();
|
||||||
|
eclipseCaseData = eclipseView->eclipseCase()->reservoirData();
|
||||||
|
wellResults = rimWell->wellResults();
|
||||||
|
|
||||||
|
if ( !wellResults || !wellResults->hasWellResult(timeStepIndex) ) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const RigWellResultFrame& wellFrame = wellResults->wellResultFrame(timeStepIndex);
|
||||||
|
bool isMultiSegmentWell = wellResults->isMultiSegmentWell();
|
||||||
|
bool useAllCellCenters = rimWell->isUsingCellCenterForPipe();
|
||||||
|
|
||||||
|
calculateWellPipeCenterlineFromWellFrame(wellFrame,
|
||||||
|
eclipseCaseData,
|
||||||
|
isMultiSegmentWell,
|
||||||
|
isAutoDetectBranches,
|
||||||
|
useAllCellCenters,
|
||||||
|
pipeBranchesCLCoords,
|
||||||
|
pipeBranchesCellIds);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
/// Based on the points and cells, calculate a pipe centerline
|
/// Based on the points and cells, calculate a pipe centerline
|
||||||
/// The returned CellIds is one less than the number of centerline points,
|
/// The returned CellIds is one less than the number of centerline points,
|
||||||
|
|||||||
@@ -28,10 +28,17 @@ class RigEclipseCaseData;
|
|||||||
class RigSimulationWellCenterLineCalculator
|
class RigSimulationWellCenterLineCalculator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void calculateWellPipeCenterline(RimEclipseWell* m_rimWell,
|
static void calculateWellPipeStaticCenterline(RimEclipseWell* rimWell,
|
||||||
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) ;
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) ;
|
||||||
|
|
||||||
|
static void calculateWellPipeDynamicCenterline(RimEclipseWell* rimWell,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
|
std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds) ;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
static void calculateWellPipeCenterlineFromWellFrame(const RigWellResultFrame& wellFrame,
|
static void calculateWellPipeCenterlineFromWellFrame(const RigWellResultFrame& wellFrame,
|
||||||
const RigEclipseCaseData* eclipseCaseData,
|
const RigEclipseCaseData* eclipseCaseData,
|
||||||
bool isMultiSegmentWell,
|
bool isMultiSegmentWell,
|
||||||
@@ -40,8 +47,6 @@ public:
|
|||||||
std::vector<std::vector<cvf::Vec3d>> & pipeBranchesCLCoords,
|
std::vector<std::vector<cvf::Vec3d>> & pipeBranchesCLCoords,
|
||||||
std::vector<std::vector<RigWellResultPoint>> & pipeBranchesCellIds);
|
std::vector<std::vector<RigWellResultPoint>> & pipeBranchesCellIds);
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
static bool hasAnyResultCells(const std::vector<RigWellResultBranch> &resBranches);
|
static bool hasAnyResultCells(const std::vector<RigWellResultBranch> &resBranches);
|
||||||
static bool hasAnyValidDataCells(const RigWellResultBranch& branch);
|
static bool hasAnyValidDataCells(const RigWellResultBranch& branch);
|
||||||
static void finishPipeCenterLine( std::vector< std::vector<cvf::Vec3d> > &pipeBranchesCLCoords, const cvf::Vec3d& lastCellCenter ) ;
|
static void finishPipeCenterLine( std::vector< std::vector<cvf::Vec3d> > &pipeBranchesCLCoords, const cvf::Vec3d& lastCellCenter ) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user