mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-05 21:53:27 -06:00
Janitor : Remove duplicated code
This commit is contained in:
parent
9d58769f89
commit
098fda9816
@ -284,3 +284,16 @@ QString RiaDefines::defaultDirectoryLabel( RiaDefines::ImportFileType fileType )
|
||||
|
||||
return defaultDirLabel;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaDefines::isInjector( WellProductionType wellProductionType )
|
||||
{
|
||||
if ( wellProductionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||
wellProductionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||
wellProductionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -192,4 +192,6 @@ enum class WellProductionType : short
|
||||
UNDEFINED_PRODUCTION_TYPE
|
||||
};
|
||||
|
||||
bool isInjector( WellProductionType wellProductionType );
|
||||
|
||||
}; // namespace RiaDefines
|
||||
|
@ -316,9 +316,7 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
|
||||
}
|
||||
|
||||
// Add visual indicator for well type injector
|
||||
if ( productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||
productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||
productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||
if ( RiaDefines::isInjector( productionType ) )
|
||||
{
|
||||
cvf::GeometryBuilderFaceList builder;
|
||||
cvf::Vec3f pos( 0.0, 0.0, 0.0 );
|
||||
|
@ -244,9 +244,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
|
||||
tracerStatus = TracerStatusType::CLOSED;
|
||||
for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps )
|
||||
{
|
||||
if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||
wellResFrame.m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||
wellResFrame.m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||
if ( RiaDefines::isInjector( wellResFrame.m_productionType ) )
|
||||
{
|
||||
if ( tracerStatus == TracerStatusType::PRODUCER )
|
||||
tracerStatus = TracerStatusType::VARYING;
|
||||
@ -300,9 +298,7 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
|
||||
|
||||
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
|
||||
|
||||
if ( wellResFrame->m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||
wellResFrame->m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||
wellResFrame->m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||
if ( RiaDefines::isInjector( wellResFrame->m_productionType ) )
|
||||
{
|
||||
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
|
||||
|
||||
|
@ -103,9 +103,7 @@ bool RimSimWellInViewTools::isInjector( RimSimWellInView* well )
|
||||
{
|
||||
const RigWellResultFrame* wrf = wRes->wellResultFrame( currentTimeStep );
|
||||
|
||||
if ( wrf->m_productionType == RiaDefines::WellProductionType::OIL_INJECTOR ||
|
||||
wrf->m_productionType == RiaDefines::WellProductionType::GAS_INJECTOR ||
|
||||
wrf->m_productionType == RiaDefines::WellProductionType::WATER_INJECTOR )
|
||||
if ( RiaDefines::isInjector( wrf->m_productionType ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user