|
[Sponsors] |
March 29, 2009, 17:52 |
Reading from User Defined Dictionary File
|
#1 |
New Member
Bill Rosemurgy
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 20
Rep Power: 17 |
Hi,
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; if (userDict_.found("startFromFn")) { lowFn = readInt(userDict_.lookup("startFromFn")); } int highFn = 1; if (userDict_.found("stopAtFn")) { 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? thanks! Bill |
|
March 29, 2009, 18:10 |
|
#2 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hello Bill,
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: http://www.cfd-online.com/Forums/ope...chanics-3.html 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!! Philippose |
|
March 30, 2009, 16:25 |
|
#3 |
New Member
Bill Rosemurgy
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 20
Rep Power: 17 |
Thanks for the help!
I'm all set for now. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
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 19:18 |
Usage of user defined functions | Gowrish | FLUENT | 1 | October 26, 2005 08:44 |
Results saving in CFD | hawk | Main CFD Forum | 16 | July 21, 2005 21:51 |
User defined memory | Hp | FLUENT | 0 | September 24, 2004 01:10 |