CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to extract Angular Velocity from Simulation? (https://www.cfd-online.com/Forums/fluent/229526-how-extract-angular-velocity-simulation.html)

David12 August 12, 2020 16:09

How to extract Angular Velocity from Simulation?
 
Hello, I currently am simulating the rotation of a propeller in ANSYS (transient solver). I've used a UDF macro (DEFINE_ZONE_MOTION) to have my propeller cell zone to rotate at a constantly changing RPM. However, I'd like to be able to see the angular velocity values for each time step, and see it's graph. I don't see an option to graph angular velocity in the report definitions, nor could I figure out how to do it through another UDF or expression. Can anybody help me figure out how to extract the angular velocity? Thank you, I'd appreciate it alot.

AlexanderZ August 12, 2020 21:07

this is definition of DEFINE_ZONE_MOTION
Code:

DEFINE_ZONE_MOTION (name, omega, axis, origin, velocity, time, dtime)
omega here is angular velocity, you may write it to file on each timestep

David12 August 13, 2020 18:48

Quote:

Originally Posted by AlexanderZ (Post 780285)
this is definition of DEFINE_ZONE_MOTION
Code:

DEFINE_ZONE_MOTION (name, omega, axis, origin, velocity, time, dtime)
omega here is angular velocity, you may write it to file on each timestep

Hi AlexanderZ, thank you for your advice, I did exactly just that and was able to export the data to a text file when the simulation runs. I do now have a different problem now since the data is posted twice in the data file as if function was ran twice. I am currently trying to solve that and if you had any advice on that, I'd love it hear it.

AlexanderZ August 14, 2020 00:26

Code:

#include "udf.h"
static int last_ts = -1;

DEFINE_ZONE_MOTION (name, omega, axis, origin, velocity, time, dtime)
{
int curr_ts;

curr_ts = N_TIME;
if (last_ts != curr_ts)
{
last_ts = curr_ts;
***your code***
}
}



All times are GMT -4. The time now is 17:37.