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

Sloshing of water tank

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2014, 11:30
Default Sloshing of water tank
  #1
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
Hi guys,
I'm trying to make the simple exercise of water sloshing in a 2d tank as explained in this file: http://willem.engen.nl/uni/fluent/do...ernal/wave.pdf , with the difference that my tank is ALL closed (also in the upper side).
Now, I want to apply a sinusoidal movement to the left wall and I have used an UDF as the code in attachment, but it returns me a fatal error:
1) http://i59.tinypic.com/s6suvn.png
2) http://i61.tinypic.com/2s01uug.png
Where I'm wrong? Probably the error consists in the UDF code?
Please, help me it's very important to go on with my project!
Thanks to all
Attached Files
File Type: c wall_motion.c (194 Bytes, 122 views)
darkluix88 is offline   Reply With Quote

Old   October 27, 2014, 05:02
Default
  #2
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Hi,
why do you hook the udf in the shear stress tab??
ghost82 is offline   Reply With Quote

Old   October 27, 2014, 06:11
Default
  #3
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
Hi ghost82,
you've right, I made a great error!
So if I have understood well:
1) I have to click on the wall to which I want apply the udf velocity;
2) select "velocity inlet" in the menu "Type";
3) load the udf "wave.c" in X-component.
Is it right? And at the voice "Phase", I have to select mixture or phase-2 (in my case water-liquid)?

darkluix88 is offline   Reply With Quote

Old   October 27, 2014, 06:15
Default
  #4
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
No, you have no velocity inlet in your domain (all bc are walls), so you can't hook that udf in velocity inlet tab.
You probably need dynamic mesh.
I suggest to read udf manual to understand what you are doing and look at some dynamic mesh tutorials.

Daniele
ghost82 is offline   Reply With Quote

Old   October 28, 2014, 07:00
Default
  #5
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
thank ghost82, now I have understood more about udf and dynamic mesh
Now I have set the case, but I have observed a problem when I've created the animation in MPEG:
during the animation, the water swings inside the tank, but the wall to which I've set the udf movement (the only left wall) moves to right and to left.
The result is that the lenghts of upper and bottom walls become longer and shorter alternatively...how can I resolve this problem?
Because I don't want to "deform" the walls...thanks for the help
darkluix88 is offline   Reply With Quote

Old   October 28, 2014, 07:42
Default
  #6
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Quote:
Originally Posted by darkluix88 View Post
The result is that the lenghts of upper and bottom walls become longer and shorter alternatively...how can I resolve this problem?
Yes, this is expected from your setup.
If you continue to follow this approach (instead of applying a force inside the tank, as in some tutorials you can find on the net) and you want to move the whole tank, you can create an outer air domain and you will setup a rigid body motion for all the tank walls and for the interior of your tank; the outer domain will remesh/layering.
ghost82 is offline   Reply With Quote

Old   October 28, 2014, 13:33
Default
  #7
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
Could you make me an example to apply the movement inside the tank? I've tried all over the web but I didn't find anything of clear for this problem
darkluix88 is offline   Reply With Quote

Old   October 29, 2014, 03:52
Default
  #8
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Here there's a tutorial for fuel sloshing tank 3d:
https://support.ansys.com/AnsysCusto...+Tank+Sloshing

No need for udf; assuming you have your tank in +xy plane you can set gravitational force (9,81 m/s2) in -y direction and you assign an additional "gravitational force" in -x direction (this to simulate a car/motorbike/etc. acceleration); then after xx time steps you can manually modify the force in -x direction to simulate braking.
ghost82 is offline   Reply With Quote

Old   October 30, 2014, 04:50
Default
  #9
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
So, if I understood well, I can reproduce the moves of a car only using gravity accelerations without udf, am I right?
Yesterday, I've reached to apply the udf obtaining a dynamic mesh. So I've a question: when I create the animation in MPEG, is it possible to make an "integral system" (in italian: "sistema solidale")? In the manner that the animation reproduce the move of only the fluid inside the tank, while the tank is unmovable.
Ps: sorry for the English
darkluix88 is offline   Reply With Quote

Old   October 30, 2014, 04:55
Default
  #10
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Yes, I think setting acceleration/deceleration forces is the fastest/easiest way to simulate the sloshing; obviously you must know the magnitude of that forces.
I don't think you can do the "integral system" animation with fluent, but I think you can do it with some video editor, for example by cutting/translate frames so that the tank seems fixed.
ghost82 is offline   Reply With Quote

Old   October 30, 2014, 13:13
Default
  #11
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
Thanks for the help! In any case, I'm trying to continue to use the dynamic mesh but when I run calculation, after about 250 steps, it returns me this error:
Error: Update-Dynamic-Mesh failed. Negative cell volume detected.
Error Object: #f

What's meaning? I've tried also to change the Time step size but with no result...probably it regards the Cell height setting in Dynamic mesh--> Layering menu?
darkluix88 is offline   Reply With Quote

