CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Animating a solution - help badly needed (https://www.cfd-online.com/Forums/fluent/45732-animating-solution-help-badly-needed.html)

Dave August 15, 2007 09:39

Animating a solution - help badly needed
 
Hi everyone

I have created a tidal turbine model in GAMBIT which i have imported into fluent. I have solved it in the unsteady state, with it rotating, and would like to now animate the flow over the turbine. I am aware you have to write a file for every step and then put them all together.

Could someone send me a link to some instructions or even start me off so I can muck about within FLUENT?

Im doing a presentation on my work and think this would be a great way of allowing people to visualise what is going on

Cheers in advance

jasond August 15, 2007 11:13

Re: Animating a solution - help badly needed
 
Well, this comes up often enough that it probably needs to be added to the FAQ - so I'll try to do that in the near term. If you search the forum for "animation" you'll find quite a lot of results. Perhaps too many. Fluent's built-in animation stuff (Solve->Animate->Define...) is pretty straightforward, but I (and others who post here) have found it to be safer to generate a hardcopy of each animation frame (I usually use the PPM format, which is overly large if not compressed) and then use an external program to actually build the animation (I use mpeg_encode, which comes with Fluent). There are a couple of ways to generate a hardcopy - the safest way is probably to use a recorded macro that sets up your scene - and then hook that in through Solve->Execute Commands... If you have a large number of frames, it can get inconvenient, but I have had the built-in stuff fail (and I was stupid about saving intermediate data files), and had to rerun the entire thing. Actually, it is also a good idea to save intermediate steps (in any case).

If anyone else has any thoughts to share, I hope that they'll respond in this thread and we can collect up enough to add it to the FAQ.

Jason D.

carno August 16, 2007 01:43

Re: Animating a solution - help badly needed
 
I use Fluent journal, MS excel and windows movie maker.MS

1. Firstly I dump the data (case file also if dynamic mesh is used) files at each required timestep. Then there will be large number of data (and case) files in the working directory. Names of the data (and case) files are succeeded by the timestep number. (e.g. case1_001.dat) Then generate a journal file to post process all the files in one shot. Let us say there are 1000 data files for 1000 time steps.

Excel: To generate the journal file for fluent. Excel is required for incrementing the data file suffixes. ('001' in 'case1_001'). Use excel functions data sort and create a journal file which has 1000 steps. -----Note: I do this because I am unable to create a loop in journal file. It will be great if somebody tell me how to input loop in journal file. If this is possible MS excel is not required. The journal file may look like as below, ------------- rc case1_0100.cas y rd case1_0100.dat display set contours filled y display contour velocity-magnitude display set hard-copy color color display set hard-copy driver jpeg display hard-copy case1_0100.jpg

rd case1_002.dat display set contours filled y display contour velocity-magnitude display set hard-copy color color display set hard-copy driver jpeg display hard-copy case1_002.jpg . . . and hence till 1000th data file. ------------------------------------------

You will get the 1000 jpeg pictures in the working directory. Then use windows movie maker to create high quality movies. (Windows movie maker comes inbuilt in XP)


Dave August 16, 2007 06:08

Re: Animating a solution - help badly needed
 
Ok so let me just confirm.

To collect images at the end of each time step I go to Solution Animation and define what I want animated. Now, i want to see the particles flowing over my turbine so do I hit particle tracks?

Once the solution has converged my frames are stored as ".dat" files. These files can be imported into Windows Movie Maker (for example). How do I convert a ".dat" file into an image?

I did a search on the forum for this info but the threads were all for specific problems at a higher level than just instructions for creating a basic movie.

Anyway let me know your thoughts, cheers

Dave

carno August 16, 2007 08:09

Re: Animating a solution - help badly needed
 
Frames are not stored as dat files. Dat files are data files and contains much more data. use below journal to create velocity mag contours at particula section.

get the desired image on the screen for one particular dat file, and run the below file with loop or many times. This will dump the image (velocity mag) files in the working directory. ------------------ rc case1_0100.cas

y

rd case1_0100.dat

display set contours filled

y

display contour velocity-magnitude

display set hard-copy color color

display set hard-copy driver jpeg

display hard-copy case1_0100.jpg

Dave August 16, 2007 08:58

Re: Animating a solution - help badly needed
 
Carno

Where do i input these commands?

Dave August 16, 2007 10:00

Re: Animating a solution - help badly needed
 
Actually forget i asked that! I have 80 sequences in '.ppm' format - how do i convert those into frames?

jasond August 16, 2007 11:22

Re: Animating a solution - help badly needed
 
There are several different ways to loop in a journal file - all that I know of require using Scheme. For example, a "do" loop looks like:


> (do ((x 1 (+ x 1))) ((> x 10)) (format "~d\n" x))
1
2
3
4
5
6
7
8
9
10
#f



More info on this is available in any Scheme book. The "for-each" looping construct is pretty useful when you have a list of names or something like that.

carno August 16, 2007 23:57

Re: Animating a solution - help badly needed
 
Take a guidance from above link. This explains how tto create goodvideo from frames. Thanks to that bloger.

carno August 17, 2007 00:00

Re: Animating a solution - help badly needed
 
Take a guidance from above link. This explains how tto create goodvideo from frames. Thanks to that bloger.

Sorry the link was edited by moderator. Search on google fluent 6.4. first link is the link I am refering. 'Dr. Flow squad's world.'

Dave August 17, 2007 03:34

Re: Animating a solution - help badly needed
 
Thankyou guys the Dr Flow link was very helpfull

Dave August 20, 2007 05:00

Re: Animating a solution - help badly needed
 
Hi again

I have followed the instructions as per Dr Flow's website and created an isosurface which i wish to observe the changing velocity contours on. Unfortunatley when I observe my images for every timestep I do not see the iso-surface - just the rotar i have defined as the wall.

I am setting up the animation as follows;

Solution Animation/Define/Animation sequence(PPM Image)/Contours/Velocity Magnitude (select iso-surface and rotor)

When i run the solution why is this not giving me the images i want?

One other quick thing while im here...what i really want to do is to animate the pathlines in 3D over the turbine...is there a trick do doing this or do i simply just select "pathlines in animation sequence?

Thankyou all

David



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