mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #433 from andlaus/conditional_temperature
ebos: only write out temperature in thermal runs
This commit is contained in:
commit
625a4cd303
@ -91,6 +91,7 @@ class EclOutputBlackOilModule
|
||||
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
|
||||
enum { gasCompIdx = FluidSystem::gasCompIdx };
|
||||
enum { oilCompIdx = FluidSystem::oilCompIdx };
|
||||
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
|
||||
|
||||
typedef std::vector<Scalar> ScalarBuffer;
|
||||
|
||||
@ -216,6 +217,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// always allocate memory for temperature
|
||||
temperature_.resize(bufferSize, 0.0);
|
||||
|
||||
// Only provide restart on restart steps
|
||||
if (!restartConfig.getWriteRestartFile(reportStepNum, log) || substep)
|
||||
return;
|
||||
@ -229,7 +233,6 @@ public:
|
||||
}
|
||||
// and oil pressure
|
||||
oilPressure_.resize(bufferSize, 0.0);
|
||||
temperature_.resize(bufferSize, 0.0);
|
||||
|
||||
if (FluidSystem::enableDissolvedGas())
|
||||
rs_.resize(bufferSize, 0.0);
|
||||
@ -384,7 +387,7 @@ public:
|
||||
Opm::Valgrind::CheckDefined(oilPressure_[globalDofIdx]);
|
||||
}
|
||||
|
||||
if (temperature_.size() > 0) {
|
||||
if (enableEnergy) {
|
||||
temperature_[globalDofIdx] = Opm::getValue(fs.temperature(oilPhaseIdx));
|
||||
Opm::Valgrind::CheckDefined(temperature_[globalDofIdx]);
|
||||
}
|
||||
@ -732,7 +735,7 @@ public:
|
||||
sol.insert("PRESSURE", Opm::UnitSystem::measure::pressure, std::move(oilPressure_), Opm::data::TargetType::RESTART_SOLUTION);
|
||||
}
|
||||
|
||||
if (temperature_.size() > 0) {
|
||||
if (enableEnergy) {
|
||||
sol.insert("TEMP", Opm::UnitSystem::measure::temperature, std::move(temperature_), Opm::data::TargetType::RESTART_SOLUTION);
|
||||
}
|
||||
|
||||
@ -960,7 +963,7 @@ public:
|
||||
|
||||
if (oilPressure_.size() > 0 && sol.has("PRESSURE"))
|
||||
oilPressure_[elemIdx] = sol.data("PRESSURE")[globalDofIndex];
|
||||
if (temperature_.size() > 0 && sol.has("TEMP"))
|
||||
if (enableEnergy && sol.has("TEMP"))
|
||||
temperature_[elemIdx] = sol.data("TEMP")[globalDofIndex];
|
||||
if (rs_.size() > 0 && sol.has("RS"))
|
||||
rs_[elemIdx] = sol.data("RS")[globalDofIndex];
|
||||
@ -1018,7 +1021,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (temperature_.size() > 0)
|
||||
if (enableEnergy)
|
||||
fs.setTemperature(temperature_[elemIdx]);
|
||||
if (rs_.size() > 0)
|
||||
fs.setRs(rs_[elemIdx]);
|
||||
|
@ -96,6 +96,8 @@ class EclWriter
|
||||
|
||||
typedef std::vector<Scalar> ScalarBuffer;
|
||||
|
||||
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
|
||||
|
||||
public:
|
||||
static void registerParameters()
|
||||
{
|
||||
@ -324,7 +326,7 @@ public:
|
||||
{"PRESSURE" , Opm::UnitSystem::measure::pressure},
|
||||
{"SWAT" , Opm::UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))},
|
||||
{"SGAS" , Opm::UnitSystem::measure::identity, static_cast<bool>(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))},
|
||||
{"TEMP" , Opm::UnitSystem::measure::temperature}, // always required for now
|
||||
{"TEMP" , Opm::UnitSystem::measure::temperature, enableEnergy},
|
||||
{"RS" , Opm::UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
|
||||
{"RV" , Opm::UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
|
||||
{"SOMAX", Opm::UnitSystem::measure::identity, simulator_.problem().vapparsActive()},
|
||||
|
Loading…
Reference in New Issue
Block a user