2016-12-14 02:50:30 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-12-14 02:50:30 -06:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-12-14 02:50:30 -06:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-12-14 02:50:30 -06:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RimFlowDiagSolution.h"
|
2017-01-09 12:04:45 -06:00
|
|
|
|
2017-01-09 12:14:07 -06:00
|
|
|
#include "RigActiveCellInfo.h"
|
2016-12-20 04:41:05 -06:00
|
|
|
#include "RigCaseCellResultsData.h"
|
2017-01-10 02:51:39 -06:00
|
|
|
#include "RigEclipseCaseData.h"
|
2017-01-09 12:04:45 -06:00
|
|
|
#include "RigFlowDiagResults.h"
|
|
|
|
#include "RigMainGrid.h"
|
2017-10-13 06:44:53 -05:00
|
|
|
#include "RigSimWellData.h"
|
2023-04-14 04:00:45 -05:00
|
|
|
#include "RigWellResultFrame.h"
|
2021-05-26 04:31:47 -05:00
|
|
|
#include "RigWellResultPoint.h"
|
2017-02-10 01:39:25 -06:00
|
|
|
|
|
|
|
#include "RimEclipseResultCase.h"
|
2017-02-24 04:07:15 -06:00
|
|
|
#include "RimEclipseView.h"
|
2017-10-13 07:20:47 -05:00
|
|
|
#include "RimSimWellInViewCollection.h"
|
2016-12-16 07:17:56 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimFlowDiagSolution, "FlowDiagSolution" );
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2017-03-16 11:46:45 -05:00
|
|
|
#define CROSS_FLOW_ENDING "-XF"
|
|
|
|
|
2017-03-06 09:33:29 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-06 09:33:29 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
bool RimFlowDiagSolution::hasCrossFlowEnding( const QString& tracerName )
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return tracerName.endsWith( CROSS_FLOW_ENDING );
|
2017-03-06 09:33:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-06 09:33:29 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QString RimFlowDiagSolution::removeCrossFlowEnding( const QString& tracerName )
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( tracerName.endsWith( CROSS_FLOW_ENDING ) )
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return tracerName.left( tracerName.size() - 3 );
|
2017-03-06 09:33:29 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return tracerName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-06 09:33:29 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
QString RimFlowDiagSolution::addCrossFlowEnding( const QString& wellName )
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2017-03-16 11:46:45 -05:00
|
|
|
return wellName + CROSS_FLOW_ENDING;
|
2017-03-06 09:33:29 -06:00
|
|
|
}
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-04-14 07:07:45 -05:00
|
|
|
RimFlowDiagSolution::RimFlowDiagSolution()
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2021-11-14 07:15:12 -06:00
|
|
|
CAF_PDM_InitObject( "Flow Diagnostics Solution" );
|
|
|
|
CAF_PDM_InitField( &m_userDescription, "UserDescription", QString( "All Wells" ), "Description" );
|
2016-12-14 02:50:30 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-04-14 07:07:45 -05:00
|
|
|
RimFlowDiagSolution::~RimFlowDiagSolution()
|
2020-02-12 04:13:38 -06:00
|
|
|
{
|
|
|
|
}
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2017-03-09 03:03:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-03-09 03:03:52 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
QString RimFlowDiagSolution::userDescription() const
|
|
|
|
{
|
|
|
|
return m_userDescription();
|
|
|
|
}
|
|
|
|
|
2016-12-16 07:17:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-16 07:17:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
|
|
|
{
|
2016-12-17 03:46:57 -06:00
|
|
|
if ( m_flowDiagResults.isNull() )
|
|
|
|
{
|
|
|
|
size_t timeStepCount;
|
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
|
2020-10-13 04:14:47 -05:00
|
|
|
if ( !eclCase || !eclCase->eclipseCaseData() )
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
2016-12-17 03:46:57 -06:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
timeStepCount = eclCase->eclipseCaseData()->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->maxTimeStepCount();
|
2016-12-17 03:46:57 -06:00
|
|
|
}
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
m_flowDiagResults = new RigFlowDiagResults( this, timeStepCount );
|
2016-12-17 03:46:57 -06:00
|
|
|
}
|
|
|
|
|
2016-12-16 07:17:56 -06:00
|
|
|
return m_flowDiagResults.p();
|
|
|
|
}
|
|
|
|
|
2023-05-11 01:37:58 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
const RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults() const
|
|
|
|
{
|
|
|
|
return m_flowDiagResults.p();
|
|
|
|
}
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2017-03-09 03:03:52 -06:00
|
|
|
std::vector<QString> RimFlowDiagSolution::tracerNames() const
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2017-01-03 02:27:25 -06:00
|
|
|
std::vector<QString> tracerNameSet;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
if ( eclCase && eclCase->eclipseCaseData() )
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2017-10-13 06:44:53 -05:00
|
|
|
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
2016-12-14 02:50:30 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
tracerNameSet.push_back( simWellData[wIdx]->m_wellName );
|
|
|
|
tracerNameSet.push_back( addCrossFlowEnding( simWellData[wIdx]->m_wellName ) );
|
2016-12-14 02:50:30 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return tracerNameSet;
|
|
|
|
}
|
|
|
|
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<std::string, std::vector<int>> RimFlowDiagSolution::allInjectorTracerActiveCellIndices( size_t timeStepIndex ) const
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return allTracerActiveCellIndices( timeStepIndex, true );
|
2016-12-20 04:41:05 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<std::string, std::vector<int>> RimFlowDiagSolution::allProducerTracerActiveCellIndices( size_t timeStepIndex ) const
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return allTracerActiveCellIndices( timeStepIndex, false );
|
2016-12-20 04:41:05 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-20 04:41:05 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
std::map<std::string, std::vector<int>> RimFlowDiagSolution::allTracerActiveCellIndices( size_t timeStepIndex, bool useInjectors ) const
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::map<std::string, std::vector<int>> tracersWithCells;
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclCase && eclCase->eclipseCaseData() )
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
|
|
|
RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
|
|
|
|
RigActiveCellInfo* activeCellInfo =
|
|
|
|
eclCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ); // Todo: Must come from the results
|
|
|
|
// definition
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2017-10-13 06:44:53 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) continue;
|
2021-05-26 04:31:47 -05:00
|
|
|
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-04-14 04:00:45 -05:00
|
|
|
bool isInjectorWell = ( wellResFrame->productionType() != RiaDefines::WellProductionType::PRODUCER &&
|
|
|
|
wellResFrame->productionType() != RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2017-10-13 06:44:53 -05:00
|
|
|
std::string wellName = simWellData[wIdx]->m_wellName.toStdString();
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string wellNameXf = addCrossFlowEnding( simWellData[wIdx]->m_wellName ).toStdString();
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<int>& tracerCells = tracersWithCells[wellName];
|
2017-03-06 09:33:29 -06:00
|
|
|
std::vector<int>& tracerCellsCrossFlow = tracersWithCells[wellNameXf];
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2023-04-14 04:00:45 -05:00
|
|
|
for ( const RigWellResultBranch& wBr : wellResFrame->wellResultBranches() )
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2023-04-14 04:00:45 -05:00
|
|
|
for ( const RigWellResultPoint& wrp : wBr.branchResultPoints() )
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2023-02-28 09:06:37 -06:00
|
|
|
if ( wrp.isValid() && wrp.isOpen() &&
|
2019-09-06 03:40:57 -05:00
|
|
|
( ( useInjectors && wrp.flowRate() < 0.0 ) || ( !useInjectors && wrp.flowRate() > 0.0 ) ) )
|
2016-12-20 04:41:05 -06:00
|
|
|
{
|
2023-02-28 09:06:37 -06:00
|
|
|
RigGridBase* grid = mainGrid->gridByIndex( wrp.gridIndex() );
|
|
|
|
size_t reservoirCellIndex = grid->reservoirCellIndex( wrp.cellIndex() );
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
int cellActiveIndex = static_cast<int>( activeCellInfo->cellResultIndex( reservoirCellIndex ) );
|
2016-12-20 04:41:05 -06:00
|
|
|
|
2017-03-06 09:33:29 -06:00
|
|
|
if ( useInjectors == isInjectorWell )
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
tracerCells.push_back( cellActiveIndex );
|
2016-12-20 04:41:05 -06:00
|
|
|
}
|
2019-09-06 03:40:57 -05:00
|
|
|
else
|
2017-03-06 09:33:29 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
tracerCellsCrossFlow.push_back( cellActiveIndex );
|
2017-03-06 09:33:29 -06:00
|
|
|
}
|
2016-12-20 04:41:05 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-03-22 08:04:13 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( tracerCells.empty() ) tracersWithCells.erase( wellName );
|
|
|
|
if ( tracerCellsCrossFlow.empty() ) tracersWithCells.erase( wellNameXf );
|
2016-12-20 04:41:05 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return tracersWithCells;
|
|
|
|
}
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall( const QString& tracerName ) const
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfTypeAsserted<RimEclipseResultCase>();
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2021-04-05 11:18:34 -05:00
|
|
|
TracerStatusType tracerStatus = TracerStatusType::UNDEFINED;
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclCase && eclCase->eclipseCaseData() )
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2018-10-02 01:20:17 -05:00
|
|
|
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2018-10-02 01:20:17 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
2016-12-14 02:50:30 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString wellName = removeCrossFlowEnding( tracerName );
|
2018-10-02 01:20:17 -05:00
|
|
|
|
|
|
|
if ( simWellData[wIdx]->m_wellName != wellName ) continue;
|
|
|
|
|
2021-04-05 11:18:34 -05:00
|
|
|
tracerStatus = TracerStatusType::CLOSED;
|
2018-10-02 01:20:17 -05:00
|
|
|
for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps )
|
2017-03-07 05:19:19 -06:00
|
|
|
{
|
2023-04-14 04:00:45 -05:00
|
|
|
if ( RiaDefines::isInjector( wellResFrame.productionType() ) )
|
2018-10-02 01:20:17 -05:00
|
|
|
{
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( tracerStatus == TracerStatusType::PRODUCER )
|
|
|
|
tracerStatus = TracerStatusType::VARYING;
|
2019-09-06 03:40:57 -05:00
|
|
|
else
|
2021-04-05 11:18:34 -05:00
|
|
|
tracerStatus = TracerStatusType::INJECTOR;
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2023-04-14 04:00:45 -05:00
|
|
|
else if ( wellResFrame.productionType() == RiaDefines::WellProductionType::PRODUCER )
|
2018-10-02 01:20:17 -05:00
|
|
|
{
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( tracerStatus == TracerStatusType::INJECTOR )
|
|
|
|
tracerStatus = TracerStatusType::VARYING;
|
2019-09-06 03:40:57 -05:00
|
|
|
else
|
2021-04-05 11:18:34 -05:00
|
|
|
tracerStatus = TracerStatusType::PRODUCER;
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( tracerStatus == TracerStatusType::VARYING ) break;
|
2016-12-14 02:50:30 -06:00
|
|
|
}
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2018-10-02 01:20:17 -05:00
|
|
|
break;
|
|
|
|
}
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( hasCrossFlowEnding( tracerName ) )
|
2018-10-02 01:20:17 -05:00
|
|
|
{
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( tracerStatus == TracerStatusType::PRODUCER )
|
|
|
|
tracerStatus = TracerStatusType::INJECTOR;
|
|
|
|
else if ( tracerStatus == TracerStatusType::INJECTOR )
|
|
|
|
tracerStatus = TracerStatusType::PRODUCER;
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2016-12-14 02:50:30 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
return tracerStatus;
|
|
|
|
}
|
|
|
|
|
2016-12-21 10:14:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-21 10:14:13 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeStep( const QString& tracerName, size_t timeStepIndex ) const
|
2016-12-21 10:14:13 -06:00
|
|
|
{
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfTypeAsserted<RimEclipseResultCase>();
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( eclCase && eclCase->eclipseCaseData() )
|
2016-12-21 10:14:13 -06:00
|
|
|
{
|
2018-10-02 01:20:17 -05:00
|
|
|
const cvf::Collection<RigSimWellData>& simWellData = eclCase->eclipseCaseData()->wellResults();
|
2016-12-21 10:14:13 -06:00
|
|
|
|
2018-10-02 01:20:17 -05:00
|
|
|
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString wellName = removeCrossFlowEnding( tracerName );
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2018-10-02 01:20:17 -05:00
|
|
|
if ( simWellData[wIdx]->m_wellName != wellName ) continue;
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) return TracerStatusType::CLOSED;
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2021-05-26 04:31:47 -05:00
|
|
|
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
2017-03-06 09:33:29 -06:00
|
|
|
|
2023-04-14 04:00:45 -05:00
|
|
|
if ( RiaDefines::isInjector( wellResFrame->productionType() ) )
|
2018-10-02 01:20:17 -05:00
|
|
|
{
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
|
2017-01-11 05:34:48 -06:00
|
|
|
|
2021-04-05 11:18:34 -05:00
|
|
|
return TracerStatusType::INJECTOR;
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2023-04-14 04:00:45 -05:00
|
|
|
else if ( wellResFrame->productionType() == RiaDefines::WellProductionType::PRODUCER ||
|
|
|
|
wellResFrame->productionType() == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
|
2018-10-02 01:20:17 -05:00
|
|
|
{
|
2021-04-05 11:18:34 -05:00
|
|
|
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::INJECTOR;
|
2018-10-02 01:20:17 -05:00
|
|
|
|
2021-04-05 11:18:34 -05:00
|
|
|
return TracerStatusType::PRODUCER;
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
CVF_ASSERT( false );
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2016-12-21 10:14:13 -06:00
|
|
|
}
|
2018-10-02 01:20:17 -05:00
|
|
|
}
|
2016-12-21 10:14:13 -06:00
|
|
|
|
2021-04-05 11:18:34 -05:00
|
|
|
return TracerStatusType::UNDEFINED;
|
2016-12-21 10:14:13 -06:00
|
|
|
}
|
|
|
|
|
2017-02-02 02:56:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2017-02-02 02:56:39 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
cvf::Color3f RimFlowDiagSolution::tracerColor( const QString& tracerName ) const
|
2017-02-02 02:56:39 -06:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
QString wellName = removeCrossFlowEnding( tracerName );
|
2017-04-06 07:12:24 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
if ( wellName == RIG_FLOW_TOTAL_NAME ) return cvf::Color3f::LIGHT_GRAY;
|
|
|
|
if ( wellName == RIG_RESERVOIR_TRACER_NAME ) return cvf::Color3f::LIGHT_GRAY;
|
|
|
|
if ( wellName == RIG_TINY_TRACER_GROUP_NAME ) return cvf::Color3f::DARK_GRAY;
|
2017-04-06 07:12:24 -05:00
|
|
|
|
2023-05-12 14:41:34 -05:00
|
|
|
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
|
2017-02-02 02:56:39 -06:00
|
|
|
if ( eclCase )
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return eclCase->defaultWellColor( wellName );
|
2017-02-02 02:56:39 -06:00
|
|
|
}
|
|
|
|
|
2017-02-17 04:18:58 -06:00
|
|
|
return cvf::Color3f::LIGHT_GRAY;
|
2017-02-02 02:56:39 -06:00
|
|
|
}
|
|
|
|
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-12-14 02:50:30 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
caf::PdmFieldHandle* RimFlowDiagSolution::userDescriptionField()
|
|
|
|
{
|
|
|
|
return &m_userDescription;
|
|
|
|
}
|