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

[waves2Foam] Verification against linear waves

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2013, 11:05
Default Verification against linear waves
  #1
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Hi Niels,

Thanks for your effort in developing the wave2Foam toolbox.
I'm new to OPENFOAM and wave2Foam (start using if two weeks ago). Luckily, I managed to get things up and running.
I want to assess the accuracy of wave2Foam for the stokesFirst case. Using really low wave steepness in intermediate water, I tried running the waveFlume tutorial. The phasing matches well with linear potential waves theory but the amplitude got shifted upward making it slightly larger than that of analytical solution. I tried using mesh twice denser but still got the same result.

WAVE PARAMETER USED
WaveType = stokesFirst
Depth, d = 0.4 m
Period, T = 2 s
Height, H = 0.01 m
WaveNumber, k = 1.70048
Omega, w = 3.14159

CORRESPONDING WAVE PROPERTIES
Wave amplitude, a = 0.005 m
Wave steepness, ak = 0.0085
Dispersion parameter, kd = 0.68

DOMAIN AND MESH PARAMETERS
Domain length = 18 m
Domain height = 0.6 m
Horizontal cell = 360
Vertical cell = 60
Delta x = 0.05 m
Delta y = 0.01 m

ANALYTICAL SOLUTION FOR LINEAR WATER WAVES (FREE SURFACE)
ZetaAnalytical = a * cos ( k*x - omega*t )

RESULTS
Phasing error ~ 0 %
Amplitude error ~ 4 %

Is there anything that I should tweak in order to get more accurate result?
Does viscosity and density between the water and air affect the result?



Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   August 28, 2013, 12:56
Default
  #2
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
Hello Katakgoreng,

Have you tried comparing your solution with second order Stokes? From my quick look into second order Stokes, then the second order amplitude is 2.7% of the first order amplitude for your conditions, so 4% off is not that bad

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 28, 2013, 13:36
Default
  #3
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hello Katakgoreng,

Have you tried comparing your solution with second order Stokes? From my quick look into second order Stokes, then the second order amplitude is 2.7% of the first order amplitude for your conditions, so 4% off is not that bad

Kind regards,

Niels
Hi Niels,

Thank you for your suggestion.
Comparison with second order Stokes yield much better result.
With maximum amplitude error of 1.4 %.
Will try another case.



Kind regards,
katakgoreng

Last edited by katakgoreng; August 28, 2013 at 13:41. Reason: legend for figure
katakgoreng is offline   Reply With Quote

Old   August 28, 2013, 18:25
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
Considering the fact that you only have 1 cell over the wave height, the result is really, really good!

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 30, 2013, 07:29
Default
  #5
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Hi Niels,

