CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2007, 03:00
Default UDF
  #1
James
Guest
 
Posts: n/a
Hi, I am having problem with UDF.I am doing a simulation of moving bodies.I need help for that.Can anybody help me to programme UDF.I know nothing is free in this world.I am willing to pay for the help.
  Reply With Quote

Old   December 6, 2007, 11:22
Default Re: UDF
  #2
SMF_MS
Guest
 
Posts: n/a
Compile Define Zones

Here an UDF example:

#include <stdio.h> #include <math.h> #include "udf.h"

# define UDF_FILENAME "udf_velocity"

DEFINE_CG_MOTION(disk, dt, cg_vel, cg_omega, time, dtime) { real velo,a,b,f,x,s1,t1,t2;

/* reset velocities */ NV_S (cg_vel, =, 0.0); NV_S (cg_omega, =, 0.0);

/* motion */ a = 0.25; /* amplitude */ f = 0.1; /* frequency */ b = 2.0 * 3.1416 * f; /* angular frequency */

s1 = 0.4; /* distance */ t1 = s1 / (a * b); /* time */

if(time < t1) /* process */ {

x = s1 * time / t1;

velo = a * b; } else /* sine motion */ {

t2 = time - t1;

x = a * sin(b * t2) + s1;

velo = a * b * cos(b * t2); }

/* set x-component of velocity */ cg_vel[0] = velo;

/*Message ("\nUDF disk: dt = %f, cg_vel = %f, cg_omega = %f, time = %f, dtime = %f, dt0 = %f, dt1= %f\n",

dt, cg_vel[0], cg_omega[0], time, dtime, dt[0], dt[1]);*/

/*Message ("\n\nUDF disk: dt = %f", dt);*/ Message (" cg_vel = %f", cg_vel[0]); /* C.G. linear velocity */ Message (" cg_omega = %f", cg_omega[0]); /* C.G. angular velocity */ Message (" time = %f", time); /* total time */ Message (" dtime = %f", dtime); /* time step size */ Message (" x = %f\n", x); /* x motion */
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 21:14.