CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Problem related with UDF for dynamic mesh (

Ryan April 16, 2004 06:03

Problem related with UDF for dynamic mesh
I am now learning how to use UDF to describe a dynamic mesh. I adopt a very simple situation: four edges forming a rectangle shpe. left edge is pressure inlet, top and bottom edge are deforming walls, right edge is rigid body motion (at a constant x-velocity 0.4m/s).

Then I wrote a UDF to define the right edge's motion as below. It is also very simple and compiled successfully. But using this UDF, I can not preview the expected motion (the right edge doesn't move at all and no dynamic mesh appears). Could anyone check this UDF and tell me the reason? Thanks a lot.

#include "udf.h"

DEFINE_CG_MOTION(translation, dt, vel, omega, time, dtime)

{ /* reset velocities */

NV_S(omega, =, 0.0);



/* set x-component of velocity */



emma April 18, 2004 06:53

Re: Problem related with UDF for dynamic mesh

Just add the line '#include "dynamesh_tools.h"' before DEFINE_CG_MOTION..........

Regards, Emma

Ryan April 18, 2004 10:51

Re: Problem related with UDF for dynamic mesh
The result is the same as the old one. Right wall still don't move, and no new mesh generates.

Ryan April 18, 2004 11:09

Re: Problem related with UDF for dynamic mesh
Hi, Emma,

Is there any other adjustment required? I am really confused.

Best regards,


Ryan April 19, 2004 02:43

Re: Problem related with UDF for dynamic mesh
Hi, Emma,

I have solved this problem. Looking backward, I find that I made a very stupid mistake all the time. Before, I only read the case file to preview the dynamic mesh. Today, I found that it is impossible to preview it successfully without reading the data file together.

Thanks & regards,


emma April 29, 2004 03:25

Re: Problem related with UDF for dynamic mesh
Hi, Ryan,


Actually, you can see the mesh motion before it is iterated by reading your original case file (motion not yet), including successful compiling,defining the correspondent dynamic mesh parameter and zones, and pressing solve-mesh motion, you just need to give the number of time steps and the display frequency. I mean, if you only want to see the mesh motion and to check if there are no negative volumes during the mesh motion. By reading data file, you can get as many distributions of different parameters during the dynamic process as you want.



Ryan April 29, 2004 09:29

Re: Problem related with UDF for dynamic mesh
Hi, emma

Thanks for your message. But the situation I faced is a bit different. When only case file exists (I mean all are ready, including udf compling and setting parameters and zones, only without saving data file), I can't preview the mesh motion through "solve-mesh motion" operation. Only when I save the data file can it be successful.

By the way, do you know the exact meaning of the data in case file? Now I am facing another problem: original case file is OK, but the case file of later time step can't be saved completely (for example, the size of original is 800k, but later one often stops at 600k). I tried to open the case file through other text-editor software, but could not understand the data in case file. If you know it and have time, would you help me check it? Anyway, thanks a lot.

All times are GMT -4. The time now is 08:17.