LHEEA / HOS-ocean

This project has migrated to GitLab: https://gitlab.com/lheea/HOS-Ocean
https://gitlab.com/lheea/HOS-Ocean
GNU General Public License v3.0
72 stars 35 forks source link

Resulting Hs for 2D simulations #28

Closed lucas-carmo closed 7 months ago

lucas-carmo commented 7 months ago

Dear all,

I am learning HOS-Ocean and I am trying to reproduce the results from Ducrozet et al, 2007. However, while comparing the results of 2D simulations, I noticed that the significant wave height of my outputs is not what I expected in dimensional terms.

I did some simple tests with i_case=3, Tp=9.5s, Hs=1m, and nx=512. The figure below shows the results I get for the first time step. I am requesting dimensional outputs (i_out_dim=1) and I am computing the significant height as $Hs = 4\sqrt{\sigma}$, where $\sigma$ is the standard deviation of the wave elevation. As shown in the legend of the figure, I only get the specified Hs when M=1. Nonetheless, the outputs that HOS-Ocean writes to the terminal say that $Hs=1m$ regardless of the value of M I used.

image

I do not have this problem with 3D simulations, though: image

My question is whether I am missing something when dealing with 2D simulations. Perhaps there is an extra postprocessing step that I should do?

Thank you, Lucas

gducrozet commented 7 months ago

Hello @lucas-carmo Could you send the input file used for the 2D simulations?

lucas-carmo commented 7 months ago

Hello @gducrozet

Sure. I used the following:

Restart previous computation :: i_restart        :: 0
Choice of computed case      :: i_case           :: 3
--- Geometry of the horizontal domain
Length in x-direction        :: xlen             :: 82.
Length in y-direction        :: ylen             :: 1.
--- Time stuff
Duration of the simulation   :: T_stop           :: 1000.
Sampling frequency (output)  :: f_out            :: 5.
Tolerance of RK scheme       :: toler            :: 1.0e-9
Dommermuth initialisation    :: n                :: 4
Dommermuth initialisation    :: Ta               :: 10.
--- Physical dimensional parameters
Gravity                      :: grav             :: 9.81
Water depth                  :: depth            :: -1. 
--- Irregular waves (i_case=3)
Peak period in s             :: Tp_real          :: 9.5
Significant wave height in m :: Hs_real          :: 1.0
JONSWAP Spectrum             :: gamma            :: 3.3
Directionality (Dysthe)      :: beta             :: 0.7
Random phases generation     :: random_phases    :: 1
--- Output files
Tecplot version              :: tecplot          :: 11
Output: 1-dim. ; 0-nondim.   :: i_out_dim        :: 1
3d free surface quantities   :: i_3d             :: 1
3d modes                     :: i_a_3d           :: 1
2d free surface, center line :: i_2d             :: 1
Wave probes in domain        :: i_prob           :: 0
Swense output 1='yes',0='no' :: i_sw             :: 1

Thank you!

gducrozet commented 7 months ago

Sorry, forgot to ask the content of the file variables_3D.f90 also.

lucas-carmo commented 7 months ago

Sure! I changed the extension because GitHub doesn't like f90: variables_3D.txt

For quicker reference, these are the values I used:

! Number of modes
INTEGER, PARAMETER :: n1 = 512
INTEGER, PARAMETER :: n2 = 1
! Array size
INTEGER, PARAMETER :: m1 = n1
INTEGER, PARAMETER :: m2 = n2
! HOS nonlinearity order
INTEGER, PARAMETER :: M = 4 ! Changed this to other values, as specified in the legend of the figures of my previous comment
gducrozet commented 7 months ago

OK, I think I know what is the issue, for 2D simulations, you should choose p2=1 in the following line INTEGER, PARAMETER :: p2 = M ! must have p2 <= M

lucas-carmo commented 7 months ago

Oh, that makes total sense! I completely overlooked that. The 2D simulations are working as expected now. Thanks a lot!