CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   How to calculate the average of torque in transient Ansys CFX Simulation (https://www.cfd-online.com/Forums/cfx/115614-how-calculate-average-torque-transient-ansys-cfx-simulation.html)

xtphgu April 3, 2013 07:18

How to calculate the average of torque in transient Ansys CFX Simulation
 
Hi,

I am trying to calculate the power of a wind turbine in a transient simulation. My simulate of a rotor blade works well but as a result I need the torque of the blade as mean over many time steps. For my CFD simulation I am using Ansys CFX 14.5.
I can get the torque in CFD-Post ->Calculators -> Function Calculator -> Fuction:torque (Location). But just for the current time step I chose.

Those anyone know how I can get the torque Results over all my time steps? As a plot, a file or somehow else? Thanks ahead.

ghorrocks April 3, 2013 07:28

I would export the torque versus time history and do the averaging in another package like excel, matlab or whatever you wish. To get the full time history, make a monitor point set to torque_x/y/z()@location and then export this point in the solver manager.

xtphgu April 3, 2013 08:07

Thanks @ghorrocks. It works just perfect in this way!

mvoss April 4, 2013 09:27

in case you did not set the monitor point before calculating, here is a little script which loops through each time step for a given res-file. start it from the cfx command line via cfx5perl. res-file needs to be next to the script (or viceversa).
Code:

>load filename=YOURRESFILE.res
!        $Liste = getValue("DATA READER","Timestep List");
!        @TIMELIST = split(/,/,$Liste);
!        print "@TIMELIST \n";
!        open OUT, ">YOURDATA.dat";
!        print OUT "Time;Massflow Inlet;Massflow Düse;Massflow Mündung\n"; #HEADER
!        foreach $TS(@TIMELIST){
>                load timestep = $TS
!                print "calculating timestep $TS \n";
!                ($time, $timeunits) = evaluate("Time");
!                $pin=massFlow("INLET");
!                $pduese=massFlow("Domain Interface 1 Side 2");
!                $pmuendung=massFlow("Domain Interface 2 Side 1");
!                print                "$time;$pin;$pduese;$pmuendung \n";
!                print OUT        "$time;$pin;$pduese;$pmuendung\n";
!        };
!                close OUT;
> close


Fernando R. March 13, 2014 13:19

Quote:

Originally Posted by ghorrocks (Post 418068)
I would export the torque versus time history and do the averaging in another package like excel, matlab or whatever you wish. To get the full time history, make a monitor point set to torque_x/y/z()@location and then export this point in the solver manager.

Hello. I can't set a torque monitor point. When I created it, torque wasn't in the output variable list. I've typed "torque_z()@pa" ("pa" was the name of the surface I've wanted to evaluate the torque around the z axis) in the box and it just goes empty again as I press "Apply". Is there any special way to do it?

xtphgu March 13, 2014 13:36

"torque_z()@pa" should actually work. Do you need torque over time or are you simulate 'steady state'?

Fernando R. March 13, 2014 13:43

Torque over time. I'm simulating a vertical axis wind turbine and I need in the torque vs angular position curve.

xtphgu March 13, 2014 13:53

If you create a output expression with "torque_z()@pa" in CFX-Setup you should get the curve as User Points in CFX-Solver.

Fernando R. March 13, 2014 14:18

I will try it.

Fernando R. March 13, 2014 15:16

1 Attachment(s)
Is it what I should do? I type "torque_z()@pa", press enter and apply and the field doesn't go empty. But, if I press ok, then open again the monitor point, the output variable goes automatically to "Absolute Pressure".

xtphgu March 13, 2014 16:00

Ok you have to change the Option drop down menu from "Cartesian Coordinates" to "Expression" then CFX will accept the torque-espresssion. God luck ;)

Fernando R. March 14, 2014 12:35

It works now. Thank you very much :)
The unit of the torque measured is relative to the solution units, right?

Fernando R. March 14, 2014 15:56

3 Attachment(s)
I was testing the results with this method and noticed that the value of torque obtained with the monitor point differed a bit from the value acquired by using the 'Function Calculator' (in Calculators) in a given timestep.

So, to have an idea of this difference I've made a simple simulation of a rotating "square" in an air flux, first with it still, to have the inicial values, and then with it moving, and a monitor point measuring the force in the x direction in the sides of the square (defined as "paredes").

After, I've compared the data exported from the monitor point and the force in the x direction evaluated at each timestep using the 'Function Calculator'. The data is shown in the third image (in the table, data refers to "exported data", and manual to data obtained with the function calculator).

It seems that the x axis using the monitor point is refers to a frame of reference fixed in the rotating domain. I've tried marking the "Coord Frame" box and selectinig the "Coord 0" (the only one that appear), but the result is the same.

How can I export the data referred to the global coordinate system?

anon_f April 24, 2014 11:13

Average Temperature
 
Hello,
The subject treated here is very interesting.
I would like to ask a question in my turn. My simulation on CFX is on heating a large block into contact with a combustion chamber. A heat flow is transmitted to the block and the temperature of the block varies with time.
So I get for each time step the temperature profiles of tho block. When I want to see the transient variation of the block temperature with XY - transient or sequence in Chart I can do it for points only (not all the domain).
Does anyone can tell me, please, how to plot the average temperature of all my block function of time? Or how to export at each timestep the average temperature of my block.
Thank you in advance for your help.

mvoss April 24, 2014 12:29

