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

[waves2Foam] how to use wave2Foam simulate wave precisely

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 30, 2014, 04:10
Default how to use wave2Foam simulate wave precisely
  #1
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Dear Everyone.
I am now using wave2Foam with OpenFOAM 2.2.2. but I got errors for simulate second order stokes wave for shallow water case, I wish some one can help me.
I choose the domain as:
Code:
X in [0,62]
Y in [-0.5,6]
still water depth =0.5 //under  y=0.
mesh is selected as
Code:
dx=0.002  for X in [-0.08, 0.08] // so within the surface elevation region I have 40 mesh cells. actually I did mesh refinement study with refine rate 2, so I tried , 20, 10 cells. and estimate the uncertainty in L2 norm is 2.7% for 40 cells in this range

dy=0.05  // that means I have roughly 53 cells per wave length.
here is my wave Parameters
Code:
    waveType            stokesSecond;
    Tsoft               2;
    depth               0.5;
    period              1.44;
    direction           ( 1 0 0 );
    phi                 0;
    height              0.12;
    waveNumber          (2.34995 0 0);
    omega               4.36332;
    debug               true;
and so put the numerical paddle in the left boundary and numerical beach at right boundary. also I had two relaxation zone at both inlet and out let as following:
inlet relaxation zone:
Code:
    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           INLET;
        startX              ( 0 -3 0 );
        endX                ( 3.43 0.2 1 );
        orientation         ( 1 0 0 );
    }
out let relaxation zone:
Code:
    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           OUTLET;
        startX              ( 43.53 -3 0 );
        endX                ( 62 0.2 1 );
        orientation         ( 1 0 0 );
    }
the fvScheme file is set as :
Code:
ddtSchemes
{
    default backward;
}

gradSchemes
{
    default         Gauss linear;
    grad(U)         Gauss linear;
    grad(alpha1)    Gauss linear;
}

