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/)
-   -   Is this the correct approach to my problem? (UDF for object in motion) (https://www.cfd-online.com/Forums/fluent-udf/125433-correct-approach-my-problem-udf-object-motion.html)

charlestan88 October 25, 2013 07:45

Is this the correct approach to my problem? (UDF for object in motion)
 
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?

vekh October 25, 2013 12:11

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.

charlestan88 October 26, 2013 05:19

Quote:

Originally Posted by vekh (Post 459026)
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

vekh October 27, 2013 05:39

Quote:

Originally Posted by charlestan88 (Post 459085)
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 (Post 459085)
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.

charlestan88 October 27, 2013 05:52

Quote:

Originally Posted by vekh (Post 459222)
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.

vekh October 27, 2013 06:09

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.


All times are GMT -4. The time now is 02:50.