2013-10-16 17:54:04 +02:00
|
|
|
/*
|
2013-11-06 12:56:19 +01:00
|
|
|
Copyright (c) 2013 Andreas Lauser
|
|
|
|
|
Copyright (c) 2013 Uni Research AS
|
2013-10-16 17:54:04 +02:00
|
|
|
|
|
|
|
|
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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-11-07 14:26:40 +01:00
|
|
|
#ifndef OPM_ECLIPSE_WRITER_HPP
|
|
|
|
|
#define OPM_ECLIPSE_WRITER_HPP
|
2013-10-16 17:54:04 +02:00
|
|
|
|
2013-11-07 14:26:40 +01:00
|
|
|
#include <opm/core/io/OutputWriter.hpp>
|
2013-11-07 14:34:57 +01:00
|
|
|
#include <opm/core/props/BlackoilPhases.hpp>
|
2013-11-07 13:40:25 +01:00
|
|
|
|
2014-03-13 16:53:11 +01:00
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
|
|
2013-10-16 17:54:04 +02:00
|
|
|
#include <string>
|
2014-03-11 15:31:46 +01:00
|
|
|
#include <vector>
|
2013-11-06 12:29:53 +01:00
|
|
|
#include <memory> // std::unique_ptr
|
2013-10-16 17:54:04 +02:00
|
|
|
|
2013-11-19 11:44:27 +01:00
|
|
|
struct UnstructuredGrid;
|
2014-01-30 11:36:31 +01:00
|
|
|
struct EclipseSummary;
|
2013-11-19 11:44:27 +01:00
|
|
|
|
2013-10-16 17:54:04 +02:00
|
|
|
namespace Opm {
|
2013-11-06 12:29:53 +01:00
|
|
|
|
2013-11-07 10:28:16 +01:00
|
|
|
// forward declarations
|
2013-11-21 12:17:54 +01:00
|
|
|
class SimulatorState;
|
2013-11-06 13:03:08 +01:00
|
|
|
class SimulatorTimer;
|
|
|
|
|
class WellState;
|
|
|
|
|
|
2013-11-06 13:21:24 +01:00
|
|
|
namespace parameter { class ParameterGroup; }
|
|
|
|
|
|
2013-10-16 17:54:04 +02:00
|
|
|
/*!
|
|
|
|
|
* \brief A class to write the reservoir state and the well state of a
|
|
|
|
|
* blackoil simulation to disk using the Eclipse binary format.
|
|
|
|
|
*
|
|
|
|
|
* This class only writes files if the 'write_output' parameter is set
|
|
|
|
|
* to 1. It needs the ERT libraries to write to disk, so if the
|
|
|
|
|
* 'write_output' parameter is set but ERT is not available, all
|
|
|
|
|
* methods throw a std::runtime_error.
|
|
|
|
|
*/
|
2013-11-07 14:26:40 +01:00
|
|
|
class EclipseWriter : public OutputWriter
|
2013-10-16 17:54:04 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2014-03-13 16:53:11 +01:00
|
|
|
/*!
|
|
|
|
|
* \brief Sets the common attributes required to write eclipse
|
|
|
|
|
* binary files using ERT.
|
|
|
|
|
*/
|
|
|
|
|
EclipseWriter(const parameter::ParameterGroup& params,
|
|
|
|
|
Opm::DeckConstPtr newParserDeck,
|
|
|
|
|
std::shared_ptr <const UnstructuredGrid> grid);
|
|
|
|
|
|
2014-03-27 15:27:11 +01:00
|
|
|
/*!
|
|
|
|
|
* \brief Sets the common attributes required to write eclipse
|
|
|
|
|
* binary files using ERT.
|
|
|
|
|
*/
|
|
|
|
|
EclipseWriter(const parameter::ParameterGroup& params,
|
|
|
|
|
Opm::DeckConstPtr newParserDeck,
|
|
|
|
|
int number_of_cells, const int* global_cell, const int* cart_dims,
|
|
|
|
|
int dimension);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-21 14:57:19 +01:00
|
|
|
/**
|
|
|
|
|
* We need a destructor in the compilation unit to avoid the
|
|
|
|
|
* EclipseSummary being a complete type here.
|
|
|
|
|
*/
|
|
|
|
|
virtual ~EclipseWriter ();
|
|
|
|
|
|
2013-11-26 22:20:55 +01:00
|
|
|
/**
|
2014-04-02 16:38:53 +02:00
|
|
|
* Write the static eclipse data (grid, PVT curves, etc) to disk.
|
2013-10-16 17:54:04 +02:00
|
|
|
*/
|
2014-04-02 16:38:53 +02:00
|
|
|
virtual void writeInit(const SimulatorTimer &timer);
|
2013-10-16 17:54:04 +02:00
|
|
|
|
|
|
|
|
/*!
|
2014-04-02 16:38:53 +02:00
|
|
|
* \brief Write a reservoir state and summary information to disk.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* The reservoir state can be inspected with visualization tools like
|
|
|
|
|
* ResInsight.
|
|
|
|
|
*
|
|
|
|
|
* The summary information can then be visualized using tools from
|
|
|
|
|
* ERT or ECLIPSE. Note that calling this method is only
|
|
|
|
|
* meaningful after the first time step has been completed.
|
2013-10-16 17:54:04 +02:00
|
|
|
*
|
|
|
|
|
* \param[in] reservoirState The thermodynamic state of the reservoir
|
|
|
|
|
* \param[in] wellState The production/injection data for all wells
|
|
|
|
|
*/
|
2013-11-07 13:40:25 +01:00
|
|
|
virtual void writeTimeStep(const SimulatorTimer& timer,
|
2013-11-21 12:17:54 +01:00
|
|
|
const SimulatorState& reservoirState,
|
2013-11-07 13:40:25 +01:00
|
|
|
const WellState& wellState);
|
2013-10-16 17:54:04 +02:00
|
|
|
|
|
|
|
|
private:
|
2014-03-13 16:53:11 +01:00
|
|
|
Opm::DeckConstPtr newParserDeck_;
|
2014-04-09 10:31:46 +02:00
|
|
|
std::shared_ptr <const UnstructuredGrid> grid_;
|
2014-02-26 10:53:31 +01:00
|
|
|
int number_of_cells_;
|
|
|
|
|
int dimensions_;
|
|
|
|
|
const int* cart_dims_;
|
|
|
|
|
const int* global_cell_;
|
2014-03-14 12:54:10 +01:00
|
|
|
bool enableOutput_;
|
|
|
|
|
int outputInterval_;
|
|
|
|
|
int outputTimeStepIdx_;
|
2013-10-16 17:54:04 +02:00
|
|
|
std::string outputDir_;
|
|
|
|
|
std::string baseName_;
|
2013-11-07 14:34:57 +01:00
|
|
|
PhaseUsage uses_; // active phases in the input deck
|
2014-01-30 11:36:31 +01:00
|
|
|
std::shared_ptr <EclipseSummary> summary_;
|
2013-11-26 22:30:26 +01:00
|
|
|
|
2014-02-26 10:53:31 +01:00
|
|
|
void init(const parameter::ParameterGroup& params);
|
2013-10-16 17:54:04 +02:00
|
|
|
};
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
|
|
|
2013-11-07 14:26:40 +01:00
|
|
|
#endif // OPM_ECLIPSE_WRITER_HPP
|