divSchemes
{
    div(rho*phi,U)  Gauss limitedLinearV 0.99;
 div(phi,U)   Gauss limitedLinearV 0.98;
    div(phi,alpha)   Gauss MUSCL;
    div(phirb,alpha) Gauss interfaceCompression;
     div(rho*phi,k)       Gauss limitedLinear 1;
    div(phi,k)       Gauss limitedLinear 1;
    div(rho*phi,epsilon)  Gauss limitedLinear 1;
    div(phi,epsilon) Gauss limitedLinear 1;
    div(phi,R)       Gauss limitedLinear 1;
    div(R)           Gauss linear;
    div(phi,nuTilda) Gauss limitedLinear 1;
    div((muEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p_rgh;
    pcorr;
    g
so in the attached pictures the blue one is simulation results at time 100 second and the green one from the analytical formula. I use sample tools in OpenFOAM to get the position where alpha1=0.5 in the space and plot it here. as you can see the wave is totally changed after it enter into the region.is it because of reflection wave of some numerical issue?

Thanks lot!

/Wei
Attached Images
File Type: jpg waveFoam.jpg (44.8 KB, 86 views)
waynezw0618 is offline   Reply With Quote

Old   October 30, 2014, 14:29
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,867
Rep Power: 33
ngj will become famous soon enoughngj will become famous soon enough
Good evening,

@Wayne: Try to switch to Euler. I do not have a good experience with higher order time stepping and VOF.

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.

Last edited by wyldckat; October 8, 2018 at 10:51. Reason: removed answer to another post that was on the main thread
ngj is offline   Reply With Quote

Old   October 31, 2014, 01:55
Default
  #3
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Niels
Thanks for replying so soon.
and I did the simulation again with the Euler scheme for time stepping. in my controlDict, I set Max Co=0.2, I observes that during the iteration, dt is roughly 0.004 s. here is the plot of time =18s. is it because of numerical dissipation?

Thanks
/Wei
Attached Images
File Type: jpg figure_2.jpg (37.3 KB, 55 views)

Last edited by wyldckat; October 8, 2018 at 10:51. Reason: removed quote, since the post is now right above it on the new thread
waynezw0618 is offline   Reply With Quote

Old   October 31, 2014, 07:59
Default
  #4
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Again here is the comparison of two different time schemes at T=18s( so there is no reflection of the wave)
from this we can see even in the relaxation zone near inlet part, the wave are different. one lead to the growth of amptitute the other in the opposite direction. but. both has the same distortion of wave in the wave length direction.

Quote:
Originally Posted by waynezw0618 View Post
Hi Niels
Thanks for replying so soon.
and I did the simulation again with the Euler scheme for time stepping. in my controlDict, I set Max Co=0.2, I observes that during the iteration, dt is roughly 0.004 s. here is the plot of time =18s. is it because of numerical dissipation?

Thanks
/Wei
Attached Images
File Type: jpg figure_2.jpg (37.6 KB, 62 views)
waynezw0618 is offline   Reply With Quote

Old   October 31, 2014, 09:18
Default PostprocessingWaves2foam
  #5
New Member
 
frederik stoll
Join Date: Aug 2014
Location: Hannover
Posts: 3
Rep Power: 8
frederik is on a distinguished road
p { margin-bottom: 0.25cm; line-height: 120%; } Dear Niels,


i am using waveFoam, too. Thank you very much for this tool.


My Masterthesis is about sedimenttransport around structures due to wave/current interaction.
At the moment i am working at a Reflexion analyses, to check, which dimensions of the Inlet/Outlet zone are the best to minimise or even avoid reflections.


Unfortunately i do not understand how to use your reflectionAnalyses2DFFT.


May you explain this to me?




The waveflume:


x-length: 25 m; 0-5: Inletzone; 20-25: Outletzone
y-width: 0.25m
z-depth: 0.75m waterdepth; 0.3 m air


The cellsize is 3.5cm/0.5cm/1cm


I used Stokes II for wavegeneration


waveheight = 0,125 m
wavelength = 4,74 m
period = 2 sec


I installed 150 wavegauges, with a distance of 0.161 m. The first gauge is located at 0.5m(close to the inlet) the last one at 24.5 m (close to the outlet)


The surface elevation ist sampeld with 100Hz.
The simulation timestep is about delta_t = 0.004 sec.


The surfaceelevation fits the theory very well. This is all fine.




I will attach you the postprocessingProperties and the results of the reflectionAnalyses2DFFT.
How to choose the gauges I want to use for the reflectionanalyses ist not obvious to me. Furthermore I do not understand what kind of data is written into the files surfaceElevation_0_rightGoing_spectrum.


Any help will be great.




Best regards


frederik
frederik is offline   Reply With Quote

Old   October 31, 2014, 10:38
Default
  #6
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi frederik:
can you show us the surface elevation plot?

Last edited by wyldckat; October 7, 2018 at 14:59. Reason: removed large quote, since the post is now right above it on the new thread
waynezw0618 is offline   Reply With Quote

Old   November 1, 2014, 06:27
Default
  #7
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,867
Rep Power: 33
ngj will become famous soon enoughngj will become famous soon enough
Good morning,

Yes, the indices defined in postProcessingWaves are those indices in the input stream to be used in any given analysis, e.g. reflection analysis or the computation of power spectra. A match between location and index can be obtained, if you start with using the action: writeIndexLocation.

Since you are using a regular wave (StokesSecond), I would suggest that you use the least squares reflection analysis tool. This is described in our paper Jacobsen et al. (2012) in the appendix. The frequency bins for the FFT-reflection analysis is due to the spectral averaging procedure that is employed for reflectionAnalysis2DFFT, i.e. a certain part of the time series is used for the reflection analysis, the time series is shifted (windowShiftFraction), and the reflection analysis is conducted again, etc. The average of all incident and reflected spectra are then outputted. Unfortunately, I do not have any reference for this, but the decomposition of the spectra follows Zelt and Skjelbreia (https://journals.tdl.org/icce/index....icle/view/4736).

Furthermore, could I please ask you to assist Wayne, as you seem to have succeeded in what he is having problems with.

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   November 1, 2014, 06:59
Default
  #8
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hello Niels:
thanks a lot! besides, Do you have any benchmark case for testing the solver . I went through this thread, I saw two test for pure shallow water flume, which could be a good start point. but one of them only use 1 cells for wave height, which is not reasonable. the other in the #57, It already shows distortion of wave propagation for second order stokes wave propagating in a shallow water flume. besides even for that test case, there are only 3-4 wave in between the inlet and outlet relaxation zone. may not be enough.

I appreciate if any of you can help me figure out how to predict the wave in shallow water flume precisely.

/Wei


Quote:
Originally Posted by ngj View Post
Good morning,

Yes, the indices defined in postProcessingWaves are those indices in the input stream to be used in any given analysis, e.g. reflection analysis or the computation of power spectra. A match between location and index can be obtained, if you start with using the action: writeIndexLocation.

Since you are using a regular wave (StokesSecond), I would suggest that you use the least squares reflection analysis tool. This is described in our paper Jacobsen et al. (2012) in the appendix. The frequency bins for the FFT-reflection analysis is due to the spectral averaging procedure that is employed for reflectionAnalysis2DFFT, i.e. a certain part of the time series is used for the reflection analysis, the time series is shifted (windowShiftFraction), and the reflection analysis is conducted again, etc. The average of all incident and reflected spectra are then outputted. Unfortunately, I do not have any reference for this, but the decomposition of the spectra follows Zelt and Skjelbreia (https://journals.tdl.org/icce/index....icle/view/4736).

Furthermore, could I please ask you to assist Wayne, as you seem to have succeeded in what he is having problems with.

Kind regards,

Niels
waynezw0618 is offline   Reply With Quote

Old   November 1, 2014, 14:47
Default
  #9
New Member
 
frederik stoll
Join Date: Aug 2014
Location: Hannover
Posts: 3
Rep Power: 8
frederik is on a distinguished road
Hello,

thank you very much Niels.

Wei, you will find a plot attached. If you have any questions, don't hesitate to ask me. It will be a great pleasure for me to help you.

A remark: as you can see the static-water-level is at 0.01 m. This is because i set the waterlevel in the waveproperties.input file to 0.01. In result the waterlevel is 0.76 m.
I did concern this when i computed Stokes II.

best
frederik
Attached Images
File Type: jpg Elevation_over_time.jpg (31.2 KB, 135 views)
frederik is offline   Reply With Quote

Old   November 1, 2014, 23:39
Default
  #10
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hello Frederick
thanks! your results looks really good and encouraging.

would you please use sample utility in OpenFOAM to plot out the surface elevation at one certain time and show me you velocity plot in your numerical flume?

here are the setup and results I tried to repeat what you have done

geometry and mesh parameters:
Code:
Lx=25m, Ly=0.75m(water)+0.3m(air), Lz=0.1m(2D, 1 cell with two empty bc)
Nx=715, Ny=105
dx=3.5cm, dy=1cm
dt=0.004s
waveProperties:
Code:
seaLevel            0;

relaxationNames     ( inlet outlet );

initializationName  outlet;

inletCoeffs
{
    waveType            stokesSecond;
    Tsoft               2;
    depth               0.75;
    period              2;
    direction           ( 1 0 0 );
    phi                 0;
    height              0.125;
    waveNumber          (1.32539 0 0);
    omega               3.14159;
    debug               true;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           INLET;
        startX              ( 0 0 -1 );
        endX                ( 5 0 1 );
        orientation         ( 1 0 0 );
    }
}

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

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           OUTLET;
        startX              ( 20 0 -1 );
        endX                ( 25 0 1 );
        orientation         ( 1 0 0 );
    }
}
I enclose my simulation results at t=18 seconds in the attachment. still you can see the discrepancy between simulation and analytical simulation. the two plots are time history of surface elevation at X=12.4195(the 74th Probes, is almost middle between two relaxation zone) and surface elevation at t=18 second in the whole flume.

I think it is a bit tricky to look at the time history since the discrepancy is fixed. while at surface elevation at whole flume show an "advection" effect of discrepancy to the downstream and for you case the wave length is around 4.5 meters, so roughly 3 waves are freely developed in the numerical wave flume,which may not enough to show the how does discrepancy evolve.
figure_1.jpg

figure_2.jpg

here also I put my parameters with the same case, say
geometry and mesh parameters of mine:
Code:
Lx=46m, Ly=0.5m(water)+0.2m(air), Lz=0.1m(2D, 1 cell with two empty bc)
Nx=2300, Ny=105
dx=2cm,dy=0.67 cm
N_waveLength=134, N_waveHeight=18 (a bit smaller, but from the results seems not affect the wave height)


waveProperties of mine:

Code:
seaLevel            0;

relaxationNames     ( inlet outlet );

initializationName  outlet;

inletCoeffs
{
    waveType            stokesSecond;
    Tsoft               2;
    depth               0.5;
    period              1.44;
    direction           ( 1 0 0 );
    phi                 0;
    height              0.12;
    waveNumber          (2.34995 0 0);
    omega               4.36332;
    debug               true;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           INLET;
        startX              ( 0 0 -1 );
        endX                ( 3 0 1 );
        orientation         ( 1 0 0 );
    }
}

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

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape     Rectangular;
        beachType           Empty;
        relaxType           OUTLET;
        startX              ( 43.55 0 -1 );
        endX                ( 46 0 1 );
        orientation         ( 1 0 0 );
    }
}
my results is surface elevation at time t=18 second in the third picture. and I have roughly 1 wave length in the front relaxation zone. so you can see after 2 waves the discrepancy is clearly.