(# UPDATE : I MADE MISTAKES IN THIS SIMULATION. I INCREASE THE WATER DEPTH IN THE "waveProperties" FILE BUT I DON'T CHANGE THE SIZE OF THE DOMAIN. THANKS NIELS FOR POINTING THINGS OUT..)

After the success of running intermediate water waves, I tried running wave2Foam for deep water waves. It seems like for deep water, the dispersion is not properly resolved resulting in slower wave propagation (compared to Stokes 2nd Order). Furthermore, the maximum amplitude is damped a bit after propagate from the inlet and stays constant until the end. Below are the wave parameters that I used:

DOMAIN AND MESH PARAMETERS FOR BOTH CASES
Domain length = 18 m
Domain height = 0.6 m
Horizontal cell = 360
Vertical cell = 60
Delta x = 0.05 m
Delta y = 0.01 m

INTERMEDIATE WATER WAVE PROPERTIES
Water depth, d : 0.4
Wave period, T : 2
Wave height, H : 0.01
Wave number, k : 1.7005
Wave amplitude, a : 0.005
Wave frequency, omega : 3.1416
Wave steepness, ak : 0.0085024
Dispersion, kd : 0.68019



DEEP WATER WAVE PROPERTIES
Water depth, d : 3.1416
Wave period, T : 2
Wave height, H : 0.01
Wave number, k : 1.0096
Wave amplitude, a : 0.005
Wave frequency, omega : 3.1416
Wave steepness, ak : 0.0050481
Dispersion, kd : 3.1718



Note : Dash line (wave2Foam), solid line (Stokes 2nd Order)

Have you run parametric study on the range of validity of wave2Foam in terms of wave steepness as well as degree of dispersion?

Kind regards,
katakgoreng

Last edited by katakgoreng; August 30, 2013 at 11:08. Reason: figure labeling, mesh information
katakgoreng is offline   Reply With Quote

Old   August 30, 2013, 08:02
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,

It really looks strange. Good you upload the deep water case here, and I will try to have a look at it tonight.

The only thing, which I can think of: You have also increased the size of the computational domain, correct? Because it looks like the wave have the similar attributes as for the intermediate water depth. If not, then the model merely make the wave fit the water depth in the computational domain.

Kind regards

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 30, 2013, 09:59
Default
  #7
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi,

It really looks strange. Good you upload the deep water case here, and I will try to have a look at it tonight.

The only thing, which I can think of: You have also increased the size of the computational domain, correct? Because it looks like the wave have the similar attributes as for the intermediate water depth. If not, then the model merely make the wave fit the water depth in the computational domain.

Kind regards

Niels
Hi Niels,

I use the the same domain and mesh properties for both cases.

For the deep water case, I:
1. Change the water depth for the deep water case in "waveProperties.input"
2. Run "setWaveParameters" and obtain the wave properties.
3. Run wave2Foam ("./Allrun")
4. Verify with 2nd order Stokes

The wave number, k for both cases are different. However, when I do the verification, the analytical 2nd order Stokes uses values from each individual cases.

I have write a matlab code that
1. Extract the wave properties from "waveProperties" file
2. Extract free surface elevation from "surfaceElevation.dat"
3. Compare with 2nd Order Stokes
4. Produce gif animation

The code is attached with this post.
* If anyone interested to use the code, just copy the "Matlab" folder into "waveFlume" folder.

Kind regards,
katakgoreng
Attached Files
File Type: zip comparisonMatlab.zip (2.6 KB, 116 views)

Last edited by katakgoreng; August 30, 2013 at 10:14. Reason: word mistakes
katakgoreng is offline   Reply With Quote

Old   August 30, 2013, 10:02
Default
  #8
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
The problem then is that the actual water depth is still 0.4 m, because the bottom is placed at this level. Therefore, the interior part of the computational domain will act accordingly, and that is why your comparison is as bad as it is.

Create a new mesh with the correct water depth, and I can assure you that the results will be substantially better.

Kind regards

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 30, 2013, 10:48
Default
  #9
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
The problem then is that the actual water depth is still 0.4 m, because the bottom is placed at this level. Therefore, the interior part of the computational domain will act accordingly, and that is why your comparison is as bad as it is.

Create a new mesh with the correct water depth, and I can assure you that the results will be substantially better.

Kind regards

Niels
Hi Niels,

Owh. My bad. I totally missed that one. I should change the domain of the problem to reflect the increase in the water depth. That's why the simulation gave weird result.
So :
1. Increase water depth, d
2. Change the domain to reflect the increase in water depth (this is extremely important)
3. Change the vertical mesh resolution
4. Run wave2Foam

I will report back as soon as I get the result. Thanks Niels.


Kind regards,
katakgoreng

( # UPDATE )

Managed to get the deep water wave propagation right this time. Phase and amplitude shows good agreement with Stokes 2nd order. Although it seems that I should make the domain much longer to avoid wave reflection from polluting the solution.



Note : Dashed line (wave2Foam), solid line (Stokes 2nd order)

Last edited by katakgoreng; August 30, 2013 at 12:50. Reason: word mistakes, add verification figure
katakgoreng is offline   Reply With Quote

Old   August 30, 2013, 15:50
Default
  #10
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
Thank you very much, Katakgoreng, for the disclaimer in your edited post.

Have a nice weekend.

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   September 9, 2013, 14:43
Default
  #11
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Hi Niels,

I have tested wave2foam for regular waves and so far the results is quite accurate (provided that I have enough mesh in the viscinity of the free surface).
I'm interested to try the irregular waves function (JONSWAP).
I have specify the JONSWAP spectrum in "waveProperties.input" as follows:

waveType : irregular;
spectrum : JONSWAP;
N : 151;
Tsoft : 3;
writeSpectrum : false;
Hs : 0.046;
Tp : 1.2;
gamma : 2.5;
depth : 0.7;
direction : ( 1 0 0 );

There is no information for the focusing time and location so I assume that the focused wave occur at xf = 0 and tf = 0, where (xf is the focusing location and tf is the focusing time). Is there any way that I could change the focusing location and time to a specified values?

Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   September 9, 2013, 15:05
Default
  #12
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
Good evening Katakgoreng,

I am glad to hear that you are so far happy with the results. The irregular wave is exactly an irregular wave train, so the phasing is set to a random value, i.e. there is not any focusing time/location as an option. To achieve this, it will require some implementation.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   September 9, 2013, 15:48
Default
  #13
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Good evening Katakgoreng,

I am glad to hear that you are so far happy with the results. The irregular wave is exactly an irregular wave train, so the phasing is set to a random value, i.e. there is not any focusing time/location as an option. To achieve this, it will require some implementation.

Kind regards,

Niels
Hi Niels,

Thank you for your clarification. I noticed when I run "setWaveParameters", in "waveProperties", sets of values (from the JONSWAP spectrum) are generated:

(a) amplitude
(b) frequency
(c) phaselag
(d) waveNumber

amplitude, frequency and wavenumber are typical values corresponding to the JONSWAP spectrum.

Would you mind clarifying what "phaselag" is?
Is this what you mean by random phasing?
Is "phaselag" equal to "phi" as in regular wave theory?

Kind regards,
katakgoreng
katakgoreng is offline   Reply With Quote

Old   September 9, 2013, 16:29
Default
  #14
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
Yes, phaselag is the same as phi in the regular wave theories. Sorry for the inconsistency in naming. Also, phaselag is the random variable.

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   September 10, 2013, 09:29
Default
  #15
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Yes, phaselag is the same as phi in the regular wave theories. Sorry for the inconsistency in naming. Also, phaselag is the random variable.

Kind regards,

Niels
Hi Niels,

So I guess, I could calculate the phaselag for every waves so that they coincide at the focusing time and location that I want. Will try it. Thanks Niels.

Kind regards,
katakgoreng

# UPDATE

I managed to get the waves to focused based on focusing time and location that I prescribed. I do this by calculating the phase-lag of each individual waves so that they coincide at the prescribed values.
So the formula that I used for calculating phase-lag is as follows:
phi = k * xf - omega * tf
where
phi = individual phase-lag
k = individual waves number
omega = individual waves angular frequency given by 2*pi*f
f = individual waves frequency
xf = focusing location
tf = focusing time
I replace the calculated phase-lag from "setWaveParameter" with the new phase-lag.

The result shows excellent agreement with linear random wave theory.
BTW, this is TopHat spectrum (same amplitude for each individual waves, again I replace the value generated from "setWaveParameter")
The focusing location, xf = 8 m from inlet whilst focusing time, tf = 32 s.
Maximum amplitude error is 1.5%.
The trough before and after the focused event is slightly under-predicted whilst the focused location drifted just abit due to either non-linear effect or inadequate mesh resolution in the vertical and horizontal direction.



The legend supposed to be "waves2Foam"..sorry about that..

# UPDATE 2

Focused waves for JONSWAP spectrum at xf = 8m and tf = 32s.
The mesh used is the same as in TopHat spectrum. It is pretty evidence that the mesh is under-resolved as the short waves riding on longer waves is not being resolved properly, resulting in decreasing in maximum focused amplitude. Using denser mesh could result in much better result.


Last edited by katakgoreng; September 11, 2013 at 11:33. Reason: Result update
katakgoreng is offline   Reply With Quote

Old   September 14, 2013, 04:58
Default
  #16
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 Katakgoreng,

Thanks for the updates. I would say that the results do look pretty nice, and I am happy to see the predictive capabilities validated.

Just out of curiosity, have you constructed the wave components inside or outside setWaveParameters? If still outside, then I do have some ideas on how to make it all work with as little work as possible. Essentially, if you post the code, which you use for creating the phases, i.e. required information from the user and the exact computation of the phases, then I could probably put it into waves2Foam during this weekend.

Please, also add the waveProperties- and waveProperties.input-files for JONSWAP, such that I can compare the created files.

Kind regards

Niels

EDIT: Sorry, after carefully reading your post from above, I can see that the equations are already there. I will make sure that it get integrated in the setWaveProperties.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.

Last edited by ngj; September 14, 2013 at 19:25.
ngj is offline   Reply With Quote

Old   September 15, 2013, 03:50
Default
  #17
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
Good morning,

This morning I have added the option of focusing an incident irregular wave train in a given time and a given location as inspired by Katakgoreng. For the control, please see

http://openfoamwiki.net/index.php/Co...ar_wave_theory

If you are using standard random phasing of the incident irregular waves, then you do not have to do anything, but a slight increase in control is added through a manual choice of seeding for the random number generator.

Kind regards

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   September 16, 2013, 06:08
Default
  #18
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Hi Niels,

Sorry for not replying your previous post abit earlier. I haven't been online on the weekend.
The latest addition is pretty neat. No need to calculate the phaselag outside "setWaveParameters".

I have updated svn and recompile wave2Foam.
I have the following in "waveProperties.input"

phaseMethod focusingPhase;
focusTime 32;
focusPoint (8 0 0);


I have the following bug (not quite sure if its on my computer only) :

Bug 1:

When I run "setWaveParameters", I got

keyword equidistantFrequencyAxis is undefined in dictionary ...

I then add "equidistantFrequencyAxis" into the "waveProperties.input" and set the value to 1. The error then goes away. Is this new additional control that you add for irregular wave theory as I can't seem to find it ever mentioned in

http://openfoamwiki.net/index.php/Co...ar_wave_theory

Bug 2:

I have the following in "waveProperties.input".

outletCoeffs
{
waveType potentialCurrent;
U ( 0 0 0 );
Tsoft 2;

relaxationZone
{
relaxationScheme Spatial;
relaxationShape Rectangular;
beachType Empty;
relaxType OUTLET;
startX (15 0.0 -1);
endX (20 0.0 1);
orientation (1.0 0.0 0.0);
}
}


When I run "setWaveParameters", the "outletCoeffs" is not written in "waveProperties" file.

Do you experience similar problem or is it just on my system?

Kind regards,
katakgoreng

# UPDATE :

Thanks Niels for pointing things out.
Bug 1 : Not a bug, additional control added by Niels.
Bug 2 : Not a bug, using file provided by Niels, the code run just fine. It could be that I made some typo error in the input file.

Last edited by katakgoreng; September 17, 2013 at 05:58.
katakgoreng is offline   Reply With Quote

Old   September 16, 2013, 11:59
Default
  #19
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,

With respect to "bug 1", then it is not a bug, but a new feature for increased control of the irregular wave spectrum. I have also added the option of user-defined frequency cut-offs. The description has now been updated on the wiki.

With respect to "bug 2", then I do not experience those type of problems. I made a quick test on the attached waveProperties.input file. This test, however, made me realise that not all the new information on phasing, etc, is carried along in the writing process. This does not have any consequence for the results, as they are purely pre-processing parameters, but they would be nice to have for future reference. This will be added in a future revision.

Kind regards,

Niels

P.S. I was not allowed to upload files called *.input, so merely rename.
Attached Files
File Type: txt waveProperties.txt (1.8 KB, 124 views)
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   September 17, 2013, 06:14
Default
  #20
Member
 
Join Date: Dec 2009
Posts: 49
Rep Power: 16
katakgoreng is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi,

With respect to "bug 1", then it is not a bug, but a new feature for increased control of the irregular wave spectrum. I have also added the option of user-defined frequency cut-offs. The description has now been updated on the wiki.

With respect to "bug 2", then I do not experience those type of problems. I made a quick test on the attached waveProperties.input file. This test, however, made me realise that not all the new information on phasing, etc, is carried along in the writing process. This does not have any consequence for the results, as they are purely pre-processing parameters, but they would be nice to have for future reference. This will be added in a future revision.

Kind regards,

Niels

P.S. I was not allowed to upload files called *.input, so merely rename.
Hi Niels,

Thanks. Both are not bugs. Using the file that you provided, I managed to get the waveProperties just fine.

Currently, I'm running quite an extensive simulation. I'm interested in the post-processing result given by waves2Foam such as the free surface elevation. If I stop the simulation, how can I continue from the latestTime and concatenated the result into "surfaceElevation.dat" file?

Kind regards,
katakgoreng
katakgoreng 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
2nd Order Convergence Problem for 3D Airfoil turkmengokce OpenFOAM Running, Solving & CFD 1 September 10, 2015 07:20
A turbulent test case for rhoCentralFoam immortality OpenFOAM Running, Solving & CFD 13 April 20, 2014 06:32
suitable boundary condition for scavenging process? immortality OpenFOAM Running, Solving & CFD 3 January 25, 2013 19:10
how to modify fvScheme to converge? immortality OpenFOAM Running, Solving & CFD 15 January 16, 2013 13:06
solution diverges when linear upwind interpolation scheme is used subash OpenFOAM 0 May 29, 2010 01:23


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