|
[Sponsors] |
May 9, 2003, 08:16 |
UDF for C.G.Motion in two direction
|
#1 |
Guest
Posts: n/a
|
i have a cylinder who has a two direction mouvement. i have this function and i really don't knew what is wrong because after i read it in fluent i receive a mesaje "segmentation violation". if somebody has a fonction for c.g.motion in more then one direction and he can send it to me or can fix this program it will be great. thank you.cip
#include "udf.h" #include "dynamesh_tools.h" static real v_prev1_x = 0.0; static real v_prev1_y = 0.0; DEFINE_CG_MOTION(cylindre_CIP, dt, vel, omega, time, dtime) { Thread *t; face_t f; real NV_VEC (A); real b; real c; real force_ox, force_oy, dv_x, dv_y; NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); if(!Data_Valid_P ()) return; t=DT_THREAD((Dynamic_Thread *)dt); force_ox = 0.0; force_oy = 0.0; begin_f_loop (f,t) { F_AREA (a,f,t); b = a[0]; force_ox +=F_P (f,t) * b; c = a[1]; force_oy +=F_P (f,t) * c; } end_f_loop (f,t) dv_x=dtime * force_ox /50.0; dv_y=dtime * force_oy /50.0; v_prev1_x += dv_x; v_prev1_y += dv_y; Message ("time=%f,x_vel =%f,y_vel =%f,force_ox=%f\n,force_oy=%f\n",time,v_prev1_x,v_ prev1_y,force_ox,force_oy); vel[0] = v_prev1_x; vel[1] = v_prev1_y; } |
|
May 12, 2003, 03:25 |
Re: UDF for C.G.Motion in two direction
|
#2 |
Guest
Posts: n/a
|
did you use a compiled UDF (ie : not interepreted one )?
|
|
May 12, 2003, 03:31 |
Re: UDF for C.G.Motion in two direction
|
#3 |
Guest
Posts: n/a
|
yes, i've done the same procedure avec other udf's and works good. only in this case not
|
|
August 20, 2009, 22:45 |
|
#4 |
New Member
jiaoyangsong
Join Date: Aug 2009
Posts: 1
Rep Power: 0 |
i have the same problem with u
how did u solve the problem? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF direction | Rowing | FLUENT | 2 | June 17, 2011 09:33 |
Help please UDF flow direction | val17lr | FLUENT | 2 | September 4, 2010 06:30 |
looping UDF in given direction | ak6g08 | Fluent UDF and Scheme Programming | 0 | September 10, 2009 11:13 |
Help: using udf to define direction | Bo | FLUENT | 1 | July 16, 2008 07:47 |
changing gravity vector direction using UDF | Nico | FLUENT | 0 | September 7, 2006 13:00 |