mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
MswRollUp: Splitted normal well and MSW handling. Got the Normal path to work fairly well. Some strangeties at the end of the pipes though
This is an intermediate commit and does not compile p4#: 22214
This commit is contained in:
@@ -173,10 +173,10 @@ void RigCaseData::computeWellCellsPrGrid()
|
||||
{
|
||||
RigWellResultBranch& wellSegment = wellCells.m_wellResultBranches[sIdx];
|
||||
size_t cdIdx;
|
||||
for (cdIdx = 0; cdIdx < wellSegment.m_wellCells.size(); ++cdIdx)
|
||||
for (cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx)
|
||||
{
|
||||
gridIndex = wellSegment.m_wellCells[cdIdx].m_gridIndex;
|
||||
gridCellIndex = wellSegment.m_wellCells[cdIdx].m_gridCellIndex;
|
||||
gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
|
||||
gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
|
||||
|
||||
if(gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
|
||||
{
|
||||
@@ -227,7 +227,7 @@ cvf::UIntArray* RigCaseData::gridCellToWellIndex(size_t gridIndex)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCell& RigCaseData::cellFromWellResultCell(const RigWellResultCell& wellResultCell)
|
||||
RigCell& RigCaseData::cellFromWellResultCell(const RigWellResultPoint& wellResultCell)
|
||||
{
|
||||
size_t gridIndex = wellResultCell.m_gridIndex;
|
||||
size_t gridCellIndex = wellResultCell.m_gridCellIndex;
|
||||
@@ -241,7 +241,7 @@ RigCell& RigCaseData::cellFromWellResultCell(const RigWellResultCell& wellResult
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace,const RigWellResultCell& sourceWellCellResult, const RigWellResultCell& otherWellCellResult) const
|
||||
bool RigCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace,const RigWellResultPoint& sourceWellCellResult, const RigWellResultPoint& otherWellCellResult) const
|
||||
{
|
||||
size_t gridIndex = sourceWellCellResult.m_gridIndex;
|
||||
size_t gridCellIndex = sourceWellCellResult.m_gridCellIndex;
|
||||
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
cvf::UByteArray* wellCellsInGrid(size_t gridIndex);
|
||||
cvf::UIntArray* gridCellToWellIndex(size_t gridIndex);
|
||||
|
||||
RigCell& cellFromWellResultCell(const RigWellResultCell& wellResultCell);
|
||||
bool findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace, const RigWellResultCell& sourceWellCellResult, const RigWellResultCell& otherWellCellResult) const;
|
||||
RigCell& cellFromWellResultCell(const RigWellResultPoint& wellResultCell);
|
||||
bool findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace, const RigWellResultPoint& sourceWellCellResult, const RigWellResultPoint& otherWellCellResult) const;
|
||||
|
||||
void computeActiveCellBoundingBoxes();
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@ void RigReservoirBuilderMock::addWellData(RigCaseData* eclipseCase, RigGridBase*
|
||||
{
|
||||
if (connIdx == (size_t)(connectionCount/4)) continue;
|
||||
|
||||
RigWellResultCell data;
|
||||
RigWellResultPoint data;
|
||||
data.m_gridIndex = 0;
|
||||
|
||||
if (connIdx < dim.y()-2)
|
||||
@@ -425,28 +425,28 @@ void RigReservoirBuilderMock::addWellData(RigCaseData* eclipseCase, RigGridBase*
|
||||
data.m_isOpen = false;
|
||||
}
|
||||
|
||||
if (wellSegment.m_wellCells.size() == 0 || wellSegment.m_wellCells.back().m_gridCellIndex != data.m_gridCellIndex)
|
||||
if (wellSegment.m_branchResultPoints.size() == 0 || wellSegment.m_branchResultPoints.back().m_gridCellIndex != data.m_gridCellIndex)
|
||||
{
|
||||
wellSegment.m_wellCells.push_back(data);
|
||||
wellSegment.m_branchResultPoints.push_back(data);
|
||||
|
||||
if (connIdx == connectionCount / 2 )
|
||||
{
|
||||
RigWellResultCell deadEndData = data;
|
||||
RigWellResultPoint deadEndData = data;
|
||||
deadEndData.m_gridCellIndex = data.m_gridCellIndex + 1;
|
||||
deadEndData.m_isOpen = true;
|
||||
|
||||
RigWellResultCell deadEndData1 = data;
|
||||
RigWellResultPoint deadEndData1 = data;
|
||||
deadEndData1.m_gridCellIndex = data.m_gridCellIndex + 2;
|
||||
deadEndData.m_isOpen = false;
|
||||
|
||||
wellSegment.m_wellCells.push_back(deadEndData);
|
||||
wellSegment.m_wellCells.push_back(deadEndData1);
|
||||
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
||||
wellSegment.m_branchResultPoints.push_back(deadEndData1);
|
||||
|
||||
deadEndData.m_isOpen = true;
|
||||
wellSegment.m_wellCells.push_back(deadEndData);
|
||||
wellSegment.m_branchResultPoints.push_back(deadEndData);
|
||||
|
||||
data.m_isOpen = true;
|
||||
wellSegment.m_wellCells.push_back(data);
|
||||
wellSegment.m_branchResultPoints.push_back(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,9 +454,9 @@ void RigReservoirBuilderMock::addWellData(RigCaseData* eclipseCase, RigGridBase*
|
||||
{
|
||||
data.m_gridCellIndex = grid->cellIndexFromIJK(1 , 1 + connIdx , 2 + connIdx);
|
||||
|
||||
if (wellSegment.m_wellCells.size() == 0 || wellSegment.m_wellCells.back().m_gridCellIndex != data.m_gridCellIndex)
|
||||
if (wellSegment.m_branchResultPoints.size() == 0 || wellSegment.m_branchResultPoints.back().m_gridCellIndex != data.m_gridCellIndex)
|
||||
{
|
||||
wellSegment.m_wellCells.push_back(data);
|
||||
wellSegment.m_branchResultPoints.push_back(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,16 +112,16 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
{
|
||||
if (m_wellCellsTimeSteps.size() == 0) return;
|
||||
|
||||
std::map < size_t, std::list< RigWellResultCell > > staticWellBranches;
|
||||
std::map < size_t, std::list< RigWellResultPoint > > staticWellBranches;
|
||||
|
||||
// Add ResultCell data from the first timestep to the final result.
|
||||
|
||||
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[0].m_wellResultBranches.size(); ++bIdx)
|
||||
{
|
||||
size_t branchNumber = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchIndex;
|
||||
std::vector<RigWellResultCell>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_wellCells;
|
||||
std::vector<RigWellResultPoint>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
|
||||
std::list< RigWellResultCell >& branch = staticWellBranches[branchNumber];
|
||||
std::list< RigWellResultPoint >& branch = staticWellBranches[branchNumber];
|
||||
|
||||
for(size_t cIdx = 0; cIdx < frameCells.size(); ++cIdx)
|
||||
{
|
||||
@@ -138,12 +138,12 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[tIdx].m_wellResultBranches.size(); ++bIdx)
|
||||
{
|
||||
size_t branchNumber = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchIndex;
|
||||
std::vector<RigWellResultCell>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_wellCells;
|
||||
std::vector<RigWellResultPoint>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
|
||||
std::list< RigWellResultCell >& stBranch = staticWellBranches[branchNumber];
|
||||
std::list< RigWellResultCell >::iterator it;
|
||||
std::list< RigWellResultCell >::iterator sStartIt;
|
||||
std::list< RigWellResultCell >::iterator sEndIt;
|
||||
std::list< RigWellResultPoint >& stBranch = staticWellBranches[branchNumber];
|
||||
std::list< RigWellResultPoint >::iterator it;
|
||||
std::list< RigWellResultPoint >::iterator sStartIt;
|
||||
std::list< RigWellResultPoint >::iterator sEndIt;
|
||||
size_t rStartIdx;
|
||||
size_t rEndIdx;
|
||||
|
||||
@@ -245,7 +245,7 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
|
||||
// Populate the static well info
|
||||
|
||||
std::map < size_t, std::list< RigWellResultCell > >::iterator bIt;
|
||||
std::map < size_t, std::list< RigWellResultPoint > >::iterator bIt;
|
||||
|
||||
m_staticWellCells.m_wellResultBranches.clear();
|
||||
m_staticWellCells.m_wellHead = m_wellCellsTimeSteps[0].m_wellHead;
|
||||
@@ -262,15 +262,15 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
rigBranch.m_branchIndex = bIt->first;
|
||||
|
||||
// Clear well cells, and insert the collection of well cells for the static situation
|
||||
rigBranch.m_wellCells.clear();
|
||||
rigBranch.m_branchResultPoints.clear();
|
||||
|
||||
std::list< RigWellResultCell >& branch = bIt->second;
|
||||
std::list< RigWellResultCell >::iterator cIt;
|
||||
std::list< RigWellResultPoint >& branch = bIt->second;
|
||||
std::list< RigWellResultPoint >::iterator cIt;
|
||||
for (cIt = branch.begin(); cIt != branch.end(); ++cIt)
|
||||
{
|
||||
RigWellResultCell rwc = *cIt;
|
||||
RigWellResultPoint rwc = *cIt;
|
||||
rwc.m_isOpen = false; // Reset the dynamic property
|
||||
rigBranch.m_wellCells.push_back(*cIt);
|
||||
rigBranch.m_branchResultPoints.push_back(*cIt);
|
||||
}
|
||||
|
||||
m_staticWellCells.m_wellResultBranches.push_back(rigBranch);
|
||||
|
||||
@@ -27,31 +27,31 @@
|
||||
#include <vector>
|
||||
#include "cvfVector3.h"
|
||||
|
||||
struct RigWellResultCell
|
||||
struct RigWellResultPoint
|
||||
{
|
||||
RigWellResultCell() :
|
||||
RigWellResultPoint() :
|
||||
m_gridIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_gridCellIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_isOpen(false),
|
||||
m_ertBranchId(-1),
|
||||
m_ertSegmentId(-1),
|
||||
m_averageCenter(cvf::Vec3d::UNDEFINED),
|
||||
m_bottomPosition(cvf::Vec3d::UNDEFINED),
|
||||
m_branchConnectionCount(0)
|
||||
{ }
|
||||
|
||||
bool hasBranchConnections() const
|
||||
bool isPointValid() const
|
||||
{
|
||||
return m_branchConnectionCount != 0;
|
||||
return m_bottomPosition != cvf::Vec3d::UNDEFINED;
|
||||
}
|
||||
|
||||
bool hasGridConnections() const
|
||||
bool isCell() const
|
||||
{
|
||||
return m_gridCellIndex != cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
bool hasConnections() const
|
||||
bool isValid() const
|
||||
{
|
||||
return hasGridConnections() || hasBranchConnections();
|
||||
return isCell() || isPointValid();
|
||||
}
|
||||
|
||||
|
||||
@@ -63,33 +63,30 @@ struct RigWellResultCell
|
||||
int m_ertBranchId;
|
||||
int m_ertSegmentId;
|
||||
|
||||
cvf::Vec3d m_averageCenter;
|
||||
cvf::Vec3d m_bottomPosition;
|
||||
size_t m_branchConnectionCount;
|
||||
};
|
||||
|
||||
|
||||
struct RigWellResultBranch
|
||||
{
|
||||
RigWellResultBranch() :
|
||||
m_branchIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_ertBranchId(-1),
|
||||
m_outletBranchIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_outletBranchHeadCellIndex(cvf::UNDEFINED_SIZE_T)
|
||||
m_outletBranchIndex_OBSOLETE(cvf::UNDEFINED_SIZE_T),
|
||||
m_outletBranchHeadCellIndex_OBSOLETE(cvf::UNDEFINED_SIZE_T)
|
||||
{}
|
||||
|
||||
|
||||
size_t m_branchIndex;
|
||||
int m_ertBranchId;
|
||||
|
||||
std::vector<RigWellResultCell> m_wellCells;
|
||||
|
||||
std::vector<RigWellResultPoint> m_branchResultPoints;
|
||||
|
||||
// Grid cell from last connection in outlet segment. For MSW wells, this is either well head or a well result cell in another branch
|
||||
// For standard wells, this is always well head.
|
||||
RigWellResultCell m_branchHead;
|
||||
|
||||
// Grid cell from last connection in outlet segment. For MSW wells, this is either well head or a well result cell in another branch
|
||||
// For standard wells, this is always well head.
|
||||
size_t m_outletBranchIndex;
|
||||
size_t m_outletBranchHeadCellIndex;
|
||||
size_t m_outletBranchIndex_OBSOLETE;
|
||||
size_t m_outletBranchHeadCellIndex_OBSOLETE;
|
||||
|
||||
};
|
||||
|
||||
@@ -104,7 +101,7 @@ public:
|
||||
m_productionType(UNDEFINED_PRODUCTION_TYPE)
|
||||
{ }
|
||||
|
||||
const RigWellResultCell* findResultCell(size_t gridIndex, size_t gridCellIndex) const
|
||||
const RigWellResultPoint* findResultCell(size_t gridIndex, size_t gridCellIndex) const
|
||||
{
|
||||
CVF_ASSERT(gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
@@ -115,12 +112,12 @@ public:
|
||||
|
||||
for (size_t wb = 0; wb < m_wellResultBranches.size(); ++wb)
|
||||
{
|
||||
for (size_t wc = 0; wc < m_wellResultBranches[wb].m_wellCells.size(); ++wc)
|
||||
for (size_t wc = 0; wc < m_wellResultBranches[wb].m_branchResultPoints.size(); ++wc)
|
||||
{
|
||||
if ( m_wellResultBranches[wb].m_wellCells[wc].m_gridCellIndex == gridCellIndex
|
||||
&& m_wellResultBranches[wb].m_wellCells[wc].m_gridIndex == gridIndex )
|
||||
if ( m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridCellIndex == gridCellIndex
|
||||
&& m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridIndex == gridIndex )
|
||||
{
|
||||
return &(m_wellResultBranches[wb].m_wellCells[wc]);
|
||||
return &(m_wellResultBranches[wb].m_branchResultPoints[wc]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,14 +125,14 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const RigWellResultCell* findResultCellFromOutletSpecification(size_t branchIndex, size_t wellResultCellIndex) const
|
||||
const RigWellResultPoint* findResultCellFromOutletSpecification(size_t branchIndex, size_t wellResultCellIndex) const
|
||||
{
|
||||
if (branchIndex != cvf::UNDEFINED_SIZE_T && branchIndex < m_wellResultBranches.size())
|
||||
{
|
||||
const RigWellResultBranch& resBranch = m_wellResultBranches[branchIndex];
|
||||
if (wellResultCellIndex != cvf::UNDEFINED_SIZE_T && wellResultCellIndex < resBranch.m_wellCells.size())
|
||||
if (wellResultCellIndex != cvf::UNDEFINED_SIZE_T && wellResultCellIndex < resBranch.m_branchResultPoints.size())
|
||||
{
|
||||
return (&resBranch.m_wellCells[wellResultCellIndex]);
|
||||
return (&resBranch.m_branchResultPoints[wellResultCellIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +142,7 @@ public:
|
||||
|
||||
WellProductionType m_productionType;
|
||||
bool m_isOpen;
|
||||
RigWellResultCell m_wellHead;
|
||||
RigWellResultPoint m_wellHead;
|
||||
QDateTime m_timestamp;
|
||||
|
||||
std::vector<RigWellResultBranch> m_wellResultBranches;
|
||||
|
||||
Reference in New Issue
Block a user