# Is this the correct approach to my problem? (UDF for object in motion)

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

 October 25, 2013, 07:45 Is this the correct approach to my problem? (UDF for object in motion) #1 New Member   Dean Smith Join Date: Oct 2013 Posts: 8 Rep Power: 3 I need to simulate a small object in a still pool of liquid. A force is exerted on the object pushing it downwards into the fluid a certain distance and eventually stops. I am currently looking into writing a UDF for this motion with a dynamic mesh. Is this the correct approach? The UDF essentially defines the motion of the object correcT?

 October 25, 2013, 12:11 #2 Member   Rafal Join Date: Aug 2013 Location: CK Posts: 33 Rep Power: 3 I don't use dynamic mesh but I was simulated couple of moving objects. For example for moving heat source you must add for your equation "dx" element. In my case dx=v*t, where v is velocity and t is current time step. Now you need to put that into your equation: original equation - l=(p/a)*pow(2,x) with dx l=(p/a)*pow(2,(x+dx)); That is of course example You must adapt that for your case.

October 26, 2013, 05:19
#3
New Member

Dean Smith
Join Date: Oct 2013
Posts: 8
Rep Power: 3
Quote:
 Originally Posted by vekh I don't use dynamic mesh but I was simulated couple of moving objects. For example for moving heat source you must add for your equation "dx" element. In my case dx=v*t, where v is velocity and t is current time step. Now you need to put that into your equation: original equation - l=(p/a)*pow(2,x) with dx l=(p/a)*pow(2,(x+dx)); That is of course example You must adapt that for your case.
I don't understand.

You didn't use a dynamic mesh?
Wouldn't this result in an inaccurate mesh when simulating the movement?

What equation do you mean? From what I can tell FLUENT only allows very simple movement in the boundary condition settings without coding a UDF

October 27, 2013, 06:39
#4
Member

Rafal
Join Date: Aug 2013
Location: CK
Posts: 33
Rep Power: 3
Quote:
 Originally Posted by charlestan88 I don't understand. You didn't use a dynamic mesh? Wouldn't this result in an inaccurate mesh when simulating the movement?
In my opinion dynamic mesh is needed only when you move physical object i.e. rock in water. In my case I move only heat flux so I don't need that.
Quote:
 Originally Posted by charlestan88 What equation do you mean? From what I can tell FLUENT only allows very simple movement in the boundary condition settings without coding a UDF
Yes - without UDF It's difficult to move anything I used UDF with DEFINE_PROFILE function to define moving heat source along determined path in my model.

October 27, 2013, 06:52
#5
New Member

Dean Smith
Join Date: Oct 2013
Posts: 8
Rep Power: 3
Quote:
 Originally Posted by vekh In my opinion dynamic mesh is needed only when you move physical object i.e. rock in water. In my case I move only heat flux so I don't need that. Yes - without UDF It's difficult to move anything I used UDF with DEFINE_PROFILE function to define moving heat source along determined path in my model.

Any idea where I can learn how to write a udf for motion?
The tutorials from abyss fluent seem to be of little use.

 October 27, 2013, 07:09 #6 Member   Rafal Join Date: Aug 2013 Location: CK Posts: 33 Rep Power: 3 I've learn it from this and other CFD forums. Youtube contains some helpful videos too. That take some time but there is no other way. If you know how to write simple C or C++ code you should learn UDF's quite fast. You must also be familiar with problem you want to solve. Equations which are included in UDF must be write properly. Additional options (like move or smth like that) must be done with precautions. To 'move' something there is often only one condition - to add some time dependent variable to equation.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post leoarmas Fluent UDF and Scheme Programming 5 April 10, 2015 03:22 lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18 ja92 FLUENT 0 February 24, 2011 10:32 anant FLUENT 2 January 17, 2007 01:15 kerem FLUENT 2 June 20, 2006 06:56

All times are GMT -4. The time now is 15:23.