CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Simulation of waves on a Water Surface

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2011, 17:20
Default Simulation of waves on a Water Surface
  #1
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
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!
Leech is offline   Reply With Quote

Old   December 18, 2011, 14:50
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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)
nimasam is offline   Reply With Quote

Old   December 18, 2011, 18:52
Default
  #3
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
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!
Leech is offline   Reply With Quote

Old   December 19, 2011, 01:56
Default
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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
ngj is offline   Reply With Quote

Old   December 19, 2011, 02:25
Default
  #5
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
Quote:
Originally Posted by Leech View Post
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!
you can apply different BC in different position of a patch, just by groovyBC, in other words you dont need to creat two box at all,
if you look in groovyBc tutorials in wiki you will find some examples about it
nimasam is offline   Reply With Quote

Old   December 19, 2011, 04:43
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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
gregjunqua likes this.
ngj is offline   Reply With Quote

Old   December 19, 2011, 10:39
Default
  #7
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by ngj View Post
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

Thanks, ill take a look at that!
Leech is offline   Reply With Quote

Old   December 19, 2011, 10:41
Default
  #8
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by ngj View Post
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

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.
Leech is offline   Reply With Quote

Old   December 19, 2011, 10:50
Default
  #9
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by nimasam View Post
you can apply different BC in different position of a patch, just by groovyBC, in other words you dont need to creat two box at all,
if you look in groovyBc tutorials in wiki you will find some examples about it
Hi,

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
Leech is offline   Reply With Quote

Old   December 19, 2011, 10:58
Default
  #10
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
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       ();
   }
Just change "wind" components to what you need.
Phicau is offline   Reply With Quote

Old   December 19, 2011, 11:07
Default
  #11
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by Phicau View Post
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       ();
   }
Just change "wind" components to what you need.

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!
Leech is offline   Reply With Quote

Old   December 19, 2011, 11:16
Default
  #12
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
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
Phicau is offline   Reply With Quote

Old   December 19, 2011, 11:20
Default groovyBC
  #13
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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)";
and in U
Code:
valueExpression "vector(pos().z>0.5 ? a : b,0,0)";
instead of a and b you should implement your function
i hope you get the whole idea!
nimasam is offline   Reply With Quote

Old   December 19, 2011, 11:22
Default
  #14
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
I think i got it now!
Thank you all so much. I'll try to get it working
Leech is offline   Reply With Quote

Old   December 19, 2011, 13:50
Default sampling forces from one phase only
  #15
Senior Member
 
musaddeque hossein
Join Date: Mar 2009
Posts: 309
Rep Power: 18
musahossein is on a distinguished road
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
musahossein is offline   Reply With Quote

Old   December 20, 2011, 15:41
Default
  #16
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
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
Attached Files
File Type: zip wavetank.zip (8.9 KB, 36 views)
Leech is offline   Reply With Quote

Old   December 20, 2011, 15:51
Default
  #17
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by nimasam View Post
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)";
and in U
Code:
valueExpression "vector(pos().z>0.5 ? a : b,0,0)";
instead of a and b you should implement your function
i hope you get the whole idea!
With "your function" you mean the function for the wind injection?
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?
Leech is offline   Reply With Quote

Old   December 20, 2011, 17:15
Default
  #18
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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");
3) if air injection is uniform then it would be constant but you have chance to choose any function or distribution for air injection
nimasam is offline   Reply With Quote

Old   December 20, 2011, 18:21
Default
  #19
Member
 
Pierre
Join Date: Sep 2010
Posts: 57
Rep Power: 15
Leech is on a distinguished road
Quote:
Originally Posted by nimasam View Post
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");
3) if air injection is uniform then it would be constant but you have chance to choose any function or distribution for air injection
to 1) what would be the difference or the benefit?
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!
Leech is offline   Reply With Quote

Old   December 21, 2011, 00:36
Default
  #20
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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
nimasam 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
Linear analytical solution oto the 2D free sloshing water surface elevation bearcat Main CFD Forum 7 August 5, 2011 20:13
CFD Animations of waves, ships, and turbulence---- Douglas Dommermuth Main CFD Forum 23 January 8, 2008 12:41
CFX bubble simulation with free surface model adma CFX 6 February 3, 2006 11:17
spherical balls in water with free surface Karthick FLUENT 0 February 10, 2004 04:24
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 18:37.