CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for Dynamic mesh (http://www.cfd-online.com/Forums/fluent-udf/115571-udf-dynamic-mesh.html)

guido_88 April 2, 2013 11:51

UDF for Dynamic mesh
 
Hi, I'm trying to simulate a 2D flow over a moving cylinder or over an inclined plate. I have to describe a vertical motion that follow a sinusoidal law for my cylinder/plate, so can anyone write a simple UDF to use? Thanks!

vasava April 3, 2013 01:51

Here is UDF from fluent tutorial. You can edit it to your specifications.



/************************************************** *******************/
/* UDF to compute the orientation of a rotating valve, based on a
specified rotational speed.

Christoph Hiemcke, Fluent Inc., 12 Feb 2004

butterlfy_flex_UDF = name shown in Fluent GUI
dt = thread
cg_vel = cg velocity (global)
cg_omega = angular velocity (global)
time = current time
dtime = time step
*/
/************************************************** *******************/
#include "udf.h"

#define omega 10.0 /* rotational speed, rad/sec */

DEFINE_CG_MOTION(butterfly_flex_UDF, dt, cg_vel, cg_omega, time, dtime)
{
cg_vel[0] = 0.0;
cg_vel[1] = 0.0;
cg_vel[2] = 0.0;

cg_omega[0] = 0.0;
cg_omega[1] = omega;
cg_omega[2] = 0.0;
}


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