Janitor : Add SOIL SGAS SWAT to RiaResultNames

wip
This commit is contained in:
Magne Sjaastad
2022-01-06 08:55:55 +01:00
parent 3d5c3134b2
commit 1e17da2926
18 changed files with 120 additions and 79 deletions

View File

@@ -350,6 +350,30 @@ QString RiaResultNames::indexKResultName()
return "INDEX_K"; return "INDEX_K";
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaResultNames::soil()
{
return "SOIL";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaResultNames::sgas()
{
return "SGAS";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaResultNames::swat()
{
return "SWAT";
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -69,6 +69,10 @@ QString indexIResultName();
QString indexJResultName(); QString indexJResultName();
QString indexKResultName(); QString indexKResultName();
QString soil();
QString sgas();
QString swat();
// Well path derived results // Well path derived results
QString wbsAzimuthResult(); QString wbsAzimuthResult();
QString wbsInclinationResult(); QString wbsInclinationResult();

View File

@@ -62,19 +62,19 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SOIL" ) ); RigEclipseResultAddress( RiaResultNames::soil() ) );
cvf::ref<RigResultAccessor> sgas = cvf::ref<RigResultAccessor> sgas =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SGAS" ) ); RigEclipseResultAddress( RiaResultNames::sgas() ) );
cvf::ref<RigResultAccessor> swat = cvf::ref<RigResultAccessor> swat =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SWAT" ) ); RigEclipseResultAddress( RiaResultNames::swat() ) );
m_resultAccessor = new RigTernaryResultAccessor(); m_resultAccessor = new RigTernaryResultAccessor();
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() ); m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );
@@ -111,19 +111,19 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator( const RimEclipse
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SOIL" ) ); RigEclipseResultAddress( RiaResultNames::soil() ) );
cvf::ref<RigResultAccessor> sgas = cvf::ref<RigResultAccessor> sgas =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SGAS" ) ); RigEclipseResultAddress( RiaResultNames::sgas() ) );
cvf::ref<RigResultAccessor> swat = cvf::ref<RigResultAccessor> swat =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
resTimeStepIdx, resTimeStepIdx,
RigEclipseResultAddress( "SWAT" ) ); RigEclipseResultAddress( RiaResultNames::swat() ) );
m_resultAccessor = new RigTernaryResultAccessor(); m_resultAccessor = new RigTernaryResultAccessor();
m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() ); m_resultAccessor->setTernaryResultAccessors( soil.p(), sgas.p(), swat.p() );

View File

@@ -298,7 +298,7 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
auto prefs = RiaPreferences::current(); auto prefs = RiaPreferences::current();
if ( prefs->loadAndShowSoil ) if ( prefs->loadAndShowSoil )
{ {
rimEclipseView->cellResult()->setResultVariable( "SOIL" ); rimEclipseView->cellResult()->setResultVariable( RiaResultNames::soil() );
} }
rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault(); rimEclipseView->faultCollection()->showFaultCollection = prefs->enableFaultsByDefault();

View File

@@ -188,7 +188,7 @@ RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QStri
{ {
colorRangeType = RimRegularLegendConfig::ColorRangesType::CATEGORY; colorRangeType = RimRegularLegendConfig::ColorRangesType::CATEGORY;
} }
else if ( resultName == "SWAT" ) else if ( resultName == RiaResultNames::swat() )
{ {
colorRangeType = RimRegularLegendConfig::ColorRangesType::OPPOSITE_NORMAL; colorRangeType = RimRegularLegendConfig::ColorRangesType::OPPOSITE_NORMAL;
} }

View File

