#1381 Wip: Well Alloc Plots split by phase without flow diagnostics

This is implemented, but turned off as Ert did not seem to deliver correct phase flow rates. Can be enabled as soon as Ert is improved and updated.
This commit is contained in:
Jacob Støren 2017-04-18 16:47:37 +02:00
parent 327fb31cb0
commit 2745d857d0
6 changed files with 85 additions and 56 deletions

View File

@ -908,6 +908,9 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint(const RigGridBa
int cellK = well_conn_get_k( ert_connection );
bool isCellOpen = well_conn_open( ert_connection );
double volumeRate = well_conn_get_volume_rate( ert_connection);
double oilRate = well_conn_get_oil_rate(ert_connection) ;
double gasRate = well_conn_get_gas_rate(ert_connection);
double waterRate = well_conn_get_water_rate(ert_connection);
// If a well is defined in fracture region, the K-value is from (cellCountK - 1) -> cellCountK*2 - 1
// Adjust K so index is always in valid grid region
@ -960,6 +963,9 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint(const RigGridBa
resultPoint.m_ertBranchId = ertBranchId;
resultPoint.m_ertSegmentId = ertSegmentId;
resultPoint.m_flowRate = volumeRate;
resultPoint.m_oilRate = oilRate;
resultPoint.m_gasRate = gasRate;
resultPoint.m_waterRate = waterRate;
}
return resultPoint;

View File

@ -250,7 +250,6 @@ void RimWellAllocationPlot::updateFromWell()
depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth(brIdx) :
std::vector<double>();
if ( m_flowDiagSolution )
{
std::vector<QString> tracerNames = wfCalculator->tracerNames();
for (const QString& tracerName: tracerNames)
@ -273,24 +272,7 @@ void RimWellAllocationPlot::updateFromWell()
//TODO: THIs is the data to be plotted...
}
}
else
{
const std::vector<double>* accFlow = nullptr;
if (depthType == RimWellLogPlot::CONNECTION_NUMBER)
{
accFlow = &(m_flowType == ACCUMULATED ?
wfCalculator->accumulatedFlowPrConnection(brIdx):
wfCalculator->flowPrConnection( brIdx));
}
else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH || depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH)
{
accFlow = &(m_flowType == ACCUMULATED ?
wfCalculator->accumulatedFlowPrPseudoLength(brIdx):
wfCalculator->flowPrPseudoLength( brIdx));
}
addStackedCurve("Total", depthValues, *accFlow, plotTrack);
}
updateWellFlowPlotXAxisTitle(plotTrack);
@ -407,10 +389,20 @@ void RimWellAllocationPlot::addStackedCurve(const QString& tracerName,
curve->setFlowValuesPrDepthValue(tracerName, depthValues, accFlow);
if ( m_flowDiagSolution )
{
curve->setColor(m_flowDiagSolution->tracerColor(tracerName));
}
else
curve->setColor(cvf::Color3f::DARK_GRAY);
{
cvf::Color3f color = cvf::Color3f::DARK_GRAY;
if (tracerName == RIG_FLOW_OIL_NAME) color = cvf::Color3f::DARK_GREEN;
if (tracerName == RIG_FLOW_GAS_NAME) color = cvf::Color3f::DARK_RED;
if (tracerName == RIG_FLOW_WATER_NAME) color = cvf::Color3f::BLUE;
curve->setColor(color);
}
plotTrack->addCurve(curve);
curve->loadDataAndUpdate();

View File

@ -46,6 +46,8 @@ size_t RigEclCellIndexCalculator::resultCellIndex(size_t gridIndex, size_t gridC
///
//==================================================================================================
//#define USE_WELL_PHASE_RATES
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -93,8 +95,14 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
m_connectionFlowPrBranch.resize(m_pipeBranchesCellIds.size());
m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesCellIds.size());
#ifdef USE_WELL_PHASE_RATES
m_tracerNames.push_back(RIG_FLOW_OIL_NAME);
m_tracerNames.push_back(RIG_FLOW_GAS_NAME);
m_tracerNames.push_back(RIG_FLOW_WATER_NAME);
#else
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME);
#endif
calculateAccumulatedFlowPrConnection(0, 1);
calculateFlowPrPseudoLength(0, 0.0);
}
@ -107,13 +115,6 @@ const std::vector<double>& RigAccWellFlowCalculator::connectionNumbersFromTop(si
return m_connectionFlowPrBranch[branchIdx].depthValuesFromTop;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>& RigAccWellFlowCalculator::accumulatedFlowPrConnection(size_t branchIdx) const
{
return accumulatedTracerFlowPrConnection(RIG_FLOW_TOTAL_NAME, branchIdx);
}
//--------------------------------------------------------------------------------------------------
///
@ -133,13 +134,6 @@ const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrConn
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>& RigAccWellFlowCalculator::flowPrConnection(size_t branchIdx) const
{
return tracerFlowPrConnection(RIG_FLOW_TOTAL_NAME, branchIdx);
}
//--------------------------------------------------------------------------------------------------
///
@ -176,13 +170,6 @@ const std::vector<double>& RigAccWellFlowCalculator::trueVerticalDepth(size_t br
return m_pseudoLengthFlowPrBranch[branchIdx].trueVerticalDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>& RigAccWellFlowCalculator::accumulatedFlowPrPseudoLength(size_t branchIdx) const
{
return accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, branchIdx);
}
//--------------------------------------------------------------------------------------------------
///
@ -202,13 +189,6 @@ const std::vector<double>& RigAccWellFlowCalculator::accumulatedTracerFlowPrPseu
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<double>& RigAccWellFlowCalculator::flowPrPseudoLength(size_t branchIdx) const
{
return tracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, branchIdx);
}
//--------------------------------------------------------------------------------------------------
///
@ -273,7 +253,7 @@ std::vector<std::pair<QString, double> > RigAccWellFlowCalculator::totalTracerFr
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigAccWellFlowCalculator::isWellFlowConsistent( bool isProducer) const
bool RigAccWellFlowCalculator::isWellFlowConsistent() const
{
bool isConsistent = true;
for (const std::vector <RigWellResultPoint> & branch : m_pipeBranchesCellIds)
@ -332,6 +312,8 @@ bool RigAccWellFlowCalculator::isConnectionFlowConsistent(const RigWellResultPoi
//--------------------------------------------------------------------------------------------------
bool RigAccWellFlowCalculator::isFlowRateConsistent(double flowRate) const
{
if (!m_tracerCellFractionValues) return true; // No flow diagnostics.
return (flowRate >= 0.0 && m_isProducer) || (flowRate <= 0.0 && !m_isProducer);
}
@ -674,7 +656,13 @@ std::vector<double> RigAccWellFlowCalculator::calculateWellCellFlowPrTracer(cons
}
else
{
#ifdef USE_WELL_PHASE_RATES
flowPrTracer[0] = wellCell.oilRate();
flowPrTracer[1] = wellCell.gasRate();
flowPrTracer[2] = wellCell.waterRate();
#else
flowPrTracer[0] = wellCell.flowRate();
#endif
}
return flowPrTracer;
@ -787,7 +775,7 @@ void RigAccWellFlowCalculator::groupSmallContributions()
std::vector<QString> tracersToGroup;
{
bool hasConsistentWellFlow = isWellFlowConsistent(m_isProducer);
bool hasConsistentWellFlow = isWellFlowConsistent();
std::vector<std::pair<QString, double> > totalTracerFractions = this->totalTracerFractions();

View File

@ -68,14 +68,11 @@ public:
double smallContribThreshold);
const std::vector<double>& connectionNumbersFromTop(size_t branchIdx) const;
const std::vector<double>& accumulatedFlowPrConnection( size_t branchIdx) const;
const std::vector<double>& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const;
const std::vector<double>& flowPrConnection( size_t branchIdx) const;
const std::vector<double>& tracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const;
const std::vector<double>& pseudoLengthFromTop(size_t branchIdx) const;
const std::vector<double>& trueVerticalDepth(size_t branchIdx) const;
const std::vector<double>& accumulatedFlowPrPseudoLength( size_t branchIdx) const;
const std::vector<double>& accumulatedTracerFlowPrPseudoLength(const QString& tracerName, size_t branchIdx) const;
const std::vector<double>& flowPrPseudoLength( size_t branchIdx) const;
const std::vector<double>& tracerFlowPrPseudoLength(const QString& tracerName, size_t branchIdx) const;
@ -102,7 +99,7 @@ private:
void groupSmallTracers(std::map<QString, std::vector<double> >* branchFlowSet,
const std::vector<QString>& tracersToGroup);
bool isWellFlowConsistent(bool isProducer) const;
bool isWellFlowConsistent() const;
std::vector<double> calculateAccumulatedFractions(const std::vector<double>& accumulatedFlowPrTracer) const;
std::vector<size_t> wrpToUniqueWrpIndexFromBottom(const std::vector<RigWellResultPoint> &branchCells) const;
static size_t connectionIndexFromTop( const std::vector<size_t>& resPointToConnectionIndexFromBottom, size_t clSegIdx) ;

View File

@ -26,6 +26,10 @@
#define RIG_FLD_COMMUNICATION_RESNAME "Communication"
#define RIG_FLOW_TOTAL_NAME "Total"
#define RIG_FLOW_OIL_NAME "Oil"
#define RIG_FLOW_GAS_NAME "Gas"
#define RIG_FLOW_WATER_NAME "Water"
#define RIG_RESERVOIR_TRACER_NAME "Reservoir"
#define RIG_TINY_TRACER_GROUP_NAME "Other"

View File

@ -40,7 +40,10 @@ struct RigWellResultPoint
m_ertBranchId(-1),
m_ertSegmentId(-1),
m_bottomPosition(cvf::Vec3d::UNDEFINED),
m_flowRate(0.0)
m_flowRate(0.0),
m_oilRate(0.0),
m_gasRate(0.0),
m_waterRate(0.0)
{ }
bool isPointValid() const
@ -70,6 +73,42 @@ struct RigWellResultPoint
}
}
double oilRate() const
{
if ( isCell() && m_isOpen)
{
return m_oilRate;
}
else
{
return 0.0;
}
}
double gasRate() const
{
if ( isCell() && m_isOpen)
{
return m_gasRate;
}
else
{
return 0.0;
}
}
double waterRate() const
{
if ( isCell() && m_isOpen)
{
return m_waterRate;
}
else
{
return 0.0;
}
}
bool isEqual(const RigWellResultPoint& other ) const
{
return ( m_gridIndex == other.m_gridIndex
@ -90,6 +129,9 @@ struct RigWellResultPoint
cvf::Vec3d m_bottomPosition; //< The estimated bottom position of the well segment, when we have no grid cell connections for the segment.
double m_flowRate;
double m_oilRate;
double m_gasRate;
double m_waterRate;
};
//==================================================================================================