|March 29, 2009, 16:52||
Reading from User Defined Dictionary File
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 20Rep Power: 9
I'm putting together a new solver and need to input some additional parameters for the set up of the problem. I thought it best to do this through the use of a user-defined dictionary file, call it userDict (located in the system folder). I've been through dictionary.H, dictionary.C, dictionaryIO.C to try to figure out how to use the class but am a bit lost in some of the more complex programming aspects. I also went through Time.H, Time.C, and TimeIO.C to try to figure out how controlDict is read from and that was a bit helpful. I believe that I have figured out to use the dictionary (or IOdictionary?) class once I have successfully declared an instance of it, that is where I am stuck.
So right now in my readUserControls.H file I have:
IOdictionary userDict_(IOobject("userDict",system(),IOobject::M UST_READ,IOobject::NO_WRITE,false));
int lowFn = 0;
lowFn = readInt(userDict_.lookup("startFromFn"));
int highFn = 1;
highFn = readInt(userDict_.lookup("stopAtFn"));
and when I try to compile the solver it errors on the IOdictionary declaration saying that there is "no matching funcion call," basically that there is no IOobject class constructor which has arguments that match the ones that I am trying to give it. All I need help with is figuring out how to successfully declare the dictionary object. Any help?
|March 29, 2009, 17:10||
Join Date: Mar 2009
Posts: 531Rep Power: 17
A Good Evening to you!
I had implemented a solver about 6 months ago, which used a user-defined dictionary file for the parameters specific to the solver.... have a look at the following post:
Turbulent solver rigid body mechanics
If you scroll down to the last third of the page, you will see a set of solvers (turbForceFoam and simpleForceFoam), along with the associated dictionary (forceFoamDict)....
Maybe this will be of help to you...
If you need any more help, let me know :-)!
Have a nice day!!
|Thread||Thread Starter||Forum||Replies||Last Post|
|Problem with rhoSimpleFoam||matteo_gautero||OpenFOAM Running, Solving & CFD||0||February 28, 2008 07:51|
|User Defined Scalars - Returning Values||Carlos V.||FLUENT||0||April 19, 2006 18:18|
|Usage of user defined functions||Gowrish||FLUENT||1||October 26, 2005 07:44|
|Results saving in CFD||hawk||Main CFD Forum||16||July 21, 2005 20:51|
|User defined memory||Hp||FLUENT||0||September 24, 2004 00:10|