EclipseIO.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2013 Andreas Lauser
3 Copyright (c) 2013 Uni Research AS
4 Copyright (c) 2014 IRIS AS
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef OPM_ECLIPSE_WRITER_HPP
23#define OPM_ECLIPSE_WRITER_HPP
24
25#include <map>
26#include <memory>
27#include <string>
28#include <vector>
29
32
37
38namespace Opm { namespace out {
39 class Summary;
40}} // namespace Opm::out
41
42namespace Opm {
43
44class EclipseState;
45class Schedule;
46class SummaryConfig;
47class SummaryState;
48
53class EclipseIO {
54public:
60 EclipseGrid grid,
61 const Schedule& schedule,
62 const SummaryConfig& summary_config);
63
64
65
66
114 void writeInitial( data::Solution simProps = data::Solution(), std::map<std::string, std::vector<int> > int_data = {}, const NNC& nnc = NNC());
115
124 void overwriteInitialOIP( const data::Solution& simProps );
125
178 int report_step,
179 bool isSubstep,
180 double seconds_elapsed,
182 const bool write_double = false);
183
184
185 /*
186 Will load solution data and wellstate from the restart
187 file. This method will consult the IOConfig object to get
188 filename and report step to restart from.
189
190 The map keys should be a map of keyword names and their
191 corresponding dimension object, i.e. to load the state from a
192 simple two phase simulation you would pass:
193
194 keys = {{"PRESSURE" , UnitSystem::measure::pressure},
195 {"SWAT" , UnitSystem::measure::identity }}
196
197 For a three phase black oil simulation you would add pairs for
198 SGAS, RS and RV. If you ask for keys which are not found in the
199 restart file an exception will be raised, the happens if the
200 size of a vector is wrong.
201
202 The function will consult the InitConfig object in the
203 EclipseState object to determine which file and report step to
204 load.
205
206 The return value is of type 'data::Solution', which is the same
207 container type which is used by the EclipseIO, but observe
208 that the dim and target elements carry no information:
209
210 - The returned double data has been converted to SI.
211 . The target is unconditionally set to 'RESTART_SOLUTION'
212
213 The extra_keys argument can be used to request additional
214 kewyords from the restart value. The extra vectors will be
215 stored in the 'extra' field of the RestartValue return
216 value. These values must have been added to the restart file
217 previosuly with the extra argument to the writeTimeStep()
218 method. If the bool value in the map is true the value is
219 required, and the output layer will throw an exception if it is
220 missing, if the bool is false missing keywords will be ignored
221 (there will *not* be an empty vector in the return value).
222 */
223 RestartValue loadRestart(SummaryState& summary_state, const std::vector<RestartKey>& solution_keys, const std::vector<RestartKey>& extra_keys = {}) const;
225
226 EclipseIO( const EclipseIO& ) = delete;
228
229private:
230 class Impl;
231 std::unique_ptr< Impl > impl;
232
233};
234
235} // namespace Opm
236
237
238#endif // OPM_ECLIPSE_WRITER_HPP
const char *const string
Definition: cJSON.h:170
Definition: EclipseGrid.hpp:54
A class to write the reservoir state and the well state of a blackoil simulation to disk using the Ec...
Definition: EclipseIO.hpp:53
void overwriteInitialOIP(const data::Solution &simProps)
Overwrite the initial OIP values.
const out::Summary & summary()
EclipseIO(const EclipseIO &)=delete
void writeInitial(data::Solution simProps=data::Solution(), std::map< std::string, std::vector< int > > int_data={}, const NNC &nnc=NNC())
Output static properties in EGRID and INIT file.
void writeTimeStep(const SummaryState &st, int report_step, bool isSubstep, double seconds_elapsed, RestartValue value, const bool write_double=false)
Write a reservoir state and summary information to disk.
EclipseIO(const EclipseState &es, EclipseGrid grid, const Schedule &schedule, const SummaryConfig &summary_config)
Sets the common attributes required to write eclipse binary files using ERT.
RestartValue loadRestart(SummaryState &summary_state, const std::vector< RestartKey > &solution_keys, const std::vector< RestartKey > &extra_keys={}) const
Definition: EclipseState.hpp:63
Definition: NNC.hpp:61
Definition: RestartValue.hpp:68
Definition: Schedule.hpp:113
Definition: SummaryConfig.hpp:123
Definition: SummaryState.hpp:65
Definition: custom-opm-common/opm-common/opm/output/data/Solution.hpp:32
Definition: Summary.hpp:46
@ NNC
Definition: MULTREGTScanner.hpp:40
std::vector< typename std::result_of< F(typename C::const_iterator::value_type &) >::type > map(F f, const C &src)
Definition: Functional.hpp:84
Definition: A.hpp:4
T value(details::expression_node< T > *n)
Definition: exprtk.hpp:12955