CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Programming Post in PowerSyntax / Perl (https://www.cfd-online.com/Forums/cfx/20925-programming-post-powersyntax-perl.html)

R P January 17, 2005 03:59

Programming Post in PowerSyntax / Perl
 
Hi

I am trying to do a bit of programming to post process my data . I have a set of 50 backup files, for which I need to process various contour plots. I have recorded a session file, from the start including loading of the files till I need to post process my contours and print them as JPEG's. Now I need to loop this single session file in a loop such that I can do the same for 50 more files. Can anyone be kind enough to help me out in this? All the 50 files are in sequential order.

Thanks

R P

James Date January 17, 2005 16:58

Re: Programming Post in PowerSyntax / Perl
 
R P,

I've done this, its not too difficult. I'll post the syntax tomorrow when i'm at work.

James

R P January 18, 2005 00:32

Re: Programming Post in PowerSyntax / Perl
 
James,

Thanks for your kind help. I am eager to see the code.

Thanks

R P

James Date January 18, 2005 08:09

Re: Programming Post in PowerSyntax / Perl
 
I actually took forces from each of the files, but you could just replace the these statements with plot statements:

You need a session file and a batch file.

--------------------------------------------------

# Session file started: 2004/10/21 10:38:42 # CFX-5.7 build 2004.04.01-23.00

! open (DATAFILE,">>Datafile.txt") or die "File Error\n";

! $filePath = getValue("DATA READER","Current Results File");

! $torque_x = torque("Rotor","X");

! $torque_y = torque("Rotor","Y");

! $torque_z = torque("Rotor","Z");

! $force_x = force("Rotor","X");

! $force_y = force("Rotor","Y");

! $force_z = force("Rotor","Z");

! $Cp_chord_wise = $torque_z/$force_y;

! $Cp_span_wise = $torque_x/$force_y;

! format DATAFILE= ! @>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> @>> @>>>>>>>>>>>>> ! "Full Path and Run Number", "Force-X (N)", "", "Force-Y (N)", "", "Force-Z (N)", "", "Torque-X (N*M)", "", "Torque-Y (N*M)", "", "Torque-Z (N*M)", "", "Cp-Chord (M)", "", "Cp-Span (M)" ! @>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> @.############ @>> @.############ @>> @.############ @>> @.############ @>> @.############ @>> @.############ @>> @.############ @>> @.############ ! $filePath, $force_x, "", $force_y, "", $force_z, "", $torque_x, "", $torque_y, "", $torque_z, "", $Cp_chord_wise, "", $Cp_span_wise !.

! write DATAFILE;

! close DATAFILE;

>quit

# Session file stopped: 2004/10/21 10:40:42

--------------------------------------------------

DOS Batch File

--------------------------------------------------

@ECHO Off

C:\CFX\CFX-5.7\bin\cfx5post -batch T:\ANSYS_CFX\Post_session.cse T:\ANSYS_CFX\1\1_001.res

C:\CFX\CFX-5.7\bin\cfx5post -batch T:\ANSYS_CFX\Post_session.cse T:\ANSYS_CFX\2\2_001.res

--------------------------------------------------

You could gave done some kind of perl loop, but i figured this was quicker to do.

Regards James

R P January 26, 2005 02:10

Re: Programming Post in PowerSyntax / Perl
 
James,

Thanks for the trick. I shall surely use it in my programming.

R P


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