CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Verification & Validation

Running irregular wave by olaflow

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Phicau
  • 1 Post By Phicau

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2020, 02:13
Default Running irregular wave by olaflow
  #1
Member
 
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10
Lewis Liang is on a distinguished road
Dear Foamer,

I have a question about simulating a 2D irregular wave system by using olaflow. The wave period, wave height, and wave phase of singe wave are calculated under the Stokes I theory. The procedure is quite straightway, namely obtaining the wave height/wave period from S(f) function; calculating wave number (k) according to the dispersion relation. Although the k is not required to provide since it will calculate during simulation, the propose of this is to compare the results of free surface elevation between analytical one and the numerical one. Here, eta(x,t) = sum(H/2 * cos(k*x-2*pi*f*t + phi)). The comparison is attached below.

However, there is some obvious difference between those two results. Since the input data of Tw, Hw and phi are the same in olaflow solver and analytical function, namely the variation of eta vs time should be in accordance with each other. But haven’t found out the potential reason/error for this qualitative difference so far. Do I miss something? or Can anyone give some advice and help?

Best regards,

Lewis
Attached Images
File Type: jpg comp.jpg (122.4 KB, 156 views)
Lewis Liang is offline   Reply With Quote

Old   March 10, 2020, 16:10
Default
  #2
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Hi Lewis,


there are lot of things that can go wrong with simulations. Here are some key questions that you need to ask to yourself:


- Are the inputs right? (e.g., phi in radians)
- Is this really a linear sea state or is nonlinearity playing a significant role?
- Where am I measuring close to the wave generation boundary or far away?
- Are waves breaking?

- Is wave reflection from the boundaries significant and may alter the results?
- What is the water depth regime? (e.g. in deep water conditions ER-AWA performance is better)
- Is the mesh good enough? Are cell sizes small enough? (e.g. performing grid convergence tests)


Best,


Pablo
Tianqi Ma and AUbuntu like this.
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   March 13, 2020, 09:16
Default
  #3
Member
 
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10
Lewis Liang is on a distinguished road
Quote:
Originally Posted by Phicau View Post
Hi Lewis,


there are lot of things that can go wrong with simulations. Here are some key questions that you need to ask to yourself:


- Are the inputs right? (e.g., phi in radians)
- Is this really a linear sea state or is nonlinearity playing a significant role?
- Where am I measuring close to the wave generation boundary or far away?
- Are waves breaking?

- Is wave reflection from the boundaries significant and may alter the results?
- What is the water depth regime? (e.g. in deep water conditions ER-AWA performance is better)
- Is the mesh good enough? Are cell sizes small enough? (e.g. performing grid convergence tests)


Best,


Pablo
Dear Pablo,

Thank you for your prompt suggestions. I'm sorry I didn't respond to you in time, because as soon as I saw your information, I modified my model (Hs=0.1m, Ts=1.2s, d=0.6m, JONSWAP spectrum including 100 wave components) based on your recommendation, and then the simulation took some time. Based on your suggestions in the previous post, here are my thoughts on each suggestion, and a new comparison between numerical and analytical results is shown:

- Are the inputs right? (e.g., phi in radians)
The random initial phase (phi) with radians unit is randomly distributed between (-pi, pi).
phi = 2*pi*(rand(1,length(F))-0.5), where F here is the wave frequency.

- Is this really a linear sea state or is nonlinearity playing a significant role?
For checking the effect of nonlinearity of sea state, another case run with second order irregular wave generation is provided for comparison.

- Where am I measuring close to the wave generation boundary or far away?
3 gauges are placed at 3m, 5m, and 10m in front of the inlet. As seen, the results at the first 2 locations overall agree with the analytical results. But the last one is not good, I think it should be due to the wave reflection, attenuation or breaking near region located in the middle of the wave flume.

- Is wave reflection from the boundaries significant and may alter the results?
The maximum wavelength among the 100 wave components is 3.7186m, and the entire length of the wave flume is 20m which is almost 6.5 times the L_max(3.7186m).On the other hand, the gauge used to sample eta is located at 3m which is far away from the outlet to avoid the wave reflection. Another two gauges will also set up to record the variation of free water surface.

