File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,13 @@ class FlowProblemBlackoil : public FlowProblem<TypeTag>
334
334
335
335
this ->initFluidSystem_ ();
336
336
337
+ // conserve inner energy instead of enthalpy if TEMP is used
338
+ // or THERMAL and parameter ConserveInnerEnergyThermal is true (default false)
339
+ bool isThermal = eclState.getSimulationConfig ().isThermal ();
340
+ bool isTemp = eclState.getSimulationConfig ().isTemp ();
341
+ bool conserveInnerEnergy = isTemp || (isThermal && Parameters::Get<Parameters::ConserveInnerEnergyThermal>());
342
+ FluidSystem::setEnergyEqualEnthalpy (conserveInnerEnergy);
343
+
337
344
if (FluidSystem::phaseIsActive (FluidSystem::oilPhaseIdx) &&
338
345
FluidSystem::phaseIsActive (FluidSystem::gasPhaseIdx)) {
339
346
this ->maxOilSaturation_ .resize (this ->model ().numGridDof (), 0.0 );
Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ void registerFlowProblemParameters()
72
72
Parameters::Register<Parameters::NumSatfuncConsistencySamplePoints>
73
73
(" Maximum number of reported failures for each individual saturation function consistency check" );
74
74
75
+ Parameters::Register<Parameters::ConserveInnerEnergyThermal>
76
+ (" Conserve inner energy and not enthalpy "
77
+ " even if THERMAL is used." );
78
+
75
79
// By default, stop it after the universe will probably have stopped
76
80
// to exist. (the ECL problem will finish the simulation explicitly
77
81
// after it simulated the last episode specified in the deck.)
@@ -90,6 +94,8 @@ void registerFlowProblemParameters()
90
94
// the default for the allowed volumetric error for oil per second
91
95
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-2 );
92
96
Parameters::SetDefault<Parameters::EnableGravity>(true );
97
+
98
+ Parameters::SetDefault<Parameters::ConserveInnerEnergyThermal>(false );
93
99
}
94
100
95
101
template void registerFlowProblemParameters<double >();
Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ struct OutputMode { static constexpr auto value = "all"; };
56
56
// between writing restart files
57
57
struct RestartWritingInterval { static constexpr int value = 0xffffff ; }; // disable
58
58
59
+ // Conserve inner energy instead of enthalpy even if THERMAL is used
60
+ struct ConserveInnerEnergyThermal { static constexpr bool value = false ; };
61
+
59
62
} // namespace Opm::Parameters
60
63
61
64
namespace Opm {
You can’t perform that action at this time.
0 commit comments