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

UDF for object oscillating in direction of flow

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 20, 2015, 05:31
Default UDF for object oscillating in direction of flow
  #1
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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, 10 views)
tsaget is offline   Reply With Quote

Old   August 20, 2015, 06:34
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 416
Rep Power: 5
`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.
`e` is offline   Reply With Quote

Old   August 24, 2015, 08:09
Default
  #3
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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, 08:39
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 416
Rep Power: 5
`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, 08:48
Default
  #5
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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, 6 views)
tsaget is offline   Reply With Quote

Old   August 24, 2015, 09:15
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 416
Rep Power: 5
`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, 10:51
Default
  #7
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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, 18:57
Default
  #8
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 416
Rep Power: 5
`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, 00:40
Default
  #9
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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, 3 views)
File Type: jpg picture2.jpg (53.0 KB, 3 views)
tsaget is offline   Reply With Quote

Old   August 26, 2015, 08:00
Default
  #10
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 416
Rep Power: 5
`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, 08:18
Default
  #11
New Member
 
Terry
Join Date: Aug 2015
Posts: 6
Rep Power: 2
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

Reply

Thread Tools
Display Modes

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 On
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 12:37
UDF problems with porous flow Nicolastheterminator Fluent UDF and Scheme Programming 0 April 8, 2014 09:12
UDF of flow over oscillating cylinder 2D case imharoon1 FLUENT 3 August 28, 2011 01:46
UDF for transient pressure inlet, mass flow check at nozzle exit and volumetric heat kokoory FLUENT 0 August 17, 2011 02: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:26.