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

Saving patch motion as an IOobject

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 26, 2007, 12:47
Default Dear OpenFoam Users Hello.
  #1
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
Dear OpenFoam Users

Hello.

I need to visualize the motion of a patch as it moves. As recommended by Hrv, I added following to the main solver file :

added --> #include "OFstream.H"
before -->main()

then declared a variable

label wallPatchID = mesh.boundaryMesh().findPatchID("walls");

and then just after-->runTime.write();

OFstream of("myFile.txt");

This way I could save just once instance of the patch motion. What i am wondering is that can it be done the way one saves the pressure , velocity and gamma fields and then animate the fields in paraFoam

What I have in mind is something like this to be added to --> createFields.H

1)capture the label for the desired patch

label wallPatchID = mesh.boundaryMesh().findPatchID("walls");

2) Get the pint list for the captured label

const labelList listOfWallPatchPointLabels mesh.boundaryMesh()[wallPatchID].meshPoints();

3) make an IOobject

IOobject WallPos
(
"listofWallPatchPointLabels",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
);


Or alternatively declare a pointField comprising of the desired patch and then create an IOobject using it. In that --> runTime.write(); shall write the position of the desired patch as a time instance as it writes for the other variables declared in createFields.H

My problem is that I do not know how IOobject syntax is organized.

Please help if anybody has done this before or knows how to accomplish this

With Best Regards
Jaswinder
jaswi is offline   Reply With Quote

Old   June 26, 2007, 13:07
Default I tried adding following to cr
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 9
jaswi is on a distinguished road
I tried adding following to createFields.H

---------------------
label wallPatchID = mesh.boundaryMesh().findPatchID("walls");

surfaceScalarField WALLPOS=mesh.boundaryMesh()[wallPatchID].Cf()
(
IOobject
(
"WALLPOS",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh
);

-------------------------
Compiling this gives the following error

createFields.H:107: error: 'const class Foam::polyPatch' has no member named 'Cf'

Please tell what I did wrong

With Best Regards
Jaswinder
jaswi 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
Patch end points mesh motion and movingWallVelocity pbo OpenFOAM Running, Solving & CFD 13 March 6, 2013 17:59
IOobject r2d2 OpenFOAM Running, Solving & CFD 19 July 31, 2009 12:48
Saving Patch cell centres as an IOobject jaswi OpenFOAM Running, Solving & CFD 4 June 27, 2007 10:01
Visualizing Patch Motion jaswi OpenFOAM Paraview & paraFoam 5 June 26, 2007 18:36
Saving variables on a user patch with physical coordinates Zoltan Turzo CFX 2 April 20, 2000 15:05


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