|
[Sponsors] |
August 10, 2010, 09:33 |
Creating animations
|
#1 |
New Member
Thomas
Join Date: Aug 2010
Posts: 11
Rep Power: 15 |
Hi,
I am running a transient LES simulation and am making an animation of the results. I was wondering if there is any way to save pictures of the results at timesteps during the run automatically. As of now I am only able to save the entire results files, and this takes vast amounts of storage. Anyone know of a solution to this problem? Best regards, Thomas |
|
August 10, 2010, 10:20 |
|
#2 |
Member
Francois Gallard
Join Date: Mar 2010
Location: Toulouse, France
Posts: 43
Rep Power: 16 |
Hi Thomas,
You don't need to save the results at each time step to make an annimation, 25 images per second is a maximum and even you don't need that much, do you ? If it is the case you can regulary use the save animation tool of paraFoam and delete the corresponding result directories once done while the computation is running. Cheers Francois. |
|
August 10, 2010, 10:57 |
|
#3 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Francois, 25 frames per second of animation, yes. However one might wish to have 50 frames per second of simulation time to make the animation more clear, or even if you restrict yourself to 25 frames per second, for a long animation and large grids a lot of data can accumulate.
You could try to write a Python script to run paraview without graphical output and create your images alongside the simulation, but I don't really know how that works. |
|
August 10, 2010, 12:12 |
|
#4 |
New Member
Join Date: Jan 2010
Posts: 12
Rep Power: 16 |
Hi,
i haven't done this before, so I don't know if it works, but I thouht of including the sample library as a function object in controlDict. This way you could at least output the vtk-files. something like this: Code:
functions ( outputFolder { type sample; region region0; functionObjectLibs ("libsampling.so"); outputControl timeStep; outputInterval 1; outputFormat vtk; // Dont know if this is the correct keyword... fields ( U p ); surfaces ( domainSlice { // surface definition } ); }; ); |
|
August 10, 2010, 16:01 |
|
#5 |
New Member
Daniel
Join Date: Jun 2010
Posts: 12
Rep Power: 15 |
Well, if the problem is memory, I believe that a python/bash/shell script would do well - store the results normally and then delete the ones you'll not use after taking a picture of.
I use the paraview create animation and then mencoder for the animations... Memory footprint is really small. Mencoder is awesome. Cheers, |
|
August 11, 2010, 03:28 |
|
#6 |
New Member
Thomas
Join Date: Aug 2010
Posts: 11
Rep Power: 15 |
Hi,
The problem is harddisk space. 1 picture per second for 60 seconds took 20 GB. Preferably I'd run the simulation for 1200 seconds, which would mean 400 GB. And this is the coarse mesh. Creating pictures manually and deleting the files is an option, but it would be nice not having to babysit the simulation. Luise, do you know where I could find information about your idea? Would be interesting to see if it is viable. |
|
August 11, 2010, 04:16 |
|
#7 |
New Member
Join Date: Jan 2010
Posts: 12
Rep Power: 16 |
Hi,
the syntax for outputFormat and surface definition etc. should be the same like in sampleDict. Luise |
|
August 11, 2010, 06:50 |
|
#8 | |
New Member
Thomas
Join Date: Aug 2010
Posts: 11
Rep Power: 15 |
Thanks Luise,
It worked like a charm. I now get 1.5 MB in .vtk files instead of 360 MB worth of results. If any one is interested this is my final function. Basically just changed outputFormat to surfaceFormat. Quote:
Last edited by ThomasBE; August 11, 2010 at 07:10. |
||
August 11, 2010, 11:47 |
|
#9 |
New Member
Daniel
Join Date: Jun 2010
Posts: 12
Rep Power: 15 |
Couldn't we also consider using something like zlib for compression and on-the-fly reading of compressed files/folders?
|
|
August 11, 2010, 13:33 |
|
#10 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29 |
Daniel, you could, but if you don't care to keep most of the results anyways why not postprocess and discard them right away? Compressing would just add additional cost to compress and uncompress again for postprocessing.
|
|
August 11, 2010, 14:05 |
|
#11 |
Member
Francois Gallard
Join Date: Mar 2010
Location: Toulouse, France
Posts: 43
Rep Power: 16 |
Thanks for sharing it, that is very useful.
|
|
August 12, 2010, 09:06 |
|
#12 |
Senior Member
|
Hey,
I basically had the same problem, so I used the suggestions from this topic and it helps a lot. Unfortunately I do not get nice results for a planar slice through a polygonal mesh. I got nice slices for the simple cavity tutorial, also for a 3D version with a hybrid tetrahedral/prims mesh and a polygonal mesh, but not for this more challenging case. There are also warnings in the output of the case, which read like: --> FOAM Warning : From function Foam::cuttingPlane::walkCell in file cuttingPlane/cuttingPlane.C at line 227 Did not find closed walk along surface of cell 900795 starting from edge 482246 in 1001 iterations. Collected cutPoints so far: And then a long list of cutPoints The corresponding surface with holes is shown in the figure beneath. I wonder if it is possible to make sure the holes are not in the surface, so we get a nice closed surface. I also created the same slices from the full dataset in paraview, which then results in normal figures. It seems like too many iterations are needed to find a "closed walk" around the surface of a cell? Or am I mistaken? I found the sourc of cuttingPlane.C, which has a limit of 1000 iterations. Modifying the source to increase the maximum number of iterations did not improve the situation. Is there any way to improve the situation? Thanks, Tom |
|
August 13, 2010, 04:51 |
|
#13 |
New Member
Thomas
Join Date: Aug 2010
Posts: 11
Rep Power: 15 |
I'm sorry, but I don't know what happens there. The vtk files I get are give images of lower quality then the datasets, but I haven't experienced any holes or error messages.
|
|
August 26, 2010, 04:54 |
|
#14 |
Member
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17 |
Hi
I don't take any samples just use the utility in paraview under files>save animation. This saves a sequence of images as you see them on screen. I don't change any thing in the first box that comes up though you can change the number of frames per timestep etc. If you save them as .png files then I understand that the resolution is better than jpeg.(?) Then with gimp: file>open as layers : select all your images, enter. (gimp is a free opensource image software package) Save as gif - you may need to write this in the name box e.g. test.gif as changing it in the drop down file type box doesn't work for me. In the next box that comes up you need to click on save as animation then Export. In the final box you can choose to loop the animation to keep it restarting, also you can specify the gap between frames. So if a feature is moving too fast for you to watch properly you can increase this value to slow the animation down. I try to space my write directories such that I'm not wasting memory space but also not making the animation too jumpy. Hope that helps too Nick The attached gif is of 46 frames with 100 ms between frames and represents ~0.2s real time and not looped |
|
August 26, 2010, 05:00 |
|
#15 |
Member
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17 |
looped hopefully
|
|
October 10, 2010, 12:16 |
|
#16 | |
Senior Member
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17 |
Quote:
Ziad |
||
October 12, 2010, 02:52 |
|
#17 |
Senior Member
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 279
Rep Power: 21 |
If you get 'low quality' in your animations when saving in vtk-format, it might be because you plot cell data instead of point data in paraview. You can convert from cell to point data by Filters -> Alphabetical -> Cell data to point data
I made a small python script some time ago to assist making animations: http://openfoamwiki.net/index.php/VtkAnim might be of help for someone... K |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Problems in creating a wedge type mesh | Joscha | OpenFOAM Meshing & Mesh Conversion | 28 | August 3, 2019 07:59 |
[Commercial meshers] Fluent msh and cyclic boundary | cfdengineering | OpenFOAM Meshing & Mesh Conversion | 48 | January 25, 2013 03:28 |
[blockMesh] Cyclic BC's: Possible face ordering problem? (Channel flow) | sega | OpenFOAM Meshing & Mesh Conversion | 3 | September 28, 2010 12:46 |
Problems with Meshing: Collapsed Cells | Emmanuel Resch | Siemens | 1 | July 30, 2007 03:02 |
Gerris software installation | mer | Main CFD Forum | 2 | November 12, 2005 08:50 |