|
[Sponsors] |
Read IOdictionary entries from within turbulence model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 2, 2012, 11:40 |
Read IOdictionary entries from within turbulence model
|
#1 | |||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hi all,
I'm "unable" to read a IOdictionary from within a modified kOmegaSST turbulence model. How can I implement such a behaviour, so that I can use the variables from the dictionary for some calculations within the turbulence model? I so far was able to make an entry of the dictionary in kOmegaSST.C (in the constructor), and in kOmegaSST.H (in the class declaration). An entry of dimensionedScalar d_grain is also in the constructor - but I'm not able to make an entry in the constructur for d_grain... kOmegaSST.H: Quote:
Quote:
Quote:
Arne Last edited by Arnoldinho; August 2, 2012 at 13:15. Reason: More details given |
||||
August 3, 2012, 04:02 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
It would help if you post the first of your compilation errors.
Instead of creating a complete new dictionary file, it may be a nicer solution to include your dictionary in the RASProperties file, by using a subDict. That is relatively easy to construct I suppose. You can also have a look at how it is implemented for certain LES models. It seems a bit overkill to me to define a new dictionary file here. |
|
August 3, 2012, 04:15 |
|
#3 | |||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Yes thats true Bernhard, I should have posted the error message.
To simplify the problem, I eliminated the dimensionality and used a normal scalar. Therefore in kOmegaSSTRough.H I have Quote:
Quote:
Quote:
Arne |
||||
August 7, 2012, 12:59 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Are there any hints on how to read values from a dictionary?
|
|
August 7, 2012, 15:36 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Arne: The short DIY answer : Code:
cd $FOAM_UTILITIES find . -name "*Dict" cd $FOAM_TUTORIALS find . -name "*Properties"
Bruno
__________________
|
|
August 8, 2012, 12:31 |
|
#6 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Thanks for your help and hints Bruno!
My problem seems nevertheless more related to "where to put the variables and declarations in the source code", i.e. public or private member functions, the constructor, namespaces, class declaration and so on. I'm afraid that I'm not familiar enough with this - but maybe this is a "standard" c++ problem and not directly related to OF. Arne |
|
August 8, 2012, 13:38 |
|
#7 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Ok, it seems that I was thinking a bit too complicated. So now I have just put it in void kOmegaSSTRough::correct(), where I need the value, and it works fine:
Code:
void kOmegaSSTRough::correct() { IOdictionary sedTransDict_ ( IOobject ( "sedTransDict", runTime_.system(), runTime_, IOobject::MUST_READ, IOobject::NO_WRITE ) ); dimensionedScalar dgrain_ ( "dgrain_", dimensionSet(0,1,0,0,0,0,0), scalar(readScalar(sedTransDict_.lookup("d_grain"))) ); dgrain_ /= 1000; // convert m -> mm ... } Arne |
|
August 11, 2012, 08:13 |
|
#9 | |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Thanks Hisham,
but I have already tried that: If gives me the error message Quote:
Any hints? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
build your own turbulence model with buoyancy | Thomas Baumann | OpenFOAM | 11 | November 23, 2009 09:53 |
Discussion: Reason of Turbulence!! | Wen Long | Main CFD Forum | 3 | May 15, 2009 10:52 |
Fan heater model: what turbulence source to use? | andy20 | Main CFD Forum | 0 | March 2, 2008 13:46 |
Sinclair Model + secondary turbulence | Yi | FLUENT | 0 | October 26, 2001 14:37 |