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

UDF for a simple sine function on base of droplet (moving wall)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2020, 09:00
Default UDF for a simple sine function on base of droplet (moving wall)
  #1
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
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!
ocyee is offline   Reply With Quote

Old   April 21, 2020, 09:13
Default Sinusoidal Velocity
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
For applying a sinusoidal velocity, you do not require a UDF. You can use a transient profile.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 09:18
Default
  #3
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Quote:
Originally Posted by vinerm View Post
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.
Attached Images
File Type: png Capture.PNG (27.8 KB, 20 views)
ocyee is offline   Reply With Quote

Old   April 21, 2020, 09:41
Default Transient Profile
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 09:49
Default
  #5
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Thank you for the clarification!
ocyee is offline   Reply With Quote

Old   April 21, 2020, 10:30
Default
  #6
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Quote:
Originally Posted by vinerm View Post
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
Attached Images
File Type: jpg 123.jpg (122.2 KB, 15 views)
ocyee is offline   Reply With Quote

Old   April 21, 2020, 10:38
Default Profile
  #7
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Could you attach your profile file here?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 10:46
Default
  #8
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Quote:
Originally Posted by vinerm View Post
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.
Attached Images
File Type: jpg basedroplet.jpg (88.0 KB, 11 views)
File Type: jpg streamlineplane.jpg (83.9 KB, 8 views)
Attached Files
File Type: txt transient.txt (1.2 KB, 12 views)
ocyee is offline   Reply With Quote

Old   April 21, 2020, 11:23
Default Velocity
  #9
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 11:30
Default
  #10
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Quote:
Originally Posted by vinerm View Post
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
ocyee is offline   Reply With Quote

Old   April 21, 2020, 11:36
Default Location of velocity
  #11
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   April 21, 2020, 12:24
Default
  #12
New Member
 
Join Date: Mar 2020
Posts: 21
Rep Power: 6
ocyee is on a distinguished road
Quote:
Originally Posted by vinerm View Post
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.
Attached Images
File Type: jpg Streamline.jpg (132.4 KB, 4 views)
ocyee is offline   Reply With Quote

Old   April 21, 2020, 13:49
Default Suggestions
  #13
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
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.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 14:07
Trying to implement a generalised wall function provided by PHOENICS with UDF hadial Fluent UDF and Scheme Programming 0 December 1, 2015 15:12
moving wall udf ahmadi Fluent UDF and Scheme Programming 6 January 13, 2015 18:40
UDF wall function Davide_sd Fluent UDF and Scheme Programming 0 August 7, 2013 11:56
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42


All times are GMT -4. The time now is 18:44.