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

how to export every data w.r.t time to txt file

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2011, 07:39
Default
  #61
Member
 
Join Date: Aug 2010
Posts: 31
Rep Power: 15
Turbomachine is on a distinguished road
Dear Pavitran,

Thank you for your help. Unfortunately, the script does not work since it says there is a syntax error in line 23 after the for loop where you specify the name of the file to be loaded. On the other hand when I use the script that I posted (without the for loop) there is no syntax error but there is another error saying that "Can't resolve filename to load".

Do you have an idea of what this might be?
Turbomachine is offline   Reply With Quote

Old   February 26, 2011, 08:53
Default Hi
  #62
Member
 
Dynampally Pavitran
Join Date: Mar 2010
Location: India
Posts: 74
Rep Power: 16
pavitran is on a distinguished road
In line 20 there is a syntax error, I forgot to add semicolon ";'' at the end, just add that, I believe it should work now: It should look like below

! $file ="$i\_Full.trn" ;
pavitran is offline   Reply With Quote

Old   February 28, 2011, 16:34
Default
  #63
New Member
 
sam13
Join Date: Jul 2009
Location: St. John's, NL, Canada
Posts: 23
Rep Power: 16
Shafiul is on a distinguished road
Quote:
Originally Posted by pavitran View Post
Ok carlitos try this !

copy the below macro in between hashes #, to some "file.cse" and copy file.cse to the directory where your *.trn files are located.

Being in the same directory, at the UNIX or Windows command line just type

cfx5post -batch file.cse ####for v11.0

cfx512post -batch file.cse ####for v12.0

As soon as you execute this and if everything is fine, I mean your location name , then on the screen you can see which case is presently in process.

eg:
:> cfx5post -batch file.cse
71100
72000
72900
:>


####################################
......

I hope it works this time
Dear pavitran,

I applied this idea for my case but I'm getting an error message like below:



Batch run of "/home/shafiul/P4718_act_scale2_Unsteady_J0751_002/file.cse" failed due to the following errors:

-- ERROR -- Error reading file '1001.trn':
Error reading dataset G/COMMANDS


Do you have any idea about it?

I used the following macro:

##############################
COMMAND FILE:
CFX Post Version = 11.0
END

!$start = 1001;
!$finish = 1002;
!for($i = $start; $i<=$finish; $i++){
!print "$i \n";
> load filename = $i.trn


EXPORT:
Export Coord Frame = Global
Export File =
/amhl_storage/home/shafiul/P4718/test_with_scale_2/testresults/$i.csv
Export Geometry = Off
Export Type = Generic
Export Units System = US Engineering
Location List = bladepre, bladesuc
Overwrite = On
Separator = " "
Variable List = Y, Z, Pressure
END
> export
!}
##########################


Thanks in advance.
Shafi

Last edited by Shafiul; February 28, 2011 at 17:07. Reason: Missed some informations
Shafiul is offline   Reply With Quote

Old   February 28, 2011, 22:20
Default
  #64
Member
 
Dynampally Pavitran
Join Date: Mar 2010
Location: India
Posts: 74
Rep Power: 16
pavitran is on a distinguished road
Hi Shafiul,

The script which you have used works perfectly in both my unix & windows machine. I executed that using v11,v12.0 & v12.1, and it works fine with the three versions.


Some of the possible problems in your case may be:
  1. You have to execute this script, being in the directory where your *.trn files are located.
  2. Other wise you have to include path of your *.trn files directory. eg: > load filename = /home/shafiul/P4718_act_scale2_Unsteady_J0751_002/$i.trn
  3. If you have created file.cse in windows machine and your exporting it to unix machine, then it is better to convert its format by using the command: dos2unix file.cse
I hope the above points will benefit you.
pavitran is offline   Reply With Quote

Old   September 16, 2011, 10:42
Default Time history data
  #65
Member
 
Rasoul
Join Date: Feb 2010
Posts: 32
Rep Power: 16
aut_iut is on a distinguished road
Dear friends
I'm going to extract time history data of acceleration for all time steps in one file!
How can I export data for all time steps just in one dat file? I would like to have a file with the first column shows time step and second one shows the acceleration at a specific point.


Best regards,
aut_iut is offline   Reply With Quote

Old   September 16, 2011, 11:16
Default
  #66
Senior Member
 
Joshua Counsil
Join Date: Jul 2009
Location: Halifax, Nova Scotia, Canada
Posts: 366
Rep Power: 17
Josh is on a distinguished road
Hi Rasoul,

The easiest way to do this would be to create a monitor point for acceleration at a specific point. It will show up as a new convergence curve in Solver which you can then export (right-click, Export) to a .csv file.
Josh is offline   Reply With Quote

Old   November 7, 2011, 12:07
Default
  #67
New Member
 
Daniel
Join Date: Aug 2011
Posts: 2
Rep Power: 0
Wedge23 is on a distinguished road
delete please

Last edited by Wedge23; November 9, 2011 at 10:24.
Wedge23 is offline   Reply With Quote

Old   March 22, 2012, 03:51
Default
  #68
New Member
 
hun
Join Date: May 2009
Posts: 27
Rep Power: 16
hung is on a distinguished road
Hi

Please help
does anyone know why this is not working any more???
ANSYS 13??

!$start = 0;
!$finish = 100;

!for($i=$start;$i<=$finish;$i++) {
> load timestep=$i

EXPORT:
Export File = export_$i.csv
END
>export
!}

Thank alot,
hung is offline   Reply With Quote

Old   March 22, 2012, 05:02
Default
  #69
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
how do you start the script? External or within the Command Editor in Post? Did you get an error message?
mvoss is offline   Reply With Quote

