#1171 WIP: Pseudo length active. Needs more verification

This commit is contained in:
Jacob Støren 2017-02-19 20:57:40 +01:00
parent 601a920337
commit b336d49fb6
4 changed files with 61 additions and 13 deletions

View File

@ -232,6 +232,11 @@ void RimWellAllocationPlot::updateFromWell()
m_contributingTracerNames = wfCalculator->tracerNames();
}
auto depthType = accumulatedWellFlowPlot()->depthType();
if ( depthType == RimWellLogPlot::MEASURED_DEPTH
|| depthType == RimWellLogPlot::TRUE_VERTICAL_DEPTH) return;
// Create tracks and curves from the calculated data
size_t branchCount = pipeBranchesCLCoords.size();
@ -246,27 +251,49 @@ void RimWellAllocationPlot::updateFromWell()
accumulatedWellFlowPlot()->addTrack(plotTrack);
std::vector<double> connNumbers = wfCalculator->connectionNumbersFromTop(brIdx);
const std::vector<double>& connNumbers = depthType == RimWellLogPlot::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop(brIdx) :
depthType == RimWellLogPlot::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop(brIdx) :
std::vector<double>();
if ( m_flowDiagSolution )
{
std::vector<QString> tracerNames = wfCalculator->tracerNames();
for (const QString& tracerName: tracerNames)
{
const std::vector<double>& accFlow = m_flowType == ACCUMULATED ?
wfCalculator->accumulatedTracerFlowPrConnection(tracerName, brIdx):
wfCalculator->tracerFlowPrConnection(tracerName, brIdx);
const std::vector<double>* accFlow = nullptr;
if (depthType == RimWellLogPlot::CONNECTION_NUMBER)
{
accFlow = &(m_flowType == ACCUMULATED ?
wfCalculator->accumulatedTracerFlowPrConnection(tracerName, brIdx):
wfCalculator->tracerFlowPrConnection(tracerName, brIdx));
}
else if ( depthType == RimWellLogPlot::PSEUDO_LENGTH)
{
accFlow = &(m_flowType == ACCUMULATED ?
wfCalculator->accumulatedTracerFlowPrPseudoLength(tracerName, brIdx):
wfCalculator->tracerFlowPrPseudoLength(tracerName, brIdx));
}
addStackedCurve(tracerName, connNumbers, accFlow, plotTrack);
addStackedCurve(tracerName, connNumbers, *accFlow, plotTrack);
}
}
else
{
const std::vector<double>& accFlow = m_flowType == ACCUMULATED ?
wfCalculator->accumulatedFlowPrConnection(brIdx):
wfCalculator->flowPrConnection(brIdx);
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)
{
accFlow = &(m_flowType == ACCUMULATED ?
wfCalculator->accumulatedFlowPrPseudoLength(brIdx):
wfCalculator->flowPrPseudoLength( brIdx));
}
addStackedCurve("Total", connNumbers, accFlow, plotTrack);
addStackedCurve("Total", connNumbers, *accFlow, plotTrack);
}
updateWellFlowPlotXAxisTitle(plotTrack);

View File

@ -115,9 +115,15 @@ void RimWellLogPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, c
{
updateMdiWindowTitle();
}
if ( changedField == &m_depthType
|| changedField == &m_depthUnit)
if ( changedField == &m_depthType )
{
RimWellAllocationPlot* wellAllocPlot;
firstAncestorOrThisOfType(wellAllocPlot);
if (wellAllocPlot) wellAllocPlot->loadDataAndUpdate();
else updateTracks();
}
if ( changedField == &m_depthUnit)
{
updateTracks();
}
@ -675,7 +681,7 @@ void RimWellLogPlot::updateDisabledDepthTypes()
{
m_disabledDepthTypes.insert(MEASURED_DEPTH);
m_disabledDepthTypes.insert(TRUE_VERTICAL_DEPTH);
m_disabledDepthTypes.insert(PSEUDO_LENGTH);
// m_disabledDepthTypes.insert(PSEUDO_LENGTH);
}
else
{

View File

@ -374,9 +374,12 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
std::vector<double> accFlowPrTracer(m_tracerNames.size(), 0.0);
BranchFlow& branchFlow = m_pseudoLengthFlowPrBranch[branchIdx];
RigWellResultPoint previousResultPoint;
while ( clSegIdx >= 0 )
{
if (previousResultPoint.isEqual(branchCells[clSegIdx])) { --clSegIdx; continue; } // Todo: Do the skipping within one cell to get the complete length span of the cell into the graph
std::vector<double> flowPrTracer = calculateFlowPrTracer(branchCells, clSegIdx);
@ -411,6 +414,8 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
storeFlowOnDepth(branchFlow, pseudoLengthFromTop_upper, accFlowPrTracer, flowPrTracer);
previousResultPoint = branchCells[clSegIdx];
--clSegIdx;
}

View File

@ -70,6 +70,16 @@ struct RigWellResultPoint
}
}
bool isEqual(const RigWellResultPoint& other ) const
{
return ( m_gridIndex == other.m_gridIndex
&& m_gridCellIndex == other.m_gridCellIndex
&& m_isOpen == other.m_isOpen
&& m_ertBranchId == other.m_ertBranchId
&& m_ertSegmentId == other.m_ertSegmentId
&& m_flowRate == other.m_flowRate);
}
size_t m_gridIndex;
size_t m_gridCellIndex; //< Index to cell which is included in the well