2012-06-26 09:10:41 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-06-26 09:10:41 -05:00
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// 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 "RifReaderInterface.h"
|
|
|
|
|
2017-01-17 08:11:02 -06:00
|
|
|
#include "cvfCollection.h"
|
2013-08-26 07:03:01 -05:00
|
|
|
|
2017-03-23 01:00:00 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
class RifEclipseOutputFileTools;
|
|
|
|
class RifEclipseRestartDataAccess;
|
2017-03-23 01:00:00 -05:00
|
|
|
class RifHdf5ReaderInterface;
|
2013-02-12 04:15:36 -06:00
|
|
|
class RigActiveCellInfo;
|
2017-01-17 08:11:02 -06:00
|
|
|
class RigFault;
|
2017-08-11 08:10:08 -05:00
|
|
|
class RigEclipseTimeStepInfo;
|
2017-03-23 01:00:00 -05:00
|
|
|
class RigGridBase;
|
|
|
|
class RigMainGrid;
|
2017-10-13 09:55:04 -05:00
|
|
|
class QDateTime;
|
2017-01-17 08:11:02 -06:00
|
|
|
|
|
|
|
struct RigWellResultPoint;
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
typedef struct ecl_grid_struct ecl_grid_type;
|
2013-02-05 03:51:32 -06:00
|
|
|
typedef struct ecl_file_struct ecl_file_type;
|
2013-08-26 07:03:01 -05:00
|
|
|
typedef struct well_conn_struct well_conn_type;
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
// File interface for Eclipse output files
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RifReaderEclipseOutput : public RifReaderInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RifReaderEclipseOutput();
|
|
|
|
virtual ~RifReaderEclipseOutput();
|
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
bool open(const QString& fileName, RigEclipseCaseData* eclipseCase);
|
2017-03-23 01:00:00 -05:00
|
|
|
void setHdf5FileName(const QString& fileName);
|
2017-08-24 23:51:56 -05:00
|
|
|
void setFileDataAccess(RifEclipseRestartDataAccess* restartDataAccess);
|
2016-10-21 01:48:33 -05:00
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
virtual bool openAndReadActiveCellData(const QString& fileName, const std::vector<QDateTime>& mainCaseTimeSteps, RigEclipseCaseData* eclipseCase);
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2017-08-11 07:05:59 -05:00
|
|
|
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);
|
2017-07-07 06:31:14 -05:00
|
|
|
void sourSimRlResult(const QString& result, size_t stepIndex, std::vector<double>* values);
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2017-08-28 08:17:03 -05:00
|
|
|
std::vector<QDateTime> allTimeSteps() const;
|
|
|
|
|
2017-01-10 02:51:39 -06:00
|
|
|
static bool transferGeometry(const ecl_grid_type* mainEclGrid, RigEclipseCaseData* eclipseCase);
|
2013-05-21 04:10:59 -05:00
|
|
|
static void transferCoarseningInfo(const ecl_grid_type* eclGrid, RigGridBase* grid);
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
private:
|
2013-02-27 07:13:37 -06:00
|
|
|
bool readActiveCellInfo();
|
2013-04-22 06:24:49 -05:00
|
|
|
void buildMetaData();
|
2014-10-24 04:19:54 -05:00
|
|
|
void readWellCells(const ecl_grid_type* mainEclGrid, bool importCompleteMswData);
|
2013-08-26 07:56:34 -05:00
|
|
|
|
|
|
|
std::string ertGridName( size_t gridNr );
|
|
|
|
|
2017-05-08 09:02:42 -05:00
|
|
|
RigWellResultPoint createWellResultPoint(const RigGridBase* grid, const well_conn_type* ert_connection, int ertBranchId, int ertSegmentId, const char* wellName);
|
2013-02-27 07:13:37 -06:00
|
|
|
|
2016-10-21 01:48:33 -05:00
|
|
|
void importFaults(const QStringList& fileSet, cvf::Collection<RigFault>* faults);
|
2013-08-26 07:03:01 -05:00
|
|
|
|
2013-04-22 07:51:47 -05:00
|
|
|
void openInitFile();
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2017-08-11 07:05:59 -05:00
|
|
|
void extractResultValuesBasedOnPorosityModel(RiaDefines::PorosityModelType matrixOrFracture, std::vector<double>* values, const std::vector<double>& fileValues);
|
2017-06-26 03:25:08 -05:00
|
|
|
void transferStaticNNCData(const ecl_grid_type* mainEclGrid , ecl_file_type* init_file, RigMainGrid* mainGrid);
|
|
|
|
void transferDynamicNNCData(const ecl_grid_type* mainEclGrid, RigMainGrid* mainGrid);
|
2013-02-05 03:51:32 -06:00
|
|
|
|
2017-08-24 23:51:56 -05:00
|
|
|
void ensureDynamicResultAccessIsPresent();
|
2013-02-05 03:51:32 -06:00
|
|
|
|
2017-08-11 07:05:59 -05:00
|
|
|
QStringList validKeywordsForPorosityModel(const QStringList& keywords, const std::vector<size_t>& keywordDataItemCounts, const RigActiveCellInfo* activeCellInfo, const RigActiveCellInfo* fractureActiveCellInfo, RiaDefines::PorosityModelType matrixOrFracture, size_t timeStepCount) const;
|
2017-08-11 05:33:10 -05:00
|
|
|
|
2017-08-11 08:10:08 -05:00
|
|
|
std::vector<RigEclipseTimeStepInfo> createFilteredTimeStepInfos();
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2017-08-30 00:11:09 -05:00
|
|
|
static bool isEclipseAndSoursimTimeStepsEqual(const QDateTime& eclipseDateTime, const QDateTime& sourSimDateTime);
|
2017-08-24 23:51:56 -05:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
private:
|
2017-08-10 04:14:32 -05:00
|
|
|
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
|
2013-02-05 03:51:32 -06:00
|
|
|
|
2017-08-10 04:14:32 -05:00
|
|
|
RigEclipseCaseData* m_eclipseCase;
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2017-08-10 04:14:32 -05:00
|
|
|
ecl_file_type* m_ecl_init_file; // File access to static results
|
2017-08-28 08:17:03 -05:00
|
|
|
mutable cvf::ref<RifEclipseRestartDataAccess> m_dynamicResultsAccess; // File access to dynamic results
|
2017-03-23 01:00:00 -05:00
|
|
|
|
|
|
|
std::unique_ptr<RifHdf5ReaderInterface> m_hdfReaderInterface;
|
2012-06-26 09:10:41 -05:00
|
|
|
};
|