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/)
-   -   New residuals function type in OF 2.4.0 not known (https://www.cfd-online.com/Forums/openfoam-post-processing/154314-new-residuals-function-type-2-4-0-not-known.html)

Babis June 11, 2015 11:06

New residuals function type in OF 2.4.0 not known
 
Dear all,

I just installed the OF 2.4.0 Deb packs created for Ubuntu and I wanted to check the new residuals function for a simple test case. Using the example mentioned on residuals.H in the src directory I included the following lines on my controlDict:

Code:

functions
{
    residuals
    {
        type            residuals;
        outputControl  timeStep;
        outputInterval  2;
        fields
        (
            U
            p
        );
    }
}

But then when I try to run my case, in the output it gives me the following output:

Code:

--> FOAM FATAL ERROR:
Unknown function type residuals

Valid functions are :

4
(
patchProbes
probes
sets
surfaces
)

Shouldn't the default list of available function types be longer than four?

The case I am testing is using the LTSReactingFoam solver and the tutorial included with that solver had the following lines in the controlDict:

Code:

libs
(
    "libOpenFOAM.so"
    "libincompressibleTurbulenceModel.so"
    "libincompressibleRASModels.so"
);

When I added for example another library to this list, "libfieldFunctionObjects.so", which I did for a couple of libraries in my effort to find which library contains the residuals function type, naturally the list of valid functions grew to 17 types.

So the first question is, are the default 4 valid functions the expected behaviour, or is there possibly a problem with the OF 2.4.0 Deb packs?

And the second question is which library from:

Code:

/opt/openfoam240/platforms/linux64GccDPOpt/lib
Contains the residuals function type, so that I can manually include it on my controDict, and is there a standard way to find out such an information in the future?

Regards,
Babis

ps. Well done to everyone involved developing OF! :)

alexeym June 11, 2015 12:49

Hi,

The function is in libutilityFunctionObjects.so, you can add this line to function description:

Code:

functionObjectLibs ("libutilityFunctionObjects.so");
so it will be

Code:

functions
{
    residuals
    {
        functionObjectLibs ("libutilityFunctionObjects.so");
        type            residuals;
        outputControl  timeStep;
        outputInterval  2;
        fields
        (
            U
            p
        );
    }
}

or you can load this library with libs directive (as you have done with libOpenFOAM.so).

To learn to which library function object belongs, you can go to $FOAM_SRC/postProcessing/functionObjects and look into subfolders (ex. field/Make/files contains line LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects, so all function objects from field folder go to libfieldFunctionObjects.so library).

Babis June 11, 2015 13:27

Cheers for the prompt reply Alexey!

This solved my problem, and now I can use the new foamMonitor script to plot the residuals on the go, very nice indeed!

Thanks about the library info as well, in fact I did have a quick look at:

Code:

$FOAM_SRC/postProcessing/functionObjects/utilities/Make/files
but unfortunately I didn't scroll all the way to the end, my fault! :o


All times are GMT -4. The time now is 22:04.