Old   March 22, 2012, 15:31
Default
  #70
New Member
 
hun
Join Date: May 2009
Posts: 27
Rep Power: 16
hung is on a distinguished road
Command Editor in Post
I did not see any error at all.
CFD loaded the timestep but did not export it to the file.
hung is offline   Reply With Quote

Old   March 25, 2012, 19:26
Default
  #71
New Member
 
hun
Join Date: May 2009
Posts: 27
Rep Power: 16
hung is on a distinguished road
They have changed the location of the files.
now all the files are saved in Mydocuments rather than userfiles
hung is offline   Reply With Quote

Old   September 4, 2012, 21:19
Default
  #72
New Member
 
Susan Tully
Join Date: Jul 2012
Posts: 15
Rep Power: 13
st268 is on a distinguished road
Hello all,

This particular thread seems to be full of lovely knowledge gems!

Im currently attempting to do the whole export transient results to file thing using all the suggestions given here.

I am wishing to look at the pressure values at roughly 100 points on a sample disk plane over a series of 1000 transitions so that I can calculate the spacial and temporal correlation.

My question is this: can I do the correlation part in post? I mean can I read and compare from numerous transient files at once within the post processing module or do I have to write to a either a whole bunch of files/one large one and go from there in matlab?

Thanks in advance for any suggestions,

Susan
st268 is offline   Reply With Quote

Old   September 5, 2012, 05:55
Default
  #73
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
CFD-Post is not very good at that sort of thing. I would export the data to a file using a CFD-Post session file and do the correlation in matlab, excel or whatever your choice of analysis package is.
ghorrocks is offline   Reply With Quote

Old   September 5, 2012, 09:12
Default
  #74
Member
 
leo
Join Date: Jun 2012
Posts: 98
Rep Power: 13
sjtusyc is on a distinguished road
How to use the CFD-Post session file to get the data ? Can i get the data at one area using this method?
sjtusyc is offline   Reply With Quote

Old   September 5, 2012, 18:40
Default
  #75
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Record a session file, then export data from a point and have a look at the session file it generates. You can then edit the session file to do any number of points you like, and play the session file to do it.
ghorrocks is offline   Reply With Quote

Old   September 6, 2012, 02:53
Default
  #76
Member
 
leo
Join Date: Jun 2012
Posts: 98
Rep Power: 13
sjtusyc is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Record a session file, then export data from a point and have a look at the session file it generates. You can then edit the session file to do any number of points you like, and play the session file to do it.
Thanks , where can i find detailed information.
I used to export data suing the chart. But sometimes i would like to know the data on a face.
sjtusyc is offline   Reply With Quote

Old   September 6, 2012, 06:08
Default
  #77
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
Thanks , where can i find detailed information.
The CFD-Post documentation and tutorial examples.
ghorrocks is offline   Reply With Quote

Old   April 5, 2014, 12:07
Default
  #78
New Member
 
Sagar
Join Date: Apr 2014
Posts: 10
Rep Power: 12
eaysk is on a distinguished road
Hello!

I have a similar problem..

I am trying evaluate the volume averaged water volume fraction for each timestep I have run.
I have written these commands in the command editor of CFD-Post.

#************************************************* *********************

! open(OFH, " >> file.dat"); # writing to a file

# for loop start

! for ($i=100; $i <= 28000; $i=$i+100) {

COMMAND FILE:
CFX Post Version = 14.5.7
END

> load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\bcp4_3_v4_sr4_omg15-13-00$i.dat
! $vff= volumeAve(Water.Volume Fraction, "Plane 1");
! printf (OFH "1.8f\n",$vff;
!}

! close(OFH);
#************************************************* *********

I get the error-
ERROR
CCL parser failed with message:
Perl Syntax errors detected:
syntax error at (eval 6235) line 11, at EOF

Could you guys tell me whether I am on the right track with the code? If yes, then how can I correct it?

Cheers.
eaysk is offline   Reply With Quote

Old   April 5, 2014, 12:37
Default
  #79
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
Unclosed printf ?
Try to run the script from outside post- so you dont have to wait for the 280 Times of showing the dat.-file in the GUI. Just add a propper state file at the begining for the Plane1. Try Glenns advice on the session.
mvoss is offline   Reply With Quote

Old   April 6, 2014, 13:07
Default
  #80
New Member
 
Sagar
Join Date: Apr 2014
Posts: 10
Rep Power: 12
eaysk is on a distinguished road
I'm don't understand how to run the script from outside post..

I've modified the code slightly. I don't get any error messages anymore, but it doesn't write anything in the file either. Could somebody please point out why?

#*************************************************
COMMAND FILE:
CFX Post Version = 14.5.7
END

! my $file=file.txt;
! open($FH, ">$file"); # writing to a file

!$start = 200;
!$finish = 28000;
! for ($i=$start; $i <= $finish; $i=$i+100) {

!if($i<1000){
> load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-00$i.dat
!}
!elsif($i<10000){
> load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-0$i.dat
!}
!else{
> load filename=C:\bcp4_3_v4_sr4_omg15_pw3\bcp4_3_v4_sr4_ omg15_pw3 (fi=0.9097)\Data files\bcp4_3_v4_sr4_omg15-13-$i.dat
!}
! $vol_frac_fluid= areaAve("Water.Volume Fraction", "Plane 1");
! printf($FH "1.8f\n",$vol_frac_fluid);
!}

! close($FH);
#************************************************* *********
eaysk is offline   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
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


All times are GMT -4. The time now is 16:04.