diff --git a/ebos/eclgenerictracermodel.cc b/ebos/eclgenerictracermodel.cc index bdd8403ea..f7d5b6d35 100644 --- a/ebos/eclgenerictracermodel.cc +++ b/ebos/eclgenerictracermodel.cc @@ -149,7 +149,7 @@ name(int tracerIdx) const template void EclGenericTracerModel:: -doInit(bool enabled, size_t numGridDof, +doInit(bool enabled, bool rst, size_t numGridDof, size_t gasPhaseIdx, size_t oilPhaseIdx, size_t waterPhaseIdx) { const auto& tracers = eclState_.tracer(); @@ -187,6 +187,9 @@ doInit(bool enabled, size_t numGridDof, tracerConcentration_[tracerIdx].resize(numGridDof); storageOfTimeIndex1_[tracerIdx].resize(numGridDof); + if (rst) + continue; + //TBLK keyword if (tracer.free_concentration.has_value()){ diff --git a/ebos/eclgenerictracermodel.hh b/ebos/eclgenerictracermodel.hh index 80cb2f02d..90efc840e 100644 --- a/ebos/eclgenerictracermodel.hh +++ b/ebos/eclgenerictracermodel.hh @@ -87,6 +87,7 @@ protected: * \brief Initialize all internal data structures needed by the tracer module */ void doInit(bool enabled, + bool rst, size_t numGridDof, size_t gasPhaseIdx, size_t oilPhaseIdx, diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index a565fc47b..05e464def 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -875,6 +875,7 @@ public: transmissibilities_.finishInit(); const auto& initconfig = eclState.getInitConfig(); + tracerModel_.init(initconfig.restartRequested()); if (initconfig.restartRequested()) readEclRestartSolution_(); else @@ -889,8 +890,6 @@ public: this->maxPolymerAdsorption_.resize(numElements, 0.0); } - tracerModel_.init(); - readBoundaryConditions_(); if (enableDriftCompensation_) { @@ -2478,11 +2477,6 @@ private: for (size_t pvtRegionIdx = 0; pvtRegionIdx < this->maxDRv_.size(); ++pvtRegionIdx) this->maxDRv_[pvtRegionIdx] = oilVaporizationControl.getMaxDRVDT(pvtRegionIdx)*simulator.timeStepSize(); - if (tracerModel().numTracers() > 0 && this->gridView().comm().rank() == 0) - std::cout << "Warning: Restart is not implemented for the tracer model, it will initialize itself " - << "with the initial tracer concentration.\n" - << std::flush; - // assign the restart solution to the current solution. note that we still need // to compute real initial solution after this because the initial fluid states // need to be correct for stuff like boundary conditions. diff --git a/ebos/ecltracermodel.hh b/ebos/ecltracermodel.hh index 4fce8eb1e..0718060b1 100644 --- a/ebos/ecltracermodel.hh +++ b/ebos/ecltracermodel.hh @@ -103,10 +103,10 @@ public: /*! * \brief Initialize all internal data structures needed by the tracer module */ - void init() + void init(bool rst) { bool enabled = EWOMS_GET_PARAM(TypeTag, bool, EnableTracerModel); - this->doInit(enabled, simulator_.model().numGridDof(), + this->doInit(enabled, rst, simulator_.model().numGridDof(), gasPhaseIdx, oilPhaseIdx, waterPhaseIdx); prepareTracerBatches();