# how to compiled udf ?

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

 November 14, 2010, 23:42 how to compiled udf ? #1 New Member   zhangzhiyan Join Date: Jul 2010 Location: Urumqi CHINA Posts: 16 Rep Power: 8 hi all i do have no idea about udf, udf1: #include "udf.h" static real v_prev = 0.0; DEFINE_CG_MOTION(piston,dt,vel,omega,time,dtime) { Thread *t; face_t f; real NV_VEC(A); real force, dv; /* reset velocities */ NV_S(vel, =, 0.0); NV_S(omega, =, 0.0); if (!Data_Valid_P()) return; /* get the thread pointer for which this motion is defined */ t = DT_THREAD(dt); /* compute pressure force on body by looping through all faces */ force = 90.0; begin_f_loop(f,t) { F_AREA(A,f,t); force += F_P(f,t) * NV_MAG(A); } end_f_loop(f,t) /* compute change in velocity, i.e., dv = F * dt / mass velocity update using explicit Euler formula */ dv = dtime * force / 50.0; v_prev += dv; Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force); /* set x-component of velocity */ vel[0] = v_prev; } it can be compiled like that: but udf 2: #include "udf.h" #include "unsteady.h" #include "memory.h" #include "stdlib.h" #include "stdio.h" DEFINE_CG_MOTION(movewall,dt,vel,omega,time,dtime) { Thread *t; cell_t c; real cx,cy; //CArray vx,vy; int i; int n=0; //if(!Data_Valid_P()) //return; t=DT_THREAD(dt); cx=0; cy=0; begin_c_loop(c,t) { //vx.Add(C_U(c,t)); //vy.Add(C_U(c,t)); cx=cx+C_U(c,t); cy=cy+C_V(c,t); n++; } end_c_loop(c,t); cx=cx/n; cy=cy/n; cx=0; cy=0.05; vel[0]=cx; vel[1]=cy; //Message("\n n=%d, vx=%f, vy=%f\n",n,vel[0],vel[1]); } it can not be compiled : is anyone can help me? thanks. __________________ In learning and straightway practising is there not pleasure also? When friends gather round from afar do we not rejoice? Whom lack of fame cannot vex is not he a gentleman?

 November 15, 2010, 06:55 #2 Member     User_CFD Join Date: Mar 2010 Posts: 48 Rep Power: 8 I can't see pictures about error:-(

November 19, 2010, 02:53
#3
New Member

zhangzhiyan
Join Date: Jul 2010
Location: Urumqi CHINA
Posts: 16
Rep Power: 8
Quote:
 Originally Posted by lehoang_mai I can't see pictures about error:-(
thank You lehoang_mai
i have slover that problem
__________________
In learning and straightway practising is there not pleasure also? When friends gather round from afar do we not rejoice? Whom lack of fame cannot vex is not he a gentleman?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post kim FLUENT 3 October 26, 2011 21:38 iman_1844 Fluent UDF and Scheme Programming 3 June 10, 2010 12:55 Xinqiang FLUENT 0 June 10, 2009 14:32 chandra sekhar FLUENT 2 April 11, 2006 00:04 tian FLUENT 0 April 8, 2003 23:53

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