|
[Sponsors] |
August 3, 2006, 13:59 |
Data reader : Timestep List
|
#1 |
Guest
Posts: n/a
|
Hi everyone,
I need a little help on CFX 10.0 session files. I have 15 result files from a transient calculation and want to automate the post-processing. Want I want to do is to run a post-processing macro (an existing session file) in all the 15 files and I thought about doing it using a FOR loop. The problem I have is I am not able to retrieve the different timesteps and load the associated results. Here is the command line I use: ! $TimeStep = (getValue("DATA READER", "Timestep List")); Using this, "TimeStep" seems to be only one string element containing the correct list (I printed it in a file). But I cannot extract only one element from that list to use it and thus everything that is not TimeStep[0], the list, is empty. How sould I do it? Also, is there a way to know the number of elements in that list i.e. length(TimeStep) or something similar ? Thanks a lot, Felix |
|
August 7, 2006, 06:41 |
Re: Data reader : Timestep List
|
#2 |
Guest
Posts: n/a
|
Hi Felix,
You need to use a bit of Perl to chop up the string and put it into an array. Something like the following should work. Regards, Johnson # Load a transient file and read the time step list > load filename=myFile.res !$timestepList = getValue("DATA READER", "Timestep List"); !@timesteps = split(/, /, $timestepList ); # Print time value and pressure for each time step ! open(FH,">myOut"); ! foreach $ts ( @timesteps ) { > load timestep=$ts ! $val = ave("Pressure", "Point 1"); ! $time = getValue( "DATA READER", "Current Timevalue"); ! print FH "$time $val\n"; !} |
|
August 7, 2006, 11:48 |
Re: Data reader : Timestep List
|
#3 |
Guest
Posts: n/a
|
Thanks Johnson, it works well
Felix |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 01:24 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |
write a xy data file every timestep | pieter brodeoux | FLUENT | 1 | December 5, 2007 17:30 |
XYZ (ASCII format) data points into GAMBIT | Neil | FLUENT | 1 | August 7, 2007 09:24 |
How to store transient data with various timestep? | Oliver | CFX | 4 | December 18, 2005 19:56 |