|
[Sponsors] |
April 4, 2014, 03:05 |
turbulenceModelConstructorTable
|
#1 |
New Member
xurenyi
Join Date: Apr 2014
Posts: 10
Rep Power: 12 |
I can find nothing about turbulenceModelConstructorTable inturbulenceModel.C in documentation. What is it and where did it be defined?
|
|
April 4, 2014, 03:25 |
|
#2 |
Senior Member
|
Hi,
turbulenceModel.C: Code:
defineRunTimeSelectionTable(turbulenceModel, turbulenceModel); Code:
// define run-time selection table #define defineRunTimeSelectionTable\ (baseType,argNames) \ \ defineRunTimeSelectionTablePtr(baseType,argNames); \ defineRunTimeSelectionTableConstructor(baseType,argNames); \ defineRunTimeSelectionTableDestructor(baseType,argNames) |
|
April 10, 2014, 22:44 |
|
#3 |
New Member
xurenyi
Join Date: Apr 2014
Posts: 10
Rep Power: 12 |
thank you very much
I studied the file 'runTimeSelectionTables.H' If the 'turbulenceProperties' file in the 'constant' folder is written as: simulationType LESModel; and the 'LESProperties' is written as: LESModel oneEqEddy; Then in the 'turbulenceModel.C', the modelType is valued as 'LESModel'. Through turbulenceModelConstructorTable::iterator cstrIter = turbulenceModelConstructorTablePtr_->find(modelType); in 'turbulenceModel.C', the derived class LESModel is instantiated. BUT, neither LESModel.C nor .H was included in turbulenceModel.C or .H, how to get the the derived class? Usually, when the main file need to use turbulenceModel, then turbulenceModel file is included in the main file. Now, turbulenceModel need to use LESModel, should LESModel file be included in turbulenceModel file? Otherwise, how to instantiate the derived class LESModel in turbulenceModel? BTW, where and how is the class add##argNames##ConstructorToTable described in 'runTimeSelectionTables.H' used? Last edited by xurenyi; April 11, 2014 at 03:30. |
|
April 11, 2014, 07:22 |
|
#4 |
Senior Member
|
Well, I guess it more-or-less like this:
1. LESModel.H include turbulenceModel.H (where class turbulenceModel is defined) 2. LESModel.C has the line Code:
addToRunTimeSelectionTable(turbulenceModel, LESModel, turbulenceModel); Code:
turbulenceModel::addturbulenceModelConstructorToTable< LESModel > addLESModelturbulenceModelConstructorToturbulenceModelTable_ Code:
addToRunTimeSelectionTable(LESModel, Smagorinsky, dictionary); Code:
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); Code:
return autoPtr<LESModel> ( cstrIter()(U, phi, transport, turbulenceModelName) ); |
|
April 11, 2014, 21:09 |
|
#5 |
New Member
xurenyi
Join Date: Apr 2014
Posts: 10
Rep Power: 12 |
But in first how to reach the code:
Code:
addToRunTimeSelectionTable(turbulenceModel, LESModel, turbulenceModel) Last edited by xurenyi; April 13, 2014 at 09:35. |
|
|
|