5. Example of usage
To give the user an idea of what a complete waveinput.dat file may look like, a set of examples are given below. If the input description was confusing and overwhelming, these examples should hopefully make it easier to see the bigger picture.
5.1. Irregular wave examples
5.1.1. Long-crested irregular focus wave group
Description:
In this example a focused irregular wave is generated using 28 frequency components. The wave group we are about to generate is uni-directional and all phase values have been set to zero, such that the focus point will be at x=y=t=0. To move the focus point, the keyword [wave reference point] can be specified using the tags time
, x
and y
to move it. In this case we set time
= 12 sec, which implies that the max crest of 20mm will occur after 12 seconds of simulation at position x=y=0.
normalize
is enabled meaning that the listed amplitudes in [irregular wave components] will be normalized such that the sum(A) = 1. The amplitude of the wave at the point of focus is controlled by the parameter amplify
. In this case the linear amplitude at point of focus will be 20mm.
Linear wave theory (superposition) is used in this case, since the specified wave has a low steepness. For steeper waves, it is generally always recommended to use higher order theory, since linear wave theory will simply be too coarse.
@v213
# Long crested wave example
[wave type]
# WAVETYPE
irregular
[general input data]
depth 1.2
mtheta 0.0
normalize 1
amplify 0.020
[wave reference point]
# for focused waves this will correspond to the focus point in time and space
time 12.0
x 0.0
y 0.0
[irregular wave components]
nfreq 28
ndir 1
# OMEGA A K Phase
5.2033 0.0369 2.7670 0.0000
5.3014 0.0356 2.8708 0.0000
5.3996 0.0343 2.9767 0.0000
5.4978 0.0331 3.0849 0.0000
5.5960 0.0319 3.1951 0.0000
5.6941 0.0308 3.3075 0.0000
5.7923 0.0298 3.4219 0.0000
5.8905 0.0288 3.5384 0.0000
5.9887 0.0279 3.6570 0.0000
6.0868 0.0270 3.7776 0.0000
6.1850 0.0261 3.9002 0.0000
6.2832 0.0253 4.0248 0.0000
6.3814 0.0246 4.1514 0.0000
6.4795 0.0238 4.2800 0.0000
6.5777 0.0231 4.4106 0.0000
6.6759 0.0224 4.5432 0.0000
6.7741 0.0218 4.6778 0.0000
6.8722 0.0212 4.8143 0.0000
6.9704 0.0206 4.9528 0.0000
7.0686 0.0200 5.0933 0.0000
7.1668 0.0195 5.2358 0.0000
7.2649 0.0189 5.3802 0.0000
7.3631 0.0184 5.5266 0.0000
7.4613 0.0180 5.6749 0.0000
7.5595 0.0175 5.8252 0.0000
7.6576 0.0171 5.9775 0.0000
7.7558 0.0166 6.1318 0.0000
7.8540 0.0162 6.2880 0.0000
# DIRS
0.00000 1.0
5.1.2. Short-crested irregular focused wave
Description:
In this example, the focused wave presented previously is extended from long crested to short crested. The amplitude is increased to 70mm such that the wave will now be quite nonlinear. Therefore we switch to second order wave theory by specifying [second order]. A spreading function is specified using 19 directional component, with the range -pi/4 to pi/4. To speed up the computation during runtime we specify the use of [lsgrid] for interpolation of kinematics along the boundary. The boundary in this case is 4.8m upwave from the focus point at (x=y=0). Further more, since the specified focused wave is symmetric along the x-axis, it is sufficient to simulate only half the domain, using a symmertry condition along the domain border at y=0.
The CFD tank for this example was initialized with water at rest (swl = 0m).
Idealy, we would tell CFDwavemaker to only calculate wave kinematics in the yz-plane along the inflow boundary. This could be done by setting dx
= 1 and bounds
to -4.8 -4.8 0. 10. However many CFD solvers use one or two layers of ghost cells along the boundaries and may ask for kinematics at positions on the outside of the boundary. To account for this we deliberately set the bounds for which kinematics are calculated in the range of -5.0 to -4.8m using 4 interpolation points in the x-direction.
Finally, to view the results that are generated by CFDwavemaker (which is generally recommended for QA purposes), we tell it to dump vtu files (using the keyword [vtk output] for every time step the interpolation grid is updated.
@v213
# Wavedata CFDwavemaker
[wave type]
# WAVETYPE
irregular
[general input data]
depth 1.2
mtheta 0.0
swl 0.0
normalize 1
amplify 0.070
[second order]
bandwidth auto
[wave reference point]
# for focused waves this will correspond to the focus point in time and space
time 12.0
x 0.0
y 0.0
[ramps]
#ramptype enable rampup_start rampup_end
time_rampup 0 0.0000 0.5
time_rampdown 0 0.0000 1.0
x_rampup 0 -11.0000 -10.0
x_rampdown 0 10.0000 12.0
y_rampup 0 -11.0000 -10.0
y_rampdown 1 10.0000 12.0
[irregular wave components]
nfreq 28
ndir 19
# OMEGA A K Phase
5.2033 0.0369 2.7670 0.0000
5.3014 0.0356 2.8708 0.0000
5.3996 0.0343 2.9767 0.0000
5.4978 0.0331 3.0849 0.0000
5.5960 0.0319 3.1951 0.0000
5.6941 0.0308 3.3075 0.0000
5.7923 0.0298 3.4219 0.0000
5.8905 0.0288 3.5384 0.0000
5.9887 0.0279 3.6570 0.0000
6.0868 0.0270 3.7776 0.0000
6.1850 0.0261 3.9002 0.0000
6.2832 0.0253 4.0248 0.0000
6.3814 0.0246 4.1514 0.0000
6.4795 0.0238 4.2800 0.0000
6.5777 0.0231 4.4106 0.0000
6.6759 0.0224 4.5432 0.0000
6.7741 0.0218 4.6778 0.0000
6.8722 0.0212 4.8143 0.0000
6.9704 0.0206 4.9528 0.0000
7.0686 0.0200 5.0933 0.0000
7.1668 0.0195 5.2358 0.0000
7.2649 0.0189 5.3802 0.0000
7.3631 0.0184 5.5266 0.0000
7.4613 0.0180 5.6749 0.0000
7.5595 0.0175 5.8252 0.0000
7.6576 0.0171 5.9775 0.0000
7.7558 0.0166 6.1318 0.0000
7.8540 0.0162 6.2880 0.0000
# DIRS
-0.7854 0.042843
-0.69813 0.045853
-0.61087 0.048652
-0.5236 0.051192
-0.43633 0.053426
-0.34907 0.055313
-0.2618 0.056819
-0.17453 0.057916
-0.087266 0.058583
0.00000 0.058806
0.087266 0.058583
0.17453 0.057916
0.2618 0.056819
0.34907 0.055313
0.43633 0.053426
0.5236 0.051192
0.61087 0.048652
0.69813 0.045853
0.7854 0.042843
[lsgrid]
# XMIN XMAX YMIN YMAX
bounds -5.0 -4.8 0. 10.0
nx 4
ny 60
nl 15
t0 0.0
dt 0.1
[vtk output]
storage_path ./vtk/
filename kin
5.1.3. Short-crested irregular random wave
Description:
The last irregular example is a large random 3D wave event, initalized at t=0. The frequency components are set such that the sea state is periodic in x- and y-direction. Again a lagrangian stretched grid ([lsgrid]) is applied to speed up initialization. a resolution of dx,dy = 200 is used to define the interpolation grid in horizontal direction. The crest event of interest is set to occur after 50 seconds of simulation.
@v213
# Short-crested irregular wave, example
to[wave type]
# WAVETYPE
irregular
[general input data]
depth 88.00
mtheta 0.0000
[second order]
# use default parameters
[wave reference point]
time 50.00
x 0.00
y 0.00
[irregular wave components]
nfreq 200
ndir 0
# OMEGA [rad/s] A[m] K Phase[rad] theta[rad]
0.80684460 0.09098686 0.06636591 22.09105101 -0.51238946
0.57527858 0.08989138 0.03410555 -8.15520380 -1.01219701
0.59315305 0.20143761 0.03615181 -8.35009702 -0.92729522
0.71493207 0.09704876 0.05213889 11.00239563 -0.58800260
0.73560378 0.15043259 0.05518335 14.76881712 -0.55165498
0.75610843 0.09650070 0.05829305 18.92708992 -0.51914611
0.77640398 0.10681407 0.06145808 24.37031505 -0.48995733
0.92931426 0.08134978 0.08803542 48.50152435 -0.33473684
0.59003036 0.13179557 0.03578847 -2.44283250 -0.78539816
0.67949822 0.08673909 0.04713620 13.61795823 -0.56672922
0.70159595 0.12872640 0.05022371 13.11161767 -0.52807445
0.72341755 0.09335832 0.05337751 21.28711895 -0.49394137
0.74492876 0.09124896 0.05658654 19.10538656 -0.46364761
0.76610938 0.14602694 0.05984190 24.25731290 -0.43662716
0.92338065 0.08982607 0.08691486 53.08713349 -0.29544084
0.56831292 0.14909982 0.03333033 1.03802376 -0.70862627
0.59315305 0.13573177 0.03615181 6.33394770 -0.64350111
0.64208478 0.20180890 0.04215990 14.81790339 -0.54041950
0.68937444 0.10420996 0.04850275 21.12983865 -0.46364761
0.71232547 0.13013337 0.05176152 22.10544051 -0.43240778
0.75683615 0.14954698 0.05840504 28.83959676 -0.38050638
0.79955776 0.14991898 0.06517361 33.77019573 -0.33929261
0.82028164 0.09363949 0.06859324 35.30440687 -0.32175055
0.46286551 0.09979804 0.02314846 -1.12148303 -0.89605538
0.51930565 0.12065759 0.02823547 0.46959009 -0.69473828
0.54759216 0.09346431 0.03109897 3.64479264 -0.62024949
0.57527858 0.23580010 0.03410555 6.60450404 -0.55859932
0.60221880 0.13918393 0.03722057 12.48810274 -0.50709850
0.62838280 0.08980944 0.04041896 15.65714562 -0.46364761
0.74871173 0.15896517 0.05716104 30.50365836 -0.32175055
0.77096525 0.10563210 0.06060148 37.56151878 -0.30288487
0.81393849 0.09999319 0.06753716 40.07111306 -0.27094685
0.89449376 0.09482638 0.08156221 56.04201999 -0.22347660
0.39528979 0.13456842 0.01807591 -1.14796713 -0.92729522
0.42863755 0.34684231 0.02045055 2.23318225 -0.78539816
0.46286551 0.29379860 0.02314846 0.49295359 -0.67474094
0.49637742 0.60488473 0.02606944 6.52514999 -0.58800260
0.52853518 0.19518107 0.02914652 7.56674679 -0.51914611
0.55920020 0.21318198 0.03233517 15.05457653 -0.46364761
0.58844898 0.36812428 0.03560541 14.47036946 -0.41822433
0.61642722 0.10810017 0.03893670 17.07895374 -0.38050638
0.66915771 0.30798981 0.04572883 25.37828169 -0.32175055
0.69415346 0.11970920 0.04917178 31.18914356 -0.29849893
0.71836302 0.09232121 0.05263784 28.41662708 -0.27829966
0.74185987 0.14303032 0.05612271 35.94006288 -0.26060239
0.76470474 0.12198513 0.05962310 40.35719145 -0.24497866
0.78694876 0.09250516 0.06313643 38.85493211 -0.23109067
0.94757522 0.09804928 0.09152908 63.25813893 -0.15865526
0.35229473 0.39580676 0.01533792 2.41303244 -0.78539816
0.39528979 0.51722717 0.01807591 3.59024874 -0.64350111
0.43694365 0.57436187 0.02107995 4.69247313 -0.54041950
0.47590833 0.38649048 0.02425137 7.69715809 -0.46364761
0.51202208 0.60868071 0.02753240 13.22258629 -0.40489179
0.54557845 0.41240763 0.03088812 17.32911178 -0.35877067
0.57697831 0.24408321 0.03429662 16.29409173 -0.32175055
0.63472639 0.15786941 0.04121941 23.02217476 -0.26625205
0.68743396 0.08650849 0.04823254 29.54858195 -0.22679885
0.73639466 0.12902820 0.05530164 35.38182388 -0.19739556
0.78238814 0.15075502 0.06240771 45.96873670 -0.17467220
0.82592276 0.14756403 0.06953940 49.17762331 -0.15660188
0.86735951 0.11331180 0.07668958 59.17340449 -0.14189705
0.20874135 0.11636035 0.00808379 -2.86391205 -1.10714872
0.25601302 0.28752201 0.01022528 0.42434227 -0.78539816
0.31170835 0.16650498 0.01303472 0.77835264 -0.58800260
0.36588901 1.30157108 0.01616758 7.10180882 -0.46364761
0.41524546 1.42221213 0.01946835 7.04756381 -0.38050638
0.45942309 0.25727916 0.02286441 15.11827779 -0.32175055
0.49909445 0.13649680 0.02631892 16.54310809 -0.27829966
0.53513229 0.63760089 0.02981155 17.08802112 -0.24497866
0.56831292 0.08769026 0.03333033 22.79427262 -0.21866895
0.59924534 0.34375363 0.03686776 25.48986694 -0.19739556
0.62838280 0.24935999 0.04041896 28.25001235 -0.17985350
0.65605630 0.17894604 0.04398058 30.66938384 -0.16514868
0.73241412 0.14448520 0.05470762 43.76531616 -0.13255153
0.75610843 0.12259364 0.05829305 46.65681002 -0.12435499
0.77908075 0.13043243 0.06188194 44.30325398 -0.11710874
0.84428359 0.10906569 0.07266425 55.80003333 -0.09966865
0.09774301 0.18759704 0.00361518 -1.18923504 -1.57079633
0.13657139 0.16566396 0.00511264 2.38774000 -0.78539816
0.20874135 0.21952946 0.00808379 5.88969665 -0.46364761
0.28080869 0.38616284 0.01143221 3.56357400 -0.32175055
0.34500601 1.20062822 0.01490577 6.93428338 -0.24497866
0.40053427 2.51602091 0.01843388 12.33488898 -0.19739556
0.44860110 0.10319715 0.02199029 16.99507246 -0.16514868
0.49079824 0.37439316 0.02556319 19.84778021 -0.14189705
0.52853518 0.50805288 0.02914652 24.42468632 -0.12435499
0.56290243 0.58198718 0.03273686 27.01940533 -0.11065722
0.59469488 0.33841702 0.03633212 30.29625258 -0.09966865
0.62447759 0.35490694 0.03993098 29.45114699 -0.09065989
0.65265033 0.19405249 0.04353255 35.30675265 -0.08314123
0.67949822 0.14387471 0.04713620 39.19974194 -0.07677189
0.70522818 0.08413218 0.05074149 38.63472082 -0.07130746
0.75391245 0.09744969 0.05795577 45.99922007 -0.06241881
0.77707579 0.10338095 0.06156432 50.58050459 -0.05875582
0.18875711 0.13519828 0.00723036 5.25487523 -0.00000000
0.26892196 0.89483800 0.01084554 8.96487578 -0.00000000
0.33734580 1.35610007 0.01446073 13.72114465 -0.00000000
0.39528979 1.09583956 0.01807591 12.86471600 -0.00000000
0.44481461 0.71764111 0.02169109 19.80064211 -0.00000000
0.48793224 0.43438010 0.02530627 19.19008302 -0.00000000
0.52627616 0.36276019 0.02892145 23.98331112 -0.00000000
0.56106115 0.85672186 0.03253663 30.99954009 -0.00000000
0.59315305 0.22696195 0.03615181 30.13513341 -0.00000000
0.62315856 0.27312478 0.03976700 36.32949287 -0.00000000
0.65150259 0.38510528 0.04338218 36.23477656 -0.00000000
0.70432549 0.11544412 0.05061254 44.67660309 -0.00000000
0.75317613 0.09347957 0.05784290 51.01818619 -0.00000000
0.79894142 0.13793047 0.06507327 57.04446261 -0.00000000
0.09774301 0.18759704 0.00361518 1.18923504 1.57079633
0.13657139 0.24180708 0.00511264 4.54020402 0.78539816
0.20874135 0.34616249 0.00808379 7.62773976 0.46364761
0.28080869 0.17779331 0.01143221 12.20177429 0.32175055
0.34500601 0.67642894 0.01490577 13.03793827 0.24497866
0.40053427 1.21920259 0.01843388 19.74895992 0.19739556
0.44860110 0.66783033 0.02199029 24.91477548 0.16514868
0.49079824 0.27761724 0.02556319 27.06847903 0.14189705
0.52853518 0.51467469 0.02914652 30.08320452 0.12435499
0.56290243 0.29320935 0.03273686 29.96763620 0.11065722
0.59469488 0.20078744 0.03633212 31.89246549 0.09966865
0.62447759 0.25016277 0.03993098 37.28870243 0.09065989
0.65265033 0.14878305 0.04353255 39.05299074 0.08314123
0.67949822 0.26387242 0.04713620 43.88942822 0.07677189
0.70522818 0.08131803 0.05074149 45.33381199 0.07130746
0.72999386 0.09443696 0.05434809 47.23771441 0.06656816
0.75391245 0.10031883 0.05795577 55.81282803 0.06241881
0.79955776 0.10076085 0.06517361 60.43898847 0.05549851
0.84271132 0.09309535 0.07239395 66.84946990 0.04995840
0.86347783 0.10114483 0.07600484 67.16931376 0.04758310
0.25601302 0.09214155 0.01022528 12.59001344 0.78539816
0.31170835 0.22496999 0.01303472 13.64296871 0.58800260
0.36588901 0.63784037 0.01616758 17.07445597 0.46364761
0.41524546 0.83406201 0.01946835 24.61973084 0.38050638
0.45942309 0.23994725 0.02286441 23.28894706 0.32175055
0.49909445 0.24364234 0.02631892 29.76444335 0.27829966
0.53513229 0.40200400 0.02981155 30.52102540 0.24497866
0.56831292 0.58429514 0.03333033 34.47462219 0.21866895
0.59924534 0.10518281 0.03686776 36.45061463 0.19739556
0.62838280 0.14993786 0.04041896 42.29889427 0.17985350
0.65605630 0.14493109 0.04398058 46.64618142 0.16514868
0.68250754 0.15054722 0.04755029 45.09734433 0.15264933
0.70791522 0.11589506 0.05112639 52.50506047 0.14189705
0.75610843 0.20639592 0.05829305 58.69501265 0.12435499
0.77908075 0.09448769 0.06188194 60.10176009 0.11710874
0.82311674 0.09749486 0.06906794 67.50694473 0.10487694
0.35229473 0.08197143 0.01533792 19.39685929 0.78539816
0.39528979 0.56395429 0.01807591 20.88794475 0.64350111
0.43694365 0.61187838 0.02107995 27.45282294 0.54041950
0.47590833 0.15748106 0.02425137 28.18523875 0.46364761
0.51202208 0.14761350 0.02753240 29.38674176 0.40489179
0.54557845 0.31585573 0.03088812 34.70056266 0.35877067
0.57697831 0.09370791 0.03429662 37.84658838 0.32175055
0.60659316 0.33263167 0.03774360 42.86578993 0.29145679
0.63472639 0.10022268 0.04121941 41.24369147 0.26625205
0.66161343 0.22516662 0.04471732 44.84011971 0.24497866
0.68743396 0.20295680 0.04823254 48.94096877 0.22679885
0.71232547 0.08664334 0.05176152 53.81675954 0.21109333
0.73639466 0.22826119 0.05530164 58.30684722 0.19739556
0.75972605 0.20271304 0.05885089 59.47388726 0.18534795
0.78238814 0.10267079 0.06240771 60.44217986 0.17467220
0.80443770 0.17521403 0.06597087 63.11907596 0.16514868
0.84688467 0.14277383 0.07311252 70.73869789 0.14888995
0.86735951 0.11766328 0.07668958 76.72328818 0.14189705
0.88737918 0.09779885 0.08027005 80.21170919 0.13552771
0.42863755 0.27263790 0.02045055 23.98627064 0.78539816
0.46286551 0.28003072 0.02314846 29.78063790 0.67474094
0.55920020 0.13249162 0.03233517 37.34537388 0.46364761
0.58844898 0.15470656 0.03560541 43.58689731 0.41822433
0.61642722 0.23390224 0.03893670 42.08822915 0.38050638
0.66915771 0.32708331 0.04572883 52.46940253 0.32175055
0.69415346 0.10479065 0.04917178 54.10763830 0.29849893
0.71836302 0.17501783 0.05263784 55.71332011 0.27829966
0.76470474 0.12625583 0.05962310 61.38264093 0.24497866
0.78694876 0.11097823 0.06313643 65.29757112 0.23109067
0.80863569 0.10327471 0.06666065 71.08978319 0.21866895
0.82980366 0.10439765 0.07019413 72.20208455 0.20749623
0.46286551 0.13140904 0.02314846 27.28467581 0.89605538
0.49079824 0.19284512 0.02556319 33.06783155 0.78539816
0.51930565 0.18640608 0.02823547 32.84459187 0.69473828
0.54759216 0.10677480 0.03109897 36.70632468 0.62024949
0.57527858 0.08808513 0.03410555 40.40596708 0.55859932
0.60221880 0.15925774 0.03722057 45.49024956 0.50709850
0.62838280 0.23254109 0.04041896 46.18808287 0.46364761
0.67848591 0.12106816 0.04699736 55.20214440 0.39479112
0.70250941 0.10466058 0.05035365 59.19068357 0.36717383
0.74871173 0.12360594 0.05716104 60.77346542 0.32175055
0.81393849 0.08550695 0.06753716 75.04767291 0.27094685
0.51930565 0.12859193 0.02823547 34.84944988 0.87605805
0.54354051 0.13499880 0.03067583 35.76793009 0.78539816
0.61779215 0.13205459 0.03910417 46.53132171 0.58800260
0.71232547 0.08793377 0.05176152 56.69759669 0.43240778
0.75683615 0.08372675 0.05840504 66.54734063 0.38050638
0.54759216 0.13529305 0.03109897 40.16036461 0.95054684
0.63472639 0.09255731 0.04121941 49.58248443 0.66104317
0.65717947 0.09367514 0.04412891 52.07049263 0.61072596
0.76610938 0.08904058 0.05984190 69.58065106 0.43662716
0.82759271 0.12183432 0.06982075 78.55677263 0.37089129
0.80684460 0.08340232 0.06636591 77.86075915 0.51238946
0.88192863 0.10535046 0.07928712 93.13534179 0.42285393
0.91814400 0.13433347 0.08593188 96.71537171 0.38831872
0.81799214 0.09781100 0.06821111 84.09139466 0.55859932
[lsgrid]
# XMIN XMAX YMIN YMAX
bounds -882.6850 872.6850 -882.6850 882.6850
nx 200
ny 200
nl 15
t0 0.0
dt 0.5
ignore_subdomain -875. 900. -875. 875.
ignore_at_init 0
[vtk output]
storage_path ./vtk/
filename kin
5.2. Regular wave examples
5.2.1. Stokes 5th order regular wave
Description:
A regular stokes 5th order wave, propagated from still water using a linear rampup from time 0.0 to time 2.0 sec.
@v213
# Wavedata CFDwavemaker2
[wave type]
regular
[general input data]
depth 88.00
mtheta 0.0000
[stokes wave properties]
#mandatory properties for stokes wave
wave_length 300.
wave_height 20.
[ramps]
# ramp_type enable rampup_start rampup_end
time_rampup 1 0.0000 2.0
# you do not need to specify all ramps, only the once you need.
5.3. Spectral-Wave-Data (swd) example
5.3.1. Example 1: SWD wave1
Description:
Irregular long crested 5th order HOSM wave simulation
propagated in from the side into still water
To run this example the swd file hosm_out.swd is required.
@v213
# CFDwavemaker SWD example 1: irregular 5th order long crested wave
[wave type]
swd
[general input data]
depth 300.00
mtheta 0.0000
[swd wave properties]
swdfile hosm_out.swd
[ramps]
# ramp_type enable rampup_start rampup_end
time_rampup 1 0.0000 2.0
[lsgrid]
# XMIN XMAX YMIN YMAX
bounds -200.00 -200.00 0.00 0.00
nx 1
ny 1
nl 16
t0 0.0
dt 0.5
stretch_params 0.7 1.5