From 37e90dbad7417532eb67155fb60f3db16121e3c8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 27 Oct 2022 10:00:00 +0100 Subject: [PATCH] ENH: limitTemperature: obey 'active' flag. Fixes #2621 --- .../limitTemperature/limitTemperature.C | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.C b/src/fvOptions/corrections/limitTemperature/limitTemperature.C index b6dc4c333e..e41c645251 100644 --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.C +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2012-2017 OpenFOAM Foundation - Copyright (C) 2018-2021 OpenCFD Ltd. + Copyright (C) 2018-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -58,17 +58,20 @@ Foam::fv::limitTemperature::limitTemperature Tmax_(coeffs_.get("max")), phase_(coeffs_.getOrDefault("phase", word::null)) { - // Set the field name to that of the energy - // field from which the temperature is obtained - const auto& thermo = - mesh_.lookupObject - ( - IOobject::groupName(basicThermo::dictName, phase_) - ); + if (isActive()) + { + // Set the field name to that of the energy + // field from which the temperature is obtained + const auto& thermo = + mesh_.lookupObject + ( + IOobject::groupName(basicThermo::dictName, phase_) + ); - fieldNames_.resize(1, thermo.he().name()); + fieldNames_.resize(1, thermo.he().name()); - fv::option::resetApplied(); + fv::option::resetApplied(); + } }