diff --git a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C index ee6831c9ee..90ed6065e2 100644 --- a/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C +++ b/src/regionModels/thermalBaffleModels/thermalBaffleModel/thermalBaffleModelNew.C @@ -38,9 +38,8 @@ namespace thermalBaffleModels autoPtr thermalBaffleModel::New(const fvMesh& mesh) { - word modelType; - { - IOdictionary thermalBafflePropertiesDict + const word modelType = + IOdictionary ( IOobject ( @@ -51,15 +50,7 @@ autoPtr thermalBaffleModel::New(const fvMesh& mesh) IOobject::NO_WRITE, false ) - ); - - word modelType = - thermalBafflePropertiesDict.lookupOrDefault - ( - "thermalBaffleModel", - "thermalBaffle" - ); - } + ).lookupOrDefault("thermalBaffleModel", "thermalBaffle"); auto cstrIter = meshConstructorTablePtr_->cfind(modelType); @@ -84,7 +75,7 @@ autoPtr thermalBaffleModel::New const dictionary& dict ) { - word modelType = + const word modelType = dict.lookupOrDefault("thermalBaffleModel", "thermalBaffle"); auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);