CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for object oscillating in direction of flow (https://www.cfd-online.com/Forums/fluent-udf/158278-udf-object-oscillating-direction-flow.html)

tsaget August 20, 2015 05:31

UDF for object oscillating in direction of flow
 
1 Attachment(s)
Hi all,

I am currently taking up a simulation project.

I was tasked to make use of ANSYS Fluent to simulate objects that oscillates in the direction of flow.

I have attached an image below to illustrate my project requirements.

From what I understand after reading through guides and forums, dynamic meshing is probably required and UDFs have to be used.

However, I am very new to programming and ANSYS FLUENT even though I have worked through several tutorials online.

Thus, would it be possible for anyone to share with me UDF codes or any guides for me to achieve my project requirement?

Thank you for your time reading this.

`e` August 20, 2015 06:34

Have a read of the Dynamic Mesh section of the UDF manual. You'll need to use the DEFINE_GRID_MOTION macro to specify the movement of your oscillating body. Use either only a smoothing dynamic mesh method or include the remeshing method as well if there's significant motion and the surrounding cells can't absorb this motion without sacrificing element quality.

tsaget August 24, 2015 08:09

Oh yea, is there any way I can let the object move without UDF? In other words, can i just rely on dynamic mesh methods?

Thank you!

`e` August 24, 2015 08:39

The UDF (DEFINE_GRID_MOTION) is only to define the movement of the oscillating body (should be quite a straightforward code where all nodes move in sync). The dynamic mesh is used for modifying the mesh (there's no default setting for oscillatory motions like your example -- there's a setting for pistons though).

tsaget August 24, 2015 08:48

1 Attachment(s)
Oh this is because I am facing problems with UDF such as the error attached in this reply.

I have searched this forum and even googled and I am still unable to find any solutions to this:(

`e` August 24, 2015 09:15

That error appears to be a compilation error. Have you managed to compile UDFs other than those for the dynamic mesh model?

tsaget August 24, 2015 10:51

oh I haven't tried others. I would probably try to figure out the cross platform compilation.

Meanwhile, would it be possible if i consult you regarding UDF Coding for lateral movements.

I see that there are DEFINE_GRID_MOTION and DEFINE_CG_MOTION.

Which one would be more useful for lateral movement?

Am I correct to say that Dynamic Mesh has to be used in conjunction with UDFs to achieve my objective?

As for the oscillating motion(i.e foward and backwards) how do I code it to make it repeat the movement?

Thank you so much, sorry for asking you so many questions. I am really new to ANSYS Fluent and Coding.

Thanks a million!

`e` August 24, 2015 18:57

Both UDFs should work for oscillatory motion of a body (I don't believe you could accomplish it without a UDF). I recommend DEFINE_CG_MOTION because you specify the velocity which is uniform across the body surface. The DEFINE_GRID_MOTION would work fine as well (but you'd specify the node displacements).

tsaget August 26, 2015 00:40

2 Attachment(s)
Hello 'e'

I have finally allowed my airfoil to oscillate front and back.

However, I am still unable to run the CFD simulation. It seems that my steps are incomplete. Do I have to define the deforming mesh by UDF or anything?

I have received an error when I preview mesh motion, and when I display zone motion, I am unable to see any mesh, only an oscillating airfoil. Would it be possible for you let me know what am I doing wrong or what have I missed?

So sorry for asking so many questions, I am really new to Fluent.

Thanks a lot for your help!

`e` August 26, 2015 08:00

What is the UDF you are using and what settings have you used? The negative volume error often occurs when you've moved the boundary too far in one time step (beyond one cell height -- a fixed upper barrier of the dynamic mesh); the solution is to reduce the time step.

tsaget August 27, 2015 08:18

Hi 'e', I have PMed you the UDF and images... Thanks for your help once again!

A.Jalal September 15, 2015 15:07

tsaget,

Were you able to solve your problem?

I believe reducing the time step just delays the error of "negative volume".

Did you only link the DEFINE_CG_MOTION to your body?

Thanks


All times are GMT -4. The time now is 03:57.