mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2097 Reservoir Phase Detection : Find available phases from result files
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include <ert/ecl/ecl_file.h>
|
||||
#include "ert/ecl/ecl_kw_magic.h"
|
||||
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
#include "RifEclipseOutputFileTools.h"
|
||||
@@ -483,3 +484,58 @@ TEST(DISABLED_RigReservoirTest, WellTest)
|
||||
|
||||
readerInterfaceEcl->setHdf5FileName(sourSim);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST(RigReservoirTest, TestForPhase)
|
||||
{
|
||||
|
||||
/*
|
||||
cvf::ref<RifReaderEclipseOutput> readerInterfaceEcl = new RifReaderEclipseOutput;
|
||||
cvf::ref<RigEclipseCaseData> reservoir = new RigEclipseCaseData(nullptr);
|
||||
|
||||
// Location of test dataset received from Håkon Høgstøl in July 2011 with 10k active cells
|
||||
#ifdef WIN32
|
||||
QString filename("d:/Models/Statoil/soursim/PKMUNK_NOV_TEST_SS.GRID");
|
||||
QString sourSim("d:/Models/Statoil/soursim/result.sourres.00001");
|
||||
#else
|
||||
QString filename("/mnt/hgfs/Statoil/testcase_juli_2011/data/TEST10K_FLT_LGR_NNC.EGRID");
|
||||
QString sourSim("d:/Models/Statoil/soursim/result.sourres");
|
||||
#endif
|
||||
|
||||
bool result = readerInterfaceEcl->open(filename, reservoir.p());
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
readerInterfaceEcl->setHdf5FileName(sourSim);
|
||||
*/
|
||||
|
||||
|
||||
std::string filename = "d:/Models/Statoil/troll_MSW/T07-4A-W2012-16-F3.UNRST";
|
||||
|
||||
//std::string filename = "d:/Models/Statoil/testcase_juli_2011/data/TEST10K_FLT_LGR_NNC.UNRST";
|
||||
//std::string filename = "d:/Models/Statoil/testcase_juli_2011/data/TEST10K_FLT_LGR_NNC.INIT";
|
||||
//std::string filename = "d:/Models/Statoil/TEST10K_FLT_LGR_NNC_TSTEP/TEST10K_FLT_LGR_NNC_TSTEP.UNRST";
|
||||
//std::string filename = "d:/Models/Statoil/gas_case_only_water/TEST_GASWATER.X0000";
|
||||
|
||||
ecl_file_type * f = ecl_file_open(filename.data(), ECL_FILE_CLOSE_STREAM);
|
||||
const ecl_kw_type * intehead = ecl_file_iget_named_kw(f, INTEHEAD_KW, 0);
|
||||
int phases = ecl_kw_iget_int(intehead, INTEHEAD_PHASE_INDEX);
|
||||
|
||||
if (phases & ECL_OIL_PHASE)
|
||||
{
|
||||
qDebug() << "oil";
|
||||
}
|
||||
|
||||
if (phases & ECL_GAS_PHASE)
|
||||
{
|
||||
qDebug() << "gas";
|
||||
}
|
||||
|
||||
if (phases & ECL_WATER_PHASE)
|
||||
{
|
||||
qDebug() << "water";
|
||||
}
|
||||
|
||||
ecl_file_close(f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user