From 627b1f39068e67b8d9217aab84f98046ef0bb0dc Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 12 Dec 2013 16:23:56 +0100 Subject: [PATCH] make the deck from opm-parser available to the black-oil PVT property classes --- examples/sim_2p_comp_ad.cpp | 8 +++++++- examples/sim_fibo_ad.cpp | 11 +++++++++-- opm/autodiff/BlackoilPropsAdFromDeck.cpp | 3 +++ opm/autodiff/BlackoilPropsAdFromDeck.hpp | 4 ++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/examples/sim_2p_comp_ad.cpp b/examples/sim_2p_comp_ad.cpp index de5a24000..42d7009c3 100644 --- a/examples/sim_2p_comp_ad.cpp +++ b/examples/sim_2p_comp_ad.cpp @@ -46,6 +46,9 @@ #include #include +#include +#include + #include #include @@ -98,10 +101,13 @@ try if (use_deck) { std::string deck_filename = param.get("deck_filename"); deck.reset(new EclipseGridParser(deck_filename)); + Opm::ParserPtr newParser(new Opm::Parser() ); + Opm::DeckConstPtr newParserDeck = newParser->parse( deck_filename ); + // Grid init grid.reset(new GridManager(*deck)); // Rock and fluid init - props.reset(new BlackoilPropertiesFromDeck(*deck, *grid->c_grid(), param)); + props.reset(new BlackoilPropertiesFromDeck(*deck, newParserDeck, *grid->c_grid(), param)); // check_well_controls = param.getDefault("check_well_controls", false); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // Rock compressibility. diff --git a/examples/sim_fibo_ad.cpp b/examples/sim_fibo_ad.cpp index 138c0f69c..57a07e3c8 100644 --- a/examples/sim_fibo_ad.cpp +++ b/examples/sim_fibo_ad.cpp @@ -49,6 +49,9 @@ #include #include +#include +#include + #include #include #include @@ -101,13 +104,17 @@ try double gravity[3] = { 0.0 }; std::string deck_filename = param.get("deck_filename"); deck.reset(new EclipseGridParser(deck_filename)); + + Opm::ParserPtr newParser(new Opm::Parser() ); + Opm::DeckConstPtr newParserDeck = newParser->parse( deck_filename ); + // Grid init grid.reset(new GridManager(*deck)); Opm::EclipseWriter outputWriter(param, share_obj(*deck), share_obj(*grid->c_grid())); // Rock and fluid init - props.reset(new BlackoilPropertiesFromDeck(*deck, *grid->c_grid(), param)); - new_props.reset(new BlackoilPropsAdFromDeck(*deck, *grid->c_grid())); + props.reset(new BlackoilPropertiesFromDeck(*deck, newParserDeck, *grid->c_grid(), param)); + new_props.reset(new BlackoilPropsAdFromDeck(*deck, newParserDeck, *grid->c_grid())); // check_well_controls = param.getDefault("check_well_controls", false); // max_well_control_iterations = param.getDefault("max_well_control_iterations", 10); // Rock compressibility. diff --git a/opm/autodiff/BlackoilPropsAdFromDeck.cpp b/opm/autodiff/BlackoilPropsAdFromDeck.cpp index d4b17c1bf..0a1be386f 100644 --- a/opm/autodiff/BlackoilPropsAdFromDeck.cpp +++ b/opm/autodiff/BlackoilPropsAdFromDeck.cpp @@ -32,6 +32,8 @@ #include #include +#include + namespace Opm { @@ -45,6 +47,7 @@ namespace Opm /// Constructor wrapping an opm-core black oil interface. BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const EclipseGridParser& deck, + Opm::DeckConstPtr newParserDeck, const UnstructuredGrid& grid, const bool init_rock) { diff --git a/opm/autodiff/BlackoilPropsAdFromDeck.hpp b/opm/autodiff/BlackoilPropsAdFromDeck.hpp index 81dc0d601..18b0bb97f 100644 --- a/opm/autodiff/BlackoilPropsAdFromDeck.hpp +++ b/opm/autodiff/BlackoilPropsAdFromDeck.hpp @@ -22,11 +22,14 @@ #include #include + #include #include #include #include +#include + #include #include @@ -49,6 +52,7 @@ namespace Opm public: /// Constructor wrapping an opm-core black oil interface. BlackoilPropsAdFromDeck(const EclipseGridParser& deck, + Opm::DeckConstPtr newParserDeck, const UnstructuredGrid& grid, const bool init_rock = true );