From a0a9c482eac144c20a14ac9ae944e283ef220a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 27 May 2013 15:44:07 +0200 Subject: [PATCH] Created new initialization routine, using RS from deck. --- opm/core/simulator/initState_impl.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/opm/core/simulator/initState_impl.hpp b/opm/core/simulator/initState_impl.hpp index b6492bb98..ed9d4fd97 100644 --- a/opm/core/simulator/initState_impl.hpp +++ b/opm/core/simulator/initState_impl.hpp @@ -599,6 +599,29 @@ namespace Opm } + /// Initialize a blackoil state from input deck. + template + void initBlackoilStateFromDeck(const UnstructuredGrid& grid, + const Props& props, + const EclipseGridParser& deck, + const double gravity, + State& state) + { + initStateFromDeck(grid, props, deck, gravity, state); + initBlackoilSurfvol(grid, props, state); + if (deck.hasField("RS")) { + const std::vector& rs_deck = deck.getFloatingPointValue("RS"); + const int num_cells = grid.number_of_cells; + for (int c = 0; c < num_cells; ++c) { + int c_deck = (grid.global_cell == NULL) ? c : grid.global_cell[c]; + state.gasoilratio()[c] = rs_deck[c_deck]; + } + } else { + THROW("Temporarily, we require the RS field."); + } + } + + } // namespace Opm