CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Reading from User Defined Dictionary File

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2009, 17:52
Default Reading from User Defined Dictionary File
  #1
New Member
 
Bill Rosemurgy
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 20
Rep Power: 16
brosemu is on a distinguished road
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
brosemu is offline   Reply With Quote

Old   March 29, 2009, 18:10
Default
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
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
philippose is offline   Reply With Quote

Old   March 30, 2009, 16:25
Default
  #3
New Member
 
Bill Rosemurgy
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 20
Rep Power: 16
brosemu is on a distinguished road
Thanks for the help!

I'm all set for now.
brosemu is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:28.