figure_3.jpg

/Wei


Quote:
Originally Posted by frederik View Post
Hello,

thank you very much Niels.

Wei, you will find a plot attached. If you have any questions, don't hesitate to ask me. It will be a great pleasure for me to help you.

A remark: as you can see the static-water-level is at 0.01 m. This is because i set the waterlevel in the waveproperties.input file to 0.01. In result the waterlevel is 0.76 m.
I did concern this when i computed Stokes II.

best
frederik

Last edited by waynezw0618; November 2, 2014 at 08:38.
waynezw0618 is offline   Reply With Quote

Old   November 3, 2014, 04:54
Default
  #11
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 14
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Niels:
it is suggested to turn off hot start parameter Tsoft for regular wave? I am using it now, seems first several wave are relative to those then it may not follow the dispersion relation. so once these first several waves enter into the domain, they will be modulated. The energy are not balanced within these waves and remain in the flume. could it be due to this?

/Wei

Last edited by waynezw0618; November 3, 2014 at 06:42.
waynezw0618 is offline   Reply With Quote

Old   April 29, 2015, 10:01
Default
  #12
giu
New Member
 
Julietta
Join Date: Nov 2014
Posts: 3
Rep Power: 8
giu is on a distinguished road
Quote:
Originally Posted by frederik View Post
Hello,

thank you very much Niels.

Wei, you will find a plot attached. If you have any questions, don't hesitate to ask me. It will be a great pleasure for me to help you.

A remark: as you can see the static-water-level is at 0.01 m. This is because i set the waterlevel in the waveproperties.input file to 0.01. In result the waterlevel is 0.76 m.
I did concern this when i computed Stokes II.

best
frederik
Hey Frederik,

would it be possible to have a look at your fvSolution and fvSchemes files? I am also simulating waves but they don't quite match the theory yet as yours do... And I am lost in trying which parameters are having an influence on the wave quality.

Your help will be greatly appreciated.
Thanks, Julietta
giu is offline   Reply With Quote

Old   May 1, 2015, 01:00
Default
  #13
New Member
 
Pablo Montalvo
Join Date: Feb 2015
Location: Taiwan
Posts: 9
Rep Power: 7
Olbap is on a distinguished road
Hello Julietta,
In what way the input doesn't match the output? Are you using the wave theories in waves2Foam or making a new one? I used the stokes second order at first and modified it, and noticed that the wave height did not match what I asked.
I had to fiddle around the fv files quite a lot to improve the result. Changed the smoother, added relaxation factors, changed laplacian schemes. It is better but not perfect, I simulate waves in extreme conditions so I guess I have to tailor it. Still, Frederik, I am also interested in your answer!
Olbap is offline   Reply With Quote