@@ -210,12 +210,12 @@ std::vector<double> RimEclipseContourMapProjection::generateResults( int timeSte
if ( m_resultAggregation == RESULTS_OIL_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN ) if ( m_resultAggregation == RESULTS_OIL_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
{ {
gridCellResult->ensureKnownResultLoaded( gridCellResult->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) );
} }
if ( m_resultAggregation == RESULTS_GAS_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN ) if ( m_resultAggregation == RESULTS_GAS_COLUMN || m_resultAggregation == RESULTS_HC_COLUMN )
{ {
gridCellResult->ensureKnownResultLoaded( gridCellResult->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
} }
gridResultValues = calculateColumnResult( m_resultAggregation() ); gridResultValues = calculateColumnResult( m_resultAggregation() );
} }
@@ -304,7 +304,8 @@ std::vector<double> RimEclipseContourMapProjection::calculateColumnResult( Resul
if ( resultAggregation == RESULTS_OIL_COLUMN || resultAggregation == RESULTS_HC_COLUMN ) if ( resultAggregation == RESULTS_OIL_COLUMN || resultAggregation == RESULTS_HC_COLUMN )
{ {
const std::vector<double>& soilResults = const std::vector<double>& soilResults =
resultData->cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ), resultData->cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::soil() ),
timeStep ); timeStep );
for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx ) for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx )
{ {
@@ -314,12 +315,13 @@ std::vector<double> RimEclipseContourMapProjection::calculateColumnResult( Resul
if ( resultAggregation == RESULTS_GAS_COLUMN || resultAggregation == RESULTS_HC_COLUMN ) if ( resultAggregation == RESULTS_GAS_COLUMN || resultAggregation == RESULTS_HC_COLUMN )
{ {
bool hasGasResult = bool hasGasResult = resultData->hasResultEntry(
resultData->hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
if ( hasGasResult ) if ( hasGasResult )
{ {
const std::vector<double>& sgasResults = const std::vector<double>& sgasResults =
resultData->cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ), resultData->cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::sgas() ),
timeStep ); timeStep );
for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx ) for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx )
{ {

View File

@@ -342,7 +342,7 @@ void RimEclipseResultCase::loadAndUpdateSourSimData()
if ( eclipseView->cellResult()->resultType() == RiaDefines::ResultCatType::SOURSIMRL ) if ( eclipseView->cellResult()->resultType() == RiaDefines::ResultCatType::SOURSIMRL )
{ {
eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); eclipseView->cellResult()->setResultType( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
eclipseView->cellResult()->setResultVariable( "SOIL" ); eclipseView->cellResult()->setResultVariable( RiaResultNames::soil() );
eclipseView->loadDataAndUpdate(); eclipseView->loadDataAndUpdate();
} }
} }

View File

@@ -1817,11 +1817,11 @@ QList<caf::PdmOptionItemInfo>
if ( ternaryEnabled ) if ( ternaryEnabled )
{ {
bool hasAtLeastOneTernaryComponent = false; bool hasAtLeastOneTernaryComponent = false;
if ( cellCenterResultNames.contains( "SOIL" ) ) if ( cellCenterResultNames.contains( RiaResultNames::soil() ) )
hasAtLeastOneTernaryComponent = true; hasAtLeastOneTernaryComponent = true;
else if ( cellCenterResultNames.contains( "SGAS" ) ) else if ( cellCenterResultNames.contains( RiaResultNames::sgas() ) )
hasAtLeastOneTernaryComponent = true; hasAtLeastOneTernaryComponent = true;
else if ( cellCenterResultNames.contains( "SWAT" ) ) else if ( cellCenterResultNames.contains( RiaResultNames::swat() ) )
hasAtLeastOneTernaryComponent = true; hasAtLeastOneTernaryComponent = true;
if ( resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent ) if ( resultCatType == RiaDefines::ResultCatType::DYNAMIC_NATIVE && hasAtLeastOneTernaryComponent )
@@ -2208,7 +2208,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
{ {
RigCaseCellResultsData* gridCellResults = this->currentGridCellResults(); RigCaseCellResultsData* gridCellResults = this->currentGridCellResults();
{ {
RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ); RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() );
if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) if ( gridCellResults->ensureKnownResultLoaded( resAddr ) )
{ {
@@ -2229,7 +2229,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
} }
{ {
RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ); RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() );
if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) if ( gridCellResults->ensureKnownResultLoaded( resAddr ) )
{ {
@@ -2250,7 +2250,7 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
} }
{ {
RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ); RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() );
if ( gridCellResults->ensureKnownResultLoaded( resAddr ) ) if ( gridCellResults->ensureKnownResultLoaded( resAddr ) )
{ {

View File

@@ -821,7 +821,8 @@ void RimEclipseStatisticsCase::populateResultSelection()
{ {
QStringList varList = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ) QStringList varList = caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )
->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); ->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
if ( varList.contains( "SOIL" ) ) m_selectedDynamicProperties.v().push_back( "SOIL" ); if ( varList.contains( RiaResultNames::soil() ) )
m_selectedDynamicProperties.v().push_back( RiaResultNames::soil() );
if ( varList.contains( "PRESSURE" ) ) m_selectedDynamicProperties.v().push_back( "PRESSURE" ); if ( varList.contains( "PRESSURE" ) ) m_selectedDynamicProperties.v().push_back( "PRESSURE" );
} }
@@ -837,7 +838,8 @@ void RimEclipseStatisticsCase::populateResultSelection()
{ {
QStringList varList = caseData->results( RiaDefines::PorosityModelType::FRACTURE_MODEL ) QStringList varList = caseData->results( RiaDefines::PorosityModelType::FRACTURE_MODEL )
->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE ); ->resultNames( RiaDefines::ResultCatType::DYNAMIC_NATIVE );
if ( varList.contains( "SOIL" ) ) m_selectedFractureDynamicProperties.v().push_back( "SOIL" ); if ( varList.contains( RiaResultNames::soil() ) )
m_selectedFractureDynamicProperties.v().push_back( RiaResultNames::soil() );
if ( varList.contains( "PRESSURE" ) ) m_selectedFractureDynamicProperties.v().push_back( "PRESSURE" ); if ( varList.contains( "PRESSURE" ) ) m_selectedFractureDynamicProperties.v().push_back( "PRESSURE" );
} }

View File

@@ -301,19 +301,19 @@ void RimTernaryLegendConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
{ {
caf::PdmUiOrdering* ternaryGroupContainer = uiOrdering.addNewGroup( "Ternary " ); caf::PdmUiOrdering* ternaryGroupContainer = uiOrdering.addNewGroup( "Ternary " );
{ {
caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( "SGAS" ); caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( RiaResultNames::sgas() );
ternaryGroup->add( &userDefinedMinValueSgas ); ternaryGroup->add( &userDefinedMinValueSgas );
ternaryGroup->add( &userDefinedMaxValueSgas ); ternaryGroup->add( &userDefinedMaxValueSgas );
} }
{ {
caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( "SWAT" ); caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( RiaResultNames::swat() );
ternaryGroup->add( &userDefinedMinValueSwat ); ternaryGroup->add( &userDefinedMinValueSwat );
ternaryGroup->add( &userDefinedMaxValueSwat ); ternaryGroup->add( &userDefinedMaxValueSwat );
} }
{ {
caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( "SOIL" ); caf::PdmUiOrdering* ternaryGroup = ternaryGroupContainer->addNewGroup( RiaResultNames::soil() );
ternaryGroup->add( &userDefinedMinValueSoil ); ternaryGroup->add( &userDefinedMinValueSoil );
ternaryGroup->add( &userDefinedMaxValueSoil ); ternaryGroup->add( &userDefinedMaxValueSoil );
} }

View File

@@ -71,9 +71,9 @@ void caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::setUp()
addItem( RifEclipseRftAddress::NONE, "NONE", "None" ); addItem( RifEclipseRftAddress::NONE, "NONE", "None" );
addItem( RifEclipseRftAddress::TVD, "DEPTH", "Depth" ); addItem( RifEclipseRftAddress::TVD, "DEPTH", "Depth" );
addItem( RifEclipseRftAddress::PRESSURE, "PRESSURE", "Pressure" ); addItem( RifEclipseRftAddress::PRESSURE, "PRESSURE", "Pressure" );
addItem( RifEclipseRftAddress::SWAT, "SWAT", "Water Saturation" ); addItem( RifEclipseRftAddress::SWAT, RiaResultNames::swat(), "Water Saturation" );
addItem( RifEclipseRftAddress::SOIL, "SOIL", "Oil Saturation" ); addItem( RifEclipseRftAddress::SOIL, RiaResultNames::soil(), "Oil Saturation" );
addItem( RifEclipseRftAddress::SGAS, "SGAS", "Gas Saturation" ); addItem( RifEclipseRftAddress::SGAS, RiaResultNames::sgas(), "Gas Saturation" );
addItem( RifEclipseRftAddress::WRAT, "WRAT", "Water Flow" ); addItem( RifEclipseRftAddress::WRAT, "WRAT", "Water Flow" );
addItem( RifEclipseRftAddress::ORAT, "ORAT", "Oil Flow" ); addItem( RifEclipseRftAddress::ORAT, "ORAT", "Oil Flow" );
addItem( RifEclipseRftAddress::GRAT, "GRAT", "Gas flow" ); addItem( RifEclipseRftAddress::GRAT, "GRAT", "Gas flow" );

View File

@@ -914,14 +914,16 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
{ {
// SOIL // SOIL
{ {
if ( !hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ) ) if ( !hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) ) )
{ {
if ( hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) ) || if ( hasResultEntry(
hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ) ) RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() ) ) ||
hasResultEntry(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) ) )
{ {
size_t soilIndex = size_t soilIndex =
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SOIL" ), RiaResultNames::soil() ),
false ); false );
this->setMustBeCalculated( soilIndex ); this->setMustBeCalculated( soilIndex );
} }
@@ -931,7 +933,7 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
// Oil Volume // Oil Volume
if ( RiaApplication::enableDevelopmentFeatures() ) if ( RiaApplication::enableDevelopmentFeatures() )
{ {
if ( hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ) ) if ( hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) ) )
{ {
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::riOilVolumeResultName() ), RiaResultNames::riOilVolumeResultName() ),
@@ -1348,14 +1350,16 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
return scalarResultIndex; return scalarResultIndex;
} }
if ( resultName == "SOIL" ) if ( resultName == RiaResultNames::soil() )
{ {
if ( this->mustBeCalculated( scalarResultIndex ) ) if ( this->mustBeCalculated( scalarResultIndex ) )
{ {
// Trigger loading of SWAT, SGAS to establish time step count if no data has been loaded from file at // Trigger loading of SWAT, SGAS to establish time step count if no data has been loaded from file at
// this point // this point
findOrLoadKnownScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) ); findOrLoadKnownScalarResult(
findOrLoadKnownScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() ) );
findOrLoadKnownScalarResult(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
m_cellScalarResults[scalarResultIndex].resize( this->maxTimeStepCount() ); m_cellScalarResults[scalarResultIndex].resize( this->maxTimeStepCount() );
for ( size_t timeStepIdx = 0; timeStepIdx < this->maxTimeStepCount(); timeStepIdx++ ) for ( size_t timeStepIdx = 0; timeStepIdx < this->maxTimeStepCount(); timeStepIdx++ )
@@ -1548,7 +1552,7 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResultForTimeStep( const Rig
QString resultName = resVarAddr.resultName(); QString resultName = resVarAddr.resultName();
// Special handling for SOIL // Special handling for SOIL
if ( type == RiaDefines::ResultCatType::DYNAMIC_NATIVE && resultName.toUpper() == "SOIL" ) if ( type == RiaDefines::ResultCatType::DYNAMIC_NATIVE && resultName.toUpper() == RiaResultNames::soil() )
{ {
size_t soilScalarResultIndex = this->findScalarResultIndexFromAddress( resVarAddr ); size_t soilScalarResultIndex = this->findScalarResultIndexFromAddress( resVarAddr );
@@ -1648,15 +1652,17 @@ void RigCaseCellResultsData::computeSOILForTimeStep( size_t timeStepIndex )
// Compute SGAS based on SWAT if the simulation contains no oil // Compute SGAS based on SWAT if the simulation contains no oil
testAndComputeSgasForTimeStep( timeStepIndex ); testAndComputeSgasForTimeStep( timeStepIndex );
RigEclipseResultAddress SWATAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ); RigEclipseResultAddress SWATAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() );
RigEclipseResultAddress SGASAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ); RigEclipseResultAddress SGASAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() );
RigEclipseResultAddress SSOLAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SSOL" ); RigEclipseResultAddress SSOLAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SSOL" );
size_t scalarIndexSWAT = size_t scalarIndexSWAT =
findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ), findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::swat() ),
timeStepIndex ); timeStepIndex );
size_t scalarIndexSGAS = size_t scalarIndexSGAS =
findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ), findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::sgas() ),
timeStepIndex ); timeStepIndex );
size_t scalarIndexSSOL = size_t scalarIndexSSOL =
findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SSOL" ), findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SSOL" ),
@@ -1694,7 +1700,7 @@ void RigCaseCellResultsData::computeSOILForTimeStep( size_t timeStepIndex )
} }
// Make sure memory is allocated for the new SOIL results // Make sure memory is allocated for the new SOIL results
RigEclipseResultAddress SOILAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ); RigEclipseResultAddress SOILAddr( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() );
size_t soilResultScalarIndex = this->findScalarResultIndexFromAddress( SOILAddr ); size_t soilResultScalarIndex = this->findScalarResultIndexFromAddress( SOILAddr );
m_cellScalarResults[soilResultScalarIndex].resize( soilTimeStepCount ); m_cellScalarResults[soilResultScalarIndex].resize( soilTimeStepCount );
@@ -1768,7 +1774,8 @@ void RigCaseCellResultsData::computeSOILForTimeStep( size_t timeStepIndex )
void RigCaseCellResultsData::testAndComputeSgasForTimeStep( size_t timeStepIndex ) void RigCaseCellResultsData::testAndComputeSgasForTimeStep( size_t timeStepIndex )
{ {
size_t scalarIndexSWAT = size_t scalarIndexSWAT =
findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ), findOrLoadKnownScalarResultForTimeStep( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::swat() ),
timeStepIndex ); timeStepIndex );
if ( scalarIndexSWAT == cvf::UNDEFINED_SIZE_T ) if ( scalarIndexSWAT == cvf::UNDEFINED_SIZE_T )
{ {
@@ -1784,7 +1791,8 @@ void RigCaseCellResultsData::testAndComputeSgasForTimeStep( size_t timeStepIndex
// Simulation type is gas and water. No SGAS is present, compute SGAS based on SWAT // Simulation type is gas and water. No SGAS is present, compute SGAS based on SWAT
size_t scalarIndexSGAS = size_t scalarIndexSGAS =
this->findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ), this->findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::sgas() ),
false ); false );
if ( m_cellScalarResults[scalarIndexSGAS].size() > timeStepIndex ) if ( m_cellScalarResults[scalarIndexSGAS].size() > timeStepIndex )
{ {
@@ -2930,8 +2938,8 @@ void RigCaseCellResultsData::computeOilVolumes()
false ); false );
const std::vector<double>& cellVolumeResults = m_cellScalarResults[cellVolIdx][0]; const std::vector<double>& cellVolumeResults = m_cellScalarResults[cellVolIdx][0];
size_t soilIdx = size_t soilIdx = this->findOrLoadKnownScalarResult(
this->findOrLoadKnownScalarResult( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) );
size_t oilVolIdx = size_t oilVolIdx =
this->findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, this->findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
RiaResultNames::riOilVolumeResultName() ), RiaResultNames::riOilVolumeResultName() ),

