CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Paraview & paraFoam (
-   -   How to calculate a custom field (

rres October 8, 2008 11:23

Hi, I'm new in OpenFOAM and

I'm new in OpenFOAM and didn't find anything clear enough explaining how to calculate a custom field. For example, how to calculate the vorticity? Q-criterion? u<sup>+</sup>, y<sup>+</sup>, wall shear stress? Skin friction coefficient? Pressure coefficient? etc.
The user guide shows the foamCalc tool, but it doesn't seems to do the trick.

>> foamCalc xxxx
Selecting calcType xxxx
unknown calcType type xxxx, constructor not in hash table
Valid calcType selections are:

Any sugestions? Thanks in advance.

Ravi Ramalho

villet October 8, 2008 13:22

Go to the OpenFOAM application
Go to the OpenFOAM applications/utilities/postProcessing directory. You may be interested about the utilities that are under "stressFields", "velocityField" and "wall" directories. These utilities are precompiled and have the same names as the directories. Try them out in your case directory!

Anyone can correct me about this. I'm not sure if there are any utilities for skin friction/pressure coefficients in the OpenFOAM distribution. But you can call function objects in your /system/controlDict while the computation. Here are more discussion about it "". You can also compute the values aferhand using the "execFlowFunctionObjects" utility.

rres October 8, 2008 14:02

Hi Ville, I found the OpenF
Hi Ville,

I found the OpenFOAM post-processing utilities on in the website.

If someone have the same problem, here is the link:

The execFlowFunctionObjects didn't work, or I don't know how to use it. I'll try a little bit.

I've managed to calculate the skin friction, pressure coefficient and other stuff using the "calculator filter" in paraFoam. But how to save these field data to make things easier?

Thanks in advance.

Ravi Ramalho

grtabor October 8, 2008 14:57

Hi. The best thing to do is

The best thing to do is to roll your own code, so to speak. Copy one of the utilities to your own directory, change the entry in Make/files to read

EXE = $(FOAM_USER_APPBIN)/new_file_Name

and then edit the .C file to do whatever you want to do with the data. The utilities will provide you with a template to work from, showing you how to read in an existing field and manipulate it, then write it out. Compile the code using the command wmake, then run it on your case.


sdharmar November 16, 2012 05:24

@ Ravi,

I know the thread is very old. But if you remember could you please explain me how did you find skin friction coefficient.


All times are GMT -4. The time now is 20:58.