CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Transient post-processing, Time averaged pressure work (http://www.cfd-online.com/Forums/cfx/83526-transient-post-processing-time-averaged-pressure-work.html)

Turbomachine January 2, 2011 18:40

Transient post-processing, Time averaged pressure work
 
Dear All,

I am currently doing the post processing of a transient turbine analysis. I was looking at the previous posts and realised that there were several similar problems that have been raised but remained unsolved. Firstly, the description of the problem is the following:

I have to calculate the work done by the pressure forces on the blade during its movement. Mathematically speaking I need to integrate pressure * mesh displacement over one cycle (100 timesteps) and then plot the work distribution.

In previous discussions the following solutions have been proposed:

1) POWER SYNTAX in CFX-Post:

! @myTimeSteps = ("71","105","136"); # add your "solver steps" between brackets as they are listed in POST "Time Selector"
! $MyVariable = "Water.Superficial Velocity"; # put the variable of interset between quotes
! $MyPlane = "Plane zx"; # put the plane name here

! open(MyOutF,">C:/TimeAvgOut.csv") || die "Can't open file $!\n"; # this will create a Report file named "TimeAvgOut.csv" on root of C:\ drive

! $TStepsNo = @myTimeSteps;
!print MyOutF "Time step , ",$MyVariable, "\n";
! for ($i=0;$i<$TStepsNo;$i++){
> load timestep= $myTimeSteps[$i]
! $MyAvgVel = areaAve($MyVariable, $MyPlane,"");
!print MyOutF $myTimeSteps[$i]," , ",$MyAvgVel, "\n";
!}
! close MyOutF;

The above syntax calculates the area averaged work value at each timestep and stores it in a file.


2) TRANSIENT STATISTICS in CFX-Pre

By setting transient statistics in CFX-Pre it is possible to obtain the time averaged output of variables, however I am not aware of the possibility to include mathematical operators such as p*displ.



Despite the first option what I need is to plot the time averaged work distribution over selected timesteps.

Can anyone suggest a way to achieve this? Thank you for your help!!

Turbomachine January 3, 2011 18:01

Macro
 
I am using the following macro (suggested by Pavitran in a former discussion) to create a folder and export the data files of the variables I need. The problem is it works for a simple case of a flat plate with 40 nodes but it does not work with a large case with 20000 nodes. When I try to export it from the CFX Post file menu, however, it works fine.

Can someone help me out with this?


################################################## ######################
#### Name convention
################################################## ######################

! $PathSeparator = "/";
! $ResFileName = getValue("DATA READER", "Current Results File");
! $ResPos = index($ResFileName, ".res");
! $ResFileLength = length($ResFileName);

! if ($ResPos == ($ResFileLength - 4)){
! $FileBase = substr($ResFileName, 0, $ResFileLength-4);
! }
! else {
! $FileBase = $ResFileName ;
! }
! $DirName = $FileBase . "_EXPORT1"; ##################### ADJUST THIS
! mkdir ($DirName, 0777);
! $DirName = $DirName . $PathSeparator;


################################################## ######################
#### Start postprocessing loop
################################################## ######################
! $count = 200; ##################### ADJUST THIS (number of the start imestep)

! @tlistt = (200, 201, 202, 203, 204, 205, 206, , 300); ##################### ADJUST THIS

! foreach $tlist (@tlistt){

DATA READER:DATA READER
Current Timestep = $tlist
END
> load

! $dummyfile = $DirName . "t" . $count.".csv";

EXPORT:
#ANSYS Export Data = Element Pressure
#ANSYS Export Locator = wallmeshcdb
#ANSYS Fluid Selection = All Fluids
#ANSYS Reference Temperature = 0.0 [C]
#ANSYS Specify Reference Temperature = Off
Export Type = Generic
#BC Profile Type = Inlet Velocity
Export Connectivity = Off
Export Coord Frame = Global
Export File = $dummyfile
Export Geometry = On
Export Node Numbers = Off
Export Null Data = Off
Export Units System = Current
#Export Variable Type = Hybrid
Include File Information = Off
Include Header = On
Location List = Plane 1 ##################### ADJUST THIS (Inlet, Outlet, Plane1,) (only one allowed!!!)
Null Token = 0
Overwrite = On
Precision = 10
Separator = ", "
Spatial Variables = X,Y,Z
Variable List = Total Temperature, Total Pressure, ##################### ADJUST THIS (you can specify more than one variable)
Vector Brackets = ()
Vector Display = Scalar
END
>export

! $count = $count + 1;

#############################
! }
#
# Ende der Sub-Definition


All times are GMT -4. The time now is 00:47.