Old   October 30, 2014, 13:16
Default
  #12
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Before starting calculation see in the dynamic mesh tab the motion preview. You have wrong setting in the layering tab or wrong setting in dynamic zones: common mistake for example is to set to deforming the fluid zone.
__________________
Google is your friend and the same for the search button!
ghost82 is offline   Reply With Quote

Old   October 30, 2014, 13:50
Default
  #13
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
I'm trying but there is something strange, because when I click Display Zone Motion, I can view that the tank moves as imposed by udf (for any time step setted), but when I click Preview Mesh Motion, I obtain the negative cell volume detected error after about 257 iterations (time step=0.001 s, number iter = 1000).
The settings are these ones:
Dynamic mesh -> Layering -> Settings -> Height Based -> Split=0.4, Collapse=0.2
Dynamic mesh zones -> Select only the walls of the tank -> Rigid Body -> Cell height=0.008 m , gravity center (0, 0)
For the mesh, I have used a cell-distance of 0.01 m (the tank dimensions are 1.0 × 1.0 m)
darkluix88 is offline   Reply With Quote

Old   October 30, 2014, 13:55
Default
  #14
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Post a sketch of your domain. I think you have to split external fluid zone and assign rigid body motion to tank walls, internal tank fluid and fluid surrounding the tank. Layers of cells will be added in the external fluid zones, adjacent to the zone sourrounding the tank.
__________________
Google is your friend and the same for the search button!
ghost82 is offline   Reply With Quote

Old   October 30, 2014, 14:51
Default
  #15
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
To precise, I'm modelling a tank completely closed (4 walls) with the water moving inside it, so there isn't external water to the tank.
In attachments I have posted the images of all info regarding the mesh
Attached Images
File Type: png Cattura.PNG (8.3 KB, 53 views)
File Type: png Cattura1.PNG (31.5 KB, 52 views)
File Type: png Cattura2.PNG (6.8 KB, 52 views)
File Type: png Cattura3.PNG (11.2 KB, 53 views)
File Type: png Cattura4.PNG (20.5 KB, 48 views)
darkluix88 is offline   Reply With Quote

Old   October 30, 2014, 14:52
Default
  #16
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
other captures...
Attached Images
File Type: png Cattura5.PNG (23.4 KB, 24 views)
File Type: png Cattura6.PNG (924 Bytes, 17 views)
File Type: png Cattura7.PNG (4.3 KB, 20 views)
darkluix88 is offline   Reply With Quote

Old   October 30, 2014, 15:13
Default
  #17
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
I can be wrong, I'm not working too much with layering, but maybe layers of cells are added/removed on stationary boundaries.
This is why I told you to create an external domain so to have the vertical boundaries of external domain where layers are added and removed.
Then you assign the rigid body motion to the whole tank (walls and interior).
Something like the attached picture.
Attached Images
File Type: png cfd.png (19.0 KB, 54 views)

Last edited by ghost82; October 31, 2014 at 04:02.
ghost82 is offline   Reply With Quote

Old   October 31, 2014, 09:55
Default
  #18
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
Thanks ghost82, now I have understood! I'll try this type of solution
I wanna ask you another question: is it possible to load udf for sloshing problems (as this one) without using dynamic mesh? I ask you to avoid the eventual problems related to cells' deformation.
Or, to do this, have I only to put simple accelerations in X,Y directions and change the forces after a determinate number of time steps?
To be more precise, my idea is that if it's possible or not use "more complex accelerations (function)" as gravity accelerations for X,Y.
darkluix88 is offline   Reply With Quote

Old   October 31, 2014, 11:38
Default
  #19
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26
ghost82 will become famous soon enough
Hi,
yes, by manually changing the value in fluent gui of gravity forces in x/y direction after xx time steps gives you the ability to change forces but as a "step" function.
In 2011, Amir, who is a qualified senior member of this forum, proposed to use the DEFINE_SOURCE macro to add a source to the momentum equation.
The thread is here:

http://www.cfd-online.com/Forums/flu...direction.html
ghost82 is offline   Reply With Quote

Old   November 1, 2014, 11:52
Default
  #20
Member
 
Join Date: Sep 2014
Posts: 43
Rep Power: 11
darkluix88 is on a distinguished road
This one probably is the better solution, applying the force to the centroid of the mass of fluid in tank.
Can you help me to create a simple UDF with the DEFINE_SOURCE macro?
For example, I want to use a simple sinusoidal velocity to the fluid: v=-omega*A*sin(omega*t + phase)
Because I'm a newbie and I don't understand some commands as C_R(c,t) or C_U(c,t), or the "con" variable.
darkluix88 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
water sloshing in oscillating tank (problem using udf Define_ZONE_MOTION) Tamsu Fluent UDF and Scheme Programming 8 November 24, 2021 00:11
Filling Tank with Water leff CFX 7 August 21, 2017 07:47
Simple Water Tank Transient 88phil88 CFX 5 March 17, 2014 03:48
Mixture and Decay of a tracer in a Water Tank Jeffrey1992 CFX 2 July 27, 2012 13:31
uptodate water distribution network fredius,magige,tanzanian,(e.a) Main CFD Forum 0 January 27, 2002 07:10


All times are GMT -4. The time now is 14:16.