CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF for a simple sine function on base of droplet (moving wall) (https://www.cfd-online.com/Forums/fluent/226233-udf-simple-sine-function-base-droplet-moving-wall.html)

ocyee April 21, 2020 09:00

UDF for a simple sine function on base of droplet (moving wall)
 
Hello guys, can anyone help me with creating a UDF file for a simple sinusoidal velocity sin(t), Im new to the UDF topic and had been trying several times for a couple days, but the results are not showing anything at all. Please help!

vinerm April 21, 2020 09:13

Sinusoidal Velocity
 
For applying a sinusoidal velocity, you do not require a UDF. You can use a transient profile.

ocyee April 21, 2020 09:18

1 Attachment(s)
Quote:

Originally Posted by vinerm (Post 766722)
For applying a sinusoidal velocity, you do not require a UDF. You can use a transient profile.

How can i do that in the FLUENT workbench? When I am trying to apply the boundary condition, i was unable to choose any settings. Image attached is my case.

vinerm April 21, 2020 09:41

Transient Profile
 
The information is available in User Guide. Just write out the profile as a simple text file, load it via File > Read > Profile and then it will be available for hooking at the boundary. Format is as follows

((nameofprofile transient 3 0)
(time
0
1
2
)
(vel
0.1
-0.1
0.1
))

nameofprofile is a name and user can use any name; no spaces are allowed nor are any capital letters. 3 is number of time points. 0 specifies periodicity. For you it should be 1 since the data is periodic. time values are in second. vel is again a variable and user can use any name. Then its values. All in SI units. transient and time should be written as it is without any modification. With last value as 1, you just need to provide data for one period.

ocyee April 21, 2020 09:49

Thank you for the clarification!

ocyee April 21, 2020 10:30

1 Attachment(s)
Quote:

Originally Posted by vinerm (Post 766725)
The information is available in User Guide. Just write out the profile as a simple text file, load it via File > Read > Profile and then it will be available for hooking at the boundary. Format is as follows

((nameofprofile transient 3 0)
(time
0
1
2
)
(vel
0.1
-0.1
0.1
))

nameofprofile is a name and user can use any name; no spaces are allowed nor are any capital letters. 3 is number of time points. 0 specifies periodicity. For you it should be 1 since the data is periodic. time values are in second. vel is again a variable and user can use any name. Then its values. All in SI units. transient and time should be written as it is without any modification. With last value as 1, you just need to provide data for one period.

@vinerm, Hello again, sorry to bother again but i tried using the transient profile method, load it in z direction, translational velocity, however, my results kept showing zero for all directions. I am not sure what is still wrong in my simulations

vinerm April 21, 2020 10:38

Profile
 
Could you attach your profile file here?

ocyee April 21, 2020 10:46

3 Attachment(s)
Quote:

Originally Posted by vinerm (Post 766743)
Could you attach your profile file here?

Here you go, the file attached is applied on the base of the water droplet as shown in the image attached. However there isnt any streamline shown on the cut off plane in the results, which is kind of weird.

vinerm April 21, 2020 11:23

Velocity
 
I suppose you have applied velocity only in the plane of the wall. Could you check by artificially increasing the velocity value, say 10 times?

ocyee April 21, 2020 11:30

Quote:

Originally Posted by vinerm (Post 766751)
I suppose you have applied velocity only in the plane of the wall. Could you check by artificially increasing the velocity value, say 10 times?

Yes, I had tried to manipulate the magnitude of the velocities too, but it does not affect the result at all. The results still show nothing.
By what you had just mentioned, should I not apply the velocity to the bottom plane only? As im trying to replicate the effect of vibration underneath the droplet base

vinerm April 21, 2020 11:36

Location of velocity
 
Yes, it should be applied only to the bottom wall but there are three components of the velocity. You need to apply only for the component(s) in the plane of the wall and not out of the plane. If the bottom wall is drawn on x-y plane, then you can apply profile in x and/or y velocity components but not for the z-velocity. Essentially, this is just a lid driven cavity and is supposed to work rather easily.

The reason you may not see much is the diffusion. Since the flow would be laminar, it would take long time for the momentum to diffuse deep into the drop even if it is a few mm in diameter. To test it, you can try by increasing the viscosity 100 times.

ocyee April 21, 2020 12:24

1 Attachment(s)
Quote:

Originally Posted by vinerm (Post 766757)
Yes, it should be applied only to the bottom wall but there are three components of the velocity. You need to apply only for the component(s) in the plane of the wall and not out of the plane. If the bottom wall is drawn on x-y plane, then you can apply profile in x and/or y velocity components but not for the z-velocity. Essentially, this is just a lid driven cavity and is supposed to work rather easily.

The reason you may not see much is the diffusion. Since the flow would be laminar, it would take long time for the momentum to diffuse deep into the drop even if it is a few mm in diameter. To test it, you can try by increasing the viscosity 100 times.

1. Finally getting values
Thank you for the clarification,i tried changing the velocity component. The analysis finally does produce some velocity values. However, I still dont understand the reason behind it. Let say for example i have a motion excitor going up and down through z axis, with a water droplet on top of it, isn't it logical if i apply the velocity profile at the z axis direction as well? Why is it that I need to apply the velocity only at the xy plane?

2.Streamlines showing mostly low velocity values.Only bottom part can be seen having higher velocity values, (as shown in image attached). Is it because of like what you mentioned before about the slow diffusion of the momentum through the water droplet? So to fix that, i need to alter the viscosity? But won't that be affecting the true water behaviour as I am trying to replicate from real life.

vinerm April 21, 2020 13:49

Suggestions
 
1. You can apply velocity in the third direction as well, however, better option for that is to use dynamic mesh. But you can try. If the results are satisfactory, then it is good.

2. Of course, you should not use a different viscosity than what it really is. However, its the job of the viscosity to diffuse the momentum. So, to check whether the boundary condition is really working or not, you can use a higher viscosity. If you observe that the momentum is really being transferred, then the case is setup alright. Reduce the viscosity to its original value and run the case long enough to observe the momentum diffusion reach almost the top surface.


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