mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5674 #5664 #5692 Shift connection number depth to show connection number at the middle of the flat areas of the graphs for inflow, and for accumulated flow to shw flow change at connection (not shifted one off) Aligned curve ascii export accordingly
This commit is contained in:
parent
ce7b08a809
commit
d74e5fe5e8
@ -323,10 +323,21 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
curveDepthValues.insert( curveDepthValues.begin(), curveDepthValues[0] );
|
||||
accFlow.insert( accFlow.begin(), 0.0 );
|
||||
|
||||
if ( brIdx == 0 && !accFlow.empty() ) // Add fictitious point to 0 for first branch
|
||||
if ( m_flowType == ACCUMULATED && brIdx == 0 && !accFlow.empty() ) // Add fictitious point to -1 for
|
||||
// first branch
|
||||
{
|
||||
accFlow.push_back( accFlow.back() );
|
||||
curveDepthValues.push_back( 0.0 );
|
||||
curveDepthValues.push_back( -1.0 );
|
||||
}
|
||||
|
||||
// Shift the "bars" to make connection number tick at the midpoint of the constant value
|
||||
// when showing in flow rate
|
||||
if ( m_flowType == INFLOW )
|
||||
{
|
||||
for ( double& connNum : curveDepthValues )
|
||||
{
|
||||
connNum += 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( depthType == RiaDefines::PSEUDO_LENGTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
|
||||
@ -676,6 +687,14 @@ int RimWellAllocationPlot::timeStep()
|
||||
return m_timeStep();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellAllocationPlot::FlowType RimWellAllocationPlot::flowType()
|
||||
{
|
||||
return m_flowType();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
caf::PdmObject* plotLegend();
|
||||
RimEclipseResultCase* rimCase();
|
||||
int timeStep();
|
||||
FlowType flowType();
|
||||
|
||||
QString wellName() const;
|
||||
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellAllocationPlot.h"
|
||||
#include "RimWellBoreStabilityPlot.h"
|
||||
#include "RimWellFlowRateCurve.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
@ -754,8 +755,17 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
std::vector<double> curveDepths;
|
||||
std::vector<std::vector<double>> curvesPlotXValues;
|
||||
|
||||
auto depthType = parentWellLogPlot()->depthType();
|
||||
auto depthUnit = parentWellLogPlot()->depthUnit();
|
||||
auto depthType = parentWellLogPlot()->depthType();
|
||||
auto depthUnit = parentWellLogPlot()->depthUnit();
|
||||
bool isWellAllocInflowPlot = false;
|
||||
{
|
||||
RimWellAllocationPlot* wapl = nullptr;
|
||||
parentWellLogPlot()->firstAncestorOfType( wapl );
|
||||
if ( wapl )
|
||||
{
|
||||
isWellAllocInflowPlot = ( wapl->flowType() == RimWellAllocationPlot::INFLOW );
|
||||
}
|
||||
}
|
||||
|
||||
for ( RimWellLogCurve* curve : m_curves() )
|
||||
{
|
||||
@ -815,9 +825,16 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
|
||||
for ( size_t dIdx = 0; dIdx < curveDepths.size(); ++dIdx )
|
||||
{
|
||||
size_t i = dIdx;
|
||||
size_t i = dIdx;
|
||||
double curveDepth = curveDepths[i];
|
||||
|
||||
if ( depthType == RiaDefines::CONNECTION_NUMBER )
|
||||
{
|
||||
if ( dIdx == 0 )
|
||||
continue; // Skip the first line. (shallow depth, which is last)
|
||||
// as it is a fictious value added to make
|
||||
// the plot easier to read
|
||||
|
||||
i = curveDepths.size() - 1 - dIdx; // Reverse the order, since the connections are coming bottom to top
|
||||
|
||||
if ( i == 0 )
|
||||
@ -828,13 +845,15 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
|
||||
}
|
||||
}
|
||||
|
||||
if ( curveDepths[i] == 0.0 )
|
||||
curveDepth = curveDepths[i];
|
||||
|
||||
if ( isWellAllocInflowPlot )
|
||||
{
|
||||
continue; // Skip the dummy connection number 0
|
||||
curveDepth -= 0.5; // To shift the values that was shifted to get the numbers between the changes
|
||||
}
|
||||
}
|
||||
|
||||
out += QString::number( curveDepths[i], 'f', 3 );
|
||||
out += QString::number( curveDepth, 'f', 3 );
|
||||
for ( std::vector<double> plotVector : curvesPlotXValues )
|
||||
{
|
||||
out += " \t" + QString::number( plotVector[i], 'g' );
|
||||
|
@ -74,7 +74,7 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(
|
||||
m_tracerNames.push_back( RIG_RESERVOIR_TRACER_NAME );
|
||||
|
||||
initializePipeBranchesMeasuredDepths();
|
||||
calculateAccumulatedFlowPrConnection( 0, 1 );
|
||||
calculateAccumulatedFlowPrConnection( 0, 0 );
|
||||
calculateFlowPrPseudoLength( 0, 0.0 );
|
||||
sortTracers();
|
||||
groupSmallContributions();
|
||||
@ -109,7 +109,7 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<std::vecto
|
||||
}
|
||||
|
||||
initializePipeBranchesMeasuredDepths();
|
||||
calculateAccumulatedFlowPrConnection( 0, 1 );
|
||||
calculateAccumulatedFlowPrConnection( 0, 0 );
|
||||
calculateFlowPrPseudoLength( 0, 0.0 );
|
||||
|
||||
if ( !m_useTotalWellPhaseRateOnly ) sortTracers();
|
||||
@ -147,7 +147,7 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<cvf::Vec3d
|
||||
}
|
||||
|
||||
initializePipeBranchesMeasuredDepths();
|
||||
calculateAccumulatedFlowPrConnection( 0, 1 );
|
||||
calculateAccumulatedFlowPrConnection( 0, 0 );
|
||||
calculateFlowPrPseudoLength( 0, 0.0 );
|
||||
|
||||
if ( !m_useTotalWellPhaseRateOnly ) sortTracers();
|
||||
|
Loading…
Reference in New Issue
Block a user