BUG: thermalBaffleModel::New from thermalBafflePropertiesDict fails

- retrieved value for the modelType was masked by a local variable
This commit is contained in:
Mark Olesen
2019-01-23 21:57:20 +01:00
parent aa4f81ff1b
commit 5b2300a8a1

View File

@ -38,9 +38,8 @@ namespace thermalBaffleModels
autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh) autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh)
{ {
word modelType; const word modelType =
{ IOdictionary
IOdictionary thermalBafflePropertiesDict
( (
IOobject IOobject
( (
@ -51,15 +50,7 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New(const fvMesh& mesh)
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
) )
); ).lookupOrDefault<word>("thermalBaffleModel", "thermalBaffle");
word modelType =
thermalBafflePropertiesDict.lookupOrDefault<word>
(
"thermalBaffleModel",
"thermalBaffle"
);
}
auto cstrIter = meshConstructorTablePtr_->cfind(modelType); auto cstrIter = meshConstructorTablePtr_->cfind(modelType);
@ -84,7 +75,7 @@ autoPtr<thermalBaffleModel> thermalBaffleModel::New
const dictionary& dict const dictionary& dict
) )
{ {
word modelType = const word modelType =
dict.lookupOrDefault<word>("thermalBaffleModel", "thermalBaffle"); dict.lookupOrDefault<word>("thermalBaffleModel", "thermalBaffle");
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);