mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge branch 'dev' into pre-proto
This commit is contained in:
commit
0ba1746755
@ -8,6 +8,7 @@ set (SOURCE_GROUP_HEADER_FILES
|
||||
${CEE_CURRENT_LIST_DIR}RiaApplication.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaDefines.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaPreferences.h
|
||||
${CEE_CURRENT_LIST_DIR}RiaPorosityModel.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -15,6 +16,7 @@ ${CEE_CURRENT_LIST_DIR}RiaApplication.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaDefines.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaMain.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaPreferences.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RiaPorosityModel.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "RimCellEdgeColors.h"
|
||||
#include "RimCellRangeFilterCollection.h"
|
||||
#include "RimCommandObject.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseFaultColors.h"
|
||||
|
@ -19,6 +19,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
|
||||
@ -36,15 +37,6 @@ namespace caf
|
||||
setDefault(RiaDefines::DYNAMIC_NATIVE);
|
||||
}
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RiaDefines::PorosityModelType >::setUp()
|
||||
{
|
||||
addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix");
|
||||
addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture");
|
||||
|
||||
setDefault(RiaDefines::MATRIX_MODEL);
|
||||
}
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RiaDefines::DepthUnitType >::setUp()
|
||||
{
|
||||
@ -110,3 +102,211 @@ bool RiaDefines::isPerCellFaceResult(const QString& resultName)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::undefinedResultName()
|
||||
{
|
||||
return "None";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::undefinedGridFaultName()
|
||||
{
|
||||
return "Undefined Grid Faults";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::undefinedGridFaultWithInactiveName()
|
||||
{
|
||||
return "Undefined Grid Faults With Inactive";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::combinedTransmissibilityResultName()
|
||||
{
|
||||
return "TRANXYZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::ternarySaturationResultName()
|
||||
{
|
||||
return "TERNARY";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::combinedMultResultName()
|
||||
{
|
||||
return "MULTXYZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riTranXResultName()
|
||||
{
|
||||
return "riTRANX";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riTranYResultName()
|
||||
{
|
||||
return "riTRANY";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riTranZResultName()
|
||||
{
|
||||
return "riTRANZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::combinedRiTranResultName()
|
||||
{
|
||||
return "riTRANXYZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riMultXResultName()
|
||||
{
|
||||
return "riMULTX";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riMultYResultName()
|
||||
{
|
||||
return "riMULTY";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riMultZResultName()
|
||||
{
|
||||
return "riMULTZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::combinedRiMultResultName()
|
||||
{
|
||||
return "riMULTXYZ";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riAreaNormTranXResultName()
|
||||
{
|
||||
return "riTRANXbyArea";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riAreaNormTranYResultName()
|
||||
{
|
||||
return "riTRANYbyArea";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::riAreaNormTranZResultName()
|
||||
{
|
||||
return "riTRANZbyArea";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::combinedRiAreaNormTranResultName()
|
||||
{
|
||||
return "riTRANXYZbyArea";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::completionTypeResultName()
|
||||
{
|
||||
return "Completion Type";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::mockModelBasic()
|
||||
{
|
||||
return "Result Mock Debug Model Simple";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::mockModelBasicWithResults()
|
||||
{
|
||||
return "Result Mock Debug Model With Results";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::mockModelLargeWithResults()
|
||||
{
|
||||
return "Result Mock Debug Model Large With Results";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::mockModelCustomized()
|
||||
{
|
||||
return "Result Mock Debug Model Customized";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaDefines::mockModelBasicInputCase()
|
||||
{
|
||||
return "Input Mock Debug Model Simple";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::minimumDefaultValuePlot()
|
||||
{
|
||||
return -10.0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaDefines::maximumDefaultValuePlot()
|
||||
{
|
||||
return 100.0;
|
||||
}
|
||||
|
@ -22,10 +22,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
class RiaDefines
|
||||
namespace RiaDefines
|
||||
{
|
||||
|
||||
public:
|
||||
enum ResultCatType
|
||||
{
|
||||
DYNAMIC_NATIVE,
|
||||
@ -37,12 +35,6 @@ public:
|
||||
REMOVED
|
||||
};
|
||||
|
||||
enum PorosityModelType
|
||||
{
|
||||
MATRIX_MODEL,
|
||||
FRACTURE_MODEL
|
||||
};
|
||||
|
||||
enum CompletionType {
|
||||
WELL_PATH,
|
||||
PERFORATION_INTERVAL,
|
||||
@ -50,38 +42,38 @@ public:
|
||||
FRACTURE,
|
||||
};
|
||||
|
||||
static bool isPerCellFaceResult(const QString& resultName);
|
||||
bool isPerCellFaceResult(const QString& resultName);
|
||||
|
||||
static QString undefinedResultName() { return "None"; }
|
||||
static QString undefinedGridFaultName() { return "Undefined Grid Faults"; }
|
||||
static QString undefinedGridFaultWithInactiveName() { return "Undefined Grid Faults With Inactive"; }
|
||||
static QString combinedTransmissibilityResultName() { return "TRANXYZ"; }
|
||||
static QString ternarySaturationResultName() { return "TERNARY"; }
|
||||
static QString combinedMultResultName() { return "MULTXYZ"; }
|
||||
QString undefinedResultName();
|
||||
QString undefinedGridFaultName();
|
||||
QString undefinedGridFaultWithInactiveName();
|
||||
QString combinedTransmissibilityResultName();
|
||||
QString ternarySaturationResultName();
|
||||
QString combinedMultResultName();
|
||||
|
||||
static QString riTranXResultName() { return "riTRANX"; }
|
||||
static QString riTranYResultName() { return "riTRANY"; }
|
||||
static QString riTranZResultName() { return "riTRANZ"; }
|
||||
static QString combinedRiTranResultName() { return "riTRANXYZ"; }
|
||||
QString riTranXResultName();
|
||||
QString riTranYResultName();
|
||||
QString riTranZResultName();
|
||||
QString combinedRiTranResultName();
|
||||
|
||||
static QString riMultXResultName() { return "riMULTX"; }
|
||||
static QString riMultYResultName() { return "riMULTY"; }
|
||||
static QString riMultZResultName() { return "riMULTZ"; }
|
||||
static QString combinedRiMultResultName() { return "riMULTXYZ"; }
|
||||
QString riMultXResultName();
|
||||
QString riMultYResultName();
|
||||
QString riMultZResultName();
|
||||
QString combinedRiMultResultName();
|
||||
|
||||
static QString riAreaNormTranXResultName() { return "riTRANXbyArea"; }
|
||||
static QString riAreaNormTranYResultName() { return "riTRANYbyArea"; }
|
||||
static QString riAreaNormTranZResultName() { return "riTRANZbyArea"; }
|
||||
static QString combinedRiAreaNormTranResultName() { return "riTRANXYZbyArea"; }
|
||||
QString riAreaNormTranXResultName();
|
||||
QString riAreaNormTranYResultName();
|
||||
QString riAreaNormTranZResultName();
|
||||
QString combinedRiAreaNormTranResultName();
|
||||
|
||||
static QString completionTypeResultName() { return "Completion Type"; }
|
||||
QString completionTypeResultName();
|
||||
|
||||
// Mock model text identifiers
|
||||
static QString mockModelBasic() { return "Result Mock Debug Model Simple"; }
|
||||
static QString mockModelBasicWithResults() { return "Result Mock Debug Model With Results"; }
|
||||
static QString mockModelLargeWithResults() { return "Result Mock Debug Model Large With Results"; }
|
||||
static QString mockModelCustomized() { return "Result Mock Debug Model Customized"; }
|
||||
static QString mockModelBasicInputCase() { return "Input Mock Debug Model Simple"; }
|
||||
QString mockModelBasic();
|
||||
QString mockModelBasicWithResults();
|
||||
QString mockModelLargeWithResults();
|
||||
QString mockModelCustomized();
|
||||
QString mockModelBasicInputCase();
|
||||
|
||||
|
||||
//Units and conversions
|
||||
@ -101,7 +93,7 @@ public:
|
||||
PLOT_AXIS_RIGHT
|
||||
};
|
||||
|
||||
static double minimumDefaultValuePlot() { return - 10.0; }
|
||||
static double maximumDefaultValuePlot() { return 100.0; }
|
||||
double minimumDefaultValuePlot();
|
||||
double maximumDefaultValuePlot();
|
||||
};
|
||||
|
||||
|
34
ApplicationCode/Application/RiaPorosityModel.cpp
Normal file
34
ApplicationCode/Application/RiaPorosityModel.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RiaDefines::PorosityModelType >::setUp()
|
||||
{
|
||||
addItem(RiaDefines::MATRIX_MODEL, "MATRIX_MODEL", "Matrix");
|
||||
addItem(RiaDefines::FRACTURE_MODEL, "FRACTURE_MODEL", "Fracture");
|
||||
|
||||
setDefault(RiaDefines::MATRIX_MODEL);
|
||||
}
|
||||
}
|
31
ApplicationCode/Application/RiaPorosityModel.h
Normal file
31
ApplicationCode/Application/RiaPorosityModel.h
Normal file
@ -0,0 +1,31 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
namespace RiaDefines
|
||||
{
|
||||
enum PorosityModelType
|
||||
{
|
||||
MATRIX_MODEL,
|
||||
FRACTURE_MODEL
|
||||
};
|
||||
};
|
@ -18,19 +18,21 @@
|
||||
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicWellPathExportCompletionDataFeature.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
#include "RigCompletionData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -86,7 +88,7 @@ std::vector<RigCompletionData> RicFishbonesTransmissibilityCalculationFeatureImp
|
||||
std::vector<RigCompletionData> completionData;
|
||||
|
||||
RigMainGrid* grid = settings.caseToApply->eclipseCaseData()->mainGrid();
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
for (auto cellAndWellBoreParts : wellBorePartsInCells)
|
||||
{
|
||||
|
@ -590,7 +590,7 @@ void RicWellPathExportCompletionDataFeature::generateCompdatTable(RifEclipseData
|
||||
RifEclipseOutputTableColumn("K2"),
|
||||
RifEclipseOutputTableColumn("Status"),
|
||||
RifEclipseOutputTableColumn("SAT"),
|
||||
RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::SCIENTIFIC)),
|
||||
RifEclipseOutputTableColumn("TR", RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC)),
|
||||
RifEclipseOutputTableColumn("DIAM"),
|
||||
RifEclipseOutputTableColumn("KH"),
|
||||
RifEclipseOutputTableColumn("S"),
|
||||
@ -703,7 +703,7 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeature::generateP
|
||||
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
|
||||
|
||||
std::vector<RigCompletionData> completionData;
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
|
||||
for (const RimPerforationInterval* interval : wellPath->perforationIntervalCollection()->perforations())
|
||||
@ -934,12 +934,12 @@ CellDirection RicWellPathExportCompletionDataFeature::calculateDirectionInCell(R
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
||||
|
||||
double xLengthFraction = abs(lengthsInCell.x() / dxAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
double yLengthFraction = abs(lengthsInCell.y() / dyAccessObject->cellScalarGlobIdx(cellIndex));
|
||||
@ -973,19 +973,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibility(RimEcli
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
|
||||
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
@ -1022,19 +1022,19 @@ double RicWellPathExportCompletionDataFeature::calculateTransmissibilityAsEclips
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseCase->eclipseCaseData();
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "DZ");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DX");
|
||||
cvf::ref<RigResultAccessor> dxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DY");
|
||||
cvf::ref<RigResultAccessor> dyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||
cvf::ref<RigResultAccessor> dzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "DZ");
|
||||
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMX");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMY");
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RifReaderInterface::MATRIX_RESULTS, 0, "PERMZ");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMX");
|
||||
cvf::ref<RigResultAccessor> permxAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMX");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMY");
|
||||
cvf::ref<RigResultAccessor> permyAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMY");
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PERMZ");
|
||||
cvf::ref<RigResultAccessor> permzAccessObject = RigResultAccessorFactory::createFromUiResultName(eclipseCaseData, 0, RiaDefines::MATRIX_MODEL, 0, "PERMZ");
|
||||
|
||||
double dx = dxAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
double dy = dyAccessObject->cellScalarGlobIdx(cellIndex);
|
||||
|
@ -260,7 +260,7 @@ RigActiveCellInfo* RicCellRangeUi::activeCellInfo() const
|
||||
RimEclipseCase* rimEclipeCase = dynamic_cast<RimEclipseCase*>(m_case());
|
||||
if (rimEclipeCase && rimEclipeCase->eclipseCaseData())
|
||||
{
|
||||
return rimEclipeCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
return rimEclipeCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "RigFault.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFault.h"
|
||||
|
||||
|
@ -248,9 +248,9 @@ QString RifEclipseDataTableFormatter::format(double num, RifEclipseOutputTableDo
|
||||
{
|
||||
switch (doubleFormat.format)
|
||||
{
|
||||
case RifEclipseOutputTableDoubleFormat::FLOAT:
|
||||
case RifEclipseOutputTableDoubleFormat::RIF_FLOAT:
|
||||
return QString("%1").arg(num, 0, 'f', doubleFormat.width);
|
||||
case RifEclipseOutputTableDoubleFormat::SCIENTIFIC:
|
||||
case RifEclipseOutputTableDoubleFormat::RIF_SCIENTIFIC:
|
||||
return QString("%1").arg(num, 0, 'E');
|
||||
default:
|
||||
return QString("%1");
|
||||
|
@ -46,8 +46,8 @@ enum RifEclipseOutputTableAlignment
|
||||
//==================================================================================================
|
||||
enum RifEclipseOutputTableDoubleFormat
|
||||
{
|
||||
SCIENTIFIC,
|
||||
FLOAT,
|
||||
RIF_SCIENTIFIC,
|
||||
RIF_FLOAT,
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@ -64,7 +64,7 @@ struct RifEclipseOutputTableLine
|
||||
//==================================================================================================
|
||||
struct RifEclipseOutputTableDoubleFormatting
|
||||
{
|
||||
RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat format = FLOAT, int width = 5)
|
||||
RifEclipseOutputTableDoubleFormatting(RifEclipseOutputTableDoubleFormat format = RIF_FLOAT, int width = 5)
|
||||
: format(format),
|
||||
width(width)
|
||||
{}
|
||||
|
@ -231,7 +231,7 @@ std::map<QString, QString> RifEclipseInputFileTools::readProperties(const QStrin
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE));
|
||||
if (eclipseKeywordData)
|
||||
{
|
||||
QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeywords[i].keyword);
|
||||
QString newResultName = caseData->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeywords[i].keyword);
|
||||
if (readDataFromKeyword(eclipseKeywordData, caseData, newResultName))
|
||||
{
|
||||
newResults[newResultName] = fileKeywords[i].keyword;
|
||||
@ -290,7 +290,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa
|
||||
{
|
||||
mathingItemCount = true;
|
||||
}
|
||||
if (itemCount == caseData->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount())
|
||||
if (itemCount == caseData->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount())
|
||||
{
|
||||
mathingItemCount = true;
|
||||
}
|
||||
@ -301,7 +301,7 @@ bool RifEclipseInputFileTools::readDataFromKeyword(ecl_kw_type* eclipseKeywordDa
|
||||
size_t resultIndex = RifEclipseInputFileTools::findOrCreateResult(resultName, caseData);
|
||||
if (resultIndex == cvf::UNDEFINED_SIZE_T) return false;
|
||||
|
||||
std::vector< std::vector<double> >& newPropertyData = caseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||
std::vector< std::vector<double> >& newPropertyData = caseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex);
|
||||
newPropertyData.push_back(std::vector<double>());
|
||||
newPropertyData[0].resize(ecl_kw_get_size(eclipseKeywordData), HUGE_VAL);
|
||||
ecl_kw_get_data_as_double(eclipseKeywordData, newPropertyData[0].data());
|
||||
@ -446,7 +446,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
|
||||
{
|
||||
CVF_ASSERT(eclipseCase);
|
||||
|
||||
size_t resultIndex = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(resultName);
|
||||
size_t resultIndex = eclipseCase->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(resultName);
|
||||
if (resultIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return false;
|
||||
@ -458,7 +458,7 @@ bool RifEclipseInputFileTools::writePropertyToTextFile(const QString& fileName,
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector< std::vector<double> >& resultData = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
|
||||
std::vector< std::vector<double> >& resultData = eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(resultIndex);
|
||||
if (resultData.size() == 0)
|
||||
{
|
||||
return false;
|
||||
@ -717,10 +717,10 @@ qint64 RifEclipseInputFileTools::findKeyword(const QString& keyword, QFile& file
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RifEclipseInputFileTools::findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir)
|
||||
{
|
||||
size_t resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(newResultName);
|
||||
size_t resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->findScalarResultIndex(newResultName);
|
||||
if (resultIndex == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false);
|
||||
resultIndex = reservoir->results(RiaDefines::MATRIX_MODEL)->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, newResultName, false);
|
||||
}
|
||||
|
||||
return resultIndex;
|
||||
|
@ -38,6 +38,6 @@ public:
|
||||
|
||||
virtual void close() {}
|
||||
|
||||
virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values ) { return false; }
|
||||
virtual bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values ) { return false; }
|
||||
virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values ) { return false; }
|
||||
virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values ) { return false; }
|
||||
};
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
@ -194,8 +195,6 @@ RifReaderEclipseOutput::RifReaderEclipseOutput()
|
||||
m_fileName.clear();
|
||||
m_filesWithSameBaseName.clear();
|
||||
|
||||
m_timeSteps.clear();
|
||||
|
||||
m_eclipseCase = NULL;
|
||||
|
||||
m_ecl_init_file = NULL;
|
||||
@ -243,8 +242,8 @@ bool RifReaderEclipseOutput::transferGeometry(const ecl_grid_type* mainEclGrid,
|
||||
return false;
|
||||
}
|
||||
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
RigActiveCellInfo* fractureActiveCellInfo = eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
CVF_ASSERT(activeCellInfo && fractureActiveCellInfo);
|
||||
|
||||
@ -581,8 +580,8 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
|
||||
return false;
|
||||
}
|
||||
|
||||
RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigActiveCellInfo* activeCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
RigActiveCellInfo* fractureActiveCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
activeCellInfo->setReservoirCellCount(reservoirCellCount);
|
||||
fractureActiveCellInfo->setReservoirCellCount(reservoirCellCount);
|
||||
@ -645,8 +644,10 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
|
||||
progInfo.setNextProgressIncrement(m_filesWithSameBaseName.size());
|
||||
|
||||
RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigCaseCellResultsData* matrixModelResults = m_eclipseCase->results(RiaDefines::MATRIX_MODEL);
|
||||
RigCaseCellResultsData* fractureModelResults = m_eclipseCase->results(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos;
|
||||
|
||||
// Create access object for dynamic results
|
||||
m_dynamicResultsAccess = createDynamicResultsAccess();
|
||||
@ -656,9 +657,7 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
|
||||
progInfo.incrementProgress();
|
||||
|
||||
// Get time steps
|
||||
m_dynamicResultsAccess->timeSteps(&m_timeSteps, &m_daysSinceSimulationStart);
|
||||
std::vector<int> reportNumbers = m_dynamicResultsAccess->reportNumbers();
|
||||
timeStepInfos = createFilteredTimeStepInfos();
|
||||
|
||||
QStringList resultNames;
|
||||
std::vector<size_t> resultNamesDataItemCounts;
|
||||
@ -666,27 +665,27 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
|
||||
{
|
||||
QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts,
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS),
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS),
|
||||
RifReaderInterface::MATRIX_RESULTS, m_dynamicResultsAccess->timeStepCount());
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL),
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL),
|
||||
RiaDefines::MATRIX_MODEL, m_dynamicResultsAccess->timeStepCount());
|
||||
|
||||
for (int i = 0; i < matrixResultNames.size(); ++i)
|
||||
{
|
||||
size_t resIndex = matrixModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, matrixResultNames[i], false);
|
||||
matrixModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers);
|
||||
matrixModelResults->setTimeStepInfos(resIndex, timeStepInfos);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts,
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS),
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS),
|
||||
RifReaderInterface::FRACTURE_RESULTS, m_dynamicResultsAccess->timeStepCount());
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL),
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL),
|
||||
RiaDefines::FRACTURE_MODEL, m_dynamicResultsAccess->timeStepCount());
|
||||
|
||||
for (int i = 0; i < fractureResultNames.size(); ++i)
|
||||
{
|
||||
size_t resIndex = fractureModelResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, fractureResultNames[i], false);
|
||||
fractureModelResults->setTimeStepDates(resIndex, m_timeSteps, m_daysSinceSimulationStart, reportNumbers);
|
||||
fractureModelResults->setTimeStepInfos(resIndex, timeStepInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,36 +721,17 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
|
||||
RifEclipseOutputFileTools::findKeywordsAndItemCount(filesUsedToFindAvailableKeywords, &resultNames, &resultNamesDataItemCounts);
|
||||
|
||||
std::vector<QDateTime> staticDate;
|
||||
std::vector<double> staticDay;
|
||||
std::vector<int> staticReportNumber;
|
||||
std::vector<RigEclipseTimeStepInfo> staticTimeStepInfo;
|
||||
if (!timeStepInfos.empty())
|
||||
{
|
||||
if ( m_timeSteps.size() > 0 )
|
||||
{
|
||||
staticDate.push_back(m_timeSteps.front());
|
||||
}
|
||||
if (m_daysSinceSimulationStart.size() > 0)
|
||||
{
|
||||
staticDay.push_back(m_daysSinceSimulationStart.front());
|
||||
}
|
||||
|
||||
std::vector<int> reportNumbers;
|
||||
if (m_dynamicResultsAccess.notNull())
|
||||
{
|
||||
reportNumbers = m_dynamicResultsAccess->reportNumbers();
|
||||
}
|
||||
|
||||
if ( reportNumbers.size() > 0 )
|
||||
{
|
||||
staticReportNumber.push_back(reportNumbers.front());
|
||||
}
|
||||
staticTimeStepInfo.push_back(timeStepInfos.front());
|
||||
}
|
||||
|
||||
{
|
||||
QStringList matrixResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts,
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS),
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS),
|
||||
RifReaderInterface::MATRIX_RESULTS, 1);
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL),
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL),
|
||||
RiaDefines::MATRIX_MODEL, 1);
|
||||
|
||||
// Add ACTNUM
|
||||
matrixResultNames += "ACTNUM";
|
||||
@ -759,22 +739,22 @@ void RifReaderEclipseOutput::buildMetaData()
|
||||
for (int i = 0; i < matrixResultNames.size(); ++i)
|
||||
{
|
||||
size_t resIndex = matrixModelResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, matrixResultNames[i], false);
|
||||
matrixModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber);
|
||||
matrixModelResults->setTimeStepInfos(resIndex, staticTimeStepInfo);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QStringList fractureResultNames = validKeywordsForPorosityModel(resultNames, resultNamesDataItemCounts,
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS),
|
||||
m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS),
|
||||
RifReaderInterface::FRACTURE_RESULTS, 1);
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL),
|
||||
m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL),
|
||||
RiaDefines::FRACTURE_MODEL, 1);
|
||||
// Add ACTNUM
|
||||
fractureResultNames += "ACTNUM";
|
||||
|
||||
for (int i = 0; i < fractureResultNames.size(); ++i)
|
||||
{
|
||||
size_t resIndex = fractureModelResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, fractureResultNames[i], false);
|
||||
fractureModelResults->setTimeStepDates(resIndex, staticDate, staticDay, staticReportNumber);
|
||||
fractureModelResults->setTimeStepInfos(resIndex, staticTimeStepInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -811,7 +791,7 @@ RifEclipseRestartDataAccess* RifReaderEclipseOutput::createDynamicResultsAccess(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get all values of a given static result as doubles
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderEclipseOutput::staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values)
|
||||
bool RifReaderEclipseOutput::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values)
|
||||
{
|
||||
CVF_ASSERT(values);
|
||||
|
||||
@ -847,7 +827,7 @@ bool RifReaderEclipseOutput::staticResult(const QString& result, PorosityModelRe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get dynamic result at given step index. Will concatenate values for the main grid and all sub grids.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderEclipseOutput::dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values)
|
||||
bool RifReaderEclipseOutput::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values)
|
||||
{
|
||||
if (m_dynamicResultsAccess.isNull())
|
||||
{
|
||||
@ -856,8 +836,10 @@ bool RifReaderEclipseOutput::dynamicResult(const QString& result, PorosityModelR
|
||||
|
||||
if (m_dynamicResultsAccess.notNull())
|
||||
{
|
||||
size_t indexOnFile = timeStepIndexOnFile(stepIndex);
|
||||
|
||||
std::vector<double> fileValues;
|
||||
if (!m_dynamicResultsAccess->results(result, stepIndex, m_eclipseCase->mainGrid()->gridCount(), &fileValues))
|
||||
if (!m_dynamicResultsAccess->results(result, indexOnFile, m_eclipseCase->mainGrid()->gridCount(), &fileValues))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1655,7 +1637,16 @@ void RifReaderEclipseOutput::readWellCells(const ecl_grid_type* mainEclGrid, boo
|
||||
}
|
||||
|
||||
|
||||
wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(m_timeSteps);
|
||||
std::vector<QDateTime> filteredTimeSteps;
|
||||
{
|
||||
std::vector<RigEclipseTimeStepInfo> filteredTimeStepInfos = createFilteredTimeStepInfos();
|
||||
for (auto a : filteredTimeStepInfos)
|
||||
{
|
||||
filteredTimeSteps.push_back(a.m_date);
|
||||
}
|
||||
}
|
||||
|
||||
wellResults->computeMappingFromResultTimeIndicesToWellTimeIndices(filteredTimeSteps);
|
||||
|
||||
wells.push_back(wellResults.p());
|
||||
|
||||
@ -1675,7 +1666,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
const std::vector<size_t>& keywordDataItemCounts,
|
||||
const RigActiveCellInfo* matrixActiveCellInfo,
|
||||
const RigActiveCellInfo* fractureActiveCellInfo,
|
||||
PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepCount) const
|
||||
{
|
||||
CVF_ASSERT(matrixActiveCellInfo);
|
||||
@ -1685,7 +1676,7 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
if (porosityModel == RifReaderInterface::FRACTURE_RESULTS)
|
||||
if (porosityModel == RiaDefines::FRACTURE_MODEL)
|
||||
{
|
||||
if (fractureActiveCellInfo->reservoirActiveCellCount() == 0)
|
||||
{
|
||||
@ -1721,14 +1712,14 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
size_t sumFractureMatrixActiveCellCount = matrixActiveCellInfo->reservoirActiveCellCount() + fractureActiveCellInfo->reservoirActiveCellCount();
|
||||
size_t timeStepsMatrixAndFractureRest = keywordDataItemCount % sumFractureMatrixActiveCellCount;
|
||||
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS && timeStepsMatrixRest == 0)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL && timeStepsMatrixRest == 0)
|
||||
{
|
||||
if (keywordDataItemCount <= timeStepCount * std::max(matrixActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount))
|
||||
{
|
||||
validKeyword = true;
|
||||
}
|
||||
}
|
||||
else if (porosityModel == RifReaderInterface::FRACTURE_RESULTS && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0)
|
||||
else if (porosityModel == RiaDefines::FRACTURE_MODEL && fractureActiveCellInfo->reservoirActiveCellCount() > 0 && timeStepsFractureRest == 0)
|
||||
{
|
||||
if (keywordDataItemCount <= timeStepCount * std::max(fractureActiveCellInfo->reservoirActiveCellCount(), sumFractureMatrixActiveCellCount))
|
||||
{
|
||||
@ -1774,19 +1765,47 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector<double>* destinationResultValues, const std::vector<double>& sourceResultValues)
|
||||
std::vector<RigEclipseTimeStepInfo> RifReaderEclipseOutput::createFilteredTimeStepInfos()
|
||||
{
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos;
|
||||
|
||||
if (m_dynamicResultsAccess.notNull())
|
||||
{
|
||||
std::vector<QDateTime> timeStepsOnFile;
|
||||
std::vector<double> daysSinceSimulationStartOnFile;
|
||||
std::vector<int> reportNumbersOnFile;
|
||||
|
||||
m_dynamicResultsAccess->timeSteps(&timeStepsOnFile, &daysSinceSimulationStartOnFile);
|
||||
reportNumbersOnFile = m_dynamicResultsAccess->reportNumbers();
|
||||
|
||||
for (size_t i = 0; i < timeStepsOnFile.size(); i++)
|
||||
{
|
||||
if (this->isTimeStepIncludedByFilter(i))
|
||||
{
|
||||
timeStepInfos.push_back(RigEclipseTimeStepInfo(timeStepsOnFile[i], reportNumbersOnFile[i], daysSinceSimulationStartOnFile[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return timeStepInfos;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* destinationResultValues, const std::vector<double>& sourceResultValues)
|
||||
{
|
||||
if (sourceResultValues.size() == 0) return;
|
||||
|
||||
RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigActiveCellInfo* fracActCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
if (matrixOrFracture == RifReaderInterface::MATRIX_RESULTS && fracActCellInfo->reservoirActiveCellCount() == 0)
|
||||
if (matrixOrFracture == RiaDefines::MATRIX_MODEL && fracActCellInfo->reservoirActiveCellCount() == 0)
|
||||
{
|
||||
destinationResultValues->insert(destinationResultValues->end(), sourceResultValues.begin(), sourceResultValues.end());
|
||||
}
|
||||
else
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigActiveCellInfo* actCellInfo = m_eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
size_t sourceStartPosition = 0;
|
||||
|
||||
@ -1798,7 +1817,7 @@ void RifReaderEclipseOutput::extractResultValuesBasedOnPorosityModel(PorosityMod
|
||||
actCellInfo->gridActiveCellCounts(i, matrixActiveCellCount);
|
||||
fracActCellInfo->gridActiveCellCounts(i, fractureActiveCellCount);
|
||||
|
||||
if (matrixOrFracture == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (matrixOrFracture == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
destinationResultValues->insert(destinationResultValues->end(),
|
||||
sourceResultValues.begin() + sourceStartPosition,
|
||||
@ -1833,14 +1852,6 @@ void RifReaderEclipseOutput::openInitFile()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QDateTime> RifReaderEclipseOutput::timeSteps()
|
||||
{
|
||||
return m_timeSteps;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -24,15 +24,13 @@
|
||||
|
||||
#include "cvfCollection.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QDateTime>
|
||||
|
||||
class RifEclipseOutputFileTools;
|
||||
class RifEclipseRestartDataAccess;
|
||||
class RigGridBase;
|
||||
class RigMainGrid;
|
||||
class RigActiveCellInfo;
|
||||
class RigFault;
|
||||
class RigEclipseTimeStepInfo;
|
||||
|
||||
struct RigWellResultPoint;
|
||||
|
||||
@ -56,8 +54,8 @@ public:
|
||||
virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector<QDateTime>& mainCaseTimeSteps, RigEclipseCaseData* eclipseCase);
|
||||
void close();
|
||||
|
||||
bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values);
|
||||
bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values);
|
||||
bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values);
|
||||
bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values);
|
||||
|
||||
static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCaseData* eclipseCase);
|
||||
static void transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid);
|
||||
@ -73,28 +71,24 @@ private:
|
||||
|
||||
void importFaults(const QStringList& fileSet, cvf::Collection<RigFault>* faults);
|
||||
|
||||
|
||||
void openInitFile();
|
||||
bool openDynamicAccess();
|
||||
|
||||
void extractResultValuesBasedOnPorosityModel(PorosityModelResultType matrixOrFracture, std::vector<double>* values, const std::vector<double>& fileValues);
|
||||
void extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values, const std::vector<double>& fileValues);
|
||||
void transferNNCData( const ecl_grid_type * mainEclGrid , const ecl_file_type * init_file,
|
||||
RigMainGrid * mainGrid);
|
||||
|
||||
RifEclipseRestartDataAccess* createDynamicResultsAccess();
|
||||
|
||||
QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector<size_t>& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, PorosityModelResultType matrixOrFracture, size_t timeStepCount) const;
|
||||
QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector<size_t>& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const;
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> createFilteredTimeStepInfos();
|
||||
|
||||
virtual std::vector<QDateTime> timeSteps();
|
||||
private:
|
||||
QString m_fileName; // Name of file used to start accessing Eclipse output files
|
||||
QStringList m_filesWithSameBaseName; // Set of files in filename's path with same base name as filename
|
||||
QString m_fileName; // Name of file used to start accessing Eclipse output files
|
||||
QStringList m_filesWithSameBaseName; // Set of files in filename's path with same base name as filename
|
||||
|
||||
RigEclipseCaseData* m_eclipseCase;
|
||||
RigEclipseCaseData* m_eclipseCase;
|
||||
|
||||
std::vector<QDateTime> m_timeSteps;
|
||||
std::vector<double> m_daysSinceSimulationStart;
|
||||
|
||||
ecl_file_type* m_ecl_init_file; // File access to static results
|
||||
cvf::ref<RifEclipseRestartDataAccess> m_dynamicResultsAccess; // File access to dynamic results
|
||||
ecl_file_type* m_ecl_init_file; // File access to static results
|
||||
cvf::ref<RifEclipseRestartDataAccess> m_dynamicResultsAccess; // File access to dynamic results
|
||||
};
|
||||
|
@ -68,6 +68,9 @@ bool RifReaderInterface::isNNCsEnabled()
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
|
||||
{
|
||||
if (m_settings.notNull())
|
||||
@ -77,3 +80,43 @@ const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RifReaderInterface::setTimeStepFilter(const std::vector<size_t>& fileTimeStepIndices)
|
||||
{
|
||||
m_fileTimeStepIndices = fileTimeStepIndices;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderInterface::isTimeStepIncludedByFilter(size_t timeStepIndex) const
|
||||
{
|
||||
if (m_fileTimeStepIndices.empty()) return true;
|
||||
|
||||
for (auto i : m_fileTimeStepIndices)
|
||||
{
|
||||
if (i == timeStepIndex)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RifReaderInterface::timeStepIndexOnFile(size_t timeStepIndex) const
|
||||
{
|
||||
if (timeStepIndex < m_fileTimeStepIndices.size())
|
||||
{
|
||||
return m_fileTimeStepIndices[timeStepIndex];
|
||||
}
|
||||
|
||||
return timeStepIndex;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
@ -43,13 +45,6 @@ class RifReaderSettings;
|
||||
//==================================================================================================
|
||||
class RifReaderInterface : public cvf::Object
|
||||
{
|
||||
public:
|
||||
enum PorosityModelResultType
|
||||
{
|
||||
MATRIX_RESULTS,
|
||||
FRACTURE_RESULTS
|
||||
};
|
||||
|
||||
public:
|
||||
RifReaderInterface() { }
|
||||
virtual ~RifReaderInterface() { }
|
||||
@ -64,16 +59,21 @@ public:
|
||||
virtual bool open(const QString& fileName, RigEclipseCaseData* eclipseCase) = 0;
|
||||
virtual void close() = 0;
|
||||
|
||||
virtual bool staticResult(const QString& result, PorosityModelResultType matrixOrFracture, std::vector<double>* values) = 0;
|
||||
virtual bool dynamicResult(const QString& result, PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values) = 0;
|
||||
|
||||
virtual std::vector<QDateTime> timeSteps() { std::vector<QDateTime> timeSteps; return timeSteps; }
|
||||
virtual bool staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values) = 0;
|
||||
virtual bool dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values) = 0;
|
||||
|
||||
void setFilenamesWithFaults(const std::vector<QString>& filenames) { m_filenamesWithFaults = filenames; }
|
||||
std::vector<QString> filenamesWithFaults() { return m_filenamesWithFaults; }
|
||||
|
||||
void setTimeStepFilter(const std::vector<size_t>& fileTimeStepIndices);
|
||||
|
||||
protected:
|
||||
bool isTimeStepIncludedByFilter(size_t timeStepIndex) const;
|
||||
size_t timeStepIndexOnFile(size_t timeStepIndex) const;
|
||||
|
||||
private:
|
||||
std::vector<QString> m_filenamesWithFaults;
|
||||
caf::PdmPointer<RifReaderSettings> m_settings;
|
||||
|
||||
std::vector<size_t> m_fileTimeStepIndices;
|
||||
};
|
||||
|
@ -20,10 +20,9 @@
|
||||
|
||||
#include "RifReaderMockModel.h"
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -34,34 +33,34 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip
|
||||
|
||||
m_reservoir = eclipseCase;
|
||||
|
||||
RigCaseCellResultsData* cellResults = eclipseCase->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* cellResults = eclipseCase->results(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
|
||||
std::vector<QDateTime> dates;
|
||||
std::vector<double> days;
|
||||
std::vector<int> repNumbers;
|
||||
|
||||
for (int i = 0; i < static_cast<int>(m_reservoirBuilder.timeStepCount()); i++)
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos;
|
||||
{
|
||||
dates.push_back(QDateTime(QDate(2012+i, 6, 1)));
|
||||
days.push_back(i);
|
||||
repNumbers.push_back(i);
|
||||
std::vector<QDateTime> dates;
|
||||
std::vector<double> days;
|
||||
std::vector<int> repNumbers;
|
||||
|
||||
for (int i = 0; i < static_cast<int>(m_reservoirBuilder.timeStepCount()); i++)
|
||||
{
|
||||
dates.push_back(QDateTime(QDate(2012+i, 6, 1)));
|
||||
days.push_back(i);
|
||||
repNumbers.push_back(i);
|
||||
}
|
||||
|
||||
timeStepInfos = RigEclipseTimeStepInfo::createTimeStepInfos(dates, repNumbers, days);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_reservoirBuilder.resultCount(); i++)
|
||||
{
|
||||
size_t resIdx = cellResults->addEmptyScalarResult(RiaDefines::DYNAMIC_NATIVE, QString("Dynamic_Result_%1").arg(i), false);
|
||||
cellResults->setTimeStepDates(resIdx, dates, days, repNumbers);
|
||||
cellResults->setTimeStepInfos(resIdx, timeStepInfos);
|
||||
}
|
||||
|
||||
if (m_reservoirBuilder.timeStepCount() == 0) return true;
|
||||
|
||||
std::vector<QDateTime> staticDates;
|
||||
staticDates.push_back(dates[0]);
|
||||
std::vector<double> staticDays;
|
||||
staticDays.push_back(days[0]);
|
||||
std::vector<int> staticRepNumbers;
|
||||
staticRepNumbers.push_back(0);
|
||||
std::vector<RigEclipseTimeStepInfo> staticResultTimeStepInfos;
|
||||
staticResultTimeStepInfos.push_back(timeStepInfos[0]);
|
||||
|
||||
for (int i = 0; i < static_cast<int>(m_reservoirBuilder.resultCount()); i++)
|
||||
{
|
||||
@ -72,7 +71,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip
|
||||
if (i > 1) resIndex = i;
|
||||
|
||||
size_t resIdx = cellResults->addEmptyScalarResult(RiaDefines::STATIC_NATIVE, QString("Static_Result_%1%2").arg(resIndex).arg(varEnd), false);
|
||||
cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers);
|
||||
cellResults->setTimeStepInfos(resIdx, staticResultTimeStepInfos);
|
||||
}
|
||||
|
||||
|
||||
@ -81,7 +80,7 @@ bool RifReaderMockModel::open(const QString& fileName, RigEclipseCaseData* eclip
|
||||
size_t resIdx; \
|
||||
QString resultName(Name); \
|
||||
resIdx = cellResults->addEmptyScalarResult(RiaDefines::INPUT_PROPERTY, resultName, false); \
|
||||
cellResults->setTimeStepDates(resIdx, staticDates, staticDays, staticRepNumbers); \
|
||||
cellResults->setTimeStepInfos(resIdx, staticResultTimeStepInfos); \
|
||||
cellResults->cellScalarResults(resIdx).resize(1); \
|
||||
std::vector<double>& values = cellResults->cellScalarResults(resIdx)[0]; \
|
||||
this->inputProperty(resultName, &values); \
|
||||
@ -114,7 +113,7 @@ bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector<
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector<double>* values)
|
||||
bool RifReaderMockModel::staticResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values)
|
||||
{
|
||||
m_reservoirBuilder.staticResult(m_reservoir, result, values);
|
||||
|
||||
@ -124,7 +123,7 @@ bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderMockModel::dynamicResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values)
|
||||
bool RifReaderMockModel::dynamicResult(const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values)
|
||||
{
|
||||
m_reservoirBuilder.dynamicResult(m_reservoir, result, stepIndex, values);
|
||||
|
||||
|
@ -39,8 +39,8 @@ public:
|
||||
virtual bool open( const QString& fileName, RigEclipseCaseData* eclipseCase );
|
||||
virtual void close();
|
||||
|
||||
virtual bool staticResult( const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector<double>* values );
|
||||
virtual bool dynamicResult( const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values );
|
||||
virtual bool staticResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values );
|
||||
virtual bool dynamicResult( const QString& result, RiaDefines::PorosityModelType matrixOrFracture, size_t stepIndex, std::vector<double>* values );
|
||||
|
||||
private:
|
||||
void populateReservoir(RigEclipseCaseData* eclipseCase);
|
||||
|
@ -36,7 +36,6 @@ ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.h
|
||||
${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivPartPriority.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.h
|
||||
${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.h
|
||||
@ -71,7 +70,6 @@ ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivSimWellPipeSourceInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellSpheresPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivObjectSourceInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivWellConnectionsPartMgr.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RivFishbonesSubsPartMgr.cpp
|
||||
|
@ -94,7 +94,6 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
RimEclipseCellColors* cellResultColors = eclipseView->cellResult();
|
||||
CVF_ASSERT(cellResultColors);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData();
|
||||
|
||||
// CrossSections
|
||||
|
@ -102,7 +102,6 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
RimEclipseCellColors* cellResultColors = eclipseView->cellResult();
|
||||
CVF_ASSERT(cellResultColors);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData();
|
||||
|
||||
// CrossSections
|
||||
|
@ -299,8 +299,6 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
{
|
||||
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
|
||||
if (cellEdgeResultColors->propertyType() == RimCellEdgeColors::ANY_SINGLE_PROPERTY)
|
||||
{
|
||||
cvf::ref<RigResultAccessor> daObj = RivCellEdgeGeometryUtils::createCellCenterResultAccessor(cellEdgeResultColors->singleVarEdgeResultColors(), timeStepIndex, eclipseCase, grid);
|
||||
@ -327,6 +325,7 @@ cvf::ref<RigResultAccessor> RivCellEdgeGeometryUtils::createCellEdgeResultAccess
|
||||
adjustedTimeStep = 0;
|
||||
}
|
||||
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createFromResultIdx(eclipseCase, grid->gridIndex(), porosityModel, adjustedTimeStep, resultIndices[cubeFaceIdx]);
|
||||
cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx), daObj.p());
|
||||
}
|
||||
|
@ -105,7 +105,6 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
|
||||
|
||||
updateNNCColors(cellResultColors);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
RimEclipseView* eclipseView = cellResultColors->reservoirView();
|
||||
RigEclipseCaseData* eclipseCase = eclipseView->eclipseCase()->eclipseCaseData();
|
||||
|
||||
|
@ -55,7 +55,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator(
|
||||
|
||||
if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
|
||||
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL");
|
||||
cvf::ref<RigResultAccessor> sgas = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SGAS");
|
||||
@ -89,7 +89,7 @@ RivTernaryTextureCoordsCreator::RivTernaryTextureCoordsCreator(
|
||||
|
||||
if (cellResultColors->hasStaticResult()) resTimeStepIdx = 0;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultColors->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = cellResultColors->porosityModel();
|
||||
|
||||
size_t gridIndex = 0;
|
||||
cvf::ref<RigResultAccessor> soil = RigResultAccessorFactory::createFromUiResultName(eclipseCase, gridIndex, porosityModel, resTimeStepIdx, "SOIL");
|
||||
|
@ -92,6 +92,7 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanLegendConfig.h
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanColors.h
|
||||
${CEE_CURRENT_LIST_DIR}RimDialogData.h
|
||||
${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -182,6 +183,7 @@ ${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanLegendConfig.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimStimPlanColors.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimDialogData.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RimTimeStepFilter.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -669,7 +669,9 @@ void RimFishbonesMultipleSubs::computeSubLateralIndices()
|
||||
m_subLateralIndices.clear();
|
||||
for (size_t subIndex = 0; subIndex < m_locationOfSubs().size(); ++subIndex)
|
||||
{
|
||||
SubLateralIndex subLateralIndex{ subIndex };
|
||||
SubLateralIndex subLateralIndex;
|
||||
subLateralIndex.subIndex = subIndex;
|
||||
|
||||
for (size_t lateralIndex = 0; lateralIndex < m_lateralCountPerSub(); ++lateralIndex)
|
||||
{
|
||||
subLateralIndex.lateralIndices.push_back(lateralIndex);
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
|
||||
@ -58,6 +60,7 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_timeStepSelectionType, "TimeSelectionType", "Time Steps", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "SelectedTimeSteps", "", "", "", "");
|
||||
CAF_PDM_InitField(&m_maxPvFraction, "CellPVThreshold", 0.1, "Aquifer Cell Threshold", "", "Exclude Aquifer Effects by adding a Cell Pore Volume Threshold as Fraction of Total Pore Volume.", "");
|
||||
|
||||
CAF_PDM_InitField(&m_showLegend, "ShowLegend", true, "Legend", "", "", "");
|
||||
|
||||
@ -119,7 +122,7 @@ void RimFlowCharacteristicsPlot::updateCurrentTimeStep()
|
||||
if (!m_flowDiagSolution()) return;
|
||||
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
if (m_currentlyPlottedTimeSteps == calculatedTimesteps) return;
|
||||
|
||||
@ -171,7 +174,7 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
|
||||
if ( m_flowDiagSolution )
|
||||
{
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
QStringList timeStepDates = m_case->timeStepStrings();
|
||||
|
||||
@ -198,6 +201,7 @@ void RimFlowCharacteristicsPlot::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
if (m_timeStepSelectionType == SELECT_AVAILABLE) uiOrdering.add(&m_selectedTimeSteps);
|
||||
|
||||
uiOrdering.add(&m_showLegend);
|
||||
uiOrdering.add(&m_maxPvFraction);
|
||||
|
||||
uiOrdering.skipRemainingFields();
|
||||
}
|
||||
@ -262,7 +266,7 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate()
|
||||
if (m_flowDiagSolution && m_flowCharPlotWidget)
|
||||
{
|
||||
RigFlowDiagResults* flowResult = m_flowDiagSolution->flowDiagResults();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps();
|
||||
std::vector<int> calculatedTimesteps = flowResult->calculatedTimeSteps(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
if (m_timeStepSelectionType == SELECT_AVAILABLE)
|
||||
{
|
||||
@ -288,14 +292,14 @@ void RimFlowCharacteristicsPlot::loadDataAndUpdate()
|
||||
|
||||
for ( int timeStepIdx: calculatedTimesteps )
|
||||
{
|
||||
lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx).m_lorenzCoefficient;
|
||||
lorenzVals[timeStepIdx] = flowResult->flowCharacteristicsResults(timeStepIdx, m_maxPvFraction()).m_lorenzCoefficient;
|
||||
}
|
||||
m_flowCharPlotWidget->setLorenzCurve(timeStepStrings, timeStepDates, lorenzVals);
|
||||
|
||||
for ( int timeStepIdx: calculatedTimesteps )
|
||||
{
|
||||
|
||||
const auto & flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx);
|
||||
const auto flowCharResults = flowResult->flowCharacteristicsResults(timeStepIdx, m_maxPvFraction());
|
||||
m_flowCharPlotWidget->addFlowCapStorageCapCurve(timeStepDates[timeStepIdx],
|
||||
flowCharResults.m_flowCapStorageCapCurve.first,
|
||||
flowCharResults.m_flowCapStorageCapCurve.second);
|
||||
|
@ -87,6 +87,7 @@ private:
|
||||
caf::PdmField<caf::AppEnum<TimeSelectionType> > m_timeStepSelectionType;
|
||||
caf::PdmField<std::vector<int> > m_selectedTimeSteps;
|
||||
caf::PdmField<bool> m_showLegend;
|
||||
caf::PdmField<double> m_maxPvFraction;
|
||||
|
||||
std::vector<int> m_currentlyPlottedTimeSteps;
|
||||
|
||||
|
@ -107,7 +107,7 @@ RigFlowDiagResults* RimFlowDiagSolution::flowDiagResults()
|
||||
|
||||
CVF_ASSERT(eclCase && eclCase->eclipseCaseData() );
|
||||
|
||||
timeStepCount = eclCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount();
|
||||
timeStepCount = eclCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount();
|
||||
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
|
||||
{
|
||||
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
|
||||
RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
|
||||
RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); //Todo: Must come from the results definition
|
||||
RigActiveCellInfo* activeCellInfo = eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); //Todo: Must come from the results definition
|
||||
|
||||
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
|
||||
{
|
||||
|
@ -209,7 +209,7 @@ void RimWellAllocationPlot::updateFromWell()
|
||||
{
|
||||
bool isProducer = ( wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::PRODUCER
|
||||
|| wellResults->wellProductionType(m_timeStep) == RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE );
|
||||
RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS));
|
||||
RigEclCellIndexCalculator cellIdxCalc(m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL));
|
||||
wfCalculator.reset(new RigAccWellFlowCalculator(pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds,
|
||||
tracerFractionCellValues,
|
||||
@ -341,7 +341,7 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
|
||||
{
|
||||
if ( m_flowDiagSolution->tracerStatusInTimeStep(tracerName, m_timeStep) == requestedTracerType )
|
||||
{
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, tracerName.toStdString());
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, tracerName.toStdString());
|
||||
const std::vector<double>* tracerCellFractions = m_flowDiagSolution->flowDiagResults()->resultValues(resAddr, m_timeStep);
|
||||
if (tracerCellFractions) tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
}
|
||||
|
@ -346,8 +346,8 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
{
|
||||
caseName = eclipseView->eclipseCase()->caseUserDescription();
|
||||
totCellCount = QString::number(eclipseView->mainGrid()->globalCellArray().size());
|
||||
size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount();
|
||||
size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount();
|
||||
size_t mxActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount();
|
||||
size_t frActCellCount = eclipseView->eclipseCase()->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount();
|
||||
if (frActCellCount > 0) activeCellCountText += "Matrix : ";
|
||||
activeCellCountText += QString::number(mxActCellCount);
|
||||
if (frActCellCount > 0) activeCellCountText += " Fracture : " + QString::number(frActCellCount);
|
||||
|
@ -19,17 +19,15 @@
|
||||
|
||||
#include "RimCase.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimFormationNames.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTimeStepFilter.h"
|
||||
|
||||
#include "cafPdmObjectFactory.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include "RimProject.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimFormationNames.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimCase, "RimCase");
|
||||
|
||||
@ -45,7 +43,11 @@ RimCase::RimCase()
|
||||
caseId.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&activeFormationNames, "DefaultFormationNames", "Formation Names File", "", "", "");
|
||||
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_timeStepFilter, "TimeStepFilter", "Time Step Filter", "", "", "");
|
||||
m_timeStepFilter.uiCapability()->setUiHidden(true);
|
||||
m_timeStepFilter.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_timeStepFilter = new RimTimeStepFilter;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "cafPdmPtrField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfVector3.h"
|
||||
@ -30,6 +31,7 @@
|
||||
|
||||
class RimView;
|
||||
class RimFormationNames;
|
||||
class RimTimeStepFilter;
|
||||
|
||||
namespace cvf {
|
||||
class BoundingBox;
|
||||
@ -68,6 +70,9 @@ protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
private:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override { return &caseUserDescription; }
|
||||
|
||||
protected:
|
||||
caf::PdmChildField<RimTimeStepFilter*> m_timeStepFilter;
|
||||
};
|
||||
|
||||
|
||||
|
@ -20,8 +20,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafFixedArray.h"
|
||||
#include "cafPdmChildField.h"
|
||||
|
@ -380,7 +380,7 @@ void RimEclipseCase::computeCachedData()
|
||||
|
||||
pInf.setNextProgressIncrement(17);
|
||||
pInf.setProgressDescription("Calculating faults");
|
||||
rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS));
|
||||
rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL));
|
||||
pInf.incrementProgress();
|
||||
|
||||
pInf.setProgressDescription("Calculating Formation Names Result");
|
||||
@ -414,8 +414,8 @@ void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase)
|
||||
m_rigEclipseCase = eclipseCase;
|
||||
if (this->eclipseCaseData())
|
||||
{
|
||||
m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS));
|
||||
m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS));
|
||||
m_fractureModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL));
|
||||
m_matrixModelResults()->setCellResults(eclipseCaseData()->results(RiaDefines::MATRIX_MODEL));
|
||||
m_fractureModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid());
|
||||
m_matrixModelResults()->setMainGrid(this->eclipseCaseData()->mainGrid());
|
||||
}
|
||||
@ -478,9 +478,9 @@ void RimEclipseCase::createTimeStepFormatString()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::BoundingBox RimEclipseCase::activeCellsBoundingBox() const
|
||||
{
|
||||
if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS))
|
||||
if (m_rigEclipseCase.notNull() && m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL))
|
||||
{
|
||||
return m_rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->geometryBoundingBox();
|
||||
return m_rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL)->geometryBoundingBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -521,9 +521,9 @@ cvf::Vec3d RimEclipseCase::displayModelOffset() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel)
|
||||
RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel)
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_matrixModelResults();
|
||||
}
|
||||
@ -534,9 +534,9 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::Poro
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel) const
|
||||
const RimReservoirCellResultsStorage* RimEclipseCase::results(RiaDefines::PorosityModelType porosityModel) const
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_matrixModelResults();
|
||||
}
|
||||
@ -592,7 +592,7 @@ bool RimEclipseCase::openReserviorCase()
|
||||
}
|
||||
|
||||
{
|
||||
RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RimReservoirCellResultsStorage* results = this->results(RiaDefines::MATRIX_MODEL);
|
||||
if (results->cellResults())
|
||||
{
|
||||
results->cellResults()->createPlaceholderResultEntries();
|
||||
@ -607,7 +607,7 @@ bool RimEclipseCase::openReserviorCase()
|
||||
|
||||
}
|
||||
{
|
||||
RimReservoirCellResultsStorage* results = this->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RimReservoirCellResultsStorage* results = this->results(RiaDefines::FRACTURE_MODEL);
|
||||
if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries();
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ QStringList RimEclipseCase::timeStepStrings() const
|
||||
{
|
||||
QStringList stringList;
|
||||
|
||||
int timeStepCount = static_cast<int>(results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->maxTimeStepCount());
|
||||
int timeStepCount = static_cast<int>(results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount());
|
||||
for (int i = 0; i < timeStepCount; i++)
|
||||
{
|
||||
stringList += this->timeStepName(i);
|
||||
@ -665,13 +665,13 @@ void RimEclipseCase::reloadDataAndUpdate()
|
||||
{
|
||||
if (this->eclipseCaseData())
|
||||
{
|
||||
RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* matrixModelResults = eclipseCaseData()->results(RiaDefines::MATRIX_MODEL);
|
||||
if (matrixModelResults)
|
||||
{
|
||||
matrixModelResults->clearAllResults();
|
||||
}
|
||||
|
||||
RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigCaseCellResultsData* fractureModelResults = eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL);
|
||||
if (fractureModelResults)
|
||||
{
|
||||
fractureModelResults->clearAllResults();
|
||||
@ -738,5 +738,5 @@ double RimEclipseCase::characteristicCellSize() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QDateTime> RimEclipseCase::timeStepDates() const
|
||||
{
|
||||
return results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates();
|
||||
return results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepDates();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RifReaderInterface.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RiaDefines.h"
|
||||
@ -73,8 +73,8 @@ public:
|
||||
const RigEclipseCaseData* eclipseCaseData() const;
|
||||
cvf::Color3f defaultWellColor(const QString& wellName);
|
||||
|
||||
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
const RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel) const;
|
||||
RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel);
|
||||
const RimReservoirCellResultsStorage* results(RiaDefines::PorosityModelType porosityModel) const;
|
||||
|
||||
RimEclipseView* createAndAddReservoirView();
|
||||
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
|
||||
|
@ -171,7 +171,7 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection(RigEclipseCa
|
||||
// This is the first insertion of this grid, compute cached data
|
||||
rigEclipseCase->mainGrid()->computeCachedData();
|
||||
|
||||
rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS));
|
||||
rigEclipseCase->mainGrid()->calculateFaults(rigEclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL));
|
||||
|
||||
equalGrid = rigEclipseCase->mainGrid();
|
||||
}
|
||||
|
@ -344,8 +344,7 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
|
||||
CVF_ASSERT(eclipseCase);
|
||||
if (!eclipseCase) return;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(this->porosityModel());
|
||||
RigCaseCellResultsData* cellResultsData = eclipseCase->results(porosityModel);
|
||||
RigCaseCellResultsData* cellResultsData = eclipseCase->results(this->porosityModel());
|
||||
CVF_ASSERT(cellResultsData);
|
||||
|
||||
double globalMin, globalMax;
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
@ -88,11 +88,11 @@ void RimEclipseInputCase::openDataFileSet(const QStringList& fileNames)
|
||||
if (fileNames.contains(RiaDefines::mockModelBasicInputCase()))
|
||||
{
|
||||
cvf::ref<RifReaderInterface> readerInterface = this->createMockModel(fileNames[0]);
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p());
|
||||
|
||||
eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->computeDerivedData();
|
||||
eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->computeDerivedData();
|
||||
eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->computeDerivedData();
|
||||
eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->computeDerivedData();
|
||||
|
||||
QFileInfo gridFileName(fileNames[0]);
|
||||
QString caseName = gridFileName.completeBaseName();
|
||||
@ -206,8 +206,8 @@ bool RimEclipseInputCase::openEclipseGridFile()
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(readerInterface.notNull());
|
||||
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p());
|
||||
|
||||
this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
|
||||
|
||||
@ -219,8 +219,8 @@ bool RimEclipseInputCase::openEclipseGridFile()
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if (app->preferences()->autocomputeDepthRelatedProperties)
|
||||
{
|
||||
RimReservoirCellResultsStorage* matrixResults = results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RimReservoirCellResultsStorage* fractureResults = results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RimReservoirCellResultsStorage* matrixResults = results(RiaDefines::MATRIX_MODEL);
|
||||
RimReservoirCellResultsStorage* fractureResults = results(RiaDefines::FRACTURE_MODEL);
|
||||
|
||||
matrixResults->computeDepthRelatedResults();
|
||||
fractureResults->computeDepthRelatedResults();
|
||||
@ -318,7 +318,7 @@ void RimEclipseInputCase::loadAndSyncronizeInputProperties()
|
||||
for (const QString fileKeyword : fileKeywordSet)
|
||||
{
|
||||
{
|
||||
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeyword);
|
||||
QString resultName = this->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->makeResultNameUnique(fileKeyword);
|
||||
if (RifEclipseInputFileTools::readProperty(filenames[i], this->eclipseCaseData(), fileKeyword, resultName))
|
||||
{
|
||||
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
|
||||
|
@ -91,7 +91,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change
|
||||
QString oldName = oldValue.toString();
|
||||
QString newName = newValue.toString();
|
||||
|
||||
RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigCaseCellResultsData* matrixResults = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL);
|
||||
if (matrixResults)
|
||||
{
|
||||
if (matrixResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName))
|
||||
@ -100,7 +100,7 @@ void RimEclipseInputProperty::fieldChangedByUi(const caf::PdmFieldHandle* change
|
||||
}
|
||||
}
|
||||
|
||||
RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS);
|
||||
RigCaseCellResultsData* fracResults = rimCase->eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL);
|
||||
if (fracResults)
|
||||
{
|
||||
if (fracResults->updateResultName(RiaDefines::INPUT_PROPERTY, oldName, newName))
|
||||
|
@ -29,14 +29,15 @@
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimMockModelSettings.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimTimeStepFilter.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include "cafPdmSettings.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
@ -111,6 +112,11 @@ bool RimEclipseResultCase::openEclipseGridFile()
|
||||
readerInterface->setReaderSetting(prefs->readerSettings());
|
||||
readerInterface->setFilenamesWithFaults(this->filesContainingFaults());
|
||||
|
||||
if (!m_timeStepFilter->timeStepIndicesToImport().empty())
|
||||
{
|
||||
readerInterface->setTimeStepFilter(m_timeStepFilter->timeStepIndicesToImport());
|
||||
}
|
||||
|
||||
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData;
|
||||
if (!readerInterface->open(caseFileName(), eclipseCase.p()))
|
||||
{
|
||||
@ -122,8 +128,8 @@ bool RimEclipseResultCase::openEclipseGridFile()
|
||||
this->setReservoirData( eclipseCase.p() );
|
||||
}
|
||||
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p());
|
||||
|
||||
progInfo.incrementProgress();
|
||||
|
||||
@ -136,14 +142,11 @@ bool RimEclipseResultCase::openEclipseGridFile()
|
||||
m_gridAndWellDataIsReadFromFile = true;
|
||||
m_activeCellInfoIsReadFromFile = true;
|
||||
|
||||
if (eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes())
|
||||
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
||||
|
||||
if (m_flowDiagSolutions.size() == 0)
|
||||
{
|
||||
m_flowDagSolverInterface = new RigFlowDiagSolverInterface(this);
|
||||
|
||||
if (m_flowDiagSolutions.size() == 0)
|
||||
{
|
||||
m_flowDiagSolutions.push_back(new RimFlowDiagSolution());
|
||||
}
|
||||
m_flowDiagSolutions.push_back(new RimFlowDiagSolution());
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -185,7 +188,7 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl
|
||||
CVF_ASSERT(mainEclipseCase && mainEclipseCase->mainGrid());
|
||||
eclipseCase->setMainGrid(mainEclipseCase->mainGrid());
|
||||
|
||||
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates();
|
||||
std::vector<QDateTime> timeStepDates = mainEclipseCase->results(RiaDefines::MATRIX_MODEL)->timeStepDates();
|
||||
if (timeStepDates.size() == 0)
|
||||
{
|
||||
return false;
|
||||
@ -204,8 +207,8 @@ bool RimEclipseResultCase::openAndReadActiveCellData(RigEclipseCaseData* mainEcl
|
||||
readerInterface = readerEclipseOutput;
|
||||
}
|
||||
|
||||
results(RifReaderInterface::MATRIX_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RifReaderInterface::FRACTURE_RESULTS)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::MATRIX_MODEL)->setReaderInterface(readerInterface.p());
|
||||
results(RiaDefines::FRACTURE_MODEL)->setReaderInterface(readerInterface.p());
|
||||
|
||||
CVF_ASSERT(this->eclipseCaseData());
|
||||
CVF_ASSERT(readerInterface.notNull());
|
||||
@ -463,5 +466,8 @@ void RimEclipseResultCase::defineUiOrdering(QString uiConfigName, caf::PdmUiOrde
|
||||
group->add(&flipXAxis);
|
||||
group->add(&flipYAxis);
|
||||
|
||||
auto group1 = uiOrdering.addNewGroup("Time Step Filter");
|
||||
group1->setCollapsedByDefault(true);
|
||||
m_timeStepFilter->uiOrdering(uiConfigName, *group1);
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,7 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
|
||||
m_selectedTracers.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_flowTracerSelectionMode, "FlowTracerSelectionMode", "Tracers", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_phaseSelection, "PhaseSelection", "Phases", "", "", "");
|
||||
|
||||
// Ui only fields
|
||||
|
||||
@ -131,6 +132,7 @@ void RimEclipseResultDefinition::simpleCopy(const RimEclipseResultDefinition* ot
|
||||
this->setFlowSolution(other->m_flowSolution());
|
||||
this->setSelectedTracers(other->m_selectedTracers());
|
||||
m_flowTracerSelectionMode = other->m_flowTracerSelectionMode();
|
||||
m_phaseSelection = other->m_phaseSelection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -151,9 +153,7 @@ RimReservoirCellResultsStorage* RimEclipseResultDefinition::currentGridCellResul
|
||||
{
|
||||
if (!m_eclipseCase ) return nullptr;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_porosityModel());
|
||||
|
||||
return m_eclipseCase->results(porosityModel);
|
||||
return m_eclipseCase->results(m_porosityModel());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -239,6 +239,11 @@ void RimEclipseResultDefinition::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
if (&m_phaseSelection == changedField)
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
}
|
||||
|
||||
if (&m_selectedTracersUiFieldFilter == changedField)
|
||||
{
|
||||
auto visibleTracerNames = tracerNamesMatchingFilter();
|
||||
@ -421,18 +426,11 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
|
||||
|
||||
if ( fieldNeedingOptions == &m_resultTypeUiField )
|
||||
{
|
||||
bool hasFlowDiagFluxes = false;
|
||||
RimEclipseResultCase* eclResCase = dynamic_cast<RimEclipseResultCase*>(m_eclipseCase.p());
|
||||
if ( eclResCase && eclResCase->eclipseCaseData() )
|
||||
{
|
||||
hasFlowDiagFluxes = eclResCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->hasFlowDiagUsableFluxes();
|
||||
}
|
||||
|
||||
RimGridTimeHistoryCurve* timeHistoryCurve;
|
||||
this->firstAncestorOrThisOfType(timeHistoryCurve);
|
||||
|
||||
// Do not include flow diagnostics results if not available or is a time history curve
|
||||
if ( !hasFlowDiagFluxes || timeHistoryCurve != nullptr )
|
||||
if ( timeHistoryCurve != nullptr )
|
||||
{
|
||||
using ResCatEnum = caf::AppEnum< RiaDefines::ResultCatType >;
|
||||
for ( size_t i = 0; i < ResCatEnum::size(); ++i )
|
||||
@ -720,7 +718,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
|
||||
}
|
||||
}
|
||||
|
||||
return RigFlowDiagResultAddress(m_resultVariable().toStdString(), selTracerNames);
|
||||
return RigFlowDiagResultAddress(m_resultVariable().toStdString(), m_phaseSelection(), selTracerNames);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -993,8 +991,8 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult()
|
||||
{
|
||||
if ( m_eclipseCase
|
||||
&& m_eclipseCase->eclipseCaseData()
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->reservoirActiveCellCount() > 0 )
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)
|
||||
&& m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -1027,6 +1025,8 @@ void RimEclipseResultDefinition::defineUiOrdering(QString uiConfigName, caf::Pdm
|
||||
uiOrdering.add(&m_selectedTracersUiField);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_phaseSelection);
|
||||
|
||||
if ( m_flowSolution() == nullptr )
|
||||
{
|
||||
assignFlowSolutionFromCase();
|
||||
|
@ -21,6 +21,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmField.h"
|
||||
@ -33,7 +36,6 @@ class RimEclipseCase;
|
||||
class RimEclipseView;
|
||||
class RimReservoirCellResultsStorage;
|
||||
class RimFlowDiagSolution;
|
||||
class RigFlowDiagResultAddress;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@ -124,6 +126,7 @@ protected:
|
||||
|
||||
caf::PdmField< caf::AppEnum< FlowTracerSelectionType > > m_flowTracerSelectionMode;
|
||||
caf::PdmPtrField<RimFlowDiagSolution*> m_flowSolutionUiField;
|
||||
caf::PdmField< RigFlowDiagResultAddress::PhaseSelectionEnum > m_phaseSelection;
|
||||
|
||||
caf::PdmField<QString> m_selectedTracersUiFieldFilter;
|
||||
caf::PdmField<std::vector<QString> > m_selectedTracersUiField;
|
||||
|
@ -159,8 +159,8 @@ bool RimEclipseStatisticsCase::openEclipseGridFile()
|
||||
|
||||
eclipseCase->setMainGrid(mainGrid);
|
||||
|
||||
eclipseCase->setActiveCellInfo(RifReaderInterface::MATRIX_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::MATRIX_RESULTS));
|
||||
eclipseCase->setActiveCellInfo(RifReaderInterface::FRACTURE_RESULTS, gridCaseGroup->unionOfActiveCells(RifReaderInterface::FRACTURE_RESULTS));
|
||||
eclipseCase->setActiveCellInfo(RiaDefines::MATRIX_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::MATRIX_MODEL));
|
||||
eclipseCase->setActiveCellInfo(RiaDefines::FRACTURE_MODEL, gridCaseGroup->unionOfActiveCells(RiaDefines::FRACTURE_MODEL));
|
||||
|
||||
this->setReservoirData( eclipseCase.p() );
|
||||
|
||||
@ -218,15 +218,15 @@ void RimEclipseStatisticsCase::computeStatistics()
|
||||
getSourceCases(sourceCases);
|
||||
|
||||
if (sourceCases.size() == 0
|
||||
|| !sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)
|
||||
|| !sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults())
|
||||
|| !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)
|
||||
|| !sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// The first source has been read completely from disk, and contains grid and meta data
|
||||
// Use this information for all cases in the case group
|
||||
size_t timeStepCount = sourceCases.at(0)->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->maxTimeStepCount();
|
||||
size_t timeStepCount = sourceCases.at(0)->results(RiaDefines::MATRIX_MODEL)->cellResults()->maxTimeStepCount();
|
||||
|
||||
RimStatisticsConfig statisticsConfig;
|
||||
|
||||
@ -248,42 +248,42 @@ void RimEclipseStatisticsCase::computeStatistics()
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedDynamicProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedDynamicProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedStaticProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE, m_selectedStaticProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedGeneratedProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::GENERATED, m_selectedGeneratedProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedInputProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::MATRIX_RESULTS, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::MATRIX_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedInputProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedFractureDynamicProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE, m_selectedFractureDynamicProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedFractureStaticProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE, m_selectedFractureStaticProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedFractureGeneratedProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::GENERATED, m_selectedFractureGeneratedProperties()[pIdx]));
|
||||
}
|
||||
|
||||
for(size_t pIdx = 0; pIdx < m_selectedFractureInputProperties().size(); ++pIdx)
|
||||
{
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RifReaderInterface::FRACTURE_RESULTS, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx]));
|
||||
resultSpecification.append(RimEclipseStatisticsCaseEvaluator::ResSpec(RiaDefines::FRACTURE_MODEL, RiaDefines::INPUT_PROPERTY, m_selectedFractureInputProperties()[pIdx]));
|
||||
}
|
||||
|
||||
RimEclipseStatisticsCaseEvaluator stat(sourceCases, timeStepIndices, statisticsConfig, resultCase, gridCaseGroup);
|
||||
@ -420,42 +420,42 @@ QList<caf::PdmOptionItemInfo> RimEclipseStatisticsCase::calculateValueOptions(co
|
||||
|
||||
if (&m_selectedDynamicProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedStaticProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedGeneratedProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::GENERATED);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::GENERATED);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedInputProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::INPUT_PROPERTY);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedFractureDynamicProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedFractureStaticProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedFractureGeneratedProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::GENERATED);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::GENERATED);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
else if (&m_selectedFractureInputProperties == fieldNeedingOptions)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::INPUT_PROPERTY);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::INPUT_PROPERTY);
|
||||
return toOptionList(varList);
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ void RimEclipseStatisticsCase::updateSelectionListVisibilities()
|
||||
{
|
||||
bool isLocked = hasComputedStatistics();
|
||||
m_resultType.uiCapability()->setUiHidden(isLocked);
|
||||
m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount()
|
||||
m_porosityModel.uiCapability()->setUiHidden(isLocked ); // || !caseGroup()->mainCase()->reservoirData()->results(RiaDefines::FRACTURE_MODEL)->resultCount()
|
||||
|
||||
m_selectedDynamicProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::DYNAMIC_NATIVE));
|
||||
m_selectedStaticProperties.uiCapability()->setUiHidden( isLocked || !(m_porosityModel() == RiaDefines::MATRIX_MODEL && m_resultType() == RiaDefines::STATIC_NATIVE));
|
||||
@ -668,8 +668,8 @@ void RimEclipseStatisticsCase::updatePercentileUiVisibility()
|
||||
bool RimEclipseStatisticsCase::hasComputedStatistics() const
|
||||
{
|
||||
if ( eclipseCaseData()
|
||||
&& ( eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->resultCount()
|
||||
|| eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->resultCount()))
|
||||
&& ( eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->resultCount()
|
||||
|| eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->resultCount()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -707,14 +707,14 @@ void RimEclipseStatisticsCase::updateConnectedEditorsAndReservoirViews()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseStatisticsCase::clearComputedStatistics()
|
||||
{
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS))
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::MATRIX_MODEL))
|
||||
{
|
||||
eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->clearAllResults();
|
||||
eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->clearAllResults();
|
||||
}
|
||||
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS))
|
||||
if (eclipseCaseData() && eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL))
|
||||
{
|
||||
eclipseCaseData()->results(RifReaderInterface::FRACTURE_RESULTS)->clearAllResults();
|
||||
eclipseCaseData()->results(RiaDefines::FRACTURE_MODEL)->clearAllResults();
|
||||
}
|
||||
|
||||
updateConnectedEditorsAndReservoirViews();
|
||||
@ -750,28 +750,28 @@ void RimEclipseStatisticsCase::populateResultSelection()
|
||||
|
||||
if (m_selectedDynamicProperties().size() == 0)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
if (varList.contains("SOIL")) m_selectedDynamicProperties.v().push_back("SOIL");
|
||||
if (varList.contains("PRESSURE")) m_selectedDynamicProperties.v().push_back("PRESSURE");
|
||||
}
|
||||
|
||||
if (m_selectedStaticProperties().size() == 0)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::MATRIX_MODEL)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
if (varList.contains("PERMX")) m_selectedStaticProperties.v().push_back("PERMX");
|
||||
if (varList.contains("PORO")) m_selectedStaticProperties.v().push_back("PORO");
|
||||
}
|
||||
|
||||
if (m_selectedFractureDynamicProperties().size() == 0)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::DYNAMIC_NATIVE);
|
||||
if (varList.contains("SOIL")) m_selectedFractureDynamicProperties.v().push_back("SOIL");
|
||||
if (varList.contains("PRESSURE")) m_selectedFractureDynamicProperties.v().push_back("PRESSURE");
|
||||
}
|
||||
|
||||
if (m_selectedFractureStaticProperties().size() == 0)
|
||||
{
|
||||
QStringList varList = caseData->results(RifReaderInterface::FRACTURE_RESULTS)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
QStringList varList = caseData->results(RiaDefines::FRACTURE_MODEL)->resultNames(RiaDefines::STATIC_NATIVE);
|
||||
if (varList.contains("PERMX")) m_selectedFractureStaticProperties.v().push_back("PERMX");
|
||||
if (varList.contains("PORO")) m_selectedFractureStaticProperties.v().push_back("PORO");
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
#include "RigResultModifier.h"
|
||||
#include "RigResultModifierFactory.h"
|
||||
#include "RigStatisticsMath.h"
|
||||
@ -43,20 +44,18 @@ void RimEclipseStatisticsCaseEvaluator::addNamedResult(RigCaseCellResultsData* d
|
||||
// Use time step dates from first result in first source case
|
||||
CVF_ASSERT(m_sourceCases.size() > 0);
|
||||
|
||||
std::vector<QDateTime> sourceTimeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(0);
|
||||
std::vector<double> sourceDaysSinceSimulationStart = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->daysSinceSimulationStart(0);
|
||||
std::vector<int> sourceReportStepNumbers = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->reportStepNumbers(0);
|
||||
std::vector<RigEclipseTimeStepInfo> sourceTimeStepInfos = m_sourceCases[0]->results(RiaDefines::MATRIX_MODEL)->cellResults()->timeStepInfos(0);
|
||||
|
||||
size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName, true);
|
||||
CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates, sourceDaysSinceSimulationStart, sourceReportStepNumbers);
|
||||
destinationCellResults->setTimeStepInfos(destinationScalarResultIndex, sourceTimeStepInfos);
|
||||
std::vector< std::vector<double> >& dataValues = destinationCellResults->cellScalarResults(destinationScalarResultIndex);
|
||||
dataValues.resize(sourceTimeStepDates.size());
|
||||
dataValues.resize(sourceTimeStepInfos.size());
|
||||
|
||||
|
||||
// Initializes the size of the destination dataset to active union cell count
|
||||
for (size_t i = 0; i < sourceTimeStepDates.size(); i++)
|
||||
for (size_t i = 0; i < sourceTimeStepInfos.size(); i++)
|
||||
{
|
||||
dataValues[i].resize(activeUnionCellCount, HUGE_VAL);
|
||||
}
|
||||
@ -83,7 +82,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
|
||||
|
||||
for (int i = 0; i < resultSpecification.size(); i++)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType poroModel = resultSpecification[i].m_poroModel;
|
||||
RiaDefines::PorosityModelType poroModel = resultSpecification[i].m_poroModel;
|
||||
RiaDefines::ResultCatType resultType = resultSpecification[i].m_resType;
|
||||
QString resultName = resultSpecification[i].m_resVarName;
|
||||
|
||||
@ -134,7 +133,7 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
|
||||
|
||||
for (int resSpecIdx = 0; resSpecIdx < resultSpecification.size(); resSpecIdx++)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType poroModel = resultSpecification[resSpecIdx].m_poroModel;
|
||||
RiaDefines::PorosityModelType poroModel = resultSpecification[resSpecIdx].m_poroModel;
|
||||
RiaDefines::ResultCatType resultType = resultSpecification[resSpecIdx].m_resType;
|
||||
QString resultName = resultSpecification[resSpecIdx].m_resVarName;
|
||||
|
||||
@ -302,13 +301,13 @@ void RimEclipseStatisticsCaseEvaluator::evaluateForResults(const QList<ResSpec>&
|
||||
|
||||
if (!eclipseCase->reservoirViews.size())
|
||||
{
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->freeAllocatedResultsData();
|
||||
eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults()->freeAllocatedResultsData();
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->freeAllocatedResultsData();
|
||||
eclipseCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->freeAllocatedResultsData();
|
||||
}
|
||||
|
||||
// Todo : These calls really do nothing right now the access actually closes automatically in ert i belive ...
|
||||
eclipseCase->results(RifReaderInterface::MATRIX_RESULTS)->readerInterface()->close();
|
||||
eclipseCase->results(RifReaderInterface::FRACTURE_RESULTS)->readerInterface()->close();
|
||||
eclipseCase->results(RiaDefines::MATRIX_MODEL)->readerInterface()->close();
|
||||
eclipseCase->results(RiaDefines::FRACTURE_MODEL)->readerInterface()->close();
|
||||
}
|
||||
|
||||
progressInfo.setProgress(timeIndicesIdx);
|
||||
|
@ -64,12 +64,12 @@ public:
|
||||
|
||||
struct ResSpec
|
||||
{
|
||||
ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RifReaderInterface::MATRIX_RESULTS) {}
|
||||
ResSpec( RifReaderInterface::PorosityModelResultType poroModel,
|
||||
ResSpec() : m_resType(RiaDefines::DYNAMIC_NATIVE), m_poroModel(RiaDefines::MATRIX_MODEL) {}
|
||||
ResSpec( RiaDefines::PorosityModelType poroModel,
|
||||
RiaDefines::ResultCatType resType,
|
||||
QString resVarName) : m_poroModel(poroModel), m_resType(resType), m_resVarName(resVarName) {}
|
||||
|
||||
RifReaderInterface::PorosityModelResultType m_poroModel;
|
||||
RiaDefines::PorosityModelType m_poroModel;
|
||||
RiaDefines::ResultCatType m_resType;
|
||||
QString m_resVarName;
|
||||
};
|
||||
@ -80,7 +80,7 @@ public:
|
||||
|
||||
private:
|
||||
void addNamedResult(RigCaseCellResultsData* cellResults, RiaDefines::ResultCatType resultType, const QString& resultName, size_t activeCellCount);
|
||||
void buildSourceMetaData(RifReaderInterface::PorosityModelResultType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName);
|
||||
void buildSourceMetaData(RiaDefines::PorosityModelType poroModel, RiaDefines::ResultCatType resultType, const QString& resultName);
|
||||
|
||||
enum StatisticsParamType { MIN, MAX, SUM, RANGE, MEAN, STDEV, PMIN, PMID, PMAX, STAT_PARAM_COUNT };
|
||||
|
||||
|
@ -879,9 +879,7 @@ RimReservoirCellResultsStorage* RimEclipseView::currentGridCellResults()
|
||||
{
|
||||
if (m_eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel());
|
||||
|
||||
return m_eclipseCase->results(porosityModel);
|
||||
return m_eclipseCase->results(cellResult->porosityModel());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -896,9 +894,7 @@ RigActiveCellInfo* RimEclipseView::currentActiveCellInfo()
|
||||
m_eclipseCase->eclipseCaseData()
|
||||
)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult->porosityModel());
|
||||
|
||||
return m_eclipseCase->eclipseCaseData()->activeCellInfo(porosityModel);
|
||||
return m_eclipseCase->eclipseCaseData()->activeCellInfo(cellResult->porosityModel());
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -983,8 +979,7 @@ void RimEclipseView::updateLegends()
|
||||
RigEclipseCaseData* eclipseCase = m_eclipseCase->eclipseCaseData();
|
||||
CVF_ASSERT(eclipseCase);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResult()->porosityModel());
|
||||
RigCaseCellResultsData* results = eclipseCase->results(porosityModel);
|
||||
RigCaseCellResultsData* results = eclipseCase->results(cellResult()->porosityModel());
|
||||
CVF_ASSERT(results);
|
||||
|
||||
updateMinMaxValuesAndAddLegendToView(QString("Cell Results: \n"), this->cellResult(), results);
|
||||
|
@ -22,10 +22,10 @@
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigGridManager.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
#include "RimCaseCollection.h"
|
||||
#include "RimCellEdgeColors.h"
|
||||
@ -184,7 +184,7 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
RigEclipseCaseData* rigCaseData = mainCase->eclipseCaseData();
|
||||
CVF_ASSERT(rigCaseData);
|
||||
|
||||
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL;
|
||||
mainCase->results(poroModel)->cellResults()->createPlaceholderResultEntries();
|
||||
|
||||
|
||||
@ -217,8 +217,8 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
RimEclipseCase* rimReservoir = statisticsCaseCollection()->reservoirs[i];
|
||||
|
||||
// Check if any results are stored in cache
|
||||
if (rimReservoir->results(RifReaderInterface::MATRIX_RESULTS)->storedResultsCount() > 0 ||
|
||||
rimReservoir->results(RifReaderInterface::FRACTURE_RESULTS)->storedResultsCount() > 0)
|
||||
if (rimReservoir->results(RiaDefines::MATRIX_MODEL)->storedResultsCount() > 0 ||
|
||||
rimReservoir->results(RiaDefines::FRACTURE_MODEL)->storedResultsCount() > 0)
|
||||
{
|
||||
foundResultsInCache = true;
|
||||
break;
|
||||
@ -236,13 +236,11 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
// for all cases
|
||||
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType poroModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType poroModel = RiaDefines::MATRIX_MODEL;
|
||||
|
||||
std::vector<QDateTime> timeStepDates = rigCaseData->results(poroModel)->timeStepDates(0);
|
||||
std::vector<double> daysSinceSimulationStart = rigCaseData->results(poroModel)->daysSinceSimulationStart(0);
|
||||
std::vector<int> reportStepNumbers = rigCaseData->results(poroModel)->reportStepNumbers(0);
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos = rigCaseData->results(poroModel)->timeStepInfos(0);
|
||||
|
||||
const std::vector<RigCaseCellResultsData::ResultInfo> resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex();
|
||||
const std::vector<RigEclipseResultInfo> resultInfos = rigCaseData->results(poroModel)->infoForEachResultIndex();
|
||||
|
||||
for (size_t i = 1; i < caseCollection()->reservoirs.size(); i++)
|
||||
{
|
||||
@ -265,10 +263,10 @@ void RimIdenticalGridCaseGroup::loadMainCaseAndActiveCellInfo()
|
||||
|
||||
if (mustBeCalculated) cellResultsStorage->cellResults()->setMustBeCalculated(scalarResultIndex);
|
||||
|
||||
cellResultsStorage->cellResults()->setTimeStepDates(scalarResultIndex, timeStepDates, daysSinceSimulationStart, reportStepNumbers);
|
||||
cellResultsStorage->cellResults()->setTimeStepInfos(scalarResultIndex, timeStepInfos);
|
||||
|
||||
std::vector< std::vector<double> >& dataValues = cellResultsStorage->cellResults()->cellScalarResults(scalarResultIndex);
|
||||
dataValues.resize(timeStepDates.size());
|
||||
dataValues.resize(timeStepInfos.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,7 +330,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
|
||||
|
||||
if (activeM[gridLocalCellIndex] == 0)
|
||||
{
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->isActive(reservoirCellIndex))
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->isActive(reservoirCellIndex))
|
||||
{
|
||||
activeM[gridLocalCellIndex] = 1;
|
||||
}
|
||||
@ -340,7 +338,7 @@ void RimIdenticalGridCaseGroup::computeUnionOfActiveCells()
|
||||
|
||||
if (activeF[gridLocalCellIndex] == 0)
|
||||
{
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RifReaderInterface::FRACTURE_RESULTS)->isActive(reservoirCellIndex))
|
||||
if (caseCollection->reservoirs[caseIdx]->eclipseCaseData()->activeCellInfo(RiaDefines::FRACTURE_MODEL)->isActive(reservoirCellIndex))
|
||||
{
|
||||
activeF[gridLocalCellIndex] = 1;
|
||||
}
|
||||
@ -424,13 +422,13 @@ void RimIdenticalGridCaseGroup::clearStatisticsResults()
|
||||
RimEclipseCase* rimStaticsCase = statisticsCaseCollection->reservoirs[i];
|
||||
if (!rimStaticsCase) continue;
|
||||
|
||||
if (rimStaticsCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults())
|
||||
if (rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults())
|
||||
{
|
||||
rimStaticsCase->results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->clearAllResults();
|
||||
rimStaticsCase->results(RiaDefines::MATRIX_MODEL)->cellResults()->clearAllResults();
|
||||
}
|
||||
if (rimStaticsCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults())
|
||||
if (rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults())
|
||||
{
|
||||
rimStaticsCase->results(RifReaderInterface::FRACTURE_RESULTS)->cellResults()->clearAllResults();
|
||||
rimStaticsCase->results(RiaDefines::FRACTURE_MODEL)->cellResults()->clearAllResults();
|
||||
}
|
||||
|
||||
for (size_t j = 0; j < rimStaticsCase->reservoirViews.size(); j++)
|
||||
@ -474,9 +472,9 @@ bool RimIdenticalGridCaseGroup::contains(RimEclipseCase* reservoir) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType)
|
||||
RigActiveCellInfo* RimIdenticalGridCaseGroup::unionOfActiveCells(RiaDefines::PorosityModelType porosityType)
|
||||
{
|
||||
if (porosityType == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityType == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_unionOfMatrixActiveCells.p();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
|
||||
RigMainGrid* mainGrid();
|
||||
|
||||
RigActiveCellInfo* unionOfActiveCells(RifReaderInterface::PorosityModelResultType porosityType);
|
||||
RigActiveCellInfo* unionOfActiveCells(RiaDefines::PorosityModelType porosityType);
|
||||
void computeUnionOfActiveCells();
|
||||
|
||||
static bool isStatisticsCaseCollection(RimCaseCollection* rimCaseCollection);
|
||||
|
@ -21,9 +21,10 @@
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigCell.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimTools.h"
|
||||
@ -90,7 +91,7 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
|
||||
|
||||
if (!m_cellResults) return;
|
||||
|
||||
const std::vector<RigCaseCellResultsData::ResultInfo>& resInfo = m_cellResults->infoForEachResultIndex();
|
||||
const std::vector<RigEclipseResultInfo>& resInfo = m_cellResults->infoForEachResultIndex();
|
||||
|
||||
bool hasResultsToStore = false;
|
||||
for (size_t rIdx = 0; rIdx < resInfo.size(); ++rIdx)
|
||||
@ -139,15 +140,15 @@ void RimReservoirCellResultsStorage::setupBeforeSave()
|
||||
|
||||
cacheEntry->m_resultType = resInfo[rIdx].m_resultType;
|
||||
cacheEntry->m_resultName = resInfo[rIdx].m_resultName;
|
||||
cacheEntry->m_timeStepDates = resInfo[rIdx].m_timeStepDates;
|
||||
cacheEntry->m_daysSinceSimulationStart = resInfo[rIdx].m_daysSinceSimulationStart;
|
||||
cacheEntry->m_timeStepDates = resInfo[rIdx].dates();
|
||||
cacheEntry->m_daysSinceSimulationStart = resInfo[rIdx].daysSinceSimulationStarts();
|
||||
|
||||
// Take note of the file position for fast lookup later
|
||||
cacheEntry->m_filePosition = cacheFile.pos();
|
||||
|
||||
// Write all the scalar values for each time step to the stream,
|
||||
// starting with the number of values
|
||||
for (size_t tsIdx = 0; tsIdx < resInfo[rIdx].m_timeStepDates.size() ; ++tsIdx)
|
||||
for (size_t tsIdx = 0; tsIdx < resInfo[rIdx].dates().size() ; ++tsIdx)
|
||||
{
|
||||
const std::vector<double>* data = NULL;
|
||||
if (tsIdx < timestepCount)
|
||||
@ -380,7 +381,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result
|
||||
if (m_readerInterface.notNull())
|
||||
{
|
||||
// Add one more result to result container
|
||||
size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepDates.size();
|
||||
size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepInfos.size();
|
||||
|
||||
bool resultLoadingSucess = true;
|
||||
|
||||
@ -392,7 +393,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result
|
||||
for (i = 0; i < timeStepCount; i++)
|
||||
{
|
||||
std::vector<double>& values = m_cellResults->cellScalarResults(scalarResultIndex)[i];
|
||||
if (!m_readerInterface->dynamicResult(resultName, RifReaderInterface::MATRIX_RESULTS, i, &values))
|
||||
if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, i, &values))
|
||||
{
|
||||
resultLoadingSucess = false;
|
||||
}
|
||||
@ -403,7 +404,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResult(RiaDefines::Result
|
||||
m_cellResults->cellScalarResults(scalarResultIndex).resize(1);
|
||||
|
||||
std::vector<double>& values = m_cellResults->cellScalarResults(scalarResultIndex)[0];
|
||||
if (!m_readerInterface->staticResult(resultName, RifReaderInterface::MATRIX_RESULTS, &values))
|
||||
if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values))
|
||||
{
|
||||
resultLoadingSucess = false;
|
||||
}
|
||||
@ -462,7 +463,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi
|
||||
|
||||
if (m_readerInterface.notNull())
|
||||
{
|
||||
size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepDates.size();
|
||||
size_t timeStepCount = m_cellResults->infoForEachResultIndex()[scalarResultIndex].m_timeStepInfos.size();
|
||||
|
||||
bool resultLoadingSucess = true;
|
||||
|
||||
@ -473,7 +474,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi
|
||||
std::vector<double>& values = m_cellResults->cellScalarResults(scalarResultIndex)[timeStepIndex];
|
||||
if (values.size() == 0)
|
||||
{
|
||||
if (!m_readerInterface->dynamicResult(resultName, RifReaderInterface::MATRIX_RESULTS, timeStepIndex, &values))
|
||||
if (!m_readerInterface->dynamicResult(resultName, RiaDefines::MATRIX_MODEL, timeStepIndex, &values))
|
||||
{
|
||||
resultLoadingSucess = false;
|
||||
}
|
||||
@ -484,7 +485,7 @@ size_t RimReservoirCellResultsStorage::findOrLoadScalarResultForTimeStep(RiaDefi
|
||||
m_cellResults->cellScalarResults(scalarResultIndex).resize(1);
|
||||
|
||||
std::vector<double>& values = m_cellResults->cellScalarResults(scalarResultIndex)[0];
|
||||
if (!m_readerInterface->staticResult(resultName, RifReaderInterface::MATRIX_RESULTS, &values))
|
||||
if (!m_readerInterface->staticResult(resultName, RiaDefines::MATRIX_MODEL, &values))
|
||||
{
|
||||
resultLoadingSucess = false;
|
||||
}
|
||||
@ -526,7 +527,7 @@ void RimReservoirCellResultsStorage::computeSOILForTimeStep(size_t timeStepIndex
|
||||
if (swatForTimeStep.size() > 0)
|
||||
{
|
||||
soilResultValueCount = swatForTimeStep.size();
|
||||
soilTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSWAT].m_timeStepDates.size();
|
||||
soilTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSWAT].m_timeStepInfos.size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -537,7 +538,7 @@ void RimReservoirCellResultsStorage::computeSOILForTimeStep(size_t timeStepIndex
|
||||
{
|
||||
soilResultValueCount = qMax(soilResultValueCount, sgasForTimeStep.size());
|
||||
|
||||
size_t sgasTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSGAS].m_timeStepDates.size();
|
||||
size_t sgasTimeStepCount = m_cellResults->infoForEachResultIndex()[scalarIndexSGAS].m_timeStepInfos.size();
|
||||
soilTimeStepCount = qMax(soilTimeStepCount, sgasTimeStepCount);
|
||||
}
|
||||
}
|
||||
@ -1495,7 +1496,11 @@ void RimReservoirCellResultsStorage::setCellResults(RigCaseCellResultsData* cell
|
||||
RimReservoirCellResultsStorageEntryInfo* resInfo = m_resultCacheMetaData[rIdx];
|
||||
size_t resultIndex = m_cellResults->addEmptyScalarResult(resInfo->m_resultType(), resInfo->m_resultName(), true);
|
||||
|
||||
m_cellResults->setTimeStepDates(resultIndex, resInfo->m_timeStepDates(), resInfo->m_daysSinceSimulationStart(), std::vector<int>()); // Hack: Using no report step numbers. Not really used except for Flow Diagnostics...
|
||||
std::vector<int> reportNumbers; // Hack: Using no report step numbers. Not really used except for Flow Diagnostics...
|
||||
reportNumbers.resize(resInfo->m_timeStepDates().size());
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos = RigEclipseTimeStepInfo::createTimeStepInfos(resInfo->m_timeStepDates(), reportNumbers, resInfo->m_daysSinceSimulationStart());
|
||||
|
||||
m_cellResults->setTimeStepInfos(resultIndex, timeStepInfos);
|
||||
|
||||
progress.setProgressDescription(resInfo->m_resultName);
|
||||
|
||||
|
47
ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp
Normal file
47
ApplicationCode/ProjectDataModel/RimTimeStepFilter.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimTimeStepFilter.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimTimeStepFilter, "TimeStepFilter");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimTimeStepFilter::RimTimeStepFilter()
|
||||
{
|
||||
CAF_PDM_InitObject("Time Step Filter", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_timeStepIndicesToImport, "TimeStepIndicesToImport", "Values", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<size_t> RimTimeStepFilter::timeStepIndicesToImport() const
|
||||
{
|
||||
std::vector<size_t> indices;
|
||||
|
||||
// Convert vector from int to size_t
|
||||
for (auto intValue : m_timeStepIndicesToImport.v())
|
||||
{
|
||||
indices.push_back(intValue);
|
||||
}
|
||||
|
||||
return indices;
|
||||
}
|
40
ApplicationCode/ProjectDataModel/RimTimeStepFilter.h
Normal file
40
ApplicationCode/ProjectDataModel/RimTimeStepFilter.h
Normal file
@ -0,0 +1,40 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RimTimeStepFilter : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
RimTimeStepFilter();
|
||||
|
||||
std::vector<size_t> timeStepIndicesToImport() const;
|
||||
|
||||
private:
|
||||
caf::PdmField< std::vector<int> > m_timeStepIndicesToImport;
|
||||
};
|
||||
|
@ -51,6 +51,8 @@
|
||||
#include "cvfScene.h"
|
||||
#include "cvfViewport.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include <limits.h>
|
||||
#include "cvfTransform.h"
|
||||
|
||||
@ -738,7 +740,7 @@ void RimView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasic
|
||||
|
||||
QDateTime currentTimeStamp;
|
||||
std::vector<QDateTime> timeStamps = ownerCase()->timeStepDates();
|
||||
if (currentTimeStep() < timeStamps.size())
|
||||
if (currentTimeStep() < static_cast<int>(timeStamps.size()))
|
||||
{
|
||||
currentTimeStamp = timeStamps[currentTimeStep()];
|
||||
}
|
||||
|
@ -19,8 +19,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "RivCellSetEnum.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
|
@ -721,10 +721,9 @@ QString RimWellLogExtractionCurve::createCurveAutoName()
|
||||
|
||||
if (eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
|
||||
if (eclipseCase->eclipseCaseData())
|
||||
{
|
||||
maxTimeStep = eclipseCase->eclipseCaseData()->results(porosityModel)->maxTimeStepCount();
|
||||
maxTimeStep = eclipseCase->eclipseCaseData()->results(m_eclipseResultDefinition->porosityModel())->maxTimeStepCount();
|
||||
}
|
||||
}
|
||||
else if (geomCase)
|
||||
@ -826,7 +825,6 @@ QString RimWellLogExtractionCurve::wellDate() const
|
||||
|
||||
if (eclipseCase)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_eclipseResultDefinition->porosityModel());
|
||||
if (eclipseCase->eclipseCaseData())
|
||||
{
|
||||
timeStepNames = eclipseCase->timeStepStrings();
|
||||
|
@ -67,6 +67,9 @@ ${CEE_CURRENT_LIST_DIR}RigFractureGrid.h
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureCell.h
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.h
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.h
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseResultInfo.h
|
||||
${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.h
|
||||
|
||||
|
||||
)
|
||||
|
||||
@ -128,6 +131,8 @@ ${CEE_CURRENT_LIST_DIR}RigFractureGrid.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigFractureCell.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigWellPathIntersectionTools.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityEquations.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigEclipseResultInfo.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator.cpp
|
||||
|
||||
)
|
||||
|
||||
|
@ -20,13 +20,15 @@
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigStatisticsDataCache.h"
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigEclipseMultiPropertyStatCalc.h"
|
||||
#include "RigEclipseNativeStatCalc.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigEclipseResultInfo.h"
|
||||
#include "RigStatisticsDataCache.h"
|
||||
#include "RigStatisticsMath.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
@ -205,7 +207,7 @@ std::vector<double>& RigCaseCellResultsData::cellScalarResults(size_t scalarResu
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigCaseCellResultsData::findScalarResultIndex(RiaDefines::ResultCatType type, const QString& resultName) const
|
||||
{
|
||||
std::vector<ResultInfo>::const_iterator it;
|
||||
std::vector<RigEclipseResultInfo>::const_iterator it;
|
||||
for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it)
|
||||
{
|
||||
if (it->m_resultType == type && it->m_resultName == resultName)
|
||||
@ -266,7 +268,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty
|
||||
|
||||
scalarResultIndex = this->resultCount();
|
||||
m_cellScalarResults.push_back(std::vector<std::vector<double> >());
|
||||
ResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex);
|
||||
RigEclipseResultInfo resInfo(type, needsToBeStored, false, resultName, scalarResultIndex);
|
||||
m_resultInfos.push_back(resInfo);
|
||||
|
||||
// Create statistics calculator and add statistics cache object
|
||||
@ -339,7 +341,7 @@ size_t RigCaseCellResultsData::addEmptyScalarResult(RiaDefines::ResultCatType ty
|
||||
QStringList RigCaseCellResultsData::resultNames(RiaDefines::ResultCatType resType) const
|
||||
{
|
||||
QStringList varList;
|
||||
std::vector<ResultInfo>::const_iterator it;
|
||||
std::vector<RigEclipseResultInfo>::const_iterator it;
|
||||
for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it)
|
||||
{
|
||||
if (it->m_resultType == resType )
|
||||
@ -392,8 +394,8 @@ bool RigCaseCellResultsData::hasFlowDiagUsableFluxes() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QDateTime RigCaseCellResultsData::timeStepDate(size_t scalarResultIndex, size_t timeStepIndex) const
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepDates.size() > timeStepIndex)
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepDates[timeStepIndex];
|
||||
if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepInfos.size() > timeStepIndex)
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepInfos[timeStepIndex].m_date;
|
||||
else
|
||||
return QDateTime();
|
||||
}
|
||||
@ -404,7 +406,9 @@ QDateTime RigCaseCellResultsData::timeStepDate(size_t scalarResultIndex, size_t
|
||||
std::vector<QDateTime> RigCaseCellResultsData::timeStepDates(size_t scalarResultIndex) const
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size())
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepDates;
|
||||
{
|
||||
return m_resultInfos[scalarResultIndex].dates();
|
||||
}
|
||||
else
|
||||
return std::vector<QDateTime>();
|
||||
}
|
||||
@ -438,7 +442,7 @@ std::vector<double> RigCaseCellResultsData::daysSinceSimulationStart(size_t scal
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size())
|
||||
{
|
||||
return m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart;
|
||||
return m_resultInfos[scalarResultIndex].daysSinceSimulationStarts();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -451,8 +455,8 @@ std::vector<double> RigCaseCellResultsData::daysSinceSimulationStart(size_t scal
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RigCaseCellResultsData::reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepReportNumbers.size() > timeStepIndex)
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepReportNumbers[timeStepIndex];
|
||||
if (scalarResultIndex < m_resultInfos.size() && m_resultInfos[scalarResultIndex].m_timeStepInfos.size() > timeStepIndex)
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepInfos[timeStepIndex].m_reportNumber;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@ -463,25 +467,33 @@ int RigCaseCellResultsData::reportStepNumber(size_t scalarResultIndex, size_t ti
|
||||
std::vector<int> RigCaseCellResultsData::reportStepNumbers(size_t scalarResultIndex) const
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size() )
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepReportNumbers;
|
||||
return m_resultInfos[scalarResultIndex].reportNumbers();
|
||||
else
|
||||
return std::vector<int>();
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::setTimeStepDates(size_t scalarResultIndex, const std::vector<QDateTime>& dates, const std::vector<double>& daysSinceSimulationStart, const std::vector<int>& reportStepNumbers)
|
||||
std::vector<RigEclipseTimeStepInfo> RigCaseCellResultsData::timeStepInfos(size_t scalarResultIndex) const
|
||||
{
|
||||
if (scalarResultIndex < m_resultInfos.size())
|
||||
return m_resultInfos[scalarResultIndex].m_timeStepInfos;
|
||||
else
|
||||
return std::vector<RigEclipseTimeStepInfo>();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::setTimeStepInfos(size_t scalarResultIndex, const std::vector<RigEclipseTimeStepInfo>& timeStepInfos)
|
||||
{
|
||||
CVF_ASSERT(scalarResultIndex < m_resultInfos.size() );
|
||||
|
||||
m_resultInfos[scalarResultIndex].m_timeStepDates = dates;
|
||||
m_resultInfos[scalarResultIndex].m_daysSinceSimulationStart = daysSinceSimulationStart;
|
||||
m_resultInfos[scalarResultIndex].m_timeStepReportNumbers = reportStepNumbers;
|
||||
m_resultInfos[scalarResultIndex].m_timeStepInfos = timeStepInfos;
|
||||
|
||||
std::vector< std::vector<double> >& dataValues = this->cellScalarResults(scalarResultIndex);
|
||||
dataValues.resize(dates.size());
|
||||
dataValues.resize(timeStepInfos.size());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -494,9 +506,9 @@ size_t RigCaseCellResultsData::maxTimeStepCount(size_t* scalarResultIndexWithMos
|
||||
|
||||
for (size_t i = 0; i < m_resultInfos.size(); i++)
|
||||
{
|
||||
if (m_resultInfos[i].m_timeStepDates.size() > maxTsCount)
|
||||
if (m_resultInfos[i].m_timeStepInfos.size() > maxTsCount)
|
||||
{
|
||||
maxTsCount = m_resultInfos[i].m_timeStepDates.size();
|
||||
maxTsCount = m_resultInfos[i].m_timeStepInfos.size();
|
||||
scalarResultIndexWithMaxTsCount = i;
|
||||
}
|
||||
}
|
||||
@ -585,16 +597,6 @@ size_t RigCaseCellResultsData::addStaticScalarResult(RiaDefines::ResultCatType t
|
||||
return resultIdx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifReaderInterface::PorosityModelResultType RigCaseCellResultsData::convertFromProjectModelPorosityModel(RiaDefines::PorosityModelType porosityModel)
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL) return RifReaderInterface::MATRIX_RESULTS;
|
||||
|
||||
return RifReaderInterface::FRACTURE_RESULTS;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -619,7 +621,7 @@ bool RigCaseCellResultsData::updateResultName(RiaDefines::ResultCatType resultTy
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const
|
||||
{
|
||||
std::vector<ResultInfo>::const_iterator it;
|
||||
std::vector<RigEclipseResultInfo>::const_iterator it;
|
||||
for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it)
|
||||
{
|
||||
if (it->m_gridScalarResultIndex == scalarResultIndex)
|
||||
@ -636,7 +638,7 @@ bool RigCaseCellResultsData::mustBeCalculated(size_t scalarResultIndex) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::setMustBeCalculated(size_t scalarResultIndex)
|
||||
{
|
||||
std::vector<ResultInfo>::iterator it;
|
||||
std::vector<RigEclipseResultInfo>::iterator it;
|
||||
for (it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it)
|
||||
{
|
||||
if (it->m_gridScalarResultIndex == scalarResultIndex)
|
||||
|
@ -32,9 +32,11 @@
|
||||
#include <cmath>
|
||||
|
||||
class RifReaderInterface;
|
||||
class RigMainGrid;
|
||||
class RigActiveCellInfo;
|
||||
class RigMainGrid;
|
||||
class RigEclipseResultInfo;
|
||||
class RigStatisticsDataCache;
|
||||
class RigEclipseTimeStepInfo;
|
||||
|
||||
//==================================================================================================
|
||||
/// Class containing the results for the complete number of active cells. Both main grid and LGR's
|
||||
@ -80,7 +82,9 @@ public:
|
||||
std::vector<double> daysSinceSimulationStart(size_t scalarResultIndex) const;
|
||||
int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const;
|
||||
std::vector<int> reportStepNumbers(size_t scalarResultIndex) const;
|
||||
void setTimeStepDates(size_t scalarResultIndex, const std::vector<QDateTime>& dates, const std::vector<double>& daysSinceSimulationStart, const std::vector<int>& reportStepNumbers);
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos(size_t scalarResultIndex) const;
|
||||
void setTimeStepInfos(size_t scalarResultIndex, const std::vector<RigEclipseTimeStepInfo>& timeStepInfos);
|
||||
|
||||
// Find or create a slot for the results
|
||||
|
||||
@ -102,29 +106,10 @@ public:
|
||||
std::vector< std::vector<double> > & cellScalarResults(size_t scalarResultIndex);
|
||||
std::vector<double>& cellScalarResults(size_t scalarResultIndex, size_t timeStepIndex);
|
||||
|
||||
static RifReaderInterface::PorosityModelResultType convertFromProjectModelPorosityModel(RiaDefines::PorosityModelType porosityModel);
|
||||
|
||||
bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName);
|
||||
|
||||
public:
|
||||
class ResultInfo
|
||||
{
|
||||
public:
|
||||
ResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated, QString resultName, size_t gridScalarResultIndex)
|
||||
: m_resultType(resultType), m_needsToBeStored(needsToBeStored), m_resultName(resultName), m_gridScalarResultIndex(gridScalarResultIndex), m_mustBeCalculated(mustBeCalculated) { }
|
||||
|
||||
public:
|
||||
RiaDefines::ResultCatType m_resultType;
|
||||
bool m_needsToBeStored;
|
||||
bool m_mustBeCalculated;
|
||||
QString m_resultName;
|
||||
size_t m_gridScalarResultIndex;
|
||||
std::vector<QDateTime> m_timeStepDates;
|
||||
std::vector<int> m_timeStepReportNumbers;
|
||||
std::vector<double> m_daysSinceSimulationStart;
|
||||
};
|
||||
|
||||
const std::vector<ResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
|
||||
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
|
||||
|
||||
bool mustBeCalculated(size_t scalarResultIndex) const;
|
||||
void setMustBeCalculated(size_t scalarResultIndex);
|
||||
@ -143,9 +128,8 @@ private:
|
||||
cvf::Collection<RigStatisticsDataCache> m_statisticsDataCache;
|
||||
|
||||
private:
|
||||
std::vector<ResultInfo> m_resultInfos;
|
||||
std::vector<RigEclipseResultInfo> m_resultInfos;
|
||||
|
||||
RigMainGrid* m_ownerMainGrid;
|
||||
RigActiveCellInfo* m_activeCellInfo;
|
||||
|
||||
};
|
||||
|
@ -20,7 +20,10 @@
|
||||
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <cmath> // Needed for HUGE_VAL on Linux
|
||||
|
||||
|
||||
|
@ -18,10 +18,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
@ -88,7 +86,7 @@ struct RigCompletionMetaData {
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigCompletionData : public cvf::Object
|
||||
class RigCompletionData
|
||||
{
|
||||
public:
|
||||
enum CompletionType {
|
||||
|
@ -434,9 +434,9 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel)
|
||||
RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel)
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_activeCellInfo.p();
|
||||
}
|
||||
@ -447,9 +447,9 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::Porosi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) const
|
||||
const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_activeCellInfo.p();
|
||||
}
|
||||
@ -460,9 +460,9 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RifReaderInterface::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo)
|
||||
void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo)
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
m_activeCellInfo = activeCellInfo;
|
||||
m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p());
|
||||
@ -604,9 +604,9 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::PorosityModelResultType porosityModel)
|
||||
RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel)
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
@ -617,9 +617,9 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::Porosity
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigCaseCellResultsData* RigEclipseCaseData::results(RifReaderInterface::PorosityModelResultType porosityModel) const
|
||||
const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const
|
||||
{
|
||||
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
|
@ -64,12 +64,12 @@ public:
|
||||
RigGridBase* grid(size_t index);
|
||||
size_t gridCount() const;
|
||||
|
||||
RigCaseCellResultsData* results(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
const RigCaseCellResultsData* results(RifReaderInterface::PorosityModelResultType porosityModel) const;
|
||||
RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel);
|
||||
const RigCaseCellResultsData* results(RiaDefines::PorosityModelType porosityModel) const;
|
||||
|
||||
RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel);
|
||||
const RigActiveCellInfo* activeCellInfo(RifReaderInterface::PorosityModelResultType porosityModel) const;
|
||||
void setActiveCellInfo(RifReaderInterface::PorosityModelResultType porosityModel, RigActiveCellInfo* activeCellInfo);
|
||||
RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel);
|
||||
const RigActiveCellInfo* activeCellInfo(RiaDefines::PorosityModelType porosityModel) const;
|
||||
void setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo);
|
||||
|
||||
void setActiveFormationNames(RigFormationNames* activeFormationNames);
|
||||
RigFormationNames* activeFormationNames();
|
||||
|
110
ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.cpp
Normal file
110
ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.cpp
Normal file
@ -0,0 +1,110 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigEclipseResultInfo.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseTimeStepInfo::RigEclipseTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart)
|
||||
: m_date(date),
|
||||
m_reportNumber(reportNumber),
|
||||
m_daysSinceSimulationStart(daysSinceSimulationStart)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RigEclipseTimeStepInfo> RigEclipseTimeStepInfo::createTimeStepInfos(std::vector<QDateTime> dates,
|
||||
std::vector<int> reportNumbers,
|
||||
std::vector<double> daysSinceSimulationStarts)
|
||||
{
|
||||
CVF_ASSERT(dates.size() == reportNumbers.size());
|
||||
CVF_ASSERT(dates.size() == daysSinceSimulationStarts.size());
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos;
|
||||
|
||||
for (size_t i = 0; i < dates.size(); i++)
|
||||
{
|
||||
timeStepInfos.push_back(RigEclipseTimeStepInfo(dates[i], reportNumbers[i], daysSinceSimulationStarts[i]));
|
||||
}
|
||||
|
||||
return timeStepInfos;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseResultInfo::RigEclipseResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated,
|
||||
QString resultName, size_t gridScalarResultIndex)
|
||||
: m_resultType(resultType),
|
||||
m_needsToBeStored(needsToBeStored),
|
||||
m_mustBeCalculated(mustBeCalculated),
|
||||
m_resultName(resultName),
|
||||
m_gridScalarResultIndex(gridScalarResultIndex)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QDateTime> RigEclipseResultInfo::dates() const
|
||||
{
|
||||
std::vector<QDateTime> values;
|
||||
|
||||
for (auto v : m_timeStepInfos)
|
||||
{
|
||||
values.push_back(v.m_date);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEclipseResultInfo::daysSinceSimulationStarts() const
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
for (auto v : m_timeStepInfos)
|
||||
{
|
||||
values.push_back(v.m_daysSinceSimulationStart);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<int> RigEclipseResultInfo::reportNumbers() const
|
||||
{
|
||||
std::vector<int> values;
|
||||
|
||||
for (auto v : m_timeStepInfos)
|
||||
{
|
||||
values.push_back(v.m_reportNumber);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
67
ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.h
Normal file
67
ApplicationCode/ReservoirDataModel/RigEclipseResultInfo.h
Normal file
@ -0,0 +1,67 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigEclipseTimeStepInfo
|
||||
{
|
||||
public:
|
||||
RigEclipseTimeStepInfo(const QDateTime& date, int reportNumber, double daysSinceSimulationStart);
|
||||
|
||||
static std::vector<RigEclipseTimeStepInfo> createTimeStepInfos(std::vector<QDateTime> dates,
|
||||
std::vector<int> reportNumbers,
|
||||
std::vector<double> daysSinceSimulationStarts);
|
||||
public:
|
||||
QDateTime m_date;
|
||||
int m_reportNumber;
|
||||
double m_daysSinceSimulationStart;
|
||||
};
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RigEclipseResultInfo
|
||||
{
|
||||
public:
|
||||
RigEclipseResultInfo(RiaDefines::ResultCatType resultType, bool needsToBeStored, bool mustBeCalculated,
|
||||
QString resultName, size_t gridScalarResultIndex);
|
||||
|
||||
std::vector<QDateTime> dates() const;
|
||||
std::vector<double> daysSinceSimulationStarts() const;
|
||||
std::vector<int> reportNumbers() const;
|
||||
|
||||
public:
|
||||
RiaDefines::ResultCatType m_resultType;
|
||||
bool m_needsToBeStored;
|
||||
bool m_mustBeCalculated;
|
||||
QString m_resultName;
|
||||
size_t m_gridScalarResultIndex;
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> m_timeStepInfos;
|
||||
};
|
@ -84,7 +84,7 @@ void RigEclipseToStimPlanCellTransmissibilityCalculator::calculateStimPlanCellsM
|
||||
|
||||
const RigEclipseCaseData* eclipseCaseData = m_case->eclipseCaseData();
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL;
|
||||
RimReservoirCellResultsStorage* gridCellResults = m_case->results(porosityModel);
|
||||
|
||||
size_t scalarSetIndex;
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
|
||||
#include <opm/flowdiagnostics/ConnectivityGraph.hpp>
|
||||
#include <opm/flowdiagnostics/ConnectionValues.hpp>
|
||||
@ -35,15 +36,34 @@
|
||||
|
||||
namespace RigFlowDiagInterfaceTools {
|
||||
|
||||
std::vector<Opm::ECLPhaseIndex> getPhases(RigFlowDiagResultAddress::PhaseSelection phaseSelection)
|
||||
{
|
||||
std::vector<Opm::ECLPhaseIndex> phases;
|
||||
|
||||
if (phaseSelection & RigFlowDiagResultAddress::PHASE_GAS)
|
||||
{
|
||||
phases.push_back(Opm::ECLPhaseIndex::Vapour);
|
||||
}
|
||||
if (phaseSelection & RigFlowDiagResultAddress::PHASE_OIL)
|
||||
{
|
||||
phases.push_back(Opm::ECLPhaseIndex::Liquid);
|
||||
}
|
||||
if (phaseSelection & RigFlowDiagResultAddress::PHASE_WAT)
|
||||
{
|
||||
phases.push_back(Opm::ECLPhaseIndex::Aqua);
|
||||
}
|
||||
|
||||
return phases;
|
||||
}
|
||||
|
||||
template <class FluxCalc>
|
||||
inline Opm::FlowDiagnostics::ConnectionValues
|
||||
extractFluxField(const Opm::ECLGraph& G,
|
||||
FluxCalc&& getFlux)
|
||||
FluxCalc&& getFlux,
|
||||
std::vector<Opm::ECLPhaseIndex> actPh)
|
||||
{
|
||||
using ConnVals = Opm::FlowDiagnostics::ConnectionValues;
|
||||
|
||||
const auto actPh = G.activePhases();
|
||||
|
||||
auto flux = ConnVals(ConnVals::NumConnections{ G.numConnections() },
|
||||
ConnVals::NumPhases{ actPh.size() });
|
||||
|
||||
@ -70,7 +90,8 @@ namespace RigFlowDiagInterfaceTools {
|
||||
|
||||
inline Opm::FlowDiagnostics::ConnectionValues
|
||||
extractFluxFieldFromRestartFile(const Opm::ECLGraph& G,
|
||||
const Opm::ECLRestartData& rstrt)
|
||||
const Opm::ECLRestartData& rstrt,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection)
|
||||
{
|
||||
auto getFlux = [&G, &rstrt]
|
||||
(const Opm::ECLPhaseIndex p)
|
||||
@ -78,7 +99,26 @@ namespace RigFlowDiagInterfaceTools {
|
||||
return G.flux(rstrt, p);
|
||||
};
|
||||
|
||||
return extractFluxField(G, getFlux);
|
||||
return extractFluxField(G, getFlux, getPhases(phaseSelection));
|
||||
}
|
||||
|
||||
inline Opm::FlowDiagnostics::ConnectionValues
|
||||
calculateFluxField(const Opm::ECLGraph& G,
|
||||
const Opm::ECLInitFileData& init,
|
||||
const Opm::ECLRestartData& rstrt,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection)
|
||||
{
|
||||
auto satfunc = Opm::ECLSaturationFunc(G, init);
|
||||
|
||||
Opm::ECLFluxCalc calc(G, std::move(satfunc));
|
||||
|
||||
auto getFlux = [&calc, &rstrt]
|
||||
(const Opm::ECLPhaseIndex p)
|
||||
{
|
||||
return calc.flux(rstrt, p);
|
||||
};
|
||||
|
||||
return extractFluxField(G, getFlux, getPhases(phaseSelection));
|
||||
}
|
||||
|
||||
template <class WellFluxes>
|
||||
|
@ -18,6 +18,19 @@
|
||||
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void RigFlowDiagResultAddress::PhaseSelectionEnum::setUp()
|
||||
{
|
||||
addItem(RigFlowDiagResultAddress::PHASE_ALL, "PHASE_ALL", "All");
|
||||
addItem(RigFlowDiagResultAddress::PHASE_OIL, "PHASE_OIL", "Oil");
|
||||
addItem(RigFlowDiagResultAddress::PHASE_GAS, "PHASE_GAS", "Gas");
|
||||
addItem(RigFlowDiagResultAddress::PHASE_WAT, "PHASE_WAT", "Water");
|
||||
|
||||
setDefault(RigFlowDiagResultAddress::PHASE_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -35,6 +48,10 @@ std::string RigFlowDiagResultAddress::uiText() const
|
||||
std::string uiVarname = variableName;
|
||||
|
||||
std::string uitext = uiVarname;
|
||||
if (phaseSelection != PHASE_ALL)
|
||||
{
|
||||
uitext += " (" + RigFlowDiagResultAddress::PhaseSelectionEnum(phaseSelection).uiText().toStdString() + ")";
|
||||
}
|
||||
uitext += " (";
|
||||
for (const std::string& tracerName : selectedTracerNames)
|
||||
{
|
||||
@ -49,6 +66,11 @@ std::string RigFlowDiagResultAddress::uiText() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RigFlowDiagResultAddress::uiShortText() const
|
||||
{
|
||||
return variableName;
|
||||
std::string uitext = variableName;
|
||||
if (phaseSelection != PHASE_ALL)
|
||||
{
|
||||
uitext += " (" + RigFlowDiagResultAddress::PhaseSelectionEnum(phaseSelection).uiText().toStdString() + ")";
|
||||
}
|
||||
return uitext;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma once
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
@ -37,11 +39,24 @@ class RigFlowDiagResultAddress
|
||||
{
|
||||
|
||||
public:
|
||||
RigFlowDiagResultAddress(const std::string& aVariableName, const std::set<std::string>& someSelectedTracerNames)
|
||||
: variableName(aVariableName), selectedTracerNames(someSelectedTracerNames) {}
|
||||
enum PhaseSelection
|
||||
{
|
||||
PHASE_ALL = 0b111,
|
||||
PHASE_OIL = 0b001,
|
||||
PHASE_GAS = 0b010,
|
||||
PHASE_WAT = 0b100,
|
||||
};
|
||||
|
||||
RigFlowDiagResultAddress(const std::string& aVariableName, const std::string& tracerName)
|
||||
: variableName(aVariableName)
|
||||
typedef caf::AppEnum<PhaseSelection> PhaseSelectionEnum;
|
||||
|
||||
RigFlowDiagResultAddress(const std::string& aVariableName, PhaseSelection phaseSelection, const std::set<std::string>& someSelectedTracerNames)
|
||||
: variableName(aVariableName),
|
||||
phaseSelection(phaseSelection),
|
||||
selectedTracerNames(someSelectedTracerNames) {}
|
||||
|
||||
RigFlowDiagResultAddress(const std::string& aVariableName, PhaseSelection phaseSelection, const std::string& tracerName)
|
||||
: variableName(aVariableName),
|
||||
phaseSelection(phaseSelection)
|
||||
{
|
||||
selectedTracerNames.insert(tracerName);
|
||||
}
|
||||
@ -53,6 +68,7 @@ public:
|
||||
|
||||
std::string variableName;
|
||||
std::set<std::string> selectedTracerNames;
|
||||
PhaseSelection phaseSelection;
|
||||
|
||||
bool operator< (const RigFlowDiagResultAddress& other) const
|
||||
{
|
||||
@ -60,6 +76,10 @@ public:
|
||||
{
|
||||
return selectedTracerNames < other.selectedTracerNames;
|
||||
}
|
||||
if (phaseSelection != other.phaseSelection)
|
||||
{
|
||||
return phaseSelection < other.phaseSelection;
|
||||
}
|
||||
|
||||
return variableName < other.variableName;
|
||||
}
|
||||
|
@ -39,9 +39,8 @@ RigFlowDiagResults::RigFlowDiagResults(RimFlowDiagSolution* flowSolution, size_t
|
||||
{
|
||||
|
||||
m_timeStepCount = timeStepCount;
|
||||
m_hasAtemptedNativeResults.resize(timeStepCount, false);
|
||||
m_hasAtemptedNativeResults.resize(timeStepCount);
|
||||
m_injProdPairFluxCommunicationTimesteps.resize(timeStepCount);
|
||||
m_flowCharResultFrames.resize(timeStepCount);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -71,7 +70,7 @@ const RigActiveCellInfo * RigFlowDiagResults::activeCellInfo(const RigFlowDiagRe
|
||||
RimEclipseResultCase* eclCase;
|
||||
m_flowDiagSolution->firstAncestorOrThisOfType(eclCase);
|
||||
|
||||
return eclCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS); // Todo: base on resVarAddr member
|
||||
return eclCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); // Todo: base on resVarAddr member
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -92,7 +91,7 @@ const std::vector<double>* RigFlowDiagResults::findOrCalculateResult(const RigFl
|
||||
|
||||
if (!solverInterface()) return nullptr;
|
||||
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex);
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, resVarAddr.phaseSelection);
|
||||
|
||||
return findScalarResultFrame(resVarAddr, frameIndex);
|
||||
}
|
||||
@ -100,12 +99,14 @@ const std::vector<double>* RigFlowDiagResults::findOrCalculateResult(const RigFl
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex)
|
||||
void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex, RigFlowDiagResultAddress::PhaseSelection phaseSelection)
|
||||
{
|
||||
if ( !m_hasAtemptedNativeResults[frameIndex] )
|
||||
auto it = m_hasAtemptedNativeResults[frameIndex].find(phaseSelection);
|
||||
if ( it == m_hasAtemptedNativeResults[frameIndex].end() || !it->second )
|
||||
{
|
||||
|
||||
RigFlowDiagTimeStepResult nativeTimestepResults = solverInterface()->calculate(frameIndex,
|
||||
phaseSelection,
|
||||
m_flowDiagSolution->allInjectorTracerActiveCellIndices(frameIndex),
|
||||
m_flowDiagSolution->allProducerTracerActiveCellIndices(frameIndex));
|
||||
|
||||
@ -119,15 +120,9 @@ void RigFlowDiagResults::calculateNativeResultsIfNotPreviouslyAttempted(size_t f
|
||||
nativeResFrames->frameData(frameIndex).swap(resIt.second);
|
||||
}
|
||||
|
||||
m_injProdPairFluxCommunicationTimesteps[frameIndex].swap(nativeTimestepResults.injProdWellPairFluxes());
|
||||
m_injProdPairFluxCommunicationTimesteps[frameIndex][phaseSelection].swap(nativeTimestepResults.injProdWellPairFluxes());
|
||||
|
||||
m_flowCharResultFrames[frameIndex].m_lorenzCoefficient = nativeTimestepResults.lorenzCoefficient();
|
||||
m_flowCharResultFrames[frameIndex].m_flowCapStorageCapCurve.first.swap(nativeTimestepResults.flowCapStorageCapCurve().first);
|
||||
m_flowCharResultFrames[frameIndex].m_flowCapStorageCapCurve.second.swap(nativeTimestepResults.flowCapStorageCapCurve().second);
|
||||
m_flowCharResultFrames[frameIndex].m_sweepEfficiencyCurve.first.swap(nativeTimestepResults.sweepEfficiencyCurve().first);
|
||||
m_flowCharResultFrames[frameIndex].m_sweepEfficiencyCurve.second.swap(nativeTimestepResults.sweepEfficiencyCurve().second);
|
||||
|
||||
m_hasAtemptedNativeResults[frameIndex] = true;
|
||||
m_hasAtemptedNativeResults[frameIndex][phaseSelection] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -428,7 +423,7 @@ std::vector<const std::vector<double>* > RigFlowDiagResults::findResultsForSelec
|
||||
if (tracerType != RimFlowDiagSolution::CLOSED
|
||||
&& ( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED) )
|
||||
{
|
||||
selectedTracersResults.push_back(findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, tracerName), frameIndex));
|
||||
selectedTracersResults.push_back(findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, resVarAddr.phaseSelection, tracerName), frameIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,7 +450,7 @@ RigFlowDiagResults::findNamedResultsForSelectedTracers(const RigFlowDiagResultAd
|
||||
if (tracerType != RimFlowDiagSolution::CLOSED
|
||||
&& ( tracerType == wantedTracerType || wantedTracerType == RimFlowDiagSolution::UNDEFINED) )
|
||||
{
|
||||
selectedTracersResults.push_back(std::make_pair(tracerName, findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, tracerName), frameIndex)));
|
||||
selectedTracersResults.push_back(std::make_pair(tracerName, findOrCalculateResult(RigFlowDiagResultAddress(nativeResultName, resVarAddr.phaseSelection, tracerName), frameIndex)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -632,10 +627,10 @@ std::pair<double, double> RigFlowDiagResults::injectorProducerPairFluxes(const s
|
||||
const std::string& prodTracerName,
|
||||
int frameIndex)
|
||||
{
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex);
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, RigFlowDiagResultAddress::PHASE_ALL);
|
||||
|
||||
auto commPair = m_injProdPairFluxCommunicationTimesteps[frameIndex].find(std::make_pair(injTracername, prodTracerName));
|
||||
if (commPair != m_injProdPairFluxCommunicationTimesteps[frameIndex].end())
|
||||
auto commPair = m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL].find(std::make_pair(injTracername, prodTracerName));
|
||||
if (commPair != m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL].end())
|
||||
{
|
||||
return commPair->second;
|
||||
}
|
||||
@ -650,10 +645,10 @@ std::pair<double, double> RigFlowDiagResults::injectorProducerPairFluxes(const s
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFlowDiagResults::maxAbsPairFlux(int frameIndex)
|
||||
{
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex);
|
||||
calculateNativeResultsIfNotPreviouslyAttempted(frameIndex, RigFlowDiagResultAddress::PHASE_ALL);
|
||||
double maxFlux = 0.0;
|
||||
|
||||
for (const auto& commPair : m_injProdPairFluxCommunicationTimesteps[frameIndex])
|
||||
for (const auto& commPair : m_injProdPairFluxCommunicationTimesteps[frameIndex][RigFlowDiagResultAddress::PHASE_ALL])
|
||||
{
|
||||
if (fabs(commPair.second.first) > maxFlux ) maxFlux = fabs(commPair.second.first);
|
||||
if (fabs(commPair.second.second) > maxFlux ) maxFlux = fabs(commPair.second.second);
|
||||
@ -665,12 +660,16 @@ double RigFlowDiagResults::maxAbsPairFlux(int frameIndex)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<int> RigFlowDiagResults::calculatedTimeSteps()
|
||||
std::vector<int> RigFlowDiagResults::calculatedTimeSteps(RigFlowDiagResultAddress::PhaseSelection phaseSelection)
|
||||
{
|
||||
std::vector<int> timestepIndices;
|
||||
for (size_t tsIdx = 0; tsIdx < m_timeStepCount; ++tsIdx)
|
||||
{
|
||||
if (m_hasAtemptedNativeResults[tsIdx]) timestepIndices.push_back(static_cast<int>(tsIdx));
|
||||
auto it = m_hasAtemptedNativeResults[tsIdx].find(phaseSelection);
|
||||
if (it != m_hasAtemptedNativeResults[tsIdx].end() && it->second)
|
||||
{
|
||||
timestepIndices.push_back(static_cast<int>(tsIdx));
|
||||
}
|
||||
}
|
||||
|
||||
return timestepIndices;
|
||||
@ -679,8 +678,31 @@ std::vector<int> RigFlowDiagResults::calculatedTimeSteps()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagResults::FlowCharacteristicsResultFrame::FlowCharacteristicsResultFrame()
|
||||
: m_lorenzCoefficient(HUGE_VAL)
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::flowCharacteristicsResults(int frameIndex, double max_pv_fraction)
|
||||
{
|
||||
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
|
||||
|
||||
std::set<std::string> injectorNames;
|
||||
std::set<std::string> producerNames;
|
||||
|
||||
for (const QString& tracerName : tracerNames)
|
||||
{
|
||||
RimFlowDiagSolution::TracerStatusType status = m_flowDiagSolution->tracerStatusInTimeStep(tracerName, frameIndex);
|
||||
if (status == RimFlowDiagSolution::INJECTOR)
|
||||
{
|
||||
injectorNames.insert(tracerName.toStdString());
|
||||
}
|
||||
else if (status == RimFlowDiagSolution::PRODUCER)
|
||||
{
|
||||
producerNames.insert(tracerName.toStdString());
|
||||
}
|
||||
}
|
||||
|
||||
RigFlowDiagResultAddress injectorAddress(RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, injectorNames);
|
||||
RigFlowDiagResultAddress producerAddress(RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, producerNames);
|
||||
|
||||
const std::vector<double>* injectorResults = resultValues(injectorAddress, frameIndex);
|
||||
const std::vector<double>* producerResults = resultValues(producerAddress, frameIndex);
|
||||
|
||||
return solverInterface()->calculateFlowCharacteristics(injectorResults, producerResults, max_pv_fraction);
|
||||
}
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
|
||||
#include "RigFlowDiagSolverInterface.h"
|
||||
|
||||
#include "RimFlowDiagSolution.h"
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
@ -32,7 +34,6 @@
|
||||
|
||||
class RigFlowDiagResultFrames;
|
||||
class RigStatisticsDataCache;
|
||||
class RigFlowDiagSolverInterface;
|
||||
class RigActiveCellInfo;
|
||||
|
||||
class RigFlowDiagResults: public cvf::Object
|
||||
@ -63,24 +64,14 @@ public:
|
||||
std::pair<double, double> injectorProducerPairFluxes(const std::string& injTracername, const std::string& prodTracerName, int frameIndex);
|
||||
double maxAbsPairFlux(int frameIndex);
|
||||
|
||||
std::vector<int> calculatedTimeSteps();
|
||||
std::vector<int> calculatedTimeSteps(RigFlowDiagResultAddress::PhaseSelection phaseSelection);
|
||||
|
||||
struct FlowCharacteristicsResultFrame
|
||||
{
|
||||
FlowCharacteristicsResultFrame();
|
||||
|
||||
using Curve = std::pair< std::vector<double>, std::vector<double> >;
|
||||
|
||||
Curve m_flowCapStorageCapCurve;
|
||||
Curve m_sweepEfficiencyCurve;
|
||||
double m_lorenzCoefficient;
|
||||
};
|
||||
|
||||
const FlowCharacteristicsResultFrame& flowCharacteristicsResults(int frameIndex) { return m_flowCharResultFrames[frameIndex];}
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame flowCharacteristicsResults(int frameIndex, double max_pv_fraction);
|
||||
|
||||
private:
|
||||
const std::vector<double>* findOrCalculateResult (const RigFlowDiagResultAddress& resVarAddr, size_t frameIndex);
|
||||
void calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex);
|
||||
void calculateNativeResultsIfNotPreviouslyAttempted(size_t frameIndex, RigFlowDiagResultAddress::PhaseSelection phaseSelection);
|
||||
|
||||
std::vector<double>* calculateDerivedResult(const RigFlowDiagResultAddress& resVarAddr, size_t frameIndex);
|
||||
|
||||
@ -126,18 +117,13 @@ private:
|
||||
size_t m_timeStepCount;
|
||||
caf::PdmPointer<RimFlowDiagSolution> m_flowDiagSolution;
|
||||
|
||||
std::vector<bool> m_hasAtemptedNativeResults;
|
||||
std::vector< std::map<RigFlowDiagResultAddress::PhaseSelection, bool > > m_hasAtemptedNativeResults;
|
||||
|
||||
std::map< RigFlowDiagResultAddress, cvf::ref<RigFlowDiagResultFrames> > m_resultSets;
|
||||
std::map< RigFlowDiagResultAddress, cvf::ref<RigStatisticsDataCache> > m_resultStatistics;
|
||||
|
||||
using InjectorProducerCommunicationMap = std::map< std::pair<std::string, std::string>, std::pair<double, double> >;
|
||||
std::vector<InjectorProducerCommunicationMap> m_injProdPairFluxCommunicationTimesteps;
|
||||
|
||||
|
||||
|
||||
std::vector<FlowCharacteristicsResultFrame> m_flowCharResultFrames;
|
||||
|
||||
std::vector< std::map<RigFlowDiagResultAddress::PhaseSelection, InjectorProducerCommunicationMap> > m_injProdPairFluxCommunicationTimesteps;
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagTimeStepResult::RigFlowDiagTimeStepResult(size_t activeCellCount)
|
||||
: m_activeCellCount(activeCellCount), m_lorenzCoefficient(HUGE_VAL)
|
||||
: m_activeCellCount(activeCellCount)
|
||||
{
|
||||
|
||||
}
|
||||
@ -49,12 +49,14 @@ RigFlowDiagTimeStepResult::RigFlowDiagTimeStepResult(size_t activeCellCount)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_TOF_RESNAME, tracers);
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_TOF_RESNAME, phaseSelection, tracers);
|
||||
|
||||
this->addResult(resAddr, cellValues);
|
||||
|
||||
@ -68,12 +70,14 @@ void RigFlowDiagTimeStepResult::setTracerTOF(const std::string& tracerName, cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagTimeStepResult::setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues)
|
||||
void RigFlowDiagTimeStepResult::setTracerFraction(const std::string& tracerName,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
const std::map<int, double>& cellValues)
|
||||
{
|
||||
std::set<std::string> tracers;
|
||||
tracers.insert(tracerName);
|
||||
|
||||
this->addResult(RigFlowDiagResultAddress(RIG_FLD_CELL_FRACTION_RESNAME, tracers), cellValues);
|
||||
this->addResult(RigFlowDiagResultAddress(RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracers), cellValues);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -148,12 +152,13 @@ RigFlowDiagSolverInterface::~RigFlowDiagSolverInterface()
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepIndex,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
std::map<std::string, std::vector<int> > injectorTracers,
|
||||
std::map<std::string, std::vector<int> > producerTracers)
|
||||
{
|
||||
using namespace Opm::FlowDiagnostics;
|
||||
|
||||
RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RifReaderInterface::MATRIX_RESULTS)->reservoirActiveCellCount());
|
||||
RigFlowDiagTimeStepResult result(m_eclipseCase->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL)->reservoirActiveCellCount());
|
||||
|
||||
caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics");
|
||||
|
||||
@ -164,14 +169,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
// Get set of files
|
||||
QString gridFileName = m_eclipseCase->gridFileName();
|
||||
|
||||
QStringList m_filesWithSameBaseName;
|
||||
std::string initFileName = getInitFileName();
|
||||
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName) ) return result;
|
||||
if (initFileName.empty()) return result;
|
||||
|
||||
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE);
|
||||
|
||||
m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData(gridFileName.toStdString(),
|
||||
initFileName.toStdString());
|
||||
m_opmFlowDiagStaticData = new RigOpmFlowDiagStaticData(gridFileName.toStdString(), initFileName);
|
||||
|
||||
progressInfo.incrementProgress();
|
||||
progressInfo.setProgressDescription("Calculating Connectivities");
|
||||
@ -189,6 +191,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignPoreVolume( m_opmFlowDiagStaticData->m_poreVolume);
|
||||
|
||||
// Look for unified restart file
|
||||
QStringList m_filesWithSameBaseName;
|
||||
|
||||
if ( !RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName) ) return result;
|
||||
|
||||
QString restartFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE);
|
||||
if ( !restartFileName.isEmpty() )
|
||||
@ -201,7 +206,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
QStringList restartFileNames = RifEclipseOutputFileTools::filterFileNamesOfType(m_filesWithSameBaseName, ECL_RESTART_FILE);
|
||||
|
||||
size_t restartFileCount = static_cast<size_t>(restartFileNames.size());
|
||||
size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount();
|
||||
size_t maxTimeStepCount = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount();
|
||||
|
||||
if (restartFileCount <= timeStepIndex && restartFileCount != maxTimeStepCount )
|
||||
{
|
||||
@ -236,9 +241,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
CVF_ASSERT(currentRestartData);
|
||||
|
||||
size_t resultIndexWithMaxTimeSteps = cvf::UNDEFINED_SIZE_T;
|
||||
m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&resultIndexWithMaxTimeSteps);
|
||||
m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&resultIndexWithMaxTimeSteps);
|
||||
|
||||
int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex);
|
||||
int reportStepNumber = m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->reportStepNumber(resultIndexWithMaxTimeSteps, timeStepIndex);
|
||||
|
||||
if ( !currentRestartData->selectReportStep(reportStepNumber) )
|
||||
{
|
||||
@ -251,10 +256,20 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell;
|
||||
|
||||
{
|
||||
Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph),
|
||||
*currentRestartData);
|
||||
if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes())
|
||||
{
|
||||
Opm::FlowDiagnostics::ConnectionValues connectionsVals = RigFlowDiagInterfaceTools::extractFluxFieldFromRestartFile(*(m_opmFlowDiagStaticData->m_eclGraph),
|
||||
*currentRestartData,
|
||||
phaseSelection);
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals);
|
||||
}
|
||||
else
|
||||
{
|
||||
Opm::ECLInitFileData init(getInitFileName());
|
||||
Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph), init, *currentRestartData, phaseSelection);
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionVals);
|
||||
}
|
||||
|
||||
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionsVals);
|
||||
|
||||
progressInfo.incrementProgress();
|
||||
|
||||
@ -334,9 +349,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
for ( const CellSetID& tracerId: injectorSolution->fd.startPoints() )
|
||||
{
|
||||
CellSetValues tofVals = injectorSolution->fd.timeOfFlight(tracerId);
|
||||
result.setTracerTOF(tracerId.to_string(), tofVals);
|
||||
result.setTracerTOF(tracerId.to_string(), phaseSelection, tofVals);
|
||||
CellSetValues fracVals = injectorSolution->fd.concentration(tracerId);
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
result.setTracerFraction(tracerId.to_string(), phaseSelection, fracVals);
|
||||
}
|
||||
|
||||
progressInfo.incrementProgress();
|
||||
@ -364,9 +379,9 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
for ( const CellSetID& tracerId: producerSolution->fd.startPoints() )
|
||||
{
|
||||
CellSetValues tofVals = producerSolution->fd.timeOfFlight(tracerId);
|
||||
result.setTracerTOF(tracerId.to_string(), tofVals);
|
||||
result.setTracerTOF(tracerId.to_string(), phaseSelection, tofVals);
|
||||
CellSetValues fracVals = producerSolution->fd.concentration(tracerId);
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
result.setTracerFraction(tracerId.to_string(), phaseSelection, fracVals);
|
||||
}
|
||||
|
||||
progressInfo.incrementProgress();
|
||||
@ -394,24 +409,67 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(*(injectorSolution.get()),
|
||||
*(producerSolution.get()),
|
||||
m_opmFlowDiagStaticData->m_poreVolume,
|
||||
0.1);
|
||||
|
||||
result.setFlowCapStorageCapCurve(flowCapStorCapCurve);
|
||||
result.setSweepEfficiencyCurve(sweepEfficiency(flowCapStorCapCurve));
|
||||
result.setLorenzCoefficient(lorenzCoefficient(flowCapStorCapCurve));
|
||||
}
|
||||
catch ( const std::exception& e )
|
||||
{
|
||||
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
return result; // Relying on implicit move constructor
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagSolverInterface::calculateFlowCharacteristics(const std::vector<double>* injector_tof,
|
||||
const std::vector<double>* producer_tof,
|
||||
double max_pv_fraction)
|
||||
{
|
||||
using namespace Opm::FlowDiagnostics;
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame result;
|
||||
|
||||
if (injector_tof == nullptr || producer_tof == nullptr)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Graph flowCapStorCapCurve = flowCapacityStorageCapacityCurve(*injector_tof,
|
||||
*producer_tof,
|
||||
m_opmFlowDiagStaticData->m_poreVolume,
|
||||
max_pv_fraction);
|
||||
|
||||
result.m_flowCapStorageCapCurve = flowCapStorCapCurve;
|
||||
result.m_lorenzCoefficient = lorenzCoefficient(flowCapStorCapCurve);
|
||||
result.m_sweepEfficiencyCurve = sweepEfficiency(flowCapStorCapCurve);
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what()));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RigFlowDiagSolverInterface::getInitFileName() const
|
||||
{
|
||||
QString gridFileName = m_eclipseCase->gridFileName();
|
||||
|
||||
QStringList m_filesWithSameBaseName;
|
||||
|
||||
if (!RifEclipseOutputFileTools::findSiblingFilesWithSameBaseName(gridFileName, &m_filesWithSameBaseName)) return std::string();
|
||||
|
||||
QString initFileName = RifEclipseOutputFileTools::firstFileNameOfType(m_filesWithSameBaseName, ECL_INIT_FILE);
|
||||
|
||||
return initFileName.toStdString();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame::FlowCharacteristicsResultFrame()
|
||||
: m_lorenzCoefficient(HUGE_VAL)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -35,25 +35,18 @@ class RigFlowDiagTimeStepResult
|
||||
public:
|
||||
explicit RigFlowDiagTimeStepResult(size_t activeCellCount);
|
||||
|
||||
void setTracerTOF (const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setTracerFraction(const std::string& tracerName, const std::map<int, double>& cellValues);
|
||||
void setTracerTOF (const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map<int, double>& cellValues);
|
||||
void setTracerFraction(const std::string& tracerName, RigFlowDiagResultAddress::PhaseSelection phaseSelection, const std::map<int, double>& cellValues);
|
||||
void setInjProdWellPairFlux(const std::string& injectorTracerName,
|
||||
const std::string& producerTracerName,
|
||||
const std::pair<double, double>& injProdFluxes) ;
|
||||
|
||||
using Curve = std::pair< std::vector<double>, std::vector<double> >;
|
||||
void setFlowCapStorageCapCurve(const Curve& flCapStCapCurve) { m_flowCapStorageCapCurve = flCapStCapCurve;}
|
||||
void setSweepEfficiencyCurve(const Curve& sweepEffCurve) { m_sweepEfficiencyCurve = sweepEffCurve; }
|
||||
void setLorenzCoefficient(double coeff) { m_lorenzCoefficient = coeff;}
|
||||
|
||||
// Used to "steal" the data from this one using swap
|
||||
std::map<RigFlowDiagResultAddress, std::vector<double> >& nativeResults() { return m_nativeResults; }
|
||||
std::map<std::pair<std::string, std::string>, std::pair<double, double> > & injProdWellPairFluxes() { return m_injProdWellPairFluxes; }
|
||||
|
||||
Curve& flowCapStorageCapCurve() { return m_flowCapStorageCapCurve; }
|
||||
Curve& sweepEfficiencyCurve() { return m_sweepEfficiencyCurve; }
|
||||
double lorenzCoefficient() { return m_lorenzCoefficient;}
|
||||
|
||||
private:
|
||||
|
||||
void addResult(const RigFlowDiagResultAddress& resAddr, const std::map<int, double>& cellValues);
|
||||
@ -61,10 +54,6 @@ private:
|
||||
std::map<RigFlowDiagResultAddress, std::vector<double> > m_nativeResults;
|
||||
std::map<std::pair<std::string, std::string>, std::pair<double, double> > m_injProdWellPairFluxes;
|
||||
|
||||
Curve m_flowCapStorageCapCurve;
|
||||
Curve m_sweepEfficiencyCurve;
|
||||
double m_lorenzCoefficient;
|
||||
|
||||
size_t m_activeCellCount;
|
||||
};
|
||||
|
||||
@ -74,15 +63,34 @@ class RigOpmFlowDiagStaticData;
|
||||
|
||||
class RigFlowDiagSolverInterface : public cvf::Object
|
||||
{
|
||||
public:
|
||||
struct FlowCharacteristicsResultFrame
|
||||
{
|
||||
FlowCharacteristicsResultFrame();
|
||||
|
||||
using Curve = std::pair< std::vector<double>, std::vector<double> >;
|
||||
|
||||
Curve m_flowCapStorageCapCurve;
|
||||
Curve m_sweepEfficiencyCurve;
|
||||
double m_lorenzCoefficient;
|
||||
};
|
||||
|
||||
public:
|
||||
explicit RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase);
|
||||
virtual ~RigFlowDiagSolverInterface();
|
||||
|
||||
RigFlowDiagTimeStepResult calculate(size_t timestep,
|
||||
RigFlowDiagResultAddress::PhaseSelection phaseSelection,
|
||||
std::map<std::string, std::vector<int> > injectorTracers,
|
||||
std::map<std::string, std::vector<int> > producerTracers);
|
||||
|
||||
FlowCharacteristicsResultFrame calculateFlowCharacteristics(const std::vector<double>* injector_tof,
|
||||
const std::vector<double>* producer_tof,
|
||||
double max_pv_fraction);
|
||||
|
||||
private:
|
||||
std::string getInitFileName() const;
|
||||
|
||||
RimEclipseResultCase * m_eclipseCase;
|
||||
|
||||
cvf::ref<RigOpmFlowDiagStaticData> m_opmFlowDiagStaticData;
|
||||
|
@ -250,7 +250,7 @@ void RigReservoirBuilderMock::populateReservoir(RigEclipseCaseData* eclipseCase)
|
||||
addFaults(eclipseCase);
|
||||
|
||||
// Set all cells active
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RifReaderInterface::MATRIX_RESULTS);
|
||||
RigActiveCellInfo* activeCellInfo = eclipseCase->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
activeCellInfo->setReservoirCellCount(eclipseCase->mainGrid()->globalCellArray().size());
|
||||
for (size_t i = 0; i < eclipseCase->mainGrid()->globalCellArray().size(); i++)
|
||||
{
|
||||
|
@ -41,7 +41,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromUiResultName(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& uiResultName)
|
||||
{
|
||||
@ -134,7 +134,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromUiResultName(con
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromNameAndType(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& uiResultName,
|
||||
RiaDefines::ResultCatType resultType)
|
||||
@ -172,8 +172,6 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition
|
||||
size_t timeStepIndex,
|
||||
RimEclipseResultDefinition* resultDefinition)
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultDefinition->porosityModel());
|
||||
|
||||
if (resultDefinition->resultType() != RiaDefines::FLOW_DIAGNOSTICS)
|
||||
{
|
||||
|
||||
@ -185,7 +183,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition
|
||||
|
||||
return RigResultAccessorFactory::createFromUiResultName(eclipseCase,
|
||||
gridIndex,
|
||||
porosityModel,
|
||||
resultDefinition->porosityModel(),
|
||||
adjustedTimeStepIndex,
|
||||
resultDefinition->resultVariable());
|
||||
}
|
||||
@ -200,7 +198,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition
|
||||
const RigGridBase* grid = eclipseCase->grid(gridIndex);
|
||||
if ( !grid ) return new RigHugeValResultAccessor;
|
||||
|
||||
cvf::ref<RigResultAccessor> object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(porosityModel));
|
||||
cvf::ref<RigResultAccessor> object = new RigActiveCellsResultAccessor(grid, resultValues, eclipseCase->activeCellInfo(resultDefinition->porosityModel()));
|
||||
|
||||
return object;
|
||||
}
|
||||
@ -211,7 +209,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultDefinition
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeFromUiResultName(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& uiResultName)
|
||||
{
|
||||
@ -239,7 +237,7 @@ cvf::ref<RigResultAccessor> RigResultAccessorFactory::createNativeFromUiResultNa
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultAccessor> RigResultAccessorFactory::createFromResultIdx(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t resultIndex)
|
||||
{
|
||||
|
@ -41,14 +41,14 @@ public:
|
||||
static cvf::ref<RigResultAccessor>
|
||||
createFromUiResultName(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& uiResultName);
|
||||
|
||||
static cvf::ref<RigResultAccessor>
|
||||
createFromNameAndType(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& uiResultName,
|
||||
RiaDefines::ResultCatType resultType);
|
||||
@ -56,7 +56,7 @@ public:
|
||||
static cvf::ref<RigResultAccessor>
|
||||
createFromResultIdx(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t resultIndex);
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
static cvf::ref<RigResultAccessor>
|
||||
createNativeFromUiResultName(const RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
const QString& resultName);
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& uiResultName)
|
||||
{
|
||||
@ -53,7 +53,7 @@ cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier(RigEc
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::ref<RigResultModifier> RigResultModifierFactory::createResultModifier(RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex, size_t scalarResultIndex)
|
||||
{
|
||||
if ( !eclipseCase ) return NULL;
|
||||
|
@ -30,14 +30,14 @@ public:
|
||||
static cvf::ref<RigResultModifier>
|
||||
createResultModifier(RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
QString& uiResultName);
|
||||
|
||||
static cvf::ref<RigResultModifier>
|
||||
createResultModifier(RigEclipseCaseData* eclipseCase,
|
||||
size_t gridIndex,
|
||||
RifReaderInterface::PorosityModelResultType porosityModel,
|
||||
RiaDefines::PorosityModelType porosityModel,
|
||||
size_t timeStepIndex,
|
||||
size_t scalarResultIndex);
|
||||
};
|
||||
|
@ -37,12 +37,12 @@ const RigWellResultFrame& RigSingleWellResultsData::wellResultFrame(size_t resul
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector<QDateTime>& resultTimes)
|
||||
void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndices(const std::vector<QDateTime>& simulationTimeSteps)
|
||||
{
|
||||
m_resultTimeStepIndexToWellTimeStepIndex.clear();
|
||||
if (m_wellCellsTimeSteps.size() == 0) return;
|
||||
|
||||
m_resultTimeStepIndexToWellTimeStepIndex.resize(resultTimes.size(), cvf::UNDEFINED_SIZE_T);
|
||||
m_resultTimeStepIndexToWellTimeStepIndex.resize(simulationTimeSteps.size(), cvf::UNDEFINED_SIZE_T);
|
||||
|
||||
if (false)
|
||||
{
|
||||
@ -54,29 +54,23 @@ void RigSingleWellResultsData::computeMappingFromResultTimeIndicesToWellTimeIndi
|
||||
}
|
||||
|
||||
qDebug() << "Result TimeStamps";
|
||||
for (size_t i = 0; i < resultTimes.size(); i++)
|
||||
for (size_t i = 0; i < simulationTimeSteps.size(); i++)
|
||||
{
|
||||
qDebug() << resultTimes[i].toString();
|
||||
qDebug() << simulationTimeSteps[i].toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int resultIdx = 0;
|
||||
size_t wellIdx = 0;
|
||||
size_t activeWellIdx = cvf::UNDEFINED_SIZE_T;
|
||||
|
||||
while (wellIdx <= m_wellCellsTimeSteps.size() && resultIdx < static_cast<int>(resultTimes.size()))
|
||||
for (size_t resultTimeStepIndex = 0; resultTimeStepIndex< simulationTimeSteps.size(); resultTimeStepIndex++)
|
||||
{
|
||||
if (wellIdx < m_wellCellsTimeSteps.size() && m_wellCellsTimeSteps[wellIdx].m_timestamp <= resultTimes[resultIdx])
|
||||
size_t wellTimeStepIndex = 0;
|
||||
|
||||
while (wellTimeStepIndex < m_wellCellsTimeSteps.size() &&
|
||||
m_wellCellsTimeSteps[wellTimeStepIndex].m_timestamp < simulationTimeSteps[resultTimeStepIndex])
|
||||
{
|
||||
activeWellIdx = wellIdx;
|
||||
wellIdx++;
|
||||
wellTimeStepIndex++;
|
||||
}
|
||||
|
||||
CVF_ASSERT(resultIdx < static_cast<int>(m_resultTimeStepIndexToWellTimeStepIndex.size()));
|
||||
m_resultTimeStepIndexToWellTimeStepIndex[resultIdx] = activeWellIdx;
|
||||
|
||||
resultIdx++;
|
||||
m_resultTimeStepIndexToWellTimeStepIndex[resultTimeStepIndex] = wellTimeStepIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,12 @@
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfMath.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include <QDateTime>
|
||||
#include <vector>
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <QDateTime>
|
||||
|
||||
#include <vector>
|
||||
|
||||
//==================================================================================================
|
||||
/// Stores the info on a significant point in the well. Either a well-to-grid connection, or the
|
||||
/// bottom position of a connection less well-segment
|
||||
|
@ -0,0 +1,137 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RigTofAccumulatedPhaseFractionsCalculator.h"
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFlowDiagResultAddress.h"
|
||||
#include "RigFlowDiagResults.h"
|
||||
#include "RigResultAccessor.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigSingleWellResultsData.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimFlowDiagSolution.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply,
|
||||
QString wellname,
|
||||
size_t timestep)
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = caseToApply->eclipseCaseData();
|
||||
RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL;
|
||||
RimReservoirCellResultsStorage* gridCellResults = caseToApply->results(porosityModel);
|
||||
|
||||
size_t scalarResultIndexSwat = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT");
|
||||
size_t scalarResultIndexSoil = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SOIL");
|
||||
size_t scalarResultIndexSgas = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS");
|
||||
size_t scalarResultIndexPorv = gridCellResults->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORV");
|
||||
const std::vector<double>* swatResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSwat, timestep));
|
||||
const std::vector<double>* soilResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSoil, timestep));
|
||||
const std::vector<double>* sgasResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexSgas, timestep));
|
||||
const std::vector<double>* porvResults = &(eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->cellScalarResults(scalarResultIndexPorv, timestep));
|
||||
|
||||
RimFlowDiagSolution* flowDiagSolution = caseToApply->defaultFlowDiagSolution();
|
||||
|
||||
std::string resultNameTof = "TOF";
|
||||
const std::vector<double>* tofData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameTof,
|
||||
RigFlowDiagResultAddress::PhaseSelection::PHASE_ALL,
|
||||
wellname.toStdString()),
|
||||
timestep);
|
||||
|
||||
std::string resultNameFraction = "Fraction";
|
||||
const std::vector<double>* fractionData = flowDiagSolution->flowDiagResults()->resultValues(RigFlowDiagResultAddress(resultNameFraction,
|
||||
RigFlowDiagResultAddress::PhaseSelection::PHASE_ALL,
|
||||
wellname.toStdString()),
|
||||
timestep);
|
||||
|
||||
sortTofAndCalculateAccPhaseFraction(tofData,
|
||||
fractionData,
|
||||
porvResults,
|
||||
swatResults,
|
||||
soilResults,
|
||||
sgasResults,
|
||||
m_accumulatedPhaseFractionSwat,
|
||||
m_accumulatedPhaseFractionSoil,
|
||||
m_accumulatedPhaseFractionSgas,
|
||||
m_tofInIncreasingOrder);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(const std::vector<double>* tofData,
|
||||
const std::vector<double>* fractionData,
|
||||
const std::vector<double>* porvResults,
|
||||
const std::vector<double>* swatResults,
|
||||
const std::vector<double>* soilResults,
|
||||
const std::vector<double>* sgasResults,
|
||||
std::vector<double>& tofInIncreasingOrder,
|
||||
std::vector<double>& accumulatedPhaseFractionSwat,
|
||||
std::vector<double>& accumulatedPhaseFractionSoil,
|
||||
std::vector<double>& accumulatedPhaseFractionSgas)
|
||||
|
||||
{
|
||||
std::map<double, std::vector<int> > tofAndIndexMap;
|
||||
|
||||
for (int i = 0; i < static_cast<int>(tofData->size()); i++)
|
||||
{
|
||||
std::vector<int> vectorOfIndexes;
|
||||
vectorOfIndexes.push_back(i);
|
||||
|
||||
auto iteratorBoolFromInsertToMap = tofAndIndexMap.insert(std::make_pair(tofData->at(i), vectorOfIndexes));
|
||||
if (!iteratorBoolFromInsertToMap.second)
|
||||
{
|
||||
//Element exist already, was not inserted
|
||||
iteratorBoolFromInsertToMap.first->second.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
double fractionPorvSum = 0.0;
|
||||
double fractionPorvPhaseSumSwat = 0.0;
|
||||
double fractionPorvPhaseSumSoil = 0.0;
|
||||
double fractionPorvPhaseSumSgas = 0.0;
|
||||
|
||||
for (auto element : tofAndIndexMap)
|
||||
{
|
||||
double tofValue = element.first;
|
||||
for (int index : element.second)
|
||||
{
|
||||
fractionPorvSum += fractionData->at(index) * porvResults->at(index);
|
||||
fractionPorvPhaseSumSwat += fractionData->at(index) * porvResults->at(index) * swatResults->at(index);
|
||||
fractionPorvPhaseSumSoil += fractionData->at(index) * porvResults->at(index) * soilResults->at(index);
|
||||
fractionPorvPhaseSumSgas += fractionData->at(index) * porvResults->at(index) * sgasResults->at(index);
|
||||
}
|
||||
|
||||
tofInIncreasingOrder.push_back(tofValue);
|
||||
accumulatedPhaseFractionSwat.push_back(fractionPorvPhaseSumSwat / fractionPorvSum);
|
||||
accumulatedPhaseFractionSoil.push_back(fractionPorvPhaseSumSoil / fractionPorvSum);
|
||||
accumulatedPhaseFractionSgas.push_back(fractionPorvPhaseSumSgas / fractionPorvSum);
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
class RimEclipseResultCase;
|
||||
class QString;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class RigTofAccumulatedPhaseFractionsCalculator
|
||||
{
|
||||
|
||||
public:
|
||||
explicit RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply,
|
||||
QString wellname,
|
||||
size_t timestep);
|
||||
|
||||
const std::vector<double>& sortedUniqueTOFValues() const { return m_tofInIncreasingOrder; }
|
||||
const std::vector<double>& accumulatedPhaseFractionsSwat() const { return m_accumulatedPhaseFractionSwat; }
|
||||
const std::vector<double>& accumulatedPhaseFractionsSoil() const { return m_accumulatedPhaseFractionSoil; }
|
||||
const std::vector<double>& accumulatedPhaseFractionsSgas() const { return m_accumulatedPhaseFractionSgas; }
|
||||
|
||||
|
||||
private:
|
||||
friend class RigTofAccumulatedPhaseFractionsCalculatorTester;
|
||||
static void sortTofAndCalculateAccPhaseFraction(const std::vector<double>* tofData,
|
||||
const std::vector<double>* fractionData,
|
||||
const std::vector<double>* porvResults,
|
||||
const std::vector<double>* swatResults,
|
||||
const std::vector<double>* soilResults,
|
||||
const std::vector<double>* sgasResults,
|
||||
std::vector<double>& tofInIncreasingOrder,
|
||||
std::vector<double>& accumulatedPhaseFractionSwat,
|
||||
std::vector<double>& accumulatedPhaseFractionSoil,
|
||||
std::vector<double>& accumulatedPhaseFractionSgas);
|
||||
|
||||
private:
|
||||
std::vector<double> m_tofInIncreasingOrder;
|
||||
std::vector<double> m_accumulatedPhaseFractionSwat;
|
||||
std::vector<double> m_accumulatedPhaseFractionSgas;
|
||||
std::vector<double> m_accumulatedPhaseFractionSoil;
|
||||
|
||||
};
|
||||
|
||||
class RigTofAccumulatedPhaseFractionsCalculatorTester
|
||||
{
|
||||
public:
|
||||
static void testSortTofAndCalculateAccPhaseFraction(const std::vector<double>* tofData,
|
||||
const std::vector<double>* fractionData,
|
||||
const std::vector<double>* porvResults,
|
||||
const std::vector<double>* swatResults,
|
||||
const std::vector<double>* soilResults,
|
||||
const std::vector<double>* sgasResults,
|
||||
std::vector<double>& tofInIncreasingOrder,
|
||||
std::vector<double>& accumulatedPhaseFractionSwat,
|
||||
std::vector<double>& accumulatedPhaseFractionSoil,
|
||||
std::vector<double>& accumulatedPhaseFractionSgas)
|
||||
{
|
||||
RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(tofData,
|
||||
fractionData,
|
||||
porvResults,
|
||||
swatResults,
|
||||
soilResults,
|
||||
sgasResults,
|
||||
tofInIncreasingOrder,
|
||||
accumulatedPhaseFractionSwat,
|
||||
accumulatedPhaseFractionSoil,
|
||||
accumulatedPhaseFractionSgas);
|
||||
}
|
||||
};
|
@ -95,14 +95,14 @@ public:
|
||||
RimEclipseCase* rimCase = RiaSocketTools::findCaseFromArgs(server, args);
|
||||
if (!rimCase) return true;
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModel = RiaDefines::MATRIX_MODEL;
|
||||
|
||||
if (args.size() > 2)
|
||||
{
|
||||
QString prorosityModelString = args[2];
|
||||
if (prorosityModelString.toUpper() == "FRACTURE")
|
||||
{
|
||||
porosityModel = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModel = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RifReaderInterface::PorosityModelResultType porosityModel, std::vector<qint32>& gridNumber, std::vector<qint32>& cellI, std::vector<qint32>& cellJ, std::vector<qint32>& cellK, std::vector<qint32>& parentGridNumber, std::vector<qint32>& hostCellI, std::vector<qint32>& hostCellJ, std::vector<qint32>& hostCellK, std::vector<qint32>& globalCoarseningBoxIdx)
|
||||
static void calculateMatrixModelActiveCellInfo(RimEclipseCase* reservoirCase, RiaDefines::PorosityModelType porosityModel, std::vector<qint32>& gridNumber, std::vector<qint32>& cellI, std::vector<qint32>& cellJ, std::vector<qint32>& cellK, std::vector<qint32>& parentGridNumber, std::vector<qint32>& hostCellI, std::vector<qint32>& hostCellJ, std::vector<qint32>& hostCellK, std::vector<qint32>& globalCoarseningBoxIdx)
|
||||
{
|
||||
gridNumber.clear();
|
||||
cellI.clear();
|
||||
@ -412,7 +412,7 @@ public:
|
||||
size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T;
|
||||
if (rimCase && rimCase->eclipseCaseData())
|
||||
{
|
||||
rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
|
||||
rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
|
||||
if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
canFetchData = false;
|
||||
@ -431,7 +431,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<QDateTime> timeStepDates = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(scalarIndexWithMaxTimeStepCount);
|
||||
std::vector<QDateTime> timeStepDates = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->timeStepDates(scalarIndexWithMaxTimeStepCount);
|
||||
|
||||
quint64 timeStepCount = timeStepDates.size();
|
||||
quint64 byteCount = sizeof(quint64) + 6 * timeStepCount * sizeof(qint32);
|
||||
@ -499,7 +499,7 @@ public:
|
||||
size_t scalarIndexWithMaxTimeStepCount = cvf::UNDEFINED_SIZE_T;
|
||||
if (rimCase && rimCase->eclipseCaseData())
|
||||
{
|
||||
rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
|
||||
rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount(&scalarIndexWithMaxTimeStepCount);
|
||||
if (scalarIndexWithMaxTimeStepCount == cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
canFetchData = false;
|
||||
@ -518,7 +518,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<double> daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount);
|
||||
std::vector<double> daysSinceSimulationStart = rimCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart(scalarIndexWithMaxTimeStepCount);
|
||||
|
||||
quint64 timeStepCount = daysSinceSimulationStart.size();
|
||||
quint64 byteCount = sizeof(quint64) + timeStepCount * sizeof(qint32);
|
||||
|
@ -165,10 +165,10 @@ public:
|
||||
QString porosityModelName;
|
||||
porosityModelName = args[2];
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL;
|
||||
if (porosityModelName.toUpper() == "FRACTURE")
|
||||
{
|
||||
porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
if (!rimCase || !rimCase->eclipseCaseData())
|
||||
@ -336,10 +336,10 @@ public:
|
||||
QString porosityModelName;
|
||||
porosityModelName = args[2];
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL;
|
||||
if (porosityModelName.toUpper() == "FRACTURE")
|
||||
{
|
||||
porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
if (!rimCase || !rimCase->eclipseCaseData() )
|
||||
|
@ -60,10 +60,10 @@ public:
|
||||
QString propertyName = args[2];
|
||||
QString porosityModelName = args[3];
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL;
|
||||
if (porosityModelName == "Fracture")
|
||||
{
|
||||
porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
// Find the requested data
|
||||
@ -233,10 +233,10 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL;
|
||||
if (porosityModelName == "Fracture")
|
||||
{
|
||||
porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
size_t scalarResultIndex = cvf::UNDEFINED_SIZE_T;
|
||||
@ -383,7 +383,7 @@ public:
|
||||
m_bytesPerTimeStepToRead(0),
|
||||
m_currentTimeStepNumberToRead(0),
|
||||
m_invalidActiveCellCountDetected(false),
|
||||
m_porosityModelEnum(RifReaderInterface::MATRIX_RESULTS)
|
||||
m_porosityModelEnum(RiaDefines::MATRIX_MODEL)
|
||||
{}
|
||||
|
||||
static QString commandName () { return QString("SetActiveCellProperty"); }
|
||||
@ -397,7 +397,7 @@ public:
|
||||
|
||||
if (porosityModelName == "Fracture")
|
||||
{
|
||||
m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
m_porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
// Find the requested data, Or create a set if we are setting data and it is not found
|
||||
@ -697,7 +697,7 @@ private:
|
||||
size_t m_currentScalarIndex;
|
||||
QString m_currentPropertyName;
|
||||
std::vector<size_t> m_requestedTimesteps;
|
||||
RifReaderInterface::PorosityModelResultType m_porosityModelEnum;
|
||||
RiaDefines::PorosityModelType m_porosityModelEnum;
|
||||
|
||||
quint64 m_timeStepCountToRead;
|
||||
quint64 m_bytesPerTimeStepToRead;
|
||||
@ -724,7 +724,7 @@ public:
|
||||
m_bytesPerTimeStepToRead(0),
|
||||
m_currentTimeStepNumberToRead(0),
|
||||
m_invalidDataDetected(false),
|
||||
m_porosityModelEnum(RifReaderInterface::MATRIX_RESULTS)
|
||||
m_porosityModelEnum(RiaDefines::MATRIX_MODEL)
|
||||
{}
|
||||
|
||||
static QString commandName () { return QString("SetGridProperty"); }
|
||||
@ -746,7 +746,7 @@ public:
|
||||
|
||||
if (porosityModelName == "Fracture")
|
||||
{
|
||||
m_porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
m_porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
RigGridBase* grid = rimCase->eclipseCaseData()->grid(m_currentGridIndex);
|
||||
@ -1061,7 +1061,7 @@ private:
|
||||
size_t m_currentScalarIndex;
|
||||
QString m_currentPropertyName;
|
||||
std::vector<size_t> m_requestedTimesteps;
|
||||
RifReaderInterface::PorosityModelResultType m_porosityModelEnum;
|
||||
RiaDefines::PorosityModelType m_porosityModelEnum;
|
||||
|
||||
quint64 m_timeStepCountToRead;
|
||||
quint64 m_bytesPerTimeStepToRead;
|
||||
@ -1092,11 +1092,11 @@ public:
|
||||
}
|
||||
|
||||
QString porosityModelName = args[2];
|
||||
RifReaderInterface::PorosityModelResultType porosityModelEnum = RifReaderInterface::MATRIX_RESULTS;
|
||||
RiaDefines::PorosityModelType porosityModelEnum = RiaDefines::MATRIX_MODEL;
|
||||
|
||||
if (porosityModelName == "Fracture")
|
||||
{
|
||||
porosityModelEnum = RifReaderInterface::FRACTURE_RESULTS;
|
||||
porosityModelEnum = RiaDefines::FRACTURE_MODEL;
|
||||
}
|
||||
|
||||
std::vector<QString> propNames;
|
||||
|
@ -24,6 +24,7 @@ ${CEE_CURRENT_LIST_DIR}RivTernaryScalarMapper-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}ScalarMapper-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}WellPathAsciiFileReader-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}opm-flowdiagnostics-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTofAccumulatedPhaseFractionsCalculator-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigCellGeometryTools-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigTransmissibilityCondenser-Test.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RigHexIntersectionTools-Test.cpp
|
||||
|
@ -260,7 +260,7 @@ TEST(RigReservoirTest, UnifiedTestFile)
|
||||
|
||||
|
||||
|
||||
void buildResultInfoString(RigReservoir* reservoir, RifReaderInterface::PorosityModelResultType porosityModel, RiaDefines::ResultCatType resultType)
|
||||
void buildResultInfoString(RigReservoir* reservoir, RiaDefines::PorosityModelType porosityModel, RiaDefines::ResultCatType resultType)
|
||||
{
|
||||
RigCaseCellResultsData* matrixResults = reservoir->results(porosityModel);
|
||||
{
|
||||
@ -302,22 +302,22 @@ TEST(RigReservoirTest, DualPorosityTest)
|
||||
qDebug() << "\n\n" <<
|
||||
"Matrix porosities, DYNAMIC results" <<
|
||||
"----------------------------------";
|
||||
buildResultInfoString(reservoir.p(), RifReaderInterface::MATRIX_RESULTS, RiaDefines::DYNAMIC_NATIVE);
|
||||
buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::DYNAMIC_NATIVE);
|
||||
|
||||
qDebug() << "\n\n" <<
|
||||
"Matrix porosities, STATIC results" <<
|
||||
"----------------------------------";
|
||||
buildResultInfoString(reservoir.p(), RifReaderInterface::MATRIX_RESULTS, RiaDefines::STATIC_NATIVE);
|
||||
buildResultInfoString(reservoir.p(), RiaDefines::MATRIX_MODEL, RiaDefines::STATIC_NATIVE);
|
||||
|
||||
qDebug() << "\n\n" <<
|
||||
"Fracture porosities, DYNAMIC results" <<
|
||||
"----------------------------------";
|
||||
buildResultInfoString(reservoir.p(), RifReaderInterface::FRACTURE_RESULTS, RiaDefines::DYNAMIC_NATIVE);
|
||||
buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::DYNAMIC_NATIVE);
|
||||
|
||||
qDebug() << "\n\n" <<
|
||||
"Fracture porosities, STATIC results" <<
|
||||
"----------------------------------";
|
||||
buildResultInfoString(reservoir.p(), RifReaderInterface::FRACTURE_RESULTS, RiaDefines::STATIC_NATIVE);
|
||||
buildResultInfoString(reservoir.p(), RiaDefines::FRACTURE_MODEL, RiaDefines::STATIC_NATIVE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,159 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 - Statoil ASA
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "RigTofAccumulatedPhaseFractionsCalculator.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFractionTest)
|
||||
{
|
||||
std::vector<double> tofDataVector;
|
||||
tofDataVector.push_back(0.001);
|
||||
tofDataVector.push_back(0.1);
|
||||
tofDataVector.push_back(0.01);
|
||||
|
||||
std::vector<double> fractionDataVector;
|
||||
fractionDataVector.push_back(0.002);
|
||||
fractionDataVector.push_back(0.2);
|
||||
fractionDataVector.push_back(0.02);
|
||||
|
||||
std::vector<double> porvResultVector;
|
||||
porvResultVector.push_back(1);
|
||||
porvResultVector.push_back(1);
|
||||
porvResultVector.push_back(1.5);
|
||||
|
||||
std::vector<double> swatResultVector;
|
||||
swatResultVector.push_back(0.1);
|
||||
swatResultVector.push_back(0.3);
|
||||
swatResultVector.push_back(0.6);
|
||||
|
||||
std::vector<double> soilResultVector;
|
||||
soilResultVector.push_back(0.3);
|
||||
soilResultVector.push_back(0.6);
|
||||
soilResultVector.push_back(0.1);
|
||||
|
||||
std::vector<double> sgasResultVector;
|
||||
sgasResultVector.push_back(0.6);
|
||||
sgasResultVector.push_back(0.1);
|
||||
sgasResultVector.push_back(0.3);
|
||||
|
||||
|
||||
std::vector<double> accumulatedPhaseFractionSwat;
|
||||
std::vector<double> accumulatedPhaseFractionSoil;
|
||||
std::vector<double> accumulatedPhaseFractionSgas;
|
||||
std::vector<double> tofInIncreasingOrder;
|
||||
|
||||
RigTofAccumulatedPhaseFractionsCalculatorTester::testSortTofAndCalculateAccPhaseFraction(&(tofDataVector),
|
||||
&(fractionDataVector),
|
||||
&(porvResultVector),
|
||||
&(swatResultVector),
|
||||
&(soilResultVector),
|
||||
&(sgasResultVector),
|
||||
tofInIncreasingOrder,
|
||||
accumulatedPhaseFractionSwat,
|
||||
accumulatedPhaseFractionSoil,
|
||||
accumulatedPhaseFractionSgas
|
||||
);
|
||||
|
||||
EXPECT_LT(tofInIncreasingOrder[0], tofInIncreasingOrder[1]);
|
||||
EXPECT_LT(tofInIncreasingOrder[1], tofInIncreasingOrder[2]);
|
||||
|
||||
double sumForOneTOF = accumulatedPhaseFractionSwat[2]
|
||||
+ accumulatedPhaseFractionSoil[2]
|
||||
+ accumulatedPhaseFractionSgas[2];
|
||||
EXPECT_DOUBLE_EQ(sumForOneTOF, 1.00);
|
||||
|
||||
EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSwat[0], 0.1000);
|
||||
EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSoil[1], 0.1125);
|
||||
EXPECT_LT(accumulatedPhaseFractionSgas[2] - 0.13017, 0.00001);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RigTofAccumulatedPhaseFractionsCalculator, sortTofAndCalculateAccPhaseFractionTest2)
|
||||
{
|
||||
std::vector<double> tofDataVector2;
|
||||
tofDataVector2.push_back(0.001);
|
||||
tofDataVector2.push_back(0.1);
|
||||
tofDataVector2.push_back(0.01);
|
||||
tofDataVector2.push_back(0.1);
|
||||
|
||||
std::vector<double> fractionDataVector2;
|
||||
fractionDataVector2.push_back(0.002);
|
||||
fractionDataVector2.push_back(0.2);
|
||||
fractionDataVector2.push_back(0.02);
|
||||
fractionDataVector2.push_back(0.02);
|
||||
|
||||
std::vector<double> porvResultVector2;
|
||||
porvResultVector2.push_back(1);
|
||||
porvResultVector2.push_back(1);
|
||||
porvResultVector2.push_back(1.5);
|
||||
porvResultVector2.push_back(1.5);
|
||||
|
||||
std::vector<double> swatResultVector2;
|
||||
swatResultVector2.push_back(0.1);
|
||||
swatResultVector2.push_back(0.3);
|
||||
swatResultVector2.push_back(0.6);
|
||||
swatResultVector2.push_back(0.6);
|
||||
|
||||
std::vector<double> soilResultVector2;
|
||||
soilResultVector2.push_back(0.3);
|
||||
soilResultVector2.push_back(0.6);
|
||||
soilResultVector2.push_back(0.1);
|
||||
soilResultVector2.push_back(0.1);
|
||||
|
||||
std::vector<double> sgasResultVector2;
|
||||
sgasResultVector2.push_back(0.6);
|
||||
sgasResultVector2.push_back(0.1);
|
||||
sgasResultVector2.push_back(0.3);
|
||||
sgasResultVector2.push_back(0.3);
|
||||
|
||||
std::vector<double> accumulatedPhaseFractionSwat2;
|
||||
std::vector<double> accumulatedPhaseFractionSoil2;
|
||||
std::vector<double> accumulatedPhaseFractionSgas2;
|
||||
std::vector<double> tofInIncreasingOrder2;
|
||||
|
||||
RigTofAccumulatedPhaseFractionsCalculatorTester::testSortTofAndCalculateAccPhaseFraction(&(tofDataVector2),
|
||||
&(fractionDataVector2),
|
||||
&(porvResultVector2),
|
||||
&(swatResultVector2),
|
||||
&(soilResultVector2),
|
||||
&(sgasResultVector2),
|
||||
tofInIncreasingOrder2,
|
||||
accumulatedPhaseFractionSwat2,
|
||||
accumulatedPhaseFractionSoil2,
|
||||
accumulatedPhaseFractionSgas2);
|
||||
EXPECT_EQ(tofInIncreasingOrder2.size(), 3);
|
||||
|
||||
double sumForOneTOF = accumulatedPhaseFractionSwat2[2]
|
||||
+ accumulatedPhaseFractionSoil2[2]
|
||||
+ accumulatedPhaseFractionSgas2[2];
|
||||
EXPECT_DOUBLE_EQ(sumForOneTOF, 1.00);
|
||||
|
||||
EXPECT_LT(tofInIncreasingOrder2[0], tofInIncreasingOrder2[1]);
|
||||
EXPECT_LT(tofInIncreasingOrder2[1], tofInIncreasingOrder2[2]);
|
||||
|
||||
EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSwat2[0], 0.1000);
|
||||
EXPECT_DOUBLE_EQ(accumulatedPhaseFractionSoil2[1], 0.1125);
|
||||
EXPECT_LT(accumulatedPhaseFractionSgas2[2] - 0.149618, 0.00001);
|
||||
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips
|
||||
return;
|
||||
}
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel();
|
||||
if (resultColors->isTernarySaturationSelected())
|
||||
{
|
||||
RimReservoirCellResultsStorage* gridCellResults = resultColors->currentGridCellResults();
|
||||
@ -407,8 +407,6 @@ void RiuResultTextBuilder::appendTextFromResultColors(RigEclipseCaseData* eclips
|
||||
}
|
||||
else if (resultColors->hasResult())
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel());
|
||||
|
||||
if (resultColors->hasStaticResult())
|
||||
{
|
||||
if (resultColors->resultVariable().compare(RiaDefines::combinedTransmissibilityResultName(), Qt::CaseInsensitive) == 0)
|
||||
@ -539,7 +537,7 @@ QString RiuResultTextBuilder::cellEdgeResultDetails()
|
||||
adjustedTimeStep = 0;
|
||||
}
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(m_reservoirView->cellResult()->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = m_reservoirView->cellResult()->porosityModel();
|
||||
cvf::ref<RigResultAccessor> resultAccessor = RigResultAccessorFactory::createFromResultIdx(m_reservoirView->eclipseCase()->eclipseCaseData(), m_gridIndex, porosityModel, adjustedTimeStep, resultIndex);
|
||||
if (resultAccessor.notNull())
|
||||
{
|
||||
@ -666,7 +664,7 @@ QString RiuResultTextBuilder::cellResultText(RimEclipseCellColors* resultColors)
|
||||
size_t sgasScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SGAS");
|
||||
size_t swatScalarSetIndex = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "SWAT");
|
||||
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultColors->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = resultColors->porosityModel();
|
||||
|
||||
cvf::ref<RigResultAccessor> dataAccessObjectX = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, soilScalarSetIndex);
|
||||
cvf::ref<RigResultAccessor> dataAccessObjectY = RigResultAccessorFactory::createFromResultIdx(eclipseCaseData, m_gridIndex, porosityModel, m_timeStepIndex, sgasScalarSetIndex);
|
||||
|
@ -113,7 +113,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
|
||||
eclipseView->eclipseCase() &&
|
||||
eclipseView->eclipseCase()->eclipseCaseData())
|
||||
{
|
||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(eclipseView->cellResult()->porosityModel());
|
||||
RiaDefines::PorosityModelType porosityModel = eclipseView->cellResult()->porosityModel();
|
||||
|
||||
std::vector<QDateTime> timeStepDates = eclipseView->eclipseCase()->eclipseCaseData()->results(porosityModel)->timeStepDates();
|
||||
|
||||
|
31
doc/eclipse_binary_file_classes.plantuml
Normal file
31
doc/eclipse_binary_file_classes.plantuml
Normal file
@ -0,0 +1,31 @@
|
||||
@startuml
|
||||
|
||||
class RifReaderInterface {
|
||||
virtual open()
|
||||
virtual close()
|
||||
virtual staticResult()
|
||||
virtual dynamicResult()
|
||||
virtual timeSteps()
|
||||
}
|
||||
|
||||
RifEclipseRestartDataAccess <|- RifEclipseRestartFilesetAccess
|
||||
RifEclipseRestartDataAccess <|- RifEclipseUnifiedRestartFileAccess
|
||||
|
||||
RifReaderInterface <|- RifReaderEclipseOutput
|
||||
|
||||
class RifEclipseOutputFileTools {
|
||||
helper class with several static functions
|
||||
used to read data from Eclipse binary files
|
||||
}
|
||||
|
||||
|
||||
RifReaderEclipseOutput o-- "1..N" RifEclipseRestartDataAccess
|
||||
|
||||
|
||||
RifEclipseRestartFilesetAccess --o RifEclipseOutputFileTools : uses
|
||||
RifEclipseUnifiedRestartFileAccess --o RifEclipseOutputFileTools : uses
|
||||
|
||||
ecl_file_type "N" o-- RifEclipseRestartFilesetAccess
|
||||
ecl_file_type "1" o-- RifEclipseUnifiedRestartFileAccess
|
||||
|
||||
@enduml
|
Loading…
Reference in New Issue
Block a user