I have a transient run with many saved .trn files. I want to export results (e.g. on a line) for different .trn files to a SINGLE data file. How can I do that?


You can use session file in post to do that. Two main things need to be done in the session file are: using loop to loop over different time steps and copy file exported from Post to another file, so that at the end this file will contain all the information for different .trn files.

Below is an example session file for exporting pressure on a line. One need to create a line first in post and then play this session file by going to Session > Play Session.
One can modify the session file to include the line creation into it, so it will be more automatic.
Brief explanations were also given.

# To avoid unnecessary file pre-processing and modifications, include
# COMMAND FILE at the top of your session file.
# If it is not included, the file is assumed to be older and will be
# modified for backward compatibility.

COMMAND FILE:
CFX Post Version = 11.0
END
#Open data file
!open (OUTFILE, ">data.dat");
# Open the output file
!for ($i=0;$i<=9; $i++){
# Start for loop to load different time step
# One need to modify it based on his/her need
!$resstp=$i;
DATA READER:DATA READER
Current Timestep = $resstp
END
> load

EXPORT:
# export data to test1.csv
ANSYS Export Data = Element Heat Flux
ANSYS Reference Temperature = 0.0 [K]
ANSYS Specify Reference Temperature = Off
ANSYS Supplemental HTC = 0.0 [W m^-2 K^-1]
BC Profile Type = Inlet Velocity
Export Connectivity = Off
Export Coord Frame = Global
Export File = test1.csv
Export Geometry = On
Export Node Numbers = Off
Export Null Data = Off
Export Type = Generic
Export Units System = Current
Export Variable Type = Current
Include File Information = Off
Include Header = On
# One can turn header off if it is wanted
Location List = Line 1
Null Token = 0
Overwrite = On y
# One should turn the Overwrite On
Precision = 8
Separator = ", "
Spatial Variables = X,Y,Z
Variable List = Pressure
Vector Brackets = ()
Vector Display = Scalar
END
>export
!open (INFILE, "<test1.csv");
!print OUTFILE <INFILE>;
# copy data in test1.csv to output file, which is data.dat
!close INFILE;
!}
!close OUTFILE;
# close the output file

# Session file stopped: 2007/07/27 09:26:30





Show Form
No comments yet. Be the first to add a comment!