mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
MswRollUp: Updated Ert to experimental MSW branch. Updated ResInsight code to handle API changes
067fa99faa
This is an intermediate commit and does not compile
p4#: 22212
This commit is contained in:
@@ -118,7 +118,7 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
|
||||
for (size_t bIdx = 0; bIdx < m_wellCellsTimeSteps[0].m_wellResultBranches.size(); ++bIdx)
|
||||
{
|
||||
size_t branchNumber = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchNumber;
|
||||
size_t branchNumber = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_branchIndex;
|
||||
std::vector<RigWellResultCell>& frameCells = m_wellCellsTimeSteps[0].m_wellResultBranches[bIdx].m_wellCells;
|
||||
|
||||
std::list< RigWellResultCell >& branch = staticWellBranches[branchNumber];
|
||||
@@ -137,7 +137,7 @@ 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_branchNumber;
|
||||
size_t branchNumber = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_branchIndex;
|
||||
std::vector<RigWellResultCell>& resBranch = m_wellCellsTimeSteps[tIdx].m_wellResultBranches[bIdx].m_wellCells;
|
||||
|
||||
std::list< RigWellResultCell >& stBranch = staticWellBranches[branchNumber];
|
||||
@@ -252,12 +252,20 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
|
||||
for (bIt = staticWellBranches.begin(); bIt != staticWellBranches.end(); ++bIt)
|
||||
{
|
||||
RigWellResultBranch rigBranch;
|
||||
rigBranch.m_branchNumber = bIt->first;
|
||||
if (bIt->first >= m_wellCellsTimeSteps[0].m_wellResultBranches.size())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Copy from first time step
|
||||
RigWellResultBranch rigBranch = m_wellCellsTimeSteps[0].m_wellResultBranches[bIt->first];
|
||||
rigBranch.m_branchIndex = bIt->first;
|
||||
|
||||
// Clear well cells, and insert the collection of well cells for the static situation
|
||||
rigBranch.m_wellCells.clear();
|
||||
|
||||
std::list< RigWellResultCell >& branch = bIt->second;
|
||||
std::list< RigWellResultCell >::iterator cIt;
|
||||
|
||||
for (cIt = branch.begin(); cIt != branch.end(); ++cIt)
|
||||
{
|
||||
RigWellResultCell rwc = *cIt;
|
||||
@@ -269,3 +277,19 @@ void RigSingleWellResultsData::computeStaticWellCellPath()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigSingleWellResultsData::setMultiSegmentWell(bool isMultiSegmentWell)
|
||||
{
|
||||
m_isMultiSegmentWell = isMultiSegmentWell;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigSingleWellResultsData::isMultiSegmentWell() const
|
||||
{
|
||||
return m_isMultiSegmentWell;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,33 +25,72 @@
|
||||
#include "RimDefines.h"
|
||||
#include <QDateTime>
|
||||
#include <vector>
|
||||
#include "cvfVector3.h"
|
||||
|
||||
struct RigWellResultCell
|
||||
{
|
||||
RigWellResultCell() :
|
||||
m_gridIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_gridCellIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_branchId(-1),
|
||||
m_segmentId(-1),
|
||||
m_isOpen(false)
|
||||
m_isOpen(false),
|
||||
m_ertBranchId(-1),
|
||||
m_ertSegmentId(-1),
|
||||
m_averageCenter(cvf::Vec3d::UNDEFINED),
|
||||
m_branchConnectionCount(0)
|
||||
{ }
|
||||
|
||||
bool hasBranchConnections() const
|
||||
{
|
||||
return m_branchConnectionCount != 0;
|
||||
}
|
||||
|
||||
bool hasGridConnections() const
|
||||
{
|
||||
return m_gridCellIndex != cvf::UNDEFINED_SIZE_T;
|
||||
}
|
||||
|
||||
bool hasConnections() const
|
||||
{
|
||||
return hasGridConnections() || hasBranchConnections();
|
||||
}
|
||||
|
||||
|
||||
size_t m_gridIndex;
|
||||
size_t m_gridCellIndex; //< Index to cell which is included in the well
|
||||
int m_branchId;
|
||||
int m_segmentId;
|
||||
|
||||
bool m_isOpen; //< Marks the well as open or closed as of Eclipse simulation
|
||||
|
||||
int m_ertBranchId;
|
||||
int m_ertSegmentId;
|
||||
|
||||
cvf::Vec3d m_averageCenter;
|
||||
size_t m_branchConnectionCount;
|
||||
};
|
||||
|
||||
struct RigWellResultBranch
|
||||
{
|
||||
RigWellResultBranch() :
|
||||
m_branchNumber(cvf::UNDEFINED_SIZE_T)
|
||||
m_branchIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_ertBranchId(-1),
|
||||
m_outletBranchIndex(cvf::UNDEFINED_SIZE_T),
|
||||
m_outletBranchHeadCellIndex(cvf::UNDEFINED_SIZE_T)
|
||||
{}
|
||||
|
||||
size_t m_branchNumber;
|
||||
|
||||
size_t m_branchIndex;
|
||||
int m_ertBranchId;
|
||||
|
||||
std::vector<RigWellResultCell> m_wellCells;
|
||||
|
||||
// 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;
|
||||
|
||||
};
|
||||
|
||||
class RigWellResultFrame
|
||||
@@ -67,6 +106,8 @@ public:
|
||||
|
||||
const RigWellResultCell* findResultCell(size_t gridIndex, size_t gridCellIndex) const
|
||||
{
|
||||
CVF_ASSERT(gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
if (m_wellHead.m_gridCellIndex == gridCellIndex && m_wellHead.m_gridIndex == gridIndex )
|
||||
{
|
||||
return &m_wellHead;
|
||||
@@ -87,6 +128,21 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const RigWellResultCell* 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())
|
||||
{
|
||||
return (&resBranch.m_wellCells[wellResultCellIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
WellProductionType m_productionType;
|
||||
bool m_isOpen;
|
||||
RigWellResultCell m_wellHead;
|
||||
@@ -102,6 +158,11 @@ public:
|
||||
class RigSingleWellResultsData : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RigSingleWellResultsData() { m_isMultiSegmentWell = false; }
|
||||
|
||||
void setMultiSegmentWell(bool isMultiSegmentWell);
|
||||
bool isMultiSegmentWell() const;
|
||||
|
||||
bool hasWellResult(size_t resultTimeStepIndex) const;
|
||||
size_t firstResultTimeStep() const;
|
||||
|
||||
@@ -113,6 +174,7 @@ public:
|
||||
|
||||
public:
|
||||
QString m_wellName;
|
||||
bool m_isMultiSegmentWell;
|
||||
|
||||
std::vector<size_t> m_resultTimeStepIndexToWellTimeStepIndex; // Well result timesteps may differ from result timesteps
|
||||
std::vector< RigWellResultFrame > m_wellCellsTimeSteps;
|
||||
|
||||
Reference in New Issue
Block a user