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

Add a new field to createProbesH

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 16, 2006, 05:49
Default Hello, I'd like to add some
  #1
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 9
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, 06:01
Default hi melanie there is a utili
  #2
Senior Member
 
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 9
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, 07:55
Default Thanks kumar, I know how to
  #3
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 9
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, 08:02
Default 1. You must create vorticity a
  #4
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 13
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, 10:23
Default Thanks Eugene, I have created
  #5
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 9
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, 12:13
Default I eventually found my error; t
  #6
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 9
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 6, 2007, 00:21
Default Hi, I want to probe the walls
  #7
New Member
 
xiuying
Join Date: Mar 2009
Posts: 24
Rep Power: 9
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

Thread Tools
Display Modes

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 On
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 10:06


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