2015-11-18 19:21:00 -06:00
|
|
|
/*
|
|
|
|
Copyright 2015 Statoil ASA.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM 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.
|
|
|
|
|
|
|
|
OPM 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 for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPM_RELPERMDIAGNOSTICS_HEADER_INCLUDED
|
|
|
|
#define OPM_RELPERMDIAGNOSTICS_HEADER_INCLUDED
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <utility>
|
|
|
|
|
2015-11-29 20:20:43 -06:00
|
|
|
#if HAVE_CONFIG_H
|
2015-11-29 20:11:43 -06:00
|
|
|
#include "config.h"
|
2015-11-29 20:20:43 -06:00
|
|
|
#endif // HAVE_CONFIG_H
|
|
|
|
|
2015-11-26 01:22:51 -06:00
|
|
|
#include <opm/core/grid.h>
|
|
|
|
#include <opm/core/grid/GridManager.hpp>
|
|
|
|
#include <opm/core/grid/GridHelpers.hpp>
|
2015-11-18 19:21:00 -06:00
|
|
|
#include <opm/core/utility/linearInterpolation.hpp>
|
|
|
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
2015-12-01 20:58:06 -06:00
|
|
|
#include <opm/parser/eclipse/OpmLog/StreamLog.hpp>
|
|
|
|
#include <opm/parser/eclipse/OpmLog/OpmLog.hpp>
|
|
|
|
|
2015-11-18 19:21:00 -06:00
|
|
|
#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
2016-01-20 07:12:04 -06:00
|
|
|
class Sof2Table;
|
|
|
|
class SgwfnTable;
|
|
|
|
|
2015-11-18 19:21:00 -06:00
|
|
|
///This class is intend to be a relpmer diganostics, to detect
|
|
|
|
///wrong input of relperm table and endpoints.
|
|
|
|
class RelpermDiagnostics
|
|
|
|
{
|
|
|
|
public:
|
2015-12-01 20:58:06 -06:00
|
|
|
|
|
|
|
///Constructor for OpmLog.
|
2015-12-09 02:51:07 -06:00
|
|
|
explicit RelpermDiagnostics(std::string& logFile);
|
2015-12-01 20:58:06 -06:00
|
|
|
|
2015-11-29 20:52:34 -06:00
|
|
|
///This function is used to diagnosis relperm in
|
|
|
|
///eclipse data file. Errors and warings will be
|
|
|
|
///output if they're found.
|
|
|
|
///\param[in] eclState eclipse state.
|
|
|
|
///\param[in] deck ecliplise data file.
|
|
|
|
///\param[in] grid unstructured grid.
|
2015-11-18 23:31:02 -06:00
|
|
|
void diagnosis(EclipseStateConstPtr eclState,
|
2015-11-26 01:22:51 -06:00
|
|
|
DeckConstPtr deck,
|
|
|
|
const UnstructuredGrid& grid);
|
2015-11-19 02:24:09 -06:00
|
|
|
|
2015-12-01 20:58:06 -06:00
|
|
|
///return streamLog
|
|
|
|
std::shared_ptr<Opm::StreamLog> getOpmLog() const;
|
|
|
|
std::vector<std::string> getMessages() const;
|
|
|
|
|
2015-11-19 02:24:09 -06:00
|
|
|
private:
|
2015-11-29 20:20:43 -06:00
|
|
|
enum FluidSystem {
|
|
|
|
OilWater,
|
|
|
|
OilGas,
|
|
|
|
WaterGas,
|
|
|
|
BlackOil
|
|
|
|
};
|
2015-11-19 02:24:09 -06:00
|
|
|
|
2015-11-29 20:20:43 -06:00
|
|
|
FluidSystem fluidSystem_;
|
|
|
|
|
|
|
|
enum SaturationFunctionFamily {
|
|
|
|
FamilyI,
|
|
|
|
FamilyII,
|
|
|
|
NoFamily
|
|
|
|
};
|
|
|
|
|
2015-11-19 02:24:09 -06:00
|
|
|
SaturationFunctionFamily satFamily_;
|
2015-11-19 20:57:13 -06:00
|
|
|
|
2016-01-04 03:09:16 -06:00
|
|
|
struct Counter {
|
|
|
|
Counter();
|
|
|
|
int error;
|
|
|
|
int warning;
|
|
|
|
int problem;
|
|
|
|
int bug;
|
|
|
|
};
|
|
|
|
|
|
|
|
Counter counter_;
|
|
|
|
|
2015-11-19 02:24:09 -06:00
|
|
|
std::vector<Opm::EclEpsScalingPointsInfo<double> > unscaledEpsInfo_;
|
2015-11-26 01:22:51 -06:00
|
|
|
std::vector<Opm::EclEpsScalingPointsInfo<double> > scaledEpsInfo_;
|
2015-11-19 02:24:09 -06:00
|
|
|
|
2015-11-29 20:42:57 -06:00
|
|
|
std::vector<std::string> messages_;
|
2016-01-04 21:05:37 -06:00
|
|
|
///Store scaled information.
|
|
|
|
std::vector<std::string> scaled_messages_;
|
2015-12-01 20:58:06 -06:00
|
|
|
|
|
|
|
///Use OpmLog
|
|
|
|
std::shared_ptr<Opm::StreamLog> streamLog_;
|
|
|
|
|
2015-11-18 19:21:00 -06:00
|
|
|
///Check the phase that used.
|
2015-11-29 20:42:57 -06:00
|
|
|
void phaseCheck_(DeckConstPtr deck);
|
2015-11-18 19:21:00 -06:00
|
|
|
|
|
|
|
///Check saturation family I and II.
|
2015-11-19 02:24:09 -06:00
|
|
|
void satFamilyCheck_(EclipseStateConstPtr eclState);
|
2015-11-18 19:21:00 -06:00
|
|
|
|
|
|
|
///Check saturation tables.
|
2015-11-19 02:24:09 -06:00
|
|
|
void tableCheck_(EclipseStateConstPtr eclState,
|
|
|
|
DeckConstPtr deck);
|
2015-11-18 19:21:00 -06:00
|
|
|
|
|
|
|
///Check endpoints in the saturation tables.
|
2015-11-26 01:22:51 -06:00
|
|
|
void unscaledEndPointsCheck_(DeckConstPtr deck,
|
|
|
|
EclipseStateConstPtr eclState);
|
|
|
|
|
|
|
|
void scaledEndPointsCheck_(DeckConstPtr deck,
|
|
|
|
EclipseStateConstPtr eclState,
|
|
|
|
const UnstructuredGrid& grid);
|
2015-11-19 20:57:13 -06:00
|
|
|
|
2015-11-18 19:21:00 -06:00
|
|
|
///For every table, need to deal with case by case.
|
2016-01-17 21:00:39 -06:00
|
|
|
void swofTableCheck_(const Opm::SwofTable& swofTables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void sgofTableCheck_(const Opm::SgofTable& sgofTables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void slgofTableCheck_(const Opm::SlgofTable& slgofTables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void swfnTableCheck_(const Opm::SwfnTable& swfnTables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void sgfnTableCheck_(const Opm::SgfnTable& sgfnTables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void sof3TableCheck_(const Opm::Sof3Table& sof3Tables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void sof2TableCheck_(const Opm::Sof2Table& sof2Tables,
|
|
|
|
const int satnumIdx);
|
|
|
|
void sgwfnTableCheck_(const Opm::SgwfnTable& sgwfnTables,
|
|
|
|
const int satnumIdx);
|
2015-11-18 19:21:00 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} //namespace Opm
|
|
|
|
|
|
|
|
#endif // OPM_RELPERMDIAGNOSTICS_HEADER_INCLUDED
|