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/)
-   -   postProcess functionality in openFOAM 4 and total(p) (https://www.cfd-online.com/Forums/openfoam-post-processing/183070-postprocess-functionality-openfoam-4-total-p.html)

LVDH January 26, 2017 06:39

postProcess functionality in openFOAM 4 and total(p)
 
Hi,
currently I am adapting some of my software to work with OF 4.1. The new post processing functionality is giving me a hard time though.
If I for example run the motorBike tutorial and create a total pressure field using:
Code:

mpirun -np 6 postProcess -func 'totalPressureIncompressible(U,p)' -parallel -latestTime
I get a new field in the 500 folder called "total(p)".
If I now modify the cuttingPlane stuff to this to include the total pressure:
Code:

cuttingPlane
{
    type            surfaces;
    libs ("libsampling.so");
    writeControl    writeTime;

    surfaceFormat  vtk;
    fields          ( p U total(p));

    interpolationScheme cellPoint;

...

I will later not get the expected cutting planes but this message:
Code:

--> FOAM Warning :
    From function Foam::label Foam::sampledSurfaces::classifyFields()
    in file sampledSurface/sampledSurfaces/sampledSurfacesGrouping.C at line 75
    Cannot find registered field matching total(p)

In older OF versions I simply renamed the field with brackets to something new and it worked. If I do that now it does not help. The funny thing is that in 4.1 using total(p) as a field to create an isosurface does work.
So as I prefer not to change anything in the OF code I am wondering what I can do. I tried casting the brackets with all kinds of tricks but it never helped.

Does anyone have an idea?

mnikku February 10, 2017 05:50

I got the same classifyFields() error as you with OF4.1 with twoPhaseEulerFoam when trying to create surfaces of timeaveraged values ( named Mean after the variable, for example pMean for timeaverage of p).

I found that using command postProcess was able to handle the Mean files, while using the solver name ie. twoPhaseEulerFoam -postProcess returned the classifyFields() error.

Another option is workaround: copy your unaccepted filename over an accepted filename. I copied my pMean to p and now it was also accepted both ways... I wouldn't use this without backing up the original files though...

LVDH February 15, 2017 05:43

Quote:

Originally Posted by mnikku (Post 636637)
Another option is workaround: copy your unaccepted filename over an accepted filename. I copied my pMean to p and now it was also accepted both ways... I wouldn't use this without backing up the original files though...

Good idea, I did not think about just using an accepted name. Too bad that seems to be a new concept. This makes using custom functionObjects more difficult.
My solution was to simply calculate the pressure coefficient in the post-processing tool (VTK).

akidess August 9, 2017 09:11

This should work if you call postProcess -field "total(p)" with the function object you already posted. Renaming is not necessary.


All times are GMT -4. The time now is 10:05.