diff --git a/opm/models/blackoil/blackoilenergymodules.hh b/opm/models/blackoil/blackoilenergymodules.hh index 58a1f5a3a3..20d3cdaf98 100644 --- a/opm/models/blackoil/blackoilenergymodules.hh +++ b/opm/models/blackoil/blackoilenergymodules.hh @@ -546,8 +546,7 @@ public: [[maybe_unused]] const PrimaryVariables& priVars, unsigned globalDofIdx, unsigned timeIdx, - [[maybe_unused]] const LinearizationType& lintype - ) + [[maybe_unused]] const LinearizationType& lintype) { updateTemperature_(problem, globalDofIdx, timeIdx); } @@ -957,17 +956,17 @@ class BlackOilEnergyExtensiveQuantities public: template - static void updateEnergy(Evaluation& energyFlux, - const unsigned& focusDofIndex, - const unsigned& inIdx, - const unsigned& exIdx, - const IntensiveQuantities& inIq, - const IntensiveQuantities& exIq, - const FluidState& inFs, - const FluidState& exFs, - const Scalar& inAlpha, - const Scalar& outAlpha, - const Scalar& faceArea) + static void updateEnergy(Evaluation& /*energyFlux*/, + const unsigned& /*focusDofIndex*/, + const unsigned& /*inIdx*/, + const unsigned& /*exIdx*/, + const IntensiveQuantities& /*inIq*/, + const IntensiveQuantities& /*exIq*/, + const FluidState& /*inFs*/, + const FluidState& /*exFs*/, + const Scalar& /*inAlpha*/, + const Scalar& /*outAlpha*/, + const Scalar& /*faceArea*/) {} void updateEnergy(const ElementContext&, diff --git a/opm/models/utils/basicproperties.hh b/opm/models/utils/basicproperties.hh index 80131d0995..b22097d114 100644 --- a/opm/models/utils/basicproperties.hh +++ b/opm/models/utils/basicproperties.hh @@ -79,11 +79,10 @@ struct Scalar { using type = UndefinedProperty; }; template struct NumEq { using type = UndefinedProperty; }; -//! Number of equations in the system of PDEs +//! Number of derivatives in the system of PDEs template struct NumDerivatives { using type = UndefinedProperty; }; - //! Property which provides a Dune::ParameterTree. template struct ParameterTree { using type = UndefinedProperty; }; diff --git a/opm/simulators/flow/EclWriter.hpp b/opm/simulators/flow/EclWriter.hpp index bcece6fb55..756777244c 100644 --- a/opm/simulators/flow/EclWriter.hpp +++ b/opm/simulators/flow/EclWriter.hpp @@ -596,6 +596,7 @@ public: } this->simulator_.problem().readSolutionFromOutputModule(0, true); + this->simulator_.problem().temperatureModel().init(); ElementContext elemCtx(this->simulator_); for (const auto& elem : elements(gridView, Dune::Partitions::interior)) { elemCtx.updatePrimaryStencil(elem); diff --git a/opm/simulators/flow/FlowProblem.hpp b/opm/simulators/flow/FlowProblem.hpp index 5b66d44958..d0aafc775c 100644 --- a/opm/simulators/flow/FlowProblem.hpp +++ b/opm/simulators/flow/FlowProblem.hpp @@ -434,7 +434,9 @@ public: this->wellModel_.endTimeStep(); this->aquiferModel_.endTimeStep(); this->tracerModel_.endTimeStep(); - this->temperatureModel_.endTimeStep(wellModel_.wellState()); + if constexpr(energyModuleType == EnergyModules::SequentialImplicitThermal) { + this->temperatureModel_.endTimeStep(wellModel_.wellState()); + } // Compute flux for output this->model().linearizer().updateFlowsInfo(); @@ -652,6 +654,9 @@ public: TracerModel& tracerModel() { return tracerModel_; } + TemperatureModel& temperatureModel() // need for restart + { return temperatureModel_; } + /*! * \copydoc FvBaseMultiPhaseProblem::porosity * diff --git a/opm/simulators/flow/TemperatureModel.hpp b/opm/simulators/flow/TemperatureModel.hpp index fe1aca1c9c..292302557e 100644 --- a/opm/simulators/flow/TemperatureModel.hpp +++ b/opm/simulators/flow/TemperatureModel.hpp @@ -463,8 +463,6 @@ class TemperatureModel { using Simulator = GetPropType; using Scalar = GetPropType; using FluidSystem = GetPropType; - using IndexTraits = typename FluidSystem::IndexTraitsType; - using WellStateType = WellState; public: TemperatureModel(Simulator&) { } @@ -489,7 +487,6 @@ public: void init() {} void beginTimeStep() {} - void endTimeStep(WellStateType& /*wellState*/) {} const Scalar temperature(size_t /*globalIdx*/) const { return 273.15; // return 0C to make the compiler happy } diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 84ebcf13b1..48c08d847a 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -2728,6 +2728,7 @@ namespace Opm result += Base::restrictEval(cq_r_thermal); } } + return result * this->well_efficiency_factor_; } } // namespace Opm diff --git a/regressionTests.cmake b/regressionTests.cmake index 14d2978ca7..b29150ae2e 100644 --- a/regressionTests.cmake +++ b/regressionTests.cmake @@ -71,6 +71,7 @@ set(_spe1_tests SPE1CASE2_THERMAL_ONEPHASE SPE1CASE2_THERMAL_WATVISC SPE1CASE2_2P + SPE1CASE2_TEMP ) add_multiple_tests( diff --git a/restartTests.cmake b/restartTests.cmake index f7458bba50..fcc75ff0a8 100644 --- a/restartTests.cmake +++ b/restartTests.cmake @@ -92,6 +92,15 @@ add_test_compare_restarted_simulation(CASENAME network_01_reroute_restart DIR network TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true) +add_test_compare_restarted_simulation(CASENAME spe1_temp + FILENAME SPE1CASE2_TEMP + SIMULATOR flow + ABS_TOL ${abs_tol_restart} + REL_TOL 5.0e-2 + RESTART_STEP 3 + DIR spe1 + TEST_ARGS --solver-max-time-step-in-days=1) + # Restart run in which a UDQ defining expression has exactly 128 # characters. Verifies that we don't overflow the ZUDL character # limit in restart files.