diff --git a/opm/autodiff/BlackoilModel.hpp b/opm/autodiff/BlackoilModel.hpp index ed90eb4d9..14c669ff9 100644 --- a/opm/autodiff/BlackoilModel.hpp +++ b/opm/autodiff/BlackoilModel.hpp @@ -68,10 +68,10 @@ namespace Opm { const bool has_disgas, const bool has_vapoil, const bool terminal_output) - : Base(param, grid, fluid, geo, rock_comp_props, wells, linsolver, - has_disgas, has_vapoil, terminal_output) - { - } + : Base(param, grid, fluid, geo, rock_comp_props, wells, linsolver, + has_disgas, has_vapoil, terminal_output) + { + } }; @@ -81,8 +81,8 @@ namespace Opm { { typedef BlackoilState ReservoirState; typedef WellStateFullyImplicitBlackoil WellState; - typedef BlackoilModelBase< Grid, BlackoilModel > Base; typedef BlackoilModelParameters ModelParameters; + typedef DefaultBlackoilSolutionState SolutionState; }; } // namespace Opm diff --git a/opm/autodiff/BlackoilModelBase.hpp b/opm/autodiff/BlackoilModelBase.hpp index e282ecee7..067dc6e4f 100644 --- a/opm/autodiff/BlackoilModelBase.hpp +++ b/opm/autodiff/BlackoilModelBase.hpp @@ -33,7 +33,6 @@ #include -struct UnstructuredGrid; struct Wells; namespace Opm { @@ -42,8 +41,35 @@ namespace Opm { class DerivedGeology; class RockCompressibility; class NewtonIterationBlackoilInterface; - class BlackoilState; - class WellStateFullyImplicitBlackoil; + + + /// Struct for containing iteration variables. + struct DefaultBlackoilSolutionState + { + typedef AutoDiffBlock ADB; + explicit DefaultBlackoilSolutionState(const int np) + : pressure ( ADB::null()) + , temperature( ADB::null()) + , saturation(np, ADB::null()) + , rs ( ADB::null()) + , rv ( ADB::null()) + , qs ( ADB::null()) + , bhp ( ADB::null()) + , canonical_phase_pressures(3, ADB::null()) + { + } + ADB pressure; + ADB temperature; + std::vector saturation; + ADB rs; + ADB rv; + ADB qs; + ADB bhp; + // Below are quantities stored in the state for optimization purposes. + std::vector canonical_phase_pressures; // Always has 3 elements, even if only 2 phases active. + }; + + /// Traits to encapsulate the types used by classes using or @@ -76,6 +102,7 @@ namespace Opm { typedef typename ModelTraits::ReservoirState ReservoirState; typedef typename ModelTraits::WellState WellState; typedef typename ModelTraits::ModelParameters ModelParameters; + typedef typename ModelTraits::SolutionState SolutionState; // --------- Public methods --------- @@ -192,19 +219,6 @@ namespace Opm { ADB mob; // Phase mobility (per cell) }; - struct SolutionState { - SolutionState(const int np); - ADB pressure; - ADB temperature; - std::vector saturation; - ADB rs; - ADB rv; - ADB qs; - ADB bhp; - // Below are quantities stored in the state for optimization purposes. - std::vector canonical_phase_pressures; // Always has 3 elements, even if only 2 phases active. - }; - struct WellOps { WellOps(const Wells* wells); M w2p; // well -> perf (scatter) diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index e1ac6e7bf..45f5d63f6 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -294,23 +294,6 @@ namespace detail { - template - BlackoilModelBase::SolutionState::SolutionState(const int np) - : pressure ( ADB::null()) - , temperature( ADB::null()) - , saturation(np, ADB::null()) - , rs ( ADB::null()) - , rv ( ADB::null()) - , qs ( ADB::null()) - , bhp ( ADB::null()) - , canonical_phase_pressures(3, ADB::null()) - { - } - - - - - template BlackoilModelBase:: WellOps::WellOps(const Wells* wells)