diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C index fd3aea1193..f38df30901 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,8 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint cellSetOption(name, modelType, dict, mesh), mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))), Tuniform_(nullptr), - TName_("T") + TName_("T"), + phase_(coeffs_.lookupOrDefault("phase", word::null)) { switch (mode_) { @@ -93,12 +94,14 @@ Foam::fv::fixedTemperatureConstraint::fixedTemperatureConstraint } } - // Set the field name to that of the energy field from which the temperature // is obtained const basicThermo& thermo = - mesh_.lookupObject(basicThermo::dictName); + mesh_.lookupObject + ( + IOobject::groupName(basicThermo::dictName, phase_) + ); fieldNames_.setSize(1, thermo.he().name()); @@ -115,7 +118,10 @@ void Foam::fv::fixedTemperatureConstraint::constrain ) { const basicThermo& thermo = - mesh_.lookupObject(basicThermo::dictName); + mesh_.lookupObject + ( + IOobject::groupName(basicThermo::dictName, phase_) + ); switch (mode_) { diff --git a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H index 5026e6ac53..0b35085774 100644 --- a/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H +++ b/src/fvOptions/constraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,6 +41,8 @@ Usage // For lookup option // T ; // optional temperature field name + + phase gas; // optional } \endverbatim @@ -105,6 +107,9 @@ protected: //- Temperature field name word TName_; + //- Optional phase name + word phase_; + public: