CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Wave Tank (

kester April 19, 2007 09:53

I am a new user of OpenFOAM an
I am a new user of OpenFOAM and was wondering if anyone could give me some indications as to weather the following is possible, and if so, how to go about achieving it.

I am attempting to model a wave tank (tank of water where waves are generated at one end and propagate along the length of the tank). I was wondering if a boundary could be setup to produce a sinusoidal input that varies with time to generate waves.


eugene April 19, 2007 10:43

Getting the waves in is fairly
Getting the waves in is fairly easy, but requires user coded boundaries. Getting them out is much much more difficult.

hjasak April 19, 2007 11:26

I'm not sure what precisely yo
I'm not sure what precisely you are after, but as Eugene says doing waves is pretty easy. Depending on your simulation and objectives, there's quite a few ways to get the pattern you need.

For illustration, here's a link to a movie of a tank on a Liquified Natural Gas (LNG) tanker on rough seas. The excitement is obtained by a prescribed 6-DOF motion of the tank.

ship tank sloshing.



kester April 19, 2007 12:08

Thanks for that, its an intres
Thanks for that, its an intresting example, and far more complicated than what i have in mind and this stage. The picture below should give some idea if what I want. Is there any information on how to code boundaries of this nature?

where 'Wave in' is an inlet/outlet patch somehow generating the wave.

At the moment im not to bothered about getting the waves out.


liu April 19, 2007 12:17

You have two choices: 1. Movi
You have two choices:
1. Moving mesh: move the mesh on the wave maker side to mimic the movement of the piston or flap

2. Wave maker BC: specify velocity condition based on wave theory. Usually linear wave is enough. Higher harmonics can be added on top of it.

[1] X. Liu and M.H. Garcia. Numerical Simulation of sea bed response under waves with coupled solver of Biot consolidation equations and free surface water flow, In proceeding of ISOPE PACOMS, Dalian, China, 2006

[2] X. Liu and M.H. Garcia. Numerical Simulation of local scour with free surface and automatic mesh deformation. In proceeding of world envrionmental and water resource congress, Omaha, NE, USA, 2006

liu April 19, 2007 12:25

For the "wave out", I haven't
For the "wave out", I haven't figure it out either. One thing for sure is to use non-reflecting boundary condition at the outlet. But till now, all the boundary conditions in OF for incompressible fluid I know of is more or less of reflection nature.

I used Flow3D for some of our projects. In Flow3D, there is a boundary called outflow which is basically far field and they claimed it to be perfect for wave outlet. The thing is that Flow3D is based on structured grid and it's relatively easy to implement the BC. For OF, the unstructured gird nature makes things complicated.

eugene April 19, 2007 12:34

E-mail or remind me tomorrow.
E-mail or remind me tomorrow. I have some code that used to do an ok job. You will have to strip out some stuff though as I was trying to do deep ocean waves based on wind prevailing speeds.

Got to go play football now.

liu April 19, 2007 12:38

Sounds good. Let's talk about
Sounds good. Let's talk about it tomorrow.

Have fun, Eugene!

kester April 19, 2007 12:38

Thank you for the papers, I ha
Thank you for the papers, I had already read the second one (It came up in a google search for OpenFOAM I think). It was very informative. I am now happily starting the first one which looks to be even better for what I'm doing.

liu April 19, 2007 12:57

So what are you doing? ^_^
So what are you doing? ^_^

kester April 20, 2007 05:36

At the moment I'm just trying
At the moment I'm just trying to see if i can accurately model the propagation of waves down a wave tank. Eventually i want to model a floating object in the tank.

eugene April 20, 2007 05:41

Ok here are the BCs. Unfortuna
Ok here are the BCs. Unfortunately I dont have time to clean this up for you (it was compiled under 1.3.3), so you will have to extract what is useful and figure out the setup and dependencies too. surfaceWavePhase.tgz surfaceWaveVelocity.tgz

As I mentioned before, there is a lot of extra code that converts wind speed to wave properties that you will have to remove. The general idea is sound though.

kester April 20, 2007 05:56

Excellent, I'm sure I'll have
Excellent, I'm sure I'll have great fun figuring them out, thanks

egp April 20, 2007 08:00

Eugene, Thanks for postin

Thanks for posting the BCs. Were these originally designed to work with free-surface tracking (interTrackFoam) or capturing (interFoam) type solvers? It appears to be the former since I don't see gamma being modified.

As far as my interests go, I am working on dynamic stability of floating bodies in waves and was just thinking about how to implement such a feature in OpenFOAM. Ultimately, I would like to have the capability to choose from various wave spectrum models (e.g., Jonswap, Pierson-Moskowitz, etc.). It appears that some of this infrastructure is already in place, which is great!

If anyone has recommendations on the best way to incorporate these BC's into a interFoam-type solver, I'd love to hear them.

eugene April 20, 2007 08:30

Let me know if you devise a de
Let me know if you devise a decent wave outlet boundary. I have an oil tanker that I want to take for a spin.

At the moment the only solution I have to the problem is to impose a velocity ramp near the wave outlet, basically turning the water into tar and dissipating the waves before they hit the outlet. You could use porous media for this as well, as long as the dissipation rate has a gradual slope from the interface.

The BCs are for interFoam. The phase boundary is for gamma (if I recall correctly!) and the velocity boundary is for the velocity.

egp April 20, 2007 09:00

Thanks for explaining that pha
Thanks for explaining that phase boundary is for gamma. It's obvious, but I was thinking you were trying to do something special for the wave phase angle.

Concerning outlet boundary, I guess I'm a bit surprised that it OpenFOAM is so sensitive. For CFDSHIP-IOWA (which is also a PISO incomp solver), we were able to get away with simple extrapolation at the outlet without generating reflections.

I'll be interested to see how Kester progresses. A validation case that I'm working on is based upon experimental work by Armin Troesch's group at Univ. Michigan where they studied a floating box barge in single harmonic head waves with 3DOF. If anyone is interested, I put two movies at:


Look for the files "video_*". Clearly, the capsize case is going to require a robust approach to the dynamic gridding (thus my long-term interest in overset grids, and my more recent interest in inserting overset capability into OpenFOAM).

eugene April 20, 2007 09:26

How is zeroGradient different
How is zeroGradient different from 1st order extrapolation? Or what kind of extrapolation did you use? If there is an easy way to do the outlet I would love to hear it!

Foam has another problem though, the interface compression term does weird things to the pressure field at the interface. Not sure if this contributes to the issue, but I wouldn't be surprised if it does.

kester April 20, 2007 10:14

I'll be intrested to see how I
I'll be intrested to see how I progress also. Dose anyone know where I can find information on the interTrackFoam solver, I can't seem to find anything, and I'd be intrested to see if it is sutable for my applications.

hjasak April 20, 2007 10:36

interTrackFoam is a free surfa
interTrackFoam is a free surface deforming mesh solver, developed at FSB Zagreb by dr. Zeljko Tukovic. It is included (full source, examples, tutorials) into the 1.3 patched up release I've been maintaining and you can find it on the FSB site:

FSB OpenFOAM release

The stuff is being merged with the changes in 1.4 and will follow up some time soon. For an idea of what it does, have a look at the

hydrofoil movie

or bubble similations

bubble mesh, 2-D

3-D bubble with surfactants



kester April 20, 2007 10:57

That bubble 3d bubble is absol
That bubble 3d bubble is absolutly amazing, a real demonstration of why the C stands for colour!

Is it posible to have 2 instilations of OF running on one computer (under ubuntu) so i can have a play with this solver without loosing what ive been doing in 1.4??

All times are GMT -4. The time now is 09:55.