|
[Sponsors] |
June 26, 2007, 13:47 |
Dear OpenFoam Users
Hello.
|
#1 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
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 |
|
June 26, 2007, 14:07 |
I tried adding following to cr
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Patch end points mesh motion and movingWallVelocity | pbo | OpenFOAM Running, Solving & CFD | 14 | October 4, 2023 12:20 |
IOobject | r2d2 | OpenFOAM Running, Solving & CFD | 20 | May 5, 2016 09:16 |
Saving Patch cell centres as an IOobject | jaswi | OpenFOAM Running, Solving & CFD | 4 | June 27, 2007 11:01 |
[OpenFOAM] Visualizing Patch Motion | jaswi | ParaView | 5 | June 26, 2007 19:36 |
Saving variables on a user patch with physical coordinates | Zoltan Turzo | CFX | 2 | April 20, 2000 16:05 |