mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: thermalBaffleModel::New from thermalBafflePropertiesDict fails
- retrieved value for the modelType was masked by a local variable
This commit is contained in:
@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user