View File

@@ -563,19 +563,19 @@ void RigFlowDiagSolverInterface::assignPhaseCorrecedPORV( RigFlowDiagResultAddre
case RigFlowDiagResultAddress::PHASE_OIL: case RigFlowDiagResultAddress::PHASE_OIL:
phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SOIL", RiaResultNames::soil(),
timeStepIdx ); timeStepIdx );
break; break;
case RigFlowDiagResultAddress::PHASE_GAS: case RigFlowDiagResultAddress::PHASE_GAS:
phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SGAS", RiaResultNames::sgas(),
timeStepIdx ); timeStepIdx );
break; break;
case RigFlowDiagResultAddress::PHASE_WAT: case RigFlowDiagResultAddress::PHASE_WAT:
phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, phaseSaturation = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SWAT", RiaResultNames::swat(),
timeStepIdx ); timeStepIdx );
break; break;
default: default:

View File

@@ -46,15 +46,15 @@ RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalcul
const std::vector<double>* swatResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, const std::vector<double>* swatResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SWAT", RiaResultNames::swat(),
timestep ); timestep );
const std::vector<double>* soilResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, const std::vector<double>* soilResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SOIL", RiaResultNames::soil(),
timestep ); timestep );
const std::vector<double>* sgasResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, const std::vector<double>* sgasResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SGAS", RiaResultNames::sgas(),
timestep ); timestep );
const std::vector<double>* porvResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, const std::vector<double>* porvResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::STATIC_NATIVE, RiaDefines::ResultCatType::STATIC_NATIVE,

