Flapping Mechanism in ANSYS Fluent (UDF)

  • Last Post 12 May 2020
  • Topic Is Solved
vganore posted this 15 January 2018

Hi Friends,

Modeling flapping mechanism in Fluent needs considerable effort and time since you are bringing flapping motion (needs motion UDF, good quality mesh, additional dynamic mesh setting, turbulence etc.). Many students are trying to solve such problems. So I am sharing following useful materials/information to get you started:

1. Generate good quality mesh around flapping region 

2. Refer this flapping door tutorial (files are attached):

Part 1 Problem setup and results: 


Part 2 (UDF and Dynamic mesh):


3. Flapping tube tutorial discussion: http://studentcommunity.ansys.com/thread/dynamic-meshing-of-bending-tube/?postbadges=true


4. Here is my blog on similar flapping wing: http://www.ansys-blog.com/dragonfly-flapping-ansys/

Vishal Ganore, ansys.com/student

Attached Files

Order By: Standard | Newest | Votes
wbmckinney posted this 06 February 2018

What version of Microsoft Visual Studio would you recommend installing to compile the UDF? I was trying to install VS Express 2012 but cannot find it available anywhere. Please let me know your thoughts.


Will McKinney

vganore posted this 06 February 2018

This information is available in ANSYS Fluent manual for respective ANSYS versions. 

2012 VS Express + VS SDK is available here: https://www.visualstudio.com/vs/older-downloads/

If you are using latest ANSYS products 18.0 and above, you could go ahead with latest 2017 VS Community. 

Vishal Ganore, ansys.com/student

ankushcool288 posted this 08 February 2018

I followed your tutorial step by step but some error is popping up and I quote "the udf library you are trying to load is not compiled for 2ddp on the current platform(win64)".

Please explain to me how can I remove this error.


vganore posted this 08 February 2018

May I know how are you launching Fluent?? Are you using VS compiler and MS SDK? If possible, please share your project file achieve (.wbpz).

Vishal Ganore, ansys.com/student

ankushcool288 posted this 12 February 2018

I am happy to tell you that I have removed my errors with the help of my friend. Your tutorial helps me a lot and I want to explore more about it. Please keep sharing.

Thank you

wbmckinney posted this 22 February 2018

I am having issues with my model for the flapping tube. Vishal, you recommended to not have a thickness on the tube. However, I am having trouble inputting the tip region of the tube as a wall BC instead of an interface BC. Right now I have 2 separate parts in my model: the atmosphere and the tube. Also, I get an error when I try to run the dynamic mesh saying negative cell volume. Please let me know if you have any suggestions.


Will McKinney

Raef.Kobeissi posted this 22 February 2018

Nice tutorial!

Raef Kobeissi

jaiswal.3 posted this 21 March 2018

Hi Ankush

I am also facing the same problem you have faced.Can you help me to remove this error out? Any help from your side will be really helpful

jaiswal.3 posted this 21 March 2018

Hi Vishal,

Nice Tutorial.I am also working in the area of hydrodynamics of oscillations.Please guide me, how to start with UDFs and what are the prerequisites,like software compatibility and what are the necessary steps before compiling the UDFs.I have tried your tutorial and facing the error like "The UDF library you are trying to load is not compiled for 2D on the current platform.The system cannot find the file specified." 

Please Help



vganore posted this 03 April 2018

Manish, Can you provide following details?

1. Which Microsoft compiler are you using?

2. Which version of ANSYS?

3. How are you launching Fluent? Through workbench or standalone mode or through MS SDK command prompt?

Files (including UDF and fluent case) are attached above which you can take and test. My understanding is you have a compiler issue. 



Vishal Ganore, ansys.com/student

  • Liked by
  • jaiswal.3
jaiswal.3 posted this 03 April 2018

Thanks Vishal,

The microsoft compiler which I am using is Visual studio 2010

I am using ANSYS '13'

I am launching Fluent through Workbench,

I also think that there is a compiler issue, how to fix that.

mahdishuvo posted this 18 July 2018


Thanks for the tutorial. I have followed the similar equations and UDF but the motion of the body is not harmonic. the body is rotating around the center of rotation. What could be the possible reason? I can share .wbpz file if you want.


mahdishuvo posted this 19 July 2018

My default time step was 1. If i make the time step to 0.1, it oscillates nicely. I don't actually get why this happens. Can any of you give me some ideas?

abenhadj posted this 21 August 2018

Pretty tutorials


Best regards, Amine

Kremella posted this 23 August 2018


This is an excellent tutorial. 


Best Regards,


psalmsyst posted this 18 March 2019

Thanks for this tutorial.
However, I will like to know what part of the code Is responsible for the fixed end. What if I want the right end to be fixed while the other end flaps? I have a similar project but my door is vertical. Will like to know how to make either ends fixed

vganore posted this 22 March 2019

Define the center of gravity location that we specify in Dynamic mesh zone in Fluent panel. The code only defines the motion of the rigid body. 

Vishal Ganore, ansys.com/student

Philipmorris posted this 19 May 2019


Excuse me, May i ask you about the udf. I 'm simulate 2D unsteady pitching of rectangular plate. The motion of the rectangular plate in cross-flow y direction is expressed by

My question , Can i used your UDF but change COS to SIN.

Thanks for your kindness

Shuvadeep posted this 07 August 2019


In the tutorial above, where is the origin. Is it at the plate center or at the hinged point?

sarvapriyasingh posted this 12 May 2020

could you please help me out in the same error what you were getting ?