CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for time dependent angular velocity calculation

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 1, 2014, 01:03
Default UDF for time dependent angular velocity calculation
New Member
shashank mishra
Join Date: Sep 2011
Posts: 12
Rep Power: 7
shashankmechguy is on a distinguished road
I am trying to use dynamic meshing for 2D wind turbine simulation and generate rpm on the basis of inlet velocity using udf.

This is the code I wrote

real w_prev= 0.0;
DEFINE_CG_MOTION(turbine, dt,vel,omega,time,dtime)

Thread *t;
face_t f;
real NV_VEC(A);
real force,torque,x[ND_ND], dw;

/* Get the thread pointer for which this motion is defined */
t= DT_THREAD(dt);
/* Compute pressure force of body by looping through all faces */
force = 0;
torque= 0;
torque+= x[1] * (F_P(f,t)* NV_MAG(A);

/* Compute change in angular velocity */
dw= dtime* torque/ 50.00;
w_prev= w_prev + dw;

Message ("time = %f , z_omega= %f,torque = %f\n", time, w_prev, torque);
/* Set Z Component of Angular velocity */
omega[2]= w_prev;

I know the code is wrong since I need to take the vector cross product of force with radius vector but I dont have any idea how to do that so I made is simple and tried to run this with this wrong code.

Anyone have any comment on how to get what I wish to simulate

shashankmechguy is offline   Reply With Quote

Old   October 24, 2016, 03:34
New Member
Join Date: Oct 2016
Posts: 5
Rep Power: 2
jealor is on a distinguished road
There seems to be an marcon "Compute-force-and-momentum" which can be used to compute the momentum
but i am not quite sure . u can do some research about it
jealor is offline   Reply With Quote

Old   October 24, 2016, 04:43
Question UDF for inlet temperature
New Member
Join Date: May 2016
Posts: 24
Rep Power: 2
mmunige is an unknown quantity at this point
Dear all

I have following UDF for inlet temperature, untill 1300s it takes correct values according to equation, but after 1300s values are higher and not accorrding to equation, like at 1301s it should have value of 405C but in simulation inlet temperature is 621C. I could not find the error in my UDF after lot of try. please check this and guide me. Thank you.

DEFINE_PROFILE(inlet_temperature,thread,position )


face_t f;



real t = RP_Get_Real("flow-time");

if (t <=1300.0 )


F_PROFILE(f,thread,position) = 379.13 + 0.0005*t;


else if (1300.0 < t && t <= 1500.0 )


F_PROFILE(f,thread,position)= -1.04289036878969*pow(10,-10)*pow(t,6.0)+ 8.86126436853789*pow(10,-7)*pow(t,5.0)-3.13621260398811*pow(10,-3)*pow(t,4.0)+5.91804640375908*pow(t,3.0)-6.27969461279651*pow(10,3)*pow(t,2.0)+ 3.55273415252714*pow(10,6)*t - 8.37223405676245*pow(10,8);

F_PROFILE(f,thread,position) = -9.51538261322402*pow(10,-23)*pow(t,6) + 8.26192751387975*pow(10,-18)*pow(t,5)-2.85237398505875*pow(10,-13)*pow(t,4)+4.97518353700886*pow(10,-9)*pow(t,3)-4.58733775886876*pow(10,-5)*pow(t,2)+ 2.10251137071757*pow(10,-1)*t +3.57252192344954*pow(10,2);




mmunige is offline   Reply With Quote


udf cg motion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
3D velocity inlet UDF zumaqiong Fluent UDF and Scheme Programming 2 October 24, 2016 04:44
UDF for a 2d vaned diffuser inflow velocity shiva102 Fluent UDF and Scheme Programming 2 September 20, 2013 00:02
3D UDF Paraboilc Velocity Profile with max velocity johnGo Fluent UDF and Scheme Programming 1 January 4, 2011 22:45
UDF velocity and temperature Raj FLUENT 3 February 1, 2009 19:29
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11

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