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/)
-   -   Difference between Utility functions and function objects (https://www.cfd-online.com/Forums/openfoam-post-processing/156337-difference-between-utility-functions-function-objects.html)

adityadsn July 7, 2015 23:25

Difference between Utility functions and function objects
 
Hi everyone,

I was wondering what is the major difference and advantage of fucntion objects over utility functions.?

I understand that function objects are executed during the solution and utility can be done after the simulation. But there are functions such as wallshearstress and etc that are available in both the methods.

So can someone throw some light on why both of them exist and what are the benefits? and when a specific method has to be used.

Thanks in advance!!

Regards

tomf July 9, 2015 03:56

Hi,

Most utilities have been there before the functionObject structure was created. When the functionObjects were created, some of these utilities have been added to the structure so they could indeed be used at runtime instead of only as postprocessing. This makes it a bit more easy to have all your files already at the end of the run. This should be the only difference. So if you need the utility at runtime, or you do not want to run additional post-processing steps after the run use the functionObject, if you rather do post-processing after the run (say only on the last timestep) use the utility.

Regards,
Tom

rafa13 July 30, 2015 06:50

Hi everbody,

I am a newbe and I am wondering if it is possible to run a function after running a case, by creating a dict or somthing?



greets

Rafa

tomf July 30, 2015 07:38

Hi Rafa,

You can modify the controlDict after the run to include the functionObjects of your choice and than run

Code:

execFlowFunctionObjects -latestTime
There are also separate postprocessing utilities that can do some postprocessing. You can find them by:

Code:

util
cd postProcessing

Regards,
Tom

rafa13 July 30, 2015 12:34

Hi Tom,

thanks alot for the fast reply, at the moment i didn try it ,becaus i am still running the case and i want to test your method right after the solving!


Greets and thanks again!

Rafa


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