Add restart and regression test for TEMP

+fix for restart
+cleanup
This commit is contained in:
Tor Harald Sandve committed 2025-11-21 14:49:40 +01:00
1 parent d536095a85
commit 951ed551ee
8 files changed
+31 -19

No files matched your search

+12 -13
View File
@@ -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<TypeTag, EnergyModules::NoTemperature>
public:
template<class FluidState>
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&,
+1 -2
View File
@@ -79,11 +79,10 @@ struct Scalar { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct NumEq { using type = UndefinedProperty; };
//! Number of equations in the system of PDEs
//! Number of derivatives in the system of PDEs
template<class TypeTag, class MyTypeTag>
struct NumDerivatives { using type = UndefinedProperty; };
//! Property which provides a Dune::ParameterTree.
template<class TypeTag, class MyTypeTag>
struct ParameterTree { using type = UndefinedProperty; };
+1
View File
@@ -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);
+6 -1
View File
@@ -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
*
-3
View File
@@ -463,8 +463,6 @@ class TemperatureModel<TypeTag, false> {
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using IndexTraits = typename FluidSystem::IndexTraitsType;
using WellStateType = WellState<Scalar, IndexTraits>;
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
}
@@ -2728,6 +2728,7 @@ namespace Opm
result += Base::restrictEval(cq_r_thermal);
}
}
return result * this->well_efficiency_factor_;
}
} // namespace Opm
+1
View File
@@ -71,6 +71,7 @@ set(_spe1_tests
SPE1CASE2_THERMAL_ONEPHASE
SPE1CASE2_THERMAL_WATVISC
SPE1CASE2_2P
SPE1CASE2_TEMP
)
add_multiple_tests(
+9
View File
@@ -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.