CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   ANSYS CFD-Post scripting - Extract Results (http://www.cfd-online.com/Forums/cfx/103914-ansys-cfd-post-scripting-extract-results.html)

E S June 28, 2012 23:37

ANSYS CFD-Post scripting - Extract Results
 
I need to run a large number of simulations based on very similar conditions, with slightly different meshes.
I have managed to create the python script that sets up each simulation and creates the solution, however, I am not sure what code to use in order to extract information from the results.

What I want, is the Mass Flow on outlet for example (which, in the GUI is obtained through Calculators --> Function Calculator)

Is there a way to extract this value without accessing the GUI?

(I don't have much experience with ANSYS Scripting / Python, so any help would be great).

Thanks

ghorrocks June 29, 2012 07:58

Simple: put a monitor point in the simulation to return the mass flow on your outlet. Then use the cfx5mon command to get the data from the command line (or in your case a python script)

E S July 1, 2012 21:13

Great, thanks for that.

I have actually found an alternative which is equivalent to using the function calculator


if the following is saved as batchtest.cse in the same folder as the .res file:

! $filePath = getValue("DATA READER","Current Results File");
! $Pout = massFlow("inlet");
! print "\nPressure at inlet is $Pout\n";

it can then be executed in cmd using:

cfx5post -batch batchtest.cse runName_001.res

(ensure that cfx5post is added to the current path)

that way, any of the 'Function Calculator' options can be executed by changing the middle line

suyesh May 13, 2016 09:48

Hi,
I have successfully obtained average area pressure values with areaAve("Total Pressure",$surface);
Now, I want to get the torque value on a surface. what command should i use?
I have tried Torque_X($surface); in all possible cases and without the underscore as well.

I used the variable for the surface as I have multiple surfaces to get the reading from.

Cheers!

suyesh May 13, 2016 10:41

Quote:

Originally Posted by suyesh (Post 599991)
Hi,
I have successfully obtained average area pressure values with areaAve("Total Pressure",$surface);
Now, I want to get the torque value on a surface. what command should i use?
I have tried Torque_X($surface); in all possible cases and without the underscore as well.

I used the variable for the surface as I have multiple surfaces to get the reading from.

Cheers!

I got the syntax for my problem...
torque($surface, x);
worked !!!

The syntax is listed in http://orange.engr.ucdavis.edu/Docum.../CFX/fpref.pdf


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