diff --git a/opm/autodiff/BlackoilAquiferModel.hpp b/opm/autodiff/BlackoilAquiferModel.hpp index a10f4500e..694223ea2 100644 --- a/opm/autodiff/BlackoilAquiferModel.hpp +++ b/opm/autodiff/BlackoilAquiferModel.hpp @@ -71,10 +71,12 @@ namespace Opm { // at the beginning of each time step (Not report step) void prepareTimeStep(const SimulatorTimerInterface& timer); + bool aquiferActive() const; + }; } // namespace Opm #include "BlackoilAquiferModel_impl.hpp" -#endif \ No newline at end of file +#endif diff --git a/opm/autodiff/BlackoilAquiferModel_impl.hpp b/opm/autodiff/BlackoilAquiferModel_impl.hpp index 9671c1691..e92c952cc 100644 --- a/opm/autodiff/BlackoilAquiferModel_impl.hpp +++ b/opm/autodiff/BlackoilAquiferModel_impl.hpp @@ -15,6 +15,10 @@ namespace Opm { void BlackoilAquiferModel:: timeStepSucceeded(const SimulatorTimerInterface& timer) { + if ( !aquiferActive() ) { + return; + } + for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer) { aquifer->afterTimeStep(timer); @@ -27,6 +31,10 @@ namespace Opm { assemble( const SimulatorTimerInterface& timer, const int iterationIdx ) { + if ( !aquiferActive() ) { + return; + } + // We need to update the reservoir pressures connected to the aquifer updateConnectionIntensiveQuantities(); @@ -85,8 +93,13 @@ namespace Opm { void BlackoilAquiferModel:: init() { - updateConnectionIntensiveQuantities(); const auto& deck = ebosSimulator_.vanguard().deck(); + + if ( !deck.hasKeyword("AQUCT") ) { + return ; + } + + updateConnectionIntensiveQuantities(); const auto& eclState = ebosSimulator_.vanguard().eclState(); // Get all the carter tracy aquifer properties data and put it in aquifers vector @@ -107,4 +120,11 @@ namespace Opm { } } -} // namespace Opm \ No newline at end of file + template + bool + BlackoilAquiferModel:: aquiferActive() const + { + return !aquifers_.empty(); + } + +} // namespace Opm