mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3333 from totto82/fixTEMPrestart
Pass the temperature to the restart machinary if enableTemperature is true
This commit is contained in:
commit
d974f6bd03
@ -69,6 +69,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
|
|||||||
const SummaryConfig& summaryConfig,
|
const SummaryConfig& summaryConfig,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
bool enableEnergy,
|
bool enableEnergy,
|
||||||
|
bool enableTemperature,
|
||||||
bool enableSolvent,
|
bool enableSolvent,
|
||||||
bool enablePolymer,
|
bool enablePolymer,
|
||||||
bool enableFoam,
|
bool enableFoam,
|
||||||
@ -79,6 +80,7 @@ EclGenericOutputBlackoilModule(const EclipseState& eclState,
|
|||||||
, summaryConfig_(summaryConfig)
|
, summaryConfig_(summaryConfig)
|
||||||
, summaryState_(summaryState)
|
, summaryState_(summaryState)
|
||||||
, enableEnergy_(enableEnergy)
|
, enableEnergy_(enableEnergy)
|
||||||
|
, enableTemperature_(enableTemperature)
|
||||||
, enableSolvent_(enableSolvent)
|
, enableSolvent_(enableSolvent)
|
||||||
, enablePolymer_(enablePolymer)
|
, enablePolymer_(enablePolymer)
|
||||||
, enableFoam_(enableFoam)
|
, enableFoam_(enableFoam)
|
||||||
@ -554,7 +556,14 @@ assignToSolution(data::Solution& sol)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!temperature_.empty()) {
|
if (!temperature_.empty()) {
|
||||||
|
if (enableEnergy_)
|
||||||
sol.insert("TEMP", UnitSystem::measure::temperature, std::move(temperature_), data::TargetType::RESTART_SOLUTION);
|
sol.insert("TEMP", UnitSystem::measure::temperature, std::move(temperature_), data::TargetType::RESTART_SOLUTION);
|
||||||
|
else {
|
||||||
|
// Flow allows for initializing of non-constant initial temperature.
|
||||||
|
// For output of this temperature for visualization and restart set --enable-opm-restart=true
|
||||||
|
assert(enableTemperature_);
|
||||||
|
sol.insert("TEMP", UnitSystem::measure::temperature, std::move(temperature_), data::TargetType::RESTART_AUXILIARY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !saturation_[waterPhaseIdx].empty()) {
|
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !saturation_[waterPhaseIdx].empty()) {
|
||||||
@ -898,7 +907,7 @@ doAllocBuffers(unsigned bufferSize,
|
|||||||
rstKeywords["PRESSURE"] = 0;
|
rstKeywords["PRESSURE"] = 0;
|
||||||
|
|
||||||
// allocate memory for temperature
|
// allocate memory for temperature
|
||||||
if (enableEnergy_ || rstKeywords["TEMP"]) {
|
if (enableEnergy_ || enableTemperature_) {
|
||||||
temperature_.resize(bufferSize, 0.0);
|
temperature_.resize(bufferSize, 0.0);
|
||||||
rstKeywords["TEMP"] = 0;
|
rstKeywords["TEMP"] = 0;
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,7 @@ protected:
|
|||||||
const SummaryConfig& summaryConfig,
|
const SummaryConfig& summaryConfig,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
bool enableEnergy,
|
bool enableEnergy,
|
||||||
|
bool enableTemperature,
|
||||||
bool enableSolvent,
|
bool enableSolvent,
|
||||||
bool enablePolymer,
|
bool enablePolymer,
|
||||||
bool enableFoam,
|
bool enableFoam,
|
||||||
@ -297,6 +298,7 @@ protected:
|
|||||||
const SummaryConfig& summaryConfig_;
|
const SummaryConfig& summaryConfig_;
|
||||||
const SummaryState& summaryState_;
|
const SummaryState& summaryState_;
|
||||||
bool enableEnergy_;
|
bool enableEnergy_;
|
||||||
|
bool enableTemperature_;
|
||||||
|
|
||||||
bool enableSolvent_;
|
bool enableSolvent_;
|
||||||
bool enablePolymer_;
|
bool enablePolymer_;
|
||||||
|
@ -118,6 +118,7 @@ public:
|
|||||||
simulator.vanguard().summaryConfig(),
|
simulator.vanguard().summaryConfig(),
|
||||||
simulator.vanguard().summaryState(),
|
simulator.vanguard().summaryState(),
|
||||||
getPropValue<TypeTag, Properties::EnableEnergy>(),
|
getPropValue<TypeTag, Properties::EnableEnergy>(),
|
||||||
|
getPropValue<TypeTag, Properties::EnableTemperature>(),
|
||||||
getPropValue<TypeTag, Properties::EnableSolvent>(),
|
getPropValue<TypeTag, Properties::EnableSolvent>(),
|
||||||
getPropValue<TypeTag, Properties::EnablePolymer>(),
|
getPropValue<TypeTag, Properties::EnablePolymer>(),
|
||||||
getPropValue<TypeTag, Properties::EnableFoam>(),
|
getPropValue<TypeTag, Properties::EnableFoam>(),
|
||||||
|
@ -98,6 +98,7 @@ class EclWriter : public EclGenericWriter<GetPropType<TypeTag, Properties::Grid>
|
|||||||
using BaseType = EclGenericWriter<Grid,EquilGrid,GridView,ElementMapper,Scalar>;
|
using BaseType = EclGenericWriter<Grid,EquilGrid,GridView,ElementMapper,Scalar>;
|
||||||
|
|
||||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||||
|
enum { enableTemperature = getPropValue<TypeTag, Properties::EnableTemperature>() };
|
||||||
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
|
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -270,11 +271,13 @@ public:
|
|||||||
{
|
{
|
||||||
bool enableHysteresis = simulator_.problem().materialLawManager()->enableHysteresis();
|
bool enableHysteresis = simulator_.problem().materialLawManager()->enableHysteresis();
|
||||||
bool enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT");
|
bool enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT");
|
||||||
|
bool opm_rst_file = EWOMS_GET_PARAM(TypeTag, bool, EnableOpmRstFile);
|
||||||
|
bool read_temp = enableEnergy || (opm_rst_file && enableTemperature);
|
||||||
std::vector<RestartKey> solutionKeys{
|
std::vector<RestartKey> solutionKeys{
|
||||||
{"PRESSURE", UnitSystem::measure::pressure},
|
{"PRESSURE", UnitSystem::measure::pressure},
|
||||||
{"SWAT", UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))},
|
{"SWAT", UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))},
|
||||||
{"SGAS", UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))},
|
{"SGAS", UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))},
|
||||||
{"TEMP" , UnitSystem::measure::temperature, enableEnergy},
|
{"TEMP" , UnitSystem::measure::temperature, read_temp},
|
||||||
{"SSOLVENT" , UnitSystem::measure::identity, enableSolvent},
|
{"SSOLVENT" , UnitSystem::measure::identity, enableSolvent},
|
||||||
{"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
|
{"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
|
||||||
{"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
|
{"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
|
||||||
|
Loading…
Reference in New Issue
Block a user