|
[Sponsors] |
June 26, 2007, 13:46 |
Visualizing Patch Motion
|
#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:25 |
Hello Jaswinder,
I am not s
|
#2 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hello Jaswinder,
I am not sure I completely understand your question.... are you using one of the already available solvers, or are you writing a completely new solver to be used with OpenFOAM? Usually, if you are running one of the standard solvers, the p, U, epsilon, cellMotionU, pointMotionU, etc, etc... variables are automatically written to disk during each write operation. This data coupled with the patch names present in the boundary file of your case is enough to visualise patch motion in Paraview, without the need for any modifications to the top level OpenFOAM solver. Each time step is displayed in paraview, and with the "play" button at the bottom left corner of the graphics window, you can create an animation. Enjoy! Philippose |
|
June 26, 2007, 16:26 |
Hi Philippose
I am using in
|
#3 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Philippose
I am using interFoam solver. I have modified to include rotation of the domain by adding dimensionedVector Omega ( "Omega", dimensionSet(0,0,-1,0,0), vector(0, 2 *PI/60 *RPM, 0) ); //centrifugal foce volVectorField Fcent = (Omega ^ (Omega^mesh.C())); // coriolis force 2*Omega ^ U) As a result i see the motion of the freesurface(the gamma field) as it changes. Alongwith the gamma field i want to visulaize the motion of my geometry as well which comprises of two patches. Now as far my understanding of OpenFOAM goes, these fields are written to U, pd, gamma files after the specified time interval and these fields are defined as IOobjects in the createFields.H. Drawing analogy i tried something like this to record the patch motion so that alongwith U,pd and gamma i get another file named "wallpos" which contains face centres. 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' Let me know if you got my point With Best Regards Jaswinder |
|
June 26, 2007, 17:26 |
Hi again Jaswinder,
I was j
|
#4 |
Senior Member
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25 |
Hi again Jaswinder,
I was just looking into interFoam... and I have a distinct feeling that you have mistaken the features the solver offers. As far as I can see, interFoam does not have the capability to incorporate moving meshes. It is a solver capable of handling two liquid phases, but not moving meshes. Unless you have exclusively modified the interFoam solver to incorporate dynamic meshes, there will be no physical motion of any of your patches when running a simulation using the standard interFoam solver. You can "simulate" a velocity on different wall patches by providing them with non-zero values in the "U" dictionary, but that does not imply displacement of the points of the mesh. Have a nice day! Philippose |
|
June 26, 2007, 18:48 |
In fact the OF-1.3 version of
|
#5 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
In fact the OF-1.3 version of interFoam does incorporate mesh motion.
Watch this: http://www.aero.lr.tudelft.nl/~frank...ngCylinder.avi Regards, Frank
__________________
Frank Bos |
|
June 26, 2007, 19:36 |
Hi Philippose
Thanks for t
|
#6 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 18 |
Hi Philippose
Thanks for the discussion. It seems you are quite right about that. Just to make sure that I understand it fully please take some time to review my problem setup. I would really appreciate if you can provide me with some comments. I have a rotating domain. Take a look at the sketch. . I need to simulate the motion of the free surface when the domain is rotating with the given rpm . There is no motion of mesh involved. The center of the reference frame is at (0,0,0) and the center of geometry is at(8,0,0). This leads to an ecentricty of 8 units. Next UEqn is modified to account for the rotation by adding terms corresponding to centrifugal and coriolis forces. dimensionedVector Omega ( "Omega", dimensionSet(0,0,-1,0,0), vector(0, 2 *PI/60 *RPM, 0) ); //centrifugal foce volVectorField Fcent = (Omega ^ (Omega^mesh.C())); // coriolis force 2*Omega ^ U) After these modification I could simulate the motion of free surface. As you must be knowing already that interFoam uses surface capturing approach and free surface is nothing but an isosurface correponding to gamma = 1. To further validate the setup, i would like to see the domain movement as well. The changes I have made to the createFields.H to record the patchmovement seems to be useless as you have said : --------------------- You can "simulate" a velocity on different wall patches by providing them with non-zero values in the "U" dictionary, but that does not imply displacement of the points of the mesh. ----------------------------------------- Is there any other way one could achieve that. Will the moving mesh approach makes that possible ? . please provide some hints With Best Regards Jaswinder Is |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Fluent msh and cyclic boundary | cfdengineering | OpenFOAM Meshing & Mesh Conversion | 49 | November 29, 2024 22:16 |
[Other] Wedge patch '*' is not planar | LilumDaru | OpenFOAM Meshing & Mesh Conversion | 7 | September 18, 2024 06:52 |
Near wall treatment in k-omega SST | Arnoldinho | OpenFOAM Running, Solving & CFD | 38 | March 8, 2017 14:48 |
chtMultiRegionFoam Tutorial | m.nichols19 | OpenFOAM | 12 | September 9, 2010 12:56 |
[mesh manipulation] Using createPatch in place of couplePatches | sripplinger | OpenFOAM Meshing & Mesh Conversion | 8 | November 13, 2009 08:14 |