CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   call a function from controlDict with postProcess (https://www.cfd-online.com/Forums/openfoam-post-processing/189515-call-function-controldict-postprocess.html)

Svensen June 21, 2017 11:46

call a function from controlDict with postProcess
 
Is it possible to execute a function from controlDict after a simulation is done ?

For example, if the controlDict looks like:
Code:

application    icoFoam;

startFrom      startTime;

...

functions
{
       
    central_slice
    {
        type            surfaces;
        libs            ("libsampling.so");

        ...

        surfaces
        (
            cuttingPlane
            {
                type        cuttingPlane;
                ...
                }               
            }
        );
    }
};

Could I execute a 'central_slice' function to process the available datafiles ?
Thanks

akidess June 21, 2017 11:47

Use the -postProcess command line option.

Svensen June 22, 2017 01:51

Yes, but I saved only U and p fields by reconstructPar and when I run pisoFoam -postProcess it showes that there is no 'sigma' field. But I don't need it for the surfaces functionObject.
Is it any idea how to solve this ?

Code:

Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar
Selecting laminar stress model Maxwell
--> FOAM Warning :
--> FOAM FATAL IO ERROR:
cannot find file

file: /home/sergey/OpenFOAM/sergey-dev/run/probe/0.5/sigma at line 0.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 72.


linyanx July 20, 2017 09:44

Quote:

Originally Posted by akidess (Post 654315)
Use the -postProcess command line option.

Hi Anton,

Could you please give me some resource about the -postProcess command line option, any illustrations or instruction in the link or guidebook?

I'm going to probe the finished simulation and find this may be a good way for me to do that. The 'postProcess -func probes' didn't work for me by failing to recognize the system/probesDict.

Best,
Linyan

Danubi July 28, 2017 03:25

Hello linyanx,

Take a look here.

The best way I found to define a dictionary for the postProcess is to go to $FOAM_ETC and find there a template to be included in the system/ folder.

Regards

Svensen July 28, 2017 04:00

What about the missing 'sigma' field?
Is it any way to post-process data files without this ?

Danubi July 28, 2017 05:11

What is sigma in your case? Do you have it as a field in your processor/ folders?

Perhaps you need to reconstruct it as well or run the postProcess in parallel to use it.


All times are GMT -4. The time now is 19:16.