You can create an expession like volumeAve(T)@block And use it instread of the Point in the Chart schematic.
For the export via script see #4 above.

anon_f April 24, 2014 14:08

Thank you so much.

walter.vahlbruch May 16, 2014 07:00

Thank you so much for all of this information!
I would like to monitor the pressure of a moving wall.

Unfortunately it doesn't work like that: "pressure()@MOVING_WALL"
Ansys doesn't know the word "pressure". What can I do?

singer1812 May 16, 2014 09:22

The variable goes into the parenthesis. The first part is how you want to evaluate the variable. In your case for example:

areaAve(Pressure)@moving_wall
maxVal(Pressure)@moving_wall
minVal(Pressure)@moving_wall

can give you the area average, the max value and min value. Please look up CEL in the help.

walter.vahlbruch May 16, 2014 10:40

Thank you very much! I'm new in CFX. I will look up CEL.
Saved me a lot of hours!
Thank you!

dynamic January 25, 2016 06:27

Quote:

Originally Posted by ghorrocks (Post 418068)
I would export the torque versus time history and do the averaging in another package like excel, matlab or whatever you wish. To get the full time history, make a monitor point set to torque_x/y/z()@location and then export this point in the solver manager.

Hi Glenn,
I want to do something similar with what you showed Benjamin how to do, but I'm using fluent, I want to export the torque at each time step of my analysis to determine what is the optimum angle of attack throughout the rotation,

I tried creating a monitoring point and setting the expression as stated above in the calculation activities in fluent but when I run it is says invalid

what am I doing wrong thanks

-Maxim- January 25, 2016 07:43

Ronald, I would ask in the Fluent forum...

vishu343 April 15, 2016 13:35

Quote:

Originally Posted by Fernando R. (Post 480116)
I was testing the results with this method and noticed that the value of torque obtained with the monitor point differed a bit from the value acquired by using the 'Function Calculator' (in Calculators) in a given timestep.

So, to have an idea of this difference I've made a simple simulation of a rotating "square" in an air flux, first with it still, to have the inicial values, and then with it moving, and a monitor point measuring the force in the x direction in the sides of the square (defined as "paredes").

After, I've compared the data exported from the monitor point and the force in the x direction evaluated at each timestep using the 'Function Calculator'. The data is shown in the third image (in the table, data refers to "exported data", and manual to data obtained with the function calculator).

It seems that the x axis using the monitor point is refers to a frame of reference fixed in the rotating domain. I've tried marking the "Coord Frame" box and selectinig the "Coord 0" (the only one that appear), but the result is the same.

How can I export the data referred to the global coordinate system?


Hi,

I am facing same problem now. I do not know but you might have looked up in help file with "Force" as a topic. There they have defined why this difference is there but I am not sure about how to solve this problem.

If you know any means then kindly let me know. This problem is specifically for rotating transient cases.:)

gbrajtm June 20, 2017 07:16

Quote:

Originally Posted by mvoss (Post 418339)
in case you did not set the monitor point before calculating, here is a little script which loops through each time step for a given res-file. start it from the cfx command line via cfx5perl. res-file needs to be next to the script (or viceversa).
Code:

>load filename=YOURRESFILE.res
!        $Liste = getValue("DATA READER","Timestep List");
!        @TIMELIST = split(/,/,$Liste);
!        print "@TIMELIST \n";
!        open OUT, ">YOURDATA.dat";
!        print OUT "Time;Massflow Inlet;Massflow Düse;Massflow Mündung\n"; #HEADER
!        foreach $TS(@TIMELIST){
>                load timestep = $TS
!                print "calculating timestep $TS \n";
!                ($time, $timeunits) = evaluate("Time");
!                $pin=massFlow("INLET");
!                $pduese=massFlow("Domain Interface 1 Side 2");
!                $pmuendung=massFlow("Domain Interface 2 Side 1");
!                print                "$time;$pin;$pduese;$pmuendung \n";
!                print OUT        "$time;$pin;$pduese;$pmuendung\n";
!        };
!                close OUT;
> close


Hi,

I wanted an expression for calculating the force at a region for particular time step using CEL. The present expression I am using is (force_x()@piston), I have to select the time step to select each time to calculate the force for the particular time step. If I could manage to modify the present expression to calculate through expression.
Please help.

lowdo June 17, 2020 07:17

Quote:

Originally Posted by Fernando R. (Post 480116)
I was testing the results with this method and noticed that the value of torque obtained with the monitor point differed a bit from the value acquired by using the 'Function Calculator' (in Calculators) in a given timestep.

So, to have an idea of this difference I've made a simple simulation of a rotating "square" in an air flux, first with it still, to have the inicial values, and then with it moving, and a monitor point measuring the force in the x direction in the sides of the square (defined as "paredes").

After, I've compared the data exported from the monitor point and the force in the x direction evaluated at each timestep using the 'Function Calculator'. The data is shown in the third image (in the table, data refers to "exported data", and manual to data obtained with the function calculator).

It seems that the x axis using the monitor point is refers to a frame of reference fixed in the rotating domain. I've tried marking the "Coord Frame" box and selectinig the "Coord 0" (the only one that appear), but the result is the same.

How can I export the data referred to the global coordinate system?

Fernando, did you ever find a resolution to this issue? I'm finding the same thing (with both torques and forces reported on a part in a rotating domain), which seems to me to be contrary to what would be expected from reading the user manual.


All times are GMT -4. The time now is 18:36.