- What is the water depth regime? (e.g. in deep water conditions ER-AWA performance is better)
The water depth is 0.6m. Based on the ration of d/L, 42 waves belong to intermediate water condition, while 38 waves belong to deep water condition. Since then, the original absorbing boundaries based on shallow water conditions have been less suitable in this case.

- Are waves breaking?
The criterion proposed by Miche (1951) is adopted: H_b≥0.142*L*tanh(2*pi*d/L). Thereafter, I found the wave heights which are used as input data for olaflow is much smaller than the critical weight height when breaking.

- Is the mesh good enough? Are cell sizes small enough? (e.g. performing grid convergence tests)
The mesh scheme is setup with delta x=0.02, delta z=0.01, which is same as the one in waveFlume tutorial case.

To summary, the comparison between the numerical results and analytical one overall agree well at the first two gauges. Except for the difference in the height of the water surface at some time points, the general phase difference can be matched. However, the comparison at the third gauge is not good, possibly due to the wave reflection from the outlet boundary. For eliminating this reflection effect, a new absorption boundary (deep water conditions ER-AWA) is required (I will check this later). For the effect of sea state nonlinearity the difference between the first order and second order is not obvious. In terms of wave breaking, the input Hw of each wave component is much smaller than the critical breaking one. Thereafter, I was wondering the difference of eta at gauge located at x=3m is resulting from the numerical attenuation of the free water surface or not?

Thanks for your time and attention!

Best regards,

Lewis
Attached Images
File Type: jpg comp3.jpg (109.0 KB, 114 views)
Lewis Liang is offline   Reply With Quote

Old   March 15, 2020, 16:03
Default
  #4
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Hi Lewis,


thanks for reporting back.


- My comment on nonlinearity playing a significant role was to highlight that if the case is very nonlinear you cannot longer assume that the evolution of the sea state is linear far away from the generation boundary, so the procedure of adding linear components to calculate the theoretical solution at a point might not be valid any more. Your new sea state conditions and results I think reflect on this, it is probably quite linear. Running second order generation will just generate the sub-harmonics resulting from component interactions but in the end NS equations are totally nonlinear.



