CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   How can I use dynamic mesh in the expansion area of the pipe that has a narrow? (

Puchanee August 18, 2020 07:12

How can I use dynamic mesh in the expansion area of the pipe that has a narrow?
2 Attachment(s)

I'm trying to run the simulation of a pipe by using dynamic mesh only at a narrow area that has the expanded condition. As following picture

Attachment 79713

Then I've tried to find a similar case to write a UDF code and found a case that has expanded condition. I tried to adapt a UDF code for my case but I faced the problems while setting up the data

During compiled: fatal error LNK1104: cannot open file 'libudf.dll'
During preview mesh motion: Update-Dynamic-Mesh failed. Negative cell volume detected.

And following is my UDF code:
Attachment 79712

As I don't have any experience of using dynamic mesh, and I think that it should be something wrong with my UDF code but I don't know how to fix it. Therefore, could anyone please give me a suggestion or guide me for this problem? I really appreciate all your kindness.

AlexanderZ August 19, 2020 01:29


  alpha = CURRENT_TIME;
to be

  alpha = time;
cause you have time already (defined in DEFINE_GRID_MOTION function header)

everything else looks good.
Are you sure you've compiled code?

If doesnt work, simplify "update" part of your code, for example

          if (NODE_POS_NEED_UPDATE (node_p))
              NODE_POS_UPDATED (node_p);

                NODE_Y (node_p) = 0.01;

so you can check if the problem is in your coordinate dependencies or not

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