CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Add a new field to createProbesH (https://www.cfd-online.com/Forums/openfoam-solving/59296-add-new-field-createprobesh.html)

melanie March 16, 2006 04:49

Hello, I'd like to add some
 
Hello,
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 !
mélanie

kumar2 March 16, 2006 05: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

kumar

melanie March 16, 2006 06: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 ?

thanks.
mélanie

eugene March 16, 2006 07: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 09: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_DIR=.
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)
thanks!

melanie March 16, 2006 11: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++...
mélanie

xiuying December 5, 2007 23:21

Hi, I want to probe the walls
 
Hi,
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?

createProbes.H:

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

IOdictionary probeLocations
(
IOobject
(
"probeLocations",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


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);

writeProbes.H:

wallShearStressProbe.write();
wallGradUProbe.write();


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