CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF for object oscillating in direction of flow

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By `e`

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2015, 06:31
Default UDF for object oscillating in direction of flow
  #1
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
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.
Attached Images
File Type: jpg SAMPLE.jpg (14.1 KB, 98 views)
tsaget is offline   Reply With Quote

Old   August 20, 2015, 07:34
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
yhlxqm likes this.
`e` is offline   Reply With Quote

Old   August 24, 2015, 09:09
Default
  #3
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
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!
tsaget is offline   Reply With Quote

Old   August 24, 2015, 09:39
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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).
`e` is offline   Reply With Quote

Old   August 24, 2015, 09:48
Default
  #5
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
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
Attached Images
File Type: jpg error.jpg (57.6 KB, 98 views)
tsaget is offline   Reply With Quote

Old   August 24, 2015, 10:15
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
That error appears to be a compilation error. Have you managed to compile UDFs other than those for the dynamic mesh model?
`e` is offline   Reply With Quote

Old   August 24, 2015, 11:51
Default
  #7
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
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!
tsaget is offline   Reply With Quote

Old   August 24, 2015, 19:57
Default
  #8
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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).
`e` is offline   Reply With Quote

Old   August 26, 2015, 01:40
Default
  #9
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
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!
Attached Images
File Type: jpg picture1.jpg (44.6 KB, 57 views)
File Type: jpg picture2.jpg (53.0 KB, 49 views)
tsaget is offline   Reply With Quote

Old   August 26, 2015, 09:00
Default
  #10
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   August 27, 2015, 09:18
Default
  #11
New Member
 
Terry
Join Date: Aug 2015
Posts: 21
Rep Power: 11
tsaget is on a distinguished road
Hi 'e', I have PMed you the UDF and images... Thanks for your help once again!
tsaget is offline   Reply With Quote

Old   September 15, 2015, 16:07
Default
  #12
New Member
 
Ahmed Jalal
Join Date: Mar 2015
Posts: 22
Rep Power: 11
A.Jalal is on a distinguished road
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
A.Jalal is offline   Reply With Quote

Reply


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
UDF for Mass Flow at the Outlet: ERROR ACCESS VIOLATION I-mech Fluent UDF and Scheme Programming 1 May 23, 2014 13:37
UDF problems with porous flow Nicolastheterminator Fluent UDF and Scheme Programming 0 April 8, 2014 10:12
UDF of flow over oscillating cylinder 2D case imharoon1 FLUENT 3 August 28, 2011 02:46
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 03:07
specifying the flow direction in periodic boundary joanna FLUENT 2 February 27, 2006 22:09


All times are GMT -4. The time now is 16:43.