CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

Dynamic mesh udf example

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2005, 16:08
Default Dynamic mesh udf example
Posts: n/a

Can anyone please post or direct me towards an example udf for dynamic mesh motion Thanks, Avant
  Reply With Quote

Old   September 16, 2005, 02:17
Default Re: Dynamic mesh udf example
Manoj Kumar
Posts: n/a

There is an example in fluent tutorial, which uses dynamic mesh. Go through its udf.


  Reply With Quote

Old   September 16, 2005, 02:24
Default Re: Dynamic mesh udf example
Manoj Kumar
Posts: n/a
Following udf calculates force acting on a regid body and sets its x-component of velocity. At the end of every time step, the udf is used and the mesh is updated.

#include "udf.h"

static real v_prev = 0.0;


{ Thread *t;

face_t f;

real NV_VEC(A);

real force, dv;

/* reset velocities */

NV_S(vel, =, 0.0);

NV_S(omega, =, 0.0);

if (!Data_Valid_P())


/* get the thread pointer for which this motion is defined */

t = DT_THREAD(dt);

/* compute pressure force on body by looping through all faces */

force = 0.0;




force += F_P(f,t) * NV_MAG(A);



/* compute change in velocity, i.e., dv = F * dt / mass

velocity update using explicit Euler formula */

dv = dtime * force / 50.0;

v_prev += dv;

Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev, force);

/* set x-component of velocity */

vel[0] = v_prev;


  Reply With Quote


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Dynamic mesh UDF problem Peter FLUENT 2 November 12, 2007 03:10
writing a dynamic mesh udf ALPER ALBAYRAQ FLUENT 0 October 24, 2005 09:41
Problem related with UDF for dynamic mesh Ryan FLUENT 6 April 29, 2004 10:29
UDF problem for dynamic mesh??? lyf FLUENT 1 April 19, 2004 07:43

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