|
[Sponsors] |
October 26, 2014, 11:30 |
Sloshing of water tank
|
#1 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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 |
|
October 27, 2014, 05:02 |
|
#2 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
Hi,
why do you hook the udf in the shear stress tab?? |
|
October 27, 2014, 06:11 |
|
#3 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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)? |
|
October 27, 2014, 06:15 |
|
#4 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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 |
|
October 28, 2014, 07:00 |
|
#5 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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 |
|
October 28, 2014, 07:42 |
|
#6 | |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
Quote:
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. |
||
October 28, 2014, 13:33 |
|
#7 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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
|
|
October 29, 2014, 03:52 |
|
#8 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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. |
|
October 30, 2014, 04:50 |
|
#9 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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 |
|
October 30, 2014, 04:55 |
|
#10 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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. |
|
October 30, 2014, 13:13 |
|
#11 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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? |
|
October 30, 2014, 13:16 |
|
#12 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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! |
|
October 30, 2014, 13:50 |
|
#13 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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) |
|
October 30, 2014, 13:55 |
|
#14 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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! |
|
October 30, 2014, 14:51 |
|
#15 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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 |
|
October 30, 2014, 14:52 |
|
#16 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
other captures...
|
|
October 30, 2014, 15:13 |
|
#17 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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. Last edited by ghost82; October 31, 2014 at 04:02. |
|
October 31, 2014, 09:55 |
|
#18 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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. |
|
October 31, 2014, 11:38 |
|
#19 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 26 |
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 |
|
November 1, 2014, 11:52 |
|
#20 |
Member
Join Date: Sep 2014
Posts: 43
Rep Power: 11 |
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. |
|
|
|
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 |