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/)
-   -   making a custom functionObject (https://www.cfd-online.com/Forums/openfoam-post-processing/235620-making-custom-functionobject.html)

nipinl April 21, 2021 16:45

making a custom functionObject
 
For learning purpose, I have copied vorticity function object and changed its name to vorticity2( and changed all necessary places in .C an .H file, I feel). I have compiled it to "libmyFunctionObjects.so". I added the following in the system/controlDict of the cavity case.



function
{
vort
{
type vorticity2;
libs ("libmyFunctionObjects.so");
}
}
However, it failed to calculate the vorticity. postProcess -func vorticity2 also run without writing any file.

It would be great if somebody point out where I went wrong or what knowledge I lack to proceed? I use OpenFOAM-v2012.

nipinl May 25, 2021 06:56

I solved it.
 
I had to add an entry

libs ("libfieldFunctionObjects.so");


with this it worked flawlessly. Hope this may be useful to some one.

Shibi July 18, 2021 15:55

Quote:

Originally Posted by nipinl (Post 804610)
I had to add an entry

libs ("libfieldFunctionObjects.so");


with this it worked flawlessly. Hope this may be useful to some one.


Hi,

I have been struggling with this issue.

To make it clear.

You had something like this:

Code:

libs ("libfieldFunctionObjects.so");

functions
{
    vort
    {
            type vorticity2;
            libs ("libmyFunctionObjects.so");
    }
}

And where able to call it in the terminal with:
Code:

postProcess -func vorticity2
Is this correct?

nipinl July 19, 2021 00:06

Yes, Exactly!


All times are GMT -4. The time now is 03:28.