CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Fluent UDF Discontinuous Motion (http://www.cfd-online.com/Forums/fluent-udf/90258-fluent-udf-discontinuous-motion.html)

 lequi7 July 5, 2011 14:26

Fluent UDF Discontinuous Motion

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)

 colopolo November 2, 2011 00:20

Quote:
 Originally Posted by lequi7 (Post 314823) 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

 lequi7 November 4, 2011 00:18

Quote:
 Originally Posted by colopolo (Post 330381) 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

 All times are GMT -4. The time now is 16:26.