CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   load different case folder (https://www.cfd-online.com/Forums/openfoam-programming-development/139707-load-different-case-folder.html)

ranius July 29, 2014 18:37

load different case folder
 
Hi,

I'm a newbie of OF, I've searched in the documentations and in the forum but I am not able to find what I need.

I'm developing a post processing tool for my simulations: I need to load two different cases because in the tool I compare the results.

I'm able to read different time using timeSelector but I don't know how load different cases.

Can anyone help me?

Thank you

jhoepken July 31, 2014 05:33

Hi,

I assume that you want to compare the fields of various cases, or something like that? If you can't do that in paraview, I would suggest to have a look at
Code:

$FOAM_SRC/OpenFOAM/include/createTime.H
which creates the runTime variable like:
Code:

    Foam::Time runTime
    (
        Foam::Time::controlDictName,
        args.rootPath(),
        args.caseName(),
        "system",
        "constant",
        !args.optionFound("noFunctionObjects")
    );

I suggest that you exchange args.rootPath() and args.caseName() with the particular path and case name, you would like to generate. You can do that in a loop and store a List<Time>. As soon as you have the runTime available, you can access pretty much everything.

I hope that this helps, though I haven't tested it. This is just a fair warning ;).

ranius August 1, 2014 04:12

It works! Thank you for your help!


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