- Your conditions are indeed in intermediate-deep waters, your reflections will decrease a lot and your results will be much better if you use ER-AWA ( see https://www.sciencedirect.com/scienc...41118719303566 ).



- While individual components can be small enough not to break when they combine into an irregular sea state some of them might. You just need to watch your simulation for breaking events. Nevertheless, in this case it seems that you might be OK (deep water conditions) except if you get very steep waves.


- Tthe mesh in the waveFlume tutorial case is just an example. Each time you start solving a new type of problem it is necessary to run a grid convergence analysis to check whether your mesh is adequate.


Best,


Pablo
Lewis Liang likes this.
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   March 18, 2020, 03:43
Default
  #5
Member
 
Lewis
Join Date: Jun 2016
Posts: 34
Rep Power: 10
Lewis Liang is on a distinguished road
Dear Pablo,

Thank you for your previous suggestions and patient answers.

A new case is set up for avoiding the appearance of wave nonlinear (Number of wave components, Ts) and wave breaking (Hs). In this case, wave properties: Hs=0.1m, Ts=10s, d=0.6m, M=11(totally 10 components), shallow water condition.

It can be seen that the comparison of the first two scales is now very good. There is no obvious difference in waveform changes, due to the number of irregular waves which equals only 10. Such a wave state is closer to a linear superposition, and the wave height superposition is unlikely to reach the breaking wave threshold. In terms of the third gauge, a better agreement is achieved as well due to the shallow water condition.

Next step, I will use ER-AWA boundary to double-check my first case as posted previously and Keep updating the results here soon. Thanks again for your time and help!

Cheers!

Lewis
Attached Images
File Type: jpg comp4.jpg (74.8 KB, 98 views)
Lewis Liang is offline   Reply With Quote

Old   March 18, 2020, 16:00
Default
  #6
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Location: Auckland
Posts: 627
Rep Power: 19
Phicau is on a distinguished road
Hi Lewis,
glad to see that you are getting a grip on it. ER-AWA will make a difference in your simulation.


If you cannot compare time series directly, due to nonlinearities and reflections playing an important role it might be useful to at least compare spectra if you run the simulation for long enough.


Best,
Pablo
__________________
Check out my new project: olaFlow --> The olaFlow Support Thread
Phicau is offline   Reply With Quote

Old   January 1, 2021, 06:14
Default
  #7
New Member
 
Join Date: Oct 2020
Posts: 2
Rep Power: 0
Wakatsuki is on a distinguished road
Hi Lewis,

I am also simulating a 2D irregular wave using olaflow, I have used the zero up crossing method to obtain the wave height and period from the wave gauge data which was gathered from physical modelling. I am wondering how did you achieve your wave phase data? You said the process was quite strightforward by using Stoke I theory. Can you explain a bit more expecially how did you obtain the time difference between waves as the equation for wave phase is (2pi*td)/T, where td is the time difference between waves and T is the wave period.
Wakatsuki is offline   Reply With Quote

Old   April 12, 2022, 08:19
Default How to calculate wave height from S(f) function
  #8
New Member
 
Tarek Hadj Hassen
Join Date: Apr 2022
Posts: 6
Rep Power: 4
Tarekhadj is on a distinguished road
Quote:
Originally Posted by Lewis Liang View Post
Dear Foamer,

I have a question about simulating a 2D irregular wave system by using olaflow. The wave period, wave height, and wave phase of singe wave are calculated under the Stokes I theory. The procedure is quite straightway, namely obtaining the wave height/wave period from S(f) function; calculating wave number (k) according to the dispersion relation. Although the k is not required to provide since it will calculate during simulation, the propose of this is to compare the results of free surface elevation between analytical one and the numerical one. Here, eta(x,t) = sum(H/2 * cos(k*x-2*pi*f*t + phi)). The comparison is attached below.

However, there is some obvious difference between those two results. Since the input data of Tw, Hw and phi are the same in olaflow solver and analytical function, namely the variation of eta vs time should be in accordance with each other. But haven’t found out the potential reason/error for this qualitative difference so far. Do I miss something? or Can anyone give some advice and help?

Best regards,

Lewis

Hi Lewis


Can you help me how to calculate wave height H[m] from the spectral density S(f)[m²s].

In fact, I have the function of S(f).


Best regard,
Tarek
Tarekhadj is offline   Reply With Quote

Old   August 27, 2023, 10:17
Default
  #9
New Member
 
Ali
Join Date: Dec 2016
Location: Hong Kong
Posts: 12
Rep Power: 9
abas.rahmani86 is on a distinguished road
Quote:
Originally Posted by Tarekhadj View Post
Hi Lewis


Can you help me how to calculate wave height H[m] from the spectral density S(f)[m²s].

In fact, I have the function of S(f).


Best regard,
Tarek
Hey Tarek,

You can find an m-file in my GitHub which generate waveDict for irregular wave in OlaFlow.
https://github.com/abasrahmani/OlaFl...arWaveDict.git

Best regards
Ali
abas.rahmani86 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
troublshooting 2D finite diff solution of pressure wave Fahraynk Main CFD Forum 5 October 17, 2019 15:37
Simulating numerical wave tank and calculating wave load on vertical cylinder Amit B FLUENT 0 July 27, 2019 10:56
[waves2Foam] NWT wave generation problem Alex song OpenFOAM Community Contributions 0 April 24, 2016 05:54
[waves2Foam] Wave Flume tutorial Dmitrjs OpenFOAM Community Contributions 5 July 23, 2014 09:15
Scaling up a wave energy converter - free surface flow mark_l CFX 3 February 17, 2010 17:57


All times are GMT -4. The time now is 00:39.