|
[Sponsors] |
December 12, 2011, 18:20 |
Simulation of waves on a Water Surface
|
#1 |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Hi anyone,
my natural language is not english, so I hope i can still describe my problem. What i want to do is to build a OpenFoam-Model which consists of a rectangular prism. The bottom half is filled with water, the top half with air. So far I am able to do it. Now I got 2 questions: -The Air on Top is supposed to flow in a distribution. What i mean is that the air shall be injected with high speed on top of the prism and with low speed near the water surface (pretty simular to a boundary layer in big). -The water shall be moved by the walls of the prism. For example one wall is oscillating in a sinus-shape or a wave-function so that waves will get build on the water surface. Actually i got no idea how to build this model. Any help would be appreciated. I hope my english isnt that horrible, that nobody understands what I'm trying to ask. Thanks a lot! |
|
December 18, 2011, 15:50 |
|
#2 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
hi pier
could you tell me in which part you face the problem? i didn't get what you are going to model, however if you want to have interface and see water surface you can use interFoam, if you want to make nonuniform boundary condition you should use a utility called groovyBC ( you can find it in wiki) |
|
December 18, 2011, 19:52 |
|
#3 |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
hi,
i allready found the swak4foam library and succesfully installed it. So what Im trying to do right now, is to create a box and fill it half with water. (Used with InterFOAM later with InterDymFoam, so ill use the setfieldsdict to fill it). My only trouble right now is if ill get the groovy bc to work and to make some waves for me. But well see that. Other question is: At the bottom half of the box ill use groovy bc to get waves into the water. At the top half i want to inject the wind (air in a distribution as described before). For that surpose i created 2 boxes right on top of each other, so i can insert 2 bc's (top-air inlet bottom-groovybc). Will this work? When the water gets waving itll move over the bottom box. What will the air inlet do to the waterwaves in front of it? Thanks! |
|
December 19, 2011, 02:56 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Pierre
Since you are going to generate waves, you might be interested in looking into waves2Foam (http://openfoamwiki.net/index.php/Contrib/waves2Foam). It is not straight forward applicable for your problem, since there has been given no thought for the velocity field in the air. However, if you change the waveVelocityFvVectorPatchField.* files, then I suppose you should be able to achieve what you describe. Kind regards, Niels |
|
December 19, 2011, 03:25 |
|
#5 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
Quote:
if you look in groovyBc tutorials in wiki you will find some examples about it |
||
December 19, 2011, 05:43 |
|
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Pierre,
One more consideration with respect to the problem you describe. The solver 'interFoam' produces considerable velocities in the air, which originate from numerical inaccuracies, so you should be very careful, if you are thinking of using interFoam to study the effect of wind on the shape and other properties of surface water waves. Good luck, Niels |
|
December 19, 2011, 11:39 |
|
#7 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
Thanks, ill take a look at that! |
||
December 19, 2011, 11:41 |
|
#8 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
Hi, good to know about these limitations. But i guess these wont bother me too much. The goal ist to place a floating object on the water, the wind ist just there to make the sea-simulation a bit more complete. I dont think that the wind effect on the water surface is important. |
||
December 19, 2011, 11:50 |
|
#9 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
thanks for that tip. But what function exactly is it that is able to place different BC's on one face? Can't find it in the wiki |
||
December 19, 2011, 11:58 |
|
#10 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
Hi
http://openfoamwiki.net/index.php/Co...groovyWaveTank Code:
inlet { type groovyBC; valueExpression "(pos().z<=A*cos(-w*time())+0.5*k*A*A*cos(2*(-w*time()))) ? vector( A*w*exp(k*pos().z)*cos(-w*time()), 0, A*w*exp(k*pos().z)*sin(-w*time())) : wind)"; variables "l=5;A=0.1;g=vector(0,0,-9.81);k=2*pi/l;w=sqrt(k*mag(g));wind=vector(0,0,0);"; timelines (); } |
|
December 19, 2011, 12:07 |
|
#11 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
I'm sorry but i don't get it Where do you define that the wind is on the upper half of the patch and that the wave is on the lower half of the patch? Or are both of these functions intersecting over the complete patch? Thank you so much! |
||
December 19, 2011, 12:16 |
|
#12 |
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19 |
Hi,
each time step it generates waves (alpha1=1) for cells with centers below the calculated eta, with the prescribed velocity. Otherwise (what lies over it) gets alpha1=0 (air) and sets velocity to vector(0,0,0) on the original code. I changed that to define variable "wind", which is basically the same now, as it is set to (0,0,0). But you can modify that to introduce wind. For example, wind=vector(1,0,0); will produce 1m/s of wind in the x direction. Regards |
|
December 19, 2011, 12:20 |
groovyBC
|
#13 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
let me simplify with an example:
consider you have a vertical face with the height of 1m and your interface is in a position 0.5 so pos().z > 0.5 is air and pos().z < 0.5 is water now you should change your boundary condition in file alpha and U to groovy BC then in alpha file you should define which portion of face is water and which portion of it is air , some thing like this Code:
valueExpression "pos().z>0.5 ? 1.0 : 0)"; Code:
valueExpression "vector(pos().z>0.5 ? a : b,0,0)"; i hope you get the whole idea! |
|
December 19, 2011, 12:22 |
|
#14 |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
I think i got it now!
Thank you all so much. I'll try to get it working |
|
December 19, 2011, 14:50 |
sampling forces from one phase only
|
#15 |
Senior Member
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18 |
Dear All:
In sampleDict is there any way to measure pressure due to one phase only (eg water and not the air above it?). I am trying to sample pressure forces on the left and right wall of a 2D tank using interDyMFoam. I get pressure at cell / cell point along the vertical face of the left and right walls. The tank is half full of water, with air in the top half of the tank. I am only interested in the pressure from the water. Can this be done? Thanks |
|
December 20, 2011, 16:41 |
|
#16 |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Hey Anyone,
i still could use some help! I am actually creating the tank with the groovy BC as you informed me. I got some problems now (to find the problems i attached my wavetank-Folder): -BlockMesh work fine (...) -When I type setFields OpenFoam says :"Couldnt find value expression on inlet" for both U and alpha1. I tried to add value uniform 1 oder value uniform (1 0 0) and then it worked but I am not shure if these are ok? Why he asks me to add this line? -I got no outlet somewhere. And I am using p_rgh. In the GroovyWaveTank-Tutorial they were using pd with an athmosphere. I am a bit confused what i need to do to create a athmosphere? (which i want to have) -What conditions do I have to give to the walls, so that the waves transmitted from the inlet just go trough and do not rebound? -When i am trying to run InterFoam he says: "Unknow BC at Inlet GroovyBC". But i installed the swak4foam library and i allready runned some of the examples and they worked? So much questions... Thank you all Greetings |
|
December 20, 2011, 16:51 |
|
#17 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
I just wrote 1,0,0 in the attached pack in the previous post, because the vector wind is also 1 0 0? Or did i missunderstood something? |
||
December 20, 2011, 18:15 |
|
#18 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
two many questions
1) i suggest to use funkySetFields instead of setFields (find in wiki) 2) add this line into your controlDict Code:
libs ("libOpenFOAM.so""libgroovyBC.so"); |
|
December 20, 2011, 19:21 |
|
#19 | |
Member
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 16 |
Quote:
to 2) ill try that tomorrow, thanks! to 3) where is that function added? at a:b? what type of function can i write there? to x) whats about the error of setFields "need to add value"? Thanks! |
||
December 21, 2011, 01:36 |
|
#20 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
to 1 and x ) use the funkySetFields you will find its great benefits
to 2) first try then, if you face problem, ask again 3)a or b should be replaced with your function ) for example you can use this function sin (pos().z), i didnt know what function was suitable for your simulation so i remained it for your modification |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Linear analytical solution oto the 2D free sloshing water surface elevation | bearcat | Main CFD Forum | 7 | August 5, 2011 21:13 |
CFD Animations of waves, ships, and turbulence---- | Douglas Dommermuth | Main CFD Forum | 23 | January 8, 2008 13:41 |
CFX bubble simulation with free surface model | adma | CFX | 6 | February 3, 2006 12:17 |
spherical balls in water with free surface | Karthick | FLUENT | 0 | February 10, 2004 05:24 |
uptodate water distribution network | fredius,magige,tanzanian,(e.a) | Main CFD Forum | 0 | January 27, 2002 08:10 |