Fix to write VTKS when THERMAL is on deck

This commit is contained in:
David Landa Marban 2023-10-09 17:05:32 +02:00
parent aa07b07da1
commit d4bb923b7a

View File

@ -87,6 +87,7 @@ class VtkBlackOilEnergyModule : public BaseOutputModule<TypeTag>
using Scalar = GetPropType<TypeTag, Properties::Scalar>; using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>; using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>; using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>(); static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>; using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
@ -172,13 +173,15 @@ public:
scalarValue(intQuants.totalThermalConductivity()); scalarValue(intQuants.totalThermalConductivity());
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
if (fluidInternalEnergiesOutput_()) if (FluidSystem::phaseIsActive(phaseIdx)) {
fluidInternalEnergies_[phaseIdx][globalDofIdx] = if (fluidInternalEnergiesOutput_())
scalarValue(intQuants.fluidState().internalEnergy(phaseIdx)); fluidInternalEnergies_[phaseIdx][globalDofIdx] =
scalarValue(intQuants.fluidState().internalEnergy(phaseIdx));
if (fluidEnthalpiesOutput_()) if (fluidEnthalpiesOutput_())
fluidEnthalpies_[phaseIdx][globalDofIdx] = fluidEnthalpies_[phaseIdx][globalDofIdx] =
scalarValue(intQuants.fluidState().enthalpy(phaseIdx)); scalarValue(intQuants.fluidState().enthalpy(phaseIdx));
}
} }
} }
} }