Old   May 6, 2015, 10:28
Default
  #14
giu
New Member
 
Julietta
Join Date: Nov 2014
Posts: 3
Rep Power: 8
giu is on a distinguished road
Quote:
Originally Posted by Olbap View Post
Hello Julietta,
In what way the input doesn't match the output? Are you using the wave theories in waves2Foam or making a new one? I used the stokes second order at first and modified it, and noticed that the wave height did not match what I asked.
I had to fiddle around the fv files quite a lot to improve the result. Changed the smoother, added relaxation factors, changed laplacian schemes. It is better but not perfect, I simulate waves in extreme conditions so I guess I have to tailor it. Still, Frederik, I am also interested in your answer!
Hey Pablo,
I am using StokesI theory from the waves2Foam toolbox. Some plots of my result are attached.

My inlet relaxation zone is 1 wave length (all the negative part) and the outlet relaxation zone is 0.5 wave length
wave height: 0.55m
wave length: 13.8m
cells per wave height: 9
cells per wave length: 72

As I said, I have been playing around, but can't really get closer.

Would you think that a finer grid might reduce the dissipation of the waves?
Any idea why the waves are being 'streched' over the length of the tank?

Thanks for your help!
Attached Images
File Type: jpg surfaceElevationInSpace.25.jpg (29.4 KB, 49 views)
File Type: jpg surfaceElevationInSpace.35.jpg (29.2 KB, 42 views)
File Type: jpg surfaceElevationInTime.15.jpg (36.6 KB, 38 views)
giu is offline   Reply With Quote

Old   May 11, 2015, 22:44
Default
  #15
New Member
 
Pablo Montalvo
Join Date: Feb 2015
Location: Taiwan
Posts: 9
Rep Power: 7
Olbap is on a distinguished road
@giu I have no idea why the waves do that, there is indeed some dissipation. Have you tried with a very low steepness? In your case say, same wavelength, wave height < 0.25? For the grid, I am not sure, your parameters do not indicate a coarse grid. I would look further into the fvSolution/fvScheme files and maybe use higher-order schemes. That's all I can say from my experience.

Last edited by wyldckat; October 7, 2018 at 14:59. Reason: removed answer to another post that was on the main thread
Olbap is offline   Reply With Quote

Old   May 13, 2015, 05:44
Default
  #16
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Deltares, Delft, The Netherlands
Posts: 1,867
Rep Power: 33
ngj will become famous soon enoughngj will become famous soon enough
Good morning,

@Giu: Please consider, whether first order Stokes is even valid in your case. It is the common error that other users commit.

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.

Last edited by wyldckat; October 7, 2018 at 14:59. Reason: removed answer to another post that was on the main thread
ngj is offline   Reply With Quote

Old   May 24, 2015, 11:21
Default
  #17
Member
 
Ali
Join Date: Oct 2013
Location: St John's Canada
Posts: 31
Rep Power: 9
ashim is on a distinguished road
Hi Julietta,

I am also using waves2Foam to simulate different wave height of different frequency. I have the same problem as you, I could not get a satisfactory wave profile for single .I couldn't figure out my mistake in script file. If you don't mind, can you share your experience?

Ali
ashim is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[waves2Foam] Waves2Foam Related Topics ngj OpenFOAM Community Contributions 660 August 20, 2018 13:39
detonation wave simulation Krish FLUENT 15 February 7, 2017 13:38
WAVE TANK star-ccm+ . wave height dampens. WHY? muhsin STAR-CCM+ 3 October 9, 2012 14:24
Pressure for wave height in an Water Wave Tank Cluain CFX 5 July 11, 2012 10:50
active wave absorb(about wave tank) zhaochuangang ANSYS 0 September 22, 2010 03:29


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