CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Add a new field to createProbesH

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2006, 04:49
Default Hello, I'd like to add some
  #1
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 17
melanie is on a distinguished road
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
melanie is offline   Reply With Quote

Old   March 16, 2006, 05:01
Default hi melanie there is a utili
  #2
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17
kumar2 is on a distinguished road
hi melanie

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

hope this helps

kumar
kumar2 is offline   Reply With Quote

Old   March 16, 2006, 06:55
Default Thanks kumar, I know how to
  #3
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 17
melanie is on a distinguished road
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
melanie is offline   Reply With Quote

Old   March 16, 2006, 07:02
Default 1. You must create vorticity a
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
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
eugene is offline   Reply With Quote

Old   March 16, 2006, 09:23
Default Thanks Eugene, I have created
  #5
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 17
melanie is on a distinguished road
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 is offline   Reply With Quote

Old   March 16, 2006, 11:13
Default I eventually found my error; t
  #6
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 17
melanie is on a distinguished road
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
melanie is offline   Reply With Quote

Old   December 5, 2007, 23:21
Default Hi, I want to probe the walls
  #7
New Member
 
xiuying
Join Date: Mar 2009
Posts: 24
Rep Power: 17
xiuying is on a distinguished road
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();
xiuying is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07
How to get Pressure field from velocity field qunwuhe@hotmail.com Main CFD Forum 4 October 14, 2007 07:38
Putting submesh field values into field on parent mesh helmut OpenFOAM Running, Solving & CFD 2 June 20, 2006 07:31
UDF for Electrostatic Field Zhenan Li FLUENT 1 August 11, 2002 21:58
field by field decomposition vs. component-wise zhanglei Main CFD Forum 0 January 5, 2001 09:06


All times are GMT -4. The time now is 21:30.