View File

@@ -71,11 +71,11 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe
QString phaseResultName; QString phaseResultName;
if ( phase == RiaDefines::PhaseType::WATER_PHASE ) if ( phase == RiaDefines::PhaseType::WATER_PHASE )
phaseResultName = "SWAT"; phaseResultName = RiaResultNames::swat();
else if ( phase == RiaDefines::PhaseType::OIL_PHASE ) else if ( phase == RiaDefines::PhaseType::OIL_PHASE )
phaseResultName = "SOIL"; phaseResultName = RiaResultNames::soil();
else if ( phase == RiaDefines::PhaseType::GAS_PHASE ) else if ( phase == RiaDefines::PhaseType::GAS_PHASE )
phaseResultName = "SGAS"; phaseResultName = RiaResultNames::sgas();
const std::vector<double>* phaseResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL, const std::vector<double>* phaseResults = eclipseCaseData->resultValues( RiaDefines::PorosityModelType::MATRIX_MODEL,
RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaDefines::ResultCatType::DYNAMIC_NATIVE,
phaseResultName, phaseResultName,

View File

@@ -18,6 +18,12 @@
#include "RiuRelativePermeabilityPlotPanel.h" #include "RiuRelativePermeabilityPlotPanel.h"
#include "RiaCurveDataTools.h"
#include "RiaEclipseUnitTools.h"
#include "RiaResultNames.h"
#include "RigFlowDiagSolverInterface.h"
#include "RiuDockedQwtPlot.h" #include "RiuDockedQwtPlot.h"
#include "RiuGuiTheme.h" #include "RiuGuiTheme.h"
#include "RiuQwtPlotCurve.h" #include "RiuQwtPlotCurve.h"
@@ -25,11 +31,6 @@
#include "RiuRelativePermeabilityPlotUpdater.h" #include "RiuRelativePermeabilityPlotUpdater.h"
#include "RiuTextDialog.h" #include "RiuTextDialog.h"
#include "RiaCurveDataTools.h"
#include "RiaEclipseUnitTools.h"
#include "RigFlowDiagSolverInterface.h"
#include "cvfAssert.h" #include "cvfAssert.h"
#include "cvfTrace.h" #include "cvfTrace.h"
@@ -466,11 +467,11 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
// Add vertical marker lines to indicate cell SWAT and/or SGAS saturations // Add vertical marker lines to indicate cell SWAT and/or SGAS saturations
if ( swat != HUGE_VAL ) if ( swat != HUGE_VAL )
{ {
addVerticalSaturationMarkerLine( swat, "SWAT", waterColor, plot, myPlotMarkers ); addVerticalSaturationMarkerLine( swat, RiaResultNames::swat(), waterColor, plot, myPlotMarkers );
} }
if ( sgas != HUGE_VAL ) if ( sgas != HUGE_VAL )
{ {
addVerticalSaturationMarkerLine( sgas, "SGAS", gasColor, plot, myPlotMarkers ); addVerticalSaturationMarkerLine( sgas, RiaResultNames::sgas(), gasColor, plot, myPlotMarkers );
} }
if ( logScaleLeftAxis ) if ( logScaleLeftAxis )

View File

@@ -172,9 +172,9 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
RigCaseCellResultsData* cellResultsData = RigCaseCellResultsData* cellResultsData =
eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL ); eclipseCaseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL );
cellResultsData->ensureKnownResultLoaded( cellResultsData->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() ) );
cellResultsData->ensureKnownResultLoaded( cellResultsData->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
cellResultsData->ensureKnownResultLoaded( cellResultsData->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "SATNUM" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "SATNUM" ) );
@@ -185,14 +185,14 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
RiaDefines::PorosityModelType::MATRIX_MODEL, RiaDefines::PorosityModelType::MATRIX_MODEL,
timeStepIndex, timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SWAT" ) ); RiaResultNames::swat() ) );
cvf::ref<RigResultAccessor> sgasAccessor = cvf::ref<RigResultAccessor> sgasAccessor =
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData, RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
gridIndex, gridIndex,
RiaDefines::PorosityModelType::MATRIX_MODEL, RiaDefines::PorosityModelType::MATRIX_MODEL,
timeStepIndex, timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SGAS" ) ); RiaResultNames::sgas() ) );
cvf::ref<RigResultAccessor> satnumAccessor = cvf::ref<RigResultAccessor> satnumAccessor =
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData, RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
gridIndex, gridIndex,

