CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Add a new field to createProbesH (

melanie March 16, 2006 05:49

Hello, I'd like to add some
I'd like to add some fields to the createProbes.H file, like vorticity, e.g. any field defined in applications/utilities. It does not work by just adding the lines

#include "vorticity.C"
Probe<volvectorfield> vorticityProbe(probeLocations, vorticity);

because the file vorticity.C is not found. What link should I define ? or is it more complicated ?
thanks !

kumar2 March 16, 2006 06:01

hi melanie there is a utili
hi melanie

there is a utility to find vorticity. look in page U-89 of users manual

hope this helps


melanie March 16, 2006 07:55

Thanks kumar, I know how to
Thanks kumar,

I know how to find the vorticity utility. My question was about how to add the vorticity field (or another) in the createProbes.H file (oodles case), i.e. how to record the vorticity at a defined point during a transient simulation ?


eugene March 16, 2006 08:02

1. You must create vorticity a
1. You must create vorticity as a derived field in createFields.H (see the vorticity tool)
2. Then you add a vorticity probe entry in createProbes.H (oodles is a good example)
3. Make sure you update the vorticity field at least once per timestep.
4. Add a write entry for the vorticity probes to writeProbes.H

melanie March 16, 2006 10:23

Thanks Eugene, I have created
Thanks Eugene,
I have created vorticity in the createFields.H as in the vorticity tool; no problems with createProbes.H nor with writeProbes.H, but when I compile (wmake), I have the error message:

tzntgq@cfdlem04:~/OpenFOAM/OpenFOAM-1.2.1/applications/solvers/DNSandLES/oodles> wmake
make: Nothing to be done for `allFiles'.
make: `Make/linuxAMD64Gcc4Opt/dependencies' is up to date.

SOURCE=oodles.C ; g++ -m64 -DlinuxAMD64 -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -ffast-math -DNoRepository -ftemplate-depth-30 -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/LESmodels -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/LESmodels/LESdeltas/lnInclude -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/transportModels -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/cfdTools/incompressible -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/cfdTools/general/lnInclude -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/meshTools/lnInclude -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/sampling/lnInclude -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/linuxAMD64Gcc4Opt/oodles.o
createFields.H: In function ‚int main(int, char**)‚:
createFields.H:5: error: redeclaration of ‚Foam::volScalarField p‚
createFields.H:5: error: ‚Foam::volScalarField p‚ previously declared here
createFields.H:20: error: redeclaration of ‚Foam::volVectorField U‚
createFields.H:20: error: ‚Foam::volVectorField U‚ previously declared here
createFields.H:33: error: redeclaration of ‚Foam::label pRefCell‚
createFields.H:33: error: ‚Foam::label pRefCell‚ previously declared here
createFields.H:34: error: redeclaration of ‚Foam::scalar pRefValue‚
createFields.H:34: error: ‚Foam::scalar pRefValue‚ previously declared here
createFields.H:38: error: redeclaration of ‚Foam::singlePhaseTransportModel laminarTransport‚
createFields.H:38: error: ‚Foam::singlePhaseTransportModel laminarTransport‚ previously declared here
createFields.H:42: error: redeclaration of ‚Foam::autoPtr<foam::lesmodel> sgsModel‚
createFields.H:42: error: ‚Foam::autoPtr<foam::lesmodel> sgsModel‚ previously declared here
createFields.H:51: error: redeclaration of ‚Foam::volVectorField vorticity‚
createFields.H:51: error: ‚Foam::volVectorField vorticity‚ previously declared here
createFields.H:65: error: redeclaration of ‚Foam::volScalarField magVorticity‚
createFields.H:65: error: ‚Foam::volScalarField magVorticity‚ previously declared here
make: *** [Make/linuxAMD64Gcc4Opt/oodles.o] Error 1

I don't know how to fix it... (the ‚ characters stand for ', don't know why)

melanie March 16, 2006 12:13

I eventually found my error; t
I eventually found my error; the #include "createFields.H" in createProbes.H was unnecessary and created a bug...
thanks again and please excuse me for being a beginner in C++...

xiuying December 6, 2007 00:21

Hi, I want to probe the walls
I want to probe the wallshearstress and wallgradu for a few boundary points. I write the 'createProbes.H' and 'writeProbes.H' like 'oodles' model in openfoam 1-2-1 as following. But the probe results only include the first point, and not the others. Could you inform me how to deal with?


Info<< "Reading probeLocations\n" << endl;

IOdictionary probeLocations

Info<< "Constructing probes\n" << endl;

//Probe<volvectorfield> UProbe(probeLocations, U);
//Probe<volscalarfield> pProbe(probeLocations, p);
Probe<volvectorfield> wallShearStressProbe(probeLocations, wallShearStress);
Probe<volvectorfield> wallGradUProbe(probeLocations, wallGradU);



All times are GMT -4. The time now is 00:51.