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

Overwriting dictionary from BC

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Phicau

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 16, 2013, 08:31
Default Overwriting dictionary from BC
  #1
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Dear all,

I am creating a custom BC that has to read a dictionary, and after some calculations, write back some new values. My dictionary is initially located in ./constant/ folder, so it is accessed easily:

Code:
    IOdictionary flowDict
    (
        IOobject
        (
            flowDict_,
            this->db().time().constant(),
            this->db(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        )
    );
Later on the code I try to write a new value:

Code:
        flowDict.set("allCheckAlpha", true);
        flowDict.Foam::regIOobject::write();
Everything works fine, but if I run my code in parallel, this dictionary gets written within ./processor*/constant/ . Then, if I restart the simulation, it is read by default from this last location.

It would be very convenient for me not to have hundreds of flowDicts scattered around in the ./processor*/constant/ folders, but just one copy in the main constant folder.

Any clues on how to fix this issue?

Thanks!

Pablo
mm.abdollahzadeh likes this.
Phicau is offline   Reply With Quote

Old   January 25, 2013, 05:24
Default
  #2
Member
 
Jim Knopf
Join Date: Dec 2010
Posts: 60
Rep Power: 16
JimKnopf is on a distinguished road
Afaik you could just reconstruct the constant directorie by using

reconstructPar -constant

Best regards
Jim
JimKnopf is offline   Reply With Quote

Reply


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
writing subDict in a dictionary ubaid OpenFOAM Programming & Development 3 October 25, 2014 18:17
New Boundary Condition: Reading Dictionary Problem Koga OpenFOAM Programming & Development 0 November 26, 2012 06:01
Reading from User Defined Dictionary File brosemu OpenFOAM Running, Solving & CFD 2 March 30, 2009 16:25
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 04:50


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