View File

@@ -544,11 +544,11 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
if ( gridCellResults ) if ( gridCellResults )
{ {
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) );
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() ) );
cvf::ref<RigResultAccessor> dataAccessObjectX = cvf::ref<RigResultAccessor> dataAccessObjectX =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
@@ -556,21 +556,21 @@ void RiuResultTextBuilder::appendTextFromResultColors( RigEclipseCaseData*
porosityModel, porosityModel,
timeStepIndex, timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SOIL" ) ); RiaResultNames::soil() ) );
cvf::ref<RigResultAccessor> dataAccessObjectY = cvf::ref<RigResultAccessor> dataAccessObjectY =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
timeStepIndex, timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SGAS" ) ); RiaResultNames::sgas() ) );
cvf::ref<RigResultAccessor> dataAccessObjectZ = cvf::ref<RigResultAccessor> dataAccessObjectZ =
RigResultAccessorFactory::createFromResultAddress( eclipseCase, RigResultAccessorFactory::createFromResultAddress( eclipseCase,
gridIndex, gridIndex,
porosityModel, porosityModel,
timeStepIndex, timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SWAT" ) ); RiaResultNames::swat() ) );
double scalarValue = 0.0; double scalarValue = 0.0;
@@ -900,11 +900,11 @@ QString RiuResultTextBuilder::cellResultText( RimEclipseResultDefinition* eclRes
if ( gridCellResults ) if ( gridCellResults )
{ {
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SOIL" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) );
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SGAS" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
gridCellResults->ensureKnownResultLoaded( gridCellResults->ensureKnownResultLoaded(
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, "SWAT" ) ); RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::swat() ) );
RiaDefines::PorosityModelType porosityModel = eclResDef->porosityModel(); RiaDefines::PorosityModelType porosityModel = eclResDef->porosityModel();
@@ -914,21 +914,21 @@ QString RiuResultTextBuilder::cellResultText( RimEclipseResultDefinition* eclRes
porosityModel, porosityModel,
m_timeStepIndex, m_timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SOIL" ) ); RiaResultNames::soil() ) );
cvf::ref<RigResultAccessor> dataAccessObjectY = cvf::ref<RigResultAccessor> dataAccessObjectY =
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData, RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
m_gridIndex, m_gridIndex,
porosityModel, porosityModel,
m_timeStepIndex, m_timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SGAS" ) ); RiaResultNames::sgas() ) );
cvf::ref<RigResultAccessor> dataAccessObjectZ = cvf::ref<RigResultAccessor> dataAccessObjectZ =
RigResultAccessorFactory::createFromResultAddress( eclipseCaseData, RigResultAccessorFactory::createFromResultAddress( eclipseCaseData,
m_gridIndex, m_gridIndex,
porosityModel, porosityModel,
m_timeStepIndex, m_timeStepIndex,
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE,
"SWAT" ) ); RiaResultNames::swat() ) );
double scalarValue = 0.0; double scalarValue = 0.0;