CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Add a new field to createProbesH (http://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:36.