|
[Sponsors] |
Turbulence models and run time selection tables |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 13, 2014, 15:47 |
Turbulence models and run time selection tables
|
#1 |
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23 |
Hi all, I spent some hours overnight to understand how turbulence models are selected by the run time selection mechanism, the best commentary I've read was by marupio:
"4.3.5 When does this all happen? The "virtual constructor" table is fully built and loaded into memory when the include list is fully read, and before the first line of code is executed. This is achieved using the static keyword. All static members of a class exist prior to any instance of that class." OpenFOAM guide/runTimeSelection mechanism For example en turbulenceModel.C Code:
75 76 autoPtr<turbulenceModel> turbulenceModel::New 77 ( 78 const volVectorField& U, 79 const surfaceScalarField& phi, 80 transportModel& transport, 81 const word& turbulenceModelName 82 ) 83 { 84 // get model name, but do not register the dictionary 85 // otherwise it is registered in the database twice 86 const word modelType 87 ( 88 IOdictionary 89 ( 90 IOobject 91 ( 92 "turbulenceProperties", 93 U.time().constant(), 94 U.db(), 95 IOobject::MUST_READ_IF_MODIFIED, 96 IOobject::NO_WRITE, 97 false 98 ) 99 ).lookup("simulationType") 100 ); 101 102 Info<< "Selecting turbulence model type " << modelType << endl; 103 104 turbulenceModelConstructorTable::iterator cstrIter = 105 turbulenceModelConstructorTablePtr_->find(modelType); 106 107 if (cstrIter == turbulenceModelConstructorTablePtr_->end()) 108 { 109 FatalErrorIn 110 ( 111 "turbulenceModel::New(const volVectorField&, " 112 "const surfaceScalarField&, transportModel&, const word&)" 113 ) << "Unknown turbulenceModel type " 114 << modelType << nl << nl 115 << "Valid turbulenceModel types:" << endl 116 << turbulenceModelConstructorTablePtr_->sortedToc() 117 << exit(FatalError); 118 } 119 120 return autoPtr<turbulenceModel> 121 ( 122 cstrIter()(U, phi, transport, turbulenceModelName) 123 ); http://www.cfd-online.com/Forums/ope...nderstand.html I've read other material about this topic, such as: Run-time type selection in OpenFOAM – the type name system but the point of when these tables are created and how isn't completely clear for me yet. All commentaries are appreciated! Santiago.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Research Scientist Research Center for Computational Methods (CIMEC) - CONICET/UNL Tel: 54-342-4511594 Int. 7032 Colectora Ruta Nac. 168 / Paraje El Pozo (3000) Santa Fe - Argentina. http://www.cimec.org.ar |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 58 | July 3, 2020 01:13 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 17:44 |
Low-Re turbulence models | grtabor | OpenFOAM Running, Solving & CFD | 4 | February 15, 2010 10:25 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |
air bubble is disappear increasing time using vof | xujjun | CFX | 9 | June 9, 2009 07:59 |