CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Overwriting dictionary from BC (http://www.cfd-online.com/Forums/openfoam-programming-development/111832-overwriting-dictionary-bc.html)

Phicau January 16, 2013 08:31

Overwriting dictionary from BC
 
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

JimKnopf January 25, 2013 05:24

Afaik you could just reconstruct the constant directorie by using

reconstructPar -constant

Best regards
Jim


All times are GMT -4. The time now is 05:07.