# Fluent UDF Discontinuous Motion

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

 July 5, 2011, 14:26 Fluent UDF Discontinuous Motion #1 New Member   Sebastian Join Date: Mar 2011 Posts: 2 Rep Power: 0 Hello you all Iīm programming Fluent for a flapping-wing simulation. After problems with the UDF compilation, VS-Fluent interaction, UDF programming and motion previewing (all solved thanks to this forum) I finally got it working (its 1DOF for now). When I preview the prescribed motion, something wierd happens: While the angular velocity is OK (sine motion), the angle is discontinuous. What I mean is that, when the angular velocity changes sign, the angle leaps to another position, where the velocity continues as it should. That is, when changing direction, the wing jumps right into another position, and then is does change direction and continues normally, until it has to change itīs direction again, just to jump again. Here is the UDF: #include "udf.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(unGDLsin20,dt,vel,omega,time,dtim e) { real w, a, pi; /* w es frecuencia Hz, a, es amplitud grados*/ pi=3.141592654; a = 20*pi/180; /* 20 degree flapping amplitude */ w = 2*pi*2; /* 2 Hz frequency */ /* speed initialisation */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); /* error message */ if (!Data_Valid_P ()) { Message("Not good at all!\n"); return; } omega[0] = 0; omega[1] = a*w*sin(w*time); omega[2] = 0; } I donīt know if the problem is in the UDF programming, or if itīs a compilation problem, or the way fluent calculates position with the angular velocity provided, or what at all. Any advice is welcome (I really need to finish my thesis)

November 1, 2011, 23:20
#2
Member

^^
Join Date: Aug 2011
Posts: 70
Rep Power: 15
Quote:
 Originally Posted by lequi7 Hello you all Iīm programming Fluent for a flapping-wing simulation. After problems with the UDF compilation, VS-Fluent interaction, UDF programming and motion previewing (all solved thanks to this forum) I finally got it working (its 1DOF for now). When I preview the prescribed motion, something wierd happens: While the angular velocity is OK (sine motion), the angle is discontinuous. What I mean is that, when the angular velocity changes sign, the angle leaps to another position, where the velocity continues as it should. That is, when changing direction, the wing jumps right into another position, and then is does change direction and continues normally, until it has to change itīs direction again, just to jump again. Here is the UDF: #include "udf.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(unGDLsin20,dt,vel,omega,time,dtim e) { real w, a, pi; /* w es frecuencia Hz, a, es amplitud grados*/ pi=3.141592654; a = 20*pi/180; /* 20 degree flapping amplitude */ w = 2*pi*2; /* 2 Hz frequency */ /* speed initialisation */ NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); /* error message */ if (!Data_Valid_P ()) { Message("Not good at all!\n"); return; } omega[0] = 0; omega[1] = a*w*sin(w*time); omega[2] = 0; } I donīt know if the problem is in the UDF programming, or if itīs a compilation problem, or the way fluent calculates position with the angular velocity provided, or what at all. Any advice is welcome (I really need to finish my thesis)
I have same problem. Please let me know if you solve this problem

Best Regards

November 3, 2011, 23:18
#3
New Member

Sebastian
Join Date: Mar 2011
Posts: 2
Rep Power: 0
Quote:
 Originally Posted by colopolo I have same problem. Please let me know if you solve this problem Best Regards
Colopolo
I messed with it a lot and couldnīt solve it...
Then I switched to another, linux based, computer and it worked like a charm. Compiling was so easy.
I believe my original UDF got messed up along the long way in the Windows *thorny* compiling process.

Hope that helps

 Tags cg_motion, discontinuity, dynamic mesh, flapping motion, udf