CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Wave generation with 1.7.x and groovyBC (

nuovodna September 9, 2010 08:57

Wave generation with 1.7.x and groovyBC
Hi, i setted up a 2d box with an inlet patch that generates a 1st order Stokes wave using groovyBC. The simulation stop to run (giving floating point exception) after 0.55 sec

This is the case

keul September 9, 2010 10:14

Hi Emanuele,

I runned your case with some modifications. In the alpha1 file, I changed the inlet condition by a zeroGradient and in the p_rgh file I changed the outlet condition by buyoantPressure. Now your case works fine.

Best regards

nuovodna September 9, 2010 10:34

still crash
Hi mikael, thanks for your fast reply. I made the corrections that you suggested me but it still crashes. Now at t=6.8 sec


keul September 9, 2010 10:42

When I runned your case, I put the tangentialVelocity in the U file at (0 0 0). Maybe your problem comes from that.


nuovodna September 9, 2010 10:50

where do you put tangentialVelocity uniform (0 0 0); ?? On which patch?



keul September 9, 2010 10:55

In your U file, patch atmosphere, I replace (1 0 0) by (0 0 0)

nuovodna September 9, 2010 11:14

it works but not like i want
1 Attachment(s)
Changing the value of tangentialVelocity it doesnt crash anymore. But the free surface prediction is wrong.
This is the graph of computed free surface (red) against analytical solution (green) at t=20 sec

keul September 9, 2010 11:32

Maybe you could try with the program I use. It generates regular waves with the deep water hypothesis. You could compile the waveBC folder with wmake. I put a floating body tutorial.

nuovodna September 9, 2010 11:40

waveBC condition
I compiled waveBC yesterday but in the tutorial folder alpha1 file is missing. I grabbed it from shipHydrodynamicIG svn. Can you attach an example of waveBC on a case??




keul September 9, 2010 11:40

1 Attachment(s)
Sorry the file was to big.

keul September 9, 2010 11:44

For the alpha1 file, you could use the same file as your case with zeroGradient on all patches except eventually atmosphere with an inletOutlet condition.

Good luck

nuovodna September 9, 2010 11:44

Allrun error
I launched Allrun but the file is missing

cp: cannot stat `0/': No such file or directory

Edit: Ok i ll try. Thanks!

Edit: It works. Now i m going to make some test :)

ngj September 9, 2010 12:06


First of all, you have defined omega (w) differently in the alpha1.ORG and the U files in your input groovy file. This is most definitely one error in the input, which can result in the strange profiles in your post #7.

However, be aware, that linear wave theory will not yield the analytical solution in shallow water as the linear theory does not fulfill the boundary conditions for the non-linear wave problem at the inlet.

I am utterly surprised that the waveBC still exists out there, it has changed a bit since those years back, however I can still find my old comments in Danish:) I hope it works for you.

Best regards,


nuovodna September 14, 2010 05:02

Hi Niels, thanks for your answer. I re-setted the case using an water depth >= Wavelength/2 but the results are still wrong (i'm using groovyBC). Do you know another system available in OF to generate waves?
Thanks in advance



ngj September 14, 2010 05:31

Hi Emanuele

Yes, I have a different system, however currently I am working on a journal article, and the source will not be released prior to publication/acceptance of the article. I made a presentation of the framework at the Gothenburg workshop, see [1].

I have been working on a specific validation case for a long time without succes, so I will not be able to give a time line for the release.

Good luck,



All times are GMT -4. The time now is 23:43.