2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02: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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 09:45:23 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-06-18 13:03:48 +02:00
|
|
|
#include "RifEclipseReportKeywords.h"
|
2017-08-25 06:51:56 +02:00
|
|
|
|
2024-06-18 13:03:48 +02:00
|
|
|
#include "RiaDefines.h"
|
|
|
|
|
#include "RiaPorosityModel.h"
|
|
|
|
|
|
|
|
|
|
#include "ert/ecl/ecl_file_view.h"
|
|
|
|
|
#include "ert/ecl/ecl_grid.h"
|
2017-08-25 06:51:56 +02:00
|
|
|
#include "ert/ecl/ecl_util.h"
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
#include "cvfObject.h"
|
|
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
#include <QDateTime>
|
2012-05-18 09:45:23 +02:00
|
|
|
#include <QString>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
2017-08-25 06:51:56 +02:00
|
|
|
#include <vector>
|
2013-02-05 10:51:32 +01:00
|
|
|
|
2023-04-14 14:07:45 +02:00
|
|
|
using ecl_file_type = struct ecl_file_struct;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2017-08-25 06:51:56 +02:00
|
|
|
class RifEclipseRestartDataAccess;
|
2023-08-28 12:17:34 +02:00
|
|
|
class RigEclipseTimeStepInfo;
|
|
|
|
|
class RigActiveCellInfo;
|
2024-06-18 13:03:48 +02:00
|
|
|
class RigEclipseCaseData;
|
|
|
|
|
|
2019-03-18 12:52:01 +01:00
|
|
|
class QByteArray;
|
2013-01-30 14:13:50 +01:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2012-05-18 09:45:23 +02:00
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
2013-02-05 10:51:32 +01:00
|
|
|
class RifEclipseOutputFileTools
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2012-06-26 16:10:41 +02:00
|
|
|
RifEclipseOutputFileTools();
|
|
|
|
|
virtual ~RifEclipseOutputFileTools();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2024-06-18 13:03:48 +02:00
|
|
|
static std::vector<RifEclipseKeywordValueCount> keywordValueCounts( const std::vector<ecl_file_type*>& ecl_files );
|
2023-02-26 10:48:40 +01:00
|
|
|
|
2024-06-18 13:03:48 +02:00
|
|
|
static void createResultEntries( const std::vector<RifEclipseKeywordValueCount>& fileKeywordInfo,
|
|
|
|
|
const std::vector<RigEclipseTimeStepInfo>& timeStepInfo,
|
|
|
|
|
RiaDefines::ResultCatType resultCategory,
|
|
|
|
|
RigEclipseCaseData* eclipseCaseData,
|
|
|
|
|
size_t totalTimeSteps );
|
2023-08-28 12:17:34 +02:00
|
|
|
|
2023-02-26 10:48:40 +01:00
|
|
|
static bool keywordData( const ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values );
|
|
|
|
|
static bool keywordData( const ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void timeSteps( const ecl_file_type* ecl_file,
|
|
|
|
|
std::vector<QDateTime>* timeSteps,
|
2020-04-06 12:15:28 +02:00
|
|
|
std::vector<double>* daysSinceSimulationStart,
|
|
|
|
|
size_t* perTimeStepHeaderKeywordCount );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static bool isValidEclipseFileName( const QString& fileName );
|
|
|
|
|
static QByteArray md5sum( const QString& fileName );
|
|
|
|
|
static bool findSiblingFilesWithSameBaseName( const QString& fileName, QStringList* fileSet );
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static QString firstFileNameOfType( const QStringList& fileSet, ecl_file_enum fileType );
|
|
|
|
|
static QStringList filterFileNamesOfType( const QStringList& fileSet, ecl_file_enum fileType );
|
2013-04-07 16:33:45 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void readGridDimensions( const QString& gridFileName, std::vector<std::vector<int>>& gridDimensions );
|
2014-08-27 14:05:29 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static int readUnitsType( const ecl_file_type* ecl_file );
|
2016-07-14 13:35:32 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static cvf::ref<RifEclipseRestartDataAccess> createDynamicResultAccess( const QString& fileName );
|
2017-08-25 06:51:56 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static QString createIndexFileName( const QString& resultFileName );
|
2017-08-25 06:51:56 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static std::set<RiaDefines::PhaseType> findAvailablePhases( const ecl_file_type* ecl_file );
|
2017-11-10 09:43:51 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static void transferNncFluxData( const ecl_grid_type* grid,
|
|
|
|
|
const ecl_file_view_type* summaryView,
|
|
|
|
|
std::vector<double>* waterFlux,
|
|
|
|
|
std::vector<double>* oilFlux,
|
|
|
|
|
std::vector<double>* gasFlux );
|
2017-11-14 10:43:14 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static bool isExportedFromIntersect( const ecl_file_type* ecl_file );
|
2018-11-13 09:28:13 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static FILE* fopen( const QString& filePath, const QString& mode );
|
2019-03-18 12:52:01 +01:00
|
|
|
|
2023-08-28 12:17:34 +02:00
|
|
|
static bool assignActiveCellData( std::vector<std::vector<int>>& actnumValuesPerGrid, RigEclipseCaseData* eclipseCaseData );
|
|
|
|
|
|
2024-06-18 13:03:48 +02:00
|
|
|
static std::vector<RifEclipseKeywordValueCount>
|
|
|
|
|
validKeywordsForPorosityModel( const std::vector<RifEclipseKeywordValueCount>& keywordItemCounts,
|
|
|
|
|
const RigActiveCellInfo* activeCellInfo,
|
|
|
|
|
const RigActiveCellInfo* fractureActiveCellInfo,
|
|
|
|
|
RiaDefines::PorosityModelType matrixOrFracture,
|
|
|
|
|
size_t timeStepCount );
|
|
|
|
|
|
|
|
|
|
static void extractResultValuesBasedOnPorosityModel( RigEclipseCaseData* eclipseCaseData,
|
|
|
|
|
RiaDefines::PorosityModelType matrixOrFracture,
|
|
|
|
|
std::vector<double>* values,
|
|
|
|
|
const std::vector<double>& fileValues );
|
|
|
|
|
|
2016-07-14 13:35:32 +02:00
|
|
|
private:
|
2024-06-18 13:03:48 +02:00
|
|
|
static void getDayMonthYear( const ecl_kw_type* intehead_kw, int* day, int* month, int* year );
|
|
|
|
|
static RifEclipseReportKeywords createReportStepsMetaData( const std::vector<ecl_file_type*>& ecl_files );
|
2012-05-18 09:45:23 +02:00
|
|
|
};
|