CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Data reader : Timestep List

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2006, 13:59
Default Data reader : Timestep List
  #1
Felix
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
  Reply With Quote

Old   August 7, 2006, 06:41
Default Re: Data reader : Timestep List
  #2
Johnson
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";

!}

  Reply With Quote

Old   August 7, 2006, 11:48
Default Re: Data reader : Timestep List
  #3
Felix
Guest
 
Posts: n/a
Thanks Johnson, it works well

Felix
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 07:30.