CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Error during Compiling UDF for Rotor Motion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2013, 19:51
Default Error during Compiling UDF for Rotor Motion
  #1
New Member
 
Deepak Ganga Dharan
Join Date: Sep 2012
Posts: 4
Rep Power: 14
deepak.dce06 is on a distinguished road
I had written a UDF to give motion to udf about a point.
The case is a 2D case.
When I try to compile the udf it gives an error that the UDF is not written for 2D. Could anyone have a look at it.
Appreciate the Help.

#include "udf.h"
#include "stdio.h"
#include<math.h>
DEFINE_CG_MOTION(ROtor_Motion,dt,vel,omega,time,dt ime)
{
Thread *tf = DT_THREAD (dt);
face_t f;
Node *v;
real time1, time2, theta1, theta2;
int n;
real CGravity[ND_ND];
real xnew[ND_ND];
real count;
real omega,e;
real trans[ND_ND];

SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));

Omega=1047.2; /*angular vel*/
e=0.16; /*eccentricity*/

time1 = time;
time2 = time+dtime;
theta1= time1 * omega; /*whirling angles at two consecutive times*/
theta2= time2 * omega;

trans[0]=e*(cos(theta2)-cos(theta1)); /* change in x & y coordinate*/
trans[1]= e*(sin(theta2)-sin(theta1));

CGravity[0] =0;
CGravity[1] =0;
count =0;
begin_f_loop (f, tf) /*loop to change the position of each node*/
{
F_CENTROID(xnew,f,tf);
CGravity[0] = CGravity[0]+xnew[0];
CGravity[1] = CGravity[1]+xnew[1];
count = count + 1;
f_node_loop (f, tf, n)
{
v = F_NODE (f, tf, n);
if (NODE_POS_NEED_UPDATE (v))
{
NODE_POS_UPDATED(v);
NV_V (NODE_COORD (v), +=, trans);
}
}
}
end_f_loop (f, tf);
CGravity[0] = CGravity[0]/count;
CGravity[1] = CGravity[1]/count;
Message ("%f %f \n", CGravity[0], CGravity[1]);
}

Last edited by deepak.dce06; October 14, 2013 at 01:05.
deepak.dce06 is offline   Reply With Quote

Old   October 15, 2013, 13:51
Default
  #2
New Member
 
Deepak Ganga Dharan
Join Date: Sep 2012
Posts: 4
Rep Power: 14
deepak.dce06 is on a distinguished road
Anyone with UDF expertise??
deepak.dce06 is offline   Reply With Quote

Reply

Tags
udf cg motion


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling my Udf noa Fluent UDF and Scheme Programming 8 November 7, 2018 21:08
Compiling UDF on a cluster Adya FLUENT 1 December 14, 2009 12:30
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
On Compiling a UDF David Chabot FLUENT 5 May 20, 2005 10:13


All times are GMT -4. The time now is 04:39.