manualWaves2Foam v090
manualWaves2Foam v090
manualWaves2Foam v090
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/319160515
waves2Foam Manual
CITATIONS READS
0 1,577
1 author:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Niels Gjl Jacobsen on 17 August 2017.
waves2Foam Manual
August 2017, version 0.9 (SVN-revision 2113)
DRAFT
WAVES2FOAM MANUAL
Niels G. Jacobsen
Copyright
c Niels Gjl Jacobsen, 2017
All right reserved
Release history:
Disclaimer:
This oering is not approved or endorsed by OpenCFD Limited, producer and distributor
of the OpenFOAM software via www.openfoam.com, and owner of the OPENFOAM
R and
OpenCFD
R trade marks.
Contents
Contents 3
Code Frames 6
Nota Benes 7
Warnings 7
1 Introduction 9
1.1 Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Background and application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Compabitility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.1 Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.2 Naming terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.3 Supported versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 Installation of waves2Foam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4.1 Third-party dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4.2 Download and installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.3 The bashrc le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.4 How to get the updates to waves2Foam? . . . . . . . . . . . . . . . . . . . 11
1.4.5 How to recompile parts of waves2Foam . . . . . . . . . . . . . . . . . . . 12
1.5 Referencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2 Mathematical Description 15
2.1 Coordinate system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Momentum and continuity equations . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.1 Modications for permeable structures . . . . . . . . . . . . . . . . . . . . 15
2.3 Advection of the indicator eld . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3.1 Modications for permeable structures . . . . . . . . . . . . . . . . . . . . 16
2.4 Turbulence modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.5 Reection compensation at the boundary . . . . . . . . . . . . . . . . . . . . . . 16
2.6 Numerical beach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7 Relaxation zone technique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7.1 Flavour of relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7.1.1 Explicit relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.7.1.2 Implicit relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.2 Specifying the relaxation zone . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.2.1 Relaxation scheme . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.2.2 Relaxation weight . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7.2.3 Relaxation shape . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.8 Specication of resistance due to a permeable structure . . . . . . . . . . . . . . 20
2.8.1 Resistance formulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8.1.1 Native OpenFoam . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8.1.2 Engelund (1953) . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8.1.3 Van Gent (1995) . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3 Utilities 23
3.1 Pre-processing utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.1 waveGaugesNProbes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.1.1 Input: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.1.1.2 Output: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.1.1.3 Run-time sampling . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.1.2 setWaveParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.1.2.1 Global parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.1.2.2 Sub-dictionary information . . . . . . . . . . . . . . . . . . . . . 26
3
4 CONTENTS
3.1.2.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.1.3 relaxationZoneLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.1.4 setWaveField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1.5 faceSetToSTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.1.6 sampleIncidentWaveField . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2 Run-time sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.1 Numerical wave gauges (surfaceElevation) . . . . . . . . . . . . . . . . . . 29
3.2.2 Overtopping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.2.1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.2.2.2 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.2.2.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3 Post-processing utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.1 Numerical wave gauges (surfaceElevation) . . . . . . . . . . . . . . . . . . 30
3.3.2 postProcessWaves2Foam . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4 Wave Theories 33
4.1 Validity of wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2 Algebraic wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.1 Regular wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.1.1 Stokes rst order . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.2.1.2 Standing Stokes rst order . . . . . . . . . . . . . . . . . . . . . 33
4.2.1.3 Stokes second order . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.1.4 Modulated second-order Stokes wave . . . . . . . . . . . . . . . 34
4.2.1.5 Stokes fth order . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.2.1.6 First-order cnoidal theory . . . . . . . . . . . . . . . . . . . . . . 35
4.2.1.7 Stream function wave . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2.2 Bichromatic wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2.2.1 First-order bichromatic wave . . . . . . . . . . . . . . . . . . . . 35
4.2.2.2 Second-order bichromatic wave . . . . . . . . . . . . . . . . . . . 36
4.2.3 First-order irregular waves . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2.3.1 Spectral shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.2.3.2 Spectral discretisation . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2.3.3 Phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2.3.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2.4 Second-order irregular waves . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.5 Potential current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.6 Solitary wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.6.1 First-order solitary wave . . . . . . . . . . . . . . . . . . . . . . 39
4.2.6.2 Chappelear (1962) . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.2.7 Combined waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.2.8 External source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.3 External wave theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3.1 Empty external method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3.2 Fast summation of irregular waves . . . . . . . . . . . . . . . . . . . . . . 41
4.3.3 OceanWave3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.3.3.1 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.4 Extensions with new theories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.4.1 Extension: Algebraic wave theory . . . . . . . . . . . . . . . . . . . . . . . 42
4.4.2 Extension: External source . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 Solvers 45
5.1 waveFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 porousWaveFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3 waveDyMFoam (moving meshes) . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3.1 Modications to interDyMFoam . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3.1.1 Changes to les . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.3.1.2 Details on Make/options . . . . . . . . . . . . . . . . . . . . . . 46
5.3.1.3 Details on Make/files . . . . . . . . . . . . . . . . . . . . . . . . 47
6 Tutorials 49
6.1 Execute a tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2 waveFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2.1 standingWave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2.2 waveFlume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2.3 bejiBattjes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.4 couplingOceanWave3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.5 periodicSolitary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.6 3Dwaves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.7 squarePile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.3 porousWaveFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3.1 porousDamBreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.4 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.4.1 relaxationZoneLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
7 Validation 53
7.1 Loads on bridge decks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.2 Interaction with coastal structures . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.3 Breaking waves on a beach prole . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.4 Modelling of oating wave energy converters (WECs) . . . . . . . . . . . . . . . . 55
7.5 Wave-structure-seabed interaction . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Bibliography 57
5
6 Code Frames
Code Frames
1.1 Download and installation instructions for the default installation directory ($ refer
to a command). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2 Updating the SVN-repository and recompilation of waves2Foam. . . . . . . . . . . . 11
1.3 Reference to the original paper accompanying the release of waves2Foam. . . . . . . 12
1.4 Reference to the paper on the porosity implementation in waves2Foam. . . . . . . . 12
1.5 Reference to the coupling between waves2Foam and OceanWave3D. . . . . . . . . . . 13
1.6 Reference to OceanWave3D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 Example code to compare les in order to understand modications made from
interFoam to waveFoam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2 How to execute the comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.3 Additional lines in Make/options for EXE_INC. . . . . . . . . . . . . . . . . . . . . . . 46
5.4 Additional lines in Make/options for EXE_LIB. . . . . . . . . . . . . . . . . . . . . . . 47
5.5 Modications to Make/files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Nota Benes
1.1 bashrc after updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Warnings
1.1 Numerical wave gauges does not compile on recent OpenFoam versions (OF and OF+). 10
7
CHAPTER 1
Introduction
1.1 Origin
The waves2Foam toolbox was originally developed at the Technical University of Denmark by
Niels Gjl Jacobsen under the supervision of Prof. Jrgen Fredse. The porosity module was
developed in collaboration between Bjarne Jensen and Niels Gjl Jacobsen, both then at the
Technical University of Denmark.
As of the employment of Niels G. Jacobsen at Deltares, The Netherlands (2013-present), the
maintenance and further developments takes place at Deltares.
Jacobsen et al. (2014); Jacobsen and Fredse (2014a,b) applied the model to study the
evolution of cross-shore morphological development under breaking waves. This involved
a coupling between the hydrodynamics, sediment transport and the resulting bed level
change.
Paulsen et al. (2014a,b) used the toolbox to study wave loads on a monopile. The work
by Paulsen et al. (2014a) furthermore included a coupling between waves2Foam and a
solution to the full non-linear wave problem, i.e. the Laplace equation with non-linear
boundary conditions; more details are given in Section 4.3.3.
The resonance of the surface elevation within moon pools (Moradi, 2015).
The study of wave loads on bridge decks, where comparions with experimental work were
presented (Seiert, 2014; Seiert et al., 2014; Hayatdavoodi et al., 2014).
Stahlmann (2013) coupled the wave generation in waves2Foam with a method for the
deformation of the sediment bed around a tripod steel structure; the purpose was to
evaluate the eects of this structure on scour patterns.
1 This oering is not approved or endorsed by OpenCFD Limited, producer and distributor of the Open-
FOAM software via www.openfoam.com, and owner of the OPENFOAM
R and OpenCFD
R trade marks.
2 OPENFOAM
R is a registered trade mark of OpenCFD Limited, producer and distributor of the Open-
FOAM software via www.openfoam.com.
9
10 Manual v. 0.9 (Draft) - 1 Introduction
Elsafti and Oumeraci (2013) coupled waves2Foam with a geotechnical model to study the
residual pore pressure build-up and dissipation underneath a caisson breakwater.
The list of application is steadily expanding, why the most up-to-date information is to
look at the citing papers on e.g. Google Scholar (https://scholar.google.com) or ResearchGate
(www.researchgate.net).
1.3 Compabitility
1.3.1 Branches
OpenFoam comes in three main branches:
OF-3.0, OF-4.0
Warning 1.1: Numerical wave gauges does not compile on recent OpenFoam ver-
sions (OF and OF+).
The surface sampling utility (numerical wave gauges) is a vital part of modelling
free surface waves with OpenFoam. Due to a code reorganisation, the wave gauges
do not work for OF-4.0 (and newer) and OF+-1612 (and newer).
gfortran is needed to compile OceanWave3D and Fenton's code for the stream function
coecients.
GNU Scientic Library (GSL) is required to compile waves2Foam. GSL provides various
mathematical functions not natively supported in OpenFoam.
Manual v. 0.9 (Draft) - 1.4 Installation of waves2Foam 11
Please refer to the package management system on your avour of Linux/UNIX for the instal-
lation of these third-party packages. Compilation of waves2Foam is unsuccessful, if any of these
packages are missing.
Code Fragment 1.1: Download and installation instructions for the default in-
stallation directory ($ refer to a command).
WAVES_APPBIN: This is the location for the executables. The default value is the user-
directory ($FOAM_USER_APPBIN), though an alternative is $FOAM_APPBIN, which is useful
for cluster installations with multiple users.
WAVES_LIBBIN: This is the location for the libraries. The default value is the user-directory
($FOAM_USER_LIBBIN), though an alternative is $FOAM_LIBBIN, which is useful for cluster
installations with multiple users.
WAVES_GSL_INCLUDE: Header les for GNU Scientic library (gsl is appended during com-
pilation).
It is recommended never to modify bashrc.org. Always make a copy and make modi-
cations in this le. Modications to bashrc.org could cause problems, when updating the
SVN-repository.
$ svn update
$ ./Allwmake
Updates to the SVN-repository are normally announced through CFD-Online in the thread
called Release of a Wave Generation and Absorption Toolbox for OF. The easiest is to subscribe
to the thread and receives email-notications.
All revisions of waves2Foam are detailed in Appendix C.
12 Manual v. 0.9 (Draft) - 1 Introduction
1.5 Referencing
The users are reguested to support the work put into the waves2Foam toolbox by providing
proper referencing to the academic work that has been supporting the various releases:
Any use of waves2Foam: Please make reference to the original work (Jacobsen et al., 2012)
as specied in Code Fragment 1.3.
Code Fragment 1.3: Reference to the original paper accompanying the release
of waves2Foam.
@article{jacobsenFuhrmanFredsoe2012,
Author = {Jacobsen, N G and Fuhrman, D R and Freds\o{}e, J},
Title = {{A Wave Generation Toolbox for the Open-Source CFD Library:
OpenFoam\textregistered}},
Journal = {{International Journal for Numerical Methods in Fluids}},
Year = {{2012}},
Volume = {{70}},
Number = {{9}},
Pages = {{1073-1088}},
DOI = {{10.1002/fld.2726}},
}
Use of the porosity module: Please make reference to the derivation of the Navier-Stokes
equations in terms of lter velocities for permeable structures (Jensen et al., 2014) as specied
in Code Fragment 1.4.
@article{jensenJacobsenChristensen2014,
Author = {Jensen, B and Jacobsen, N G and Christensen, E D},
Title = {{Investigations on the porous media equations and resistance
coefficients for coastal structures}},
Journal = {{Coastal Engineering}},
Year = {{2014}},
Volume = {{84}},
Pages = {{56-72}},
}
Coupling with OceanWave3D: When the coupling between waves2Foam and OceanWave3D
is used, please make reference to Paulsen et al. (2014a) for the coupling (Code Fragment 1.5) and
reference to Engsig-Karup et al. (2009) for the development of OceanWave3D (Code Fragment
1.6).
The coupling was later streamlined into the waves2Foam framework and it ts into the frame-
work as an external source, see Section 4.2.8).
Manual v. 0.9 (Draft) - 1.5 Referencing 13
Code Fragment 1.5: Reference to the coupling between waves2Foam and Ocean-
Wave3D.
@article{ paulsenBredmoseBingham2014,
Author = {Paulsen, B. T. and Bredmose, H. and Bingham, H. B.},
Title = {{An efficient domain decomposition strategy for wave loads on
surface piercing circular cylinders}},
Journal = {{Coastal Engineering}},
Year = {{2014}},
Volume = {{86}},
Pages = {{57-76}},
}
u
+ uuT = p + g (x xr ) + tot u (2.1)
t
Here, is the density of the uid, u is the velocity vector in Cartesian coordinates, t is time,
= (/x, /y, /z) is the dierential operator, p is the excess pressure, g is the vector
of acceleration due to gravity, x = (x, y, z) is the Cartesian coordinate vector, xr is a reference
location (dened at sea level, see Section 3.1.2) and tot is the total dynamic viscosity, see
Section 2.4.
The incompressible continuity equation reads:
u=0 (2.2)
The excess pressure is dened as p = p g x, where p is the total pressure. The solution
procedure for the discretised equations are outlined in Rusche (2002).
u = nup (2.3)
up is the pore velocity. The derivation of the implementation of the correction due to permeable
layers is presented in Jensen et al. (2014). The continuity equation is the same as in Eq. (2.2),
while the momentum equation takes the following modied version:
u 1 1
(1 + Cm ) + uuT = p + g (x xr ) + tot u Fp (2.4)
t n n n n
This form of the momentum equation deviates from the one presented in Higuera et al. (2014),
however, in a later work the main author (Higuera, 2015) aligned himself with the formulation
in Eq. (2.4). The quantities Cm and Fp are discussed in Section 2.8. The continuity equation
is still given by Eq. (2.2).
This modelling framework has successfully been applied to study the interaction between waves
and permeable structure (Jensen et al., 2014; Jacobsen et al., 2015; Van Gent et al., 2015). These
works have validated quantities such as reection, wave dissipation, wave overtopping and wave
induced pressures and setup inside permeable structures.
15
16 Manual v. 0.9 (Draft) - 2 Mathematical Description
F
+ uF + ur (1 F )F = 0 (2.5)
t
Here, ur is a relevative velocity, see e.g. Berberovi et al. (2009) for details. F is used to evaluate
the spatial variation in density and viscosity as follows:
= F 1 + (1 F )0 and = F 1 + (1 F )0 (2.6)
F 1
+ ( uF + ur (1 F )F ) = 0 (2.7)
t n
n is the porosity.
Here, the weighting function wR [0, 1] can be dened in various ways as will be described in
the following sections.
Manual v. 0.9 (Draft) - 2.7 Relaxation zone technique 17
This method explicitly corrects the elds and u according to Eq. (2.8) each time step
prior to the solution to the pressure-velocity coupling. The method was originally described in
Jacobsen et al. (2012) for OpenFoam, though it is a fairly common approach for e.g. Boussinesq
type wave modelling or solution to the full Laplace problem (see e.g. Fuhrman et al., 2006;
Engsig-Karup et al., 2009).
These methods produce a weight, wR , which can be corrected based on the local Courant
number as follows:
Co/Comax
wR = 1 (1 wR ) (2.9)
where wR = 1 wR and wR is used in Eq. (2.8). Here, Co is the local Courant number and
Comax is the maximum Courant number. The method is implemented following the work by
Seng (2012). The eect is activated by adding the keyword courantCorrection in the denition
of the relaxation zone, see Code Fragment 2.1.
In all cases, the weights are a function of a local coordinate system in the relaxation zone,
such thatwR ( = 1) = 0 and wR ( = 0) = 1. Here, is a local coordinate within the relaxation
zone, where the coordinate depends on the shape of the relaxation zone.
Exponential weight The exponential weight distribution is taken from Fuhrman et al. (2006)
and it has the following form:
exp p 1
wR = 1 (2.10)
exp 1 1
The exponent p is set to 3.5 as default. The method is default and there is no need to specify
it, but it can be explicitly included as in Code Fragment 2.4:
Free polynomial weight The free polynomial weight is encountered in Engsig-Karup (2006)
and the weight function is given as:
wR = 1 p (2.11)
where p is an integer exponent. The weight can be specied as in Code Fragment 2.5. There is
no default value for the exponent p.
Third-order polynomial weight The third order polynomial weight is encountered in Engsig-
Karup (2006) and the weight function is given as:
wR = 2 3 + 3 2 (2.12)
Rectangular;
Semi-cylindrical;
Cylindrical;
Manual v. 0.9 (Draft) - 2.7 Relaxation zone technique 19
Frozen
All of the relaxation zones update the aected cell indices every time step, if the mesh is
changing (moving or mesh renement). The exception to this is the frozen relaxation zone, see
below. The settings for each of these are as follows. For all case, the vertical axis is dened
based on the direction of gravity.
Rectangular The rectangular shape is the most useful shape, because it works equally well
for 2D and 3D simulations. It is dened based on the coordinates of the two diagonal corner
points of a rectangle and the direction of one of the lateral sides (and direction of relaxation).
The formatting of the relaxation shape is given in Code Fragment 2.7
The keyword relaxType takes either of two words, namelyINLET and OUTLET. The former is
used to dened that the direction of the vector orientation describes the direction of relaxation,
whereas the use of OUTLET means that the direction of relaxation is opposite to that prescribed
by orientation, see more in Section 3.1.3.
All points must be in the same horizontal plane.
Cylindrical The cylindrical relaxation shape dened a relaxation zone with an inner and
outer radious (Code Fragment 2.9). The target solution is enforced at the outer edge of the
cylindrical relaxation zone. Until now, the only usage of this relaxation zone appears to be the
work by Arrighi et al. (2015).
Frozen The frozen relaxation shape is special in the way that is mimics any of the other
relaxation shapes, except for one aspect: It does not update the cell indices for the relaxation
zone, if the computational mesh is moving. The method is not applicable on meshes with
topological changes. The relaxation shape is dened as given in Code Fragment 2.10
20 Manual v. 0.9 (Draft) - 2 Mathematical Description
Fp
= au + bukuk2 (2.13)
where a and b are resistance coecients. In additional to this, the added mass coecient Cm is
given as follows:
1n
Cm = p (2.14)
n
Here, p is a closure coecient is taken as 0.34.
(1 n)3 1n 1
a= , b= (2.15)
n2 d250 n3 d50
Here, is the kinematic viscosity and d50 is the nominal, median diameter of the grain material.
The input parameters are specied in Code Fragment 2.12.
porosity <scalar>;
gammaAddedMass <scalar>;
(1 n)2
7.5 1 n 1
a= , b= 1+ (2.16)
n3 d250 KC n3 d50
Here, is the kinematic viscosity and d50 is the nominal diameter of the grain material. The
input parameters are specied in Code Fragment 2.13.
porosity <scalar>;
gammaAddedMass <scalar>;
The inserted values are merely examples. For choice of , and KC , see e.g. Jensen et al.
(2014); Jacobsen et al. (2015); Losada et al. (2016). Furthermore, please note that the eect of
the KC number is being discussed in Jacobsen et al. (In preparation).
CHAPTER 3
Utilities
This chapter discusses the range of pre- and post-processing utilities.
3.1.1.1 Input:
The le constant/probeDefinitions is used to specify the location of the wave gauges and
probes. The common settings are dened in Code Fragment 3.1.
Code Fragment 3.1: Common settings for denition of wave gauges and probes
<name of wave gauges>
{
type waveGauge; // Definition of the type
<name of probes>
{
type probeGauge;
The point distributions to be provided (Code Fragment 3.1) are dened in the following.
23
24 Manual v. 0.9 (Draft) - 3 Utilities
lineDistribution Denes a linear distribution along a line dened by a starting and an end
point. It is possible to have the distribution stretched along the line; resulting in a non-
equidistant point distribution (Code Fragment 3.3).
userDenedDistribution The user dened distribution is conveniently used, when the wave
gauges should be distributed according to locations in a physical experiment (Code Fragment
3.5).
All of the locations (xValues, yValues and zValues) can be dened according to either
nonuniform or uniform formatting.
3.1.1.2 Output:
There are two (probe gauges) or four (wave gauges) outputs from waveGaugesNProbes per sub-
dictionary in constant/probeDefinitions. All output are written to the folder 'waveGauges-
NProbes' in the case folder. The les are detailed here:
Manual v. 0.9 (Draft) - 3.1 Pre-processing utilities 25
<name of set>_controlDict: This le contains the part that should be copied to the
controlDict for run-time sampling with the wave gauges, see e.g. Section 3.1.1.3 for a
description.
<name of set>_sets (only wave gauges): This le contains the denition of the wave
gauges, which is essentially the denition of vertical lines in the standard format for the
'sample' utility in OpenFoam.
<name of set>surfaceElevationDict (only wave gauges): This le is to be used for sam-
pling of the wave gauges as a post-processing step. Simply copy the le to the system
folder and execute the command surfaceElevation (Section 3.3.1).
<name of set>.vtk: This le can be opened with ParaView/paraFoam in order to visu-
alise the the location of the probe and wave gauges.
Code Fragment 3.6: Example of the control of the surface elevation sampling.
surfaceElevation
{
type surfaceElevation;
functionObjectLibs ( "libwaves2Foam.so" );
setFormat raw;
interpolationScheme cellPointFace;
fields (alpha1);
#includeIfPresent "../waveGaugesNProbes/surfaceElevationAnyName_sets";
}
Note that the name of the indicator eld alpha1 is automatically adjusted to the default
naming a given version of OpenFoam.
The ordinary outputControls work for this utility, but it is also possible to sample the surface
elevation at an approximately equidistant time step, which is much smaller than the output
time of the elds (see commented lines in Code Fragment 3.6). Note, irrespectively of the value
of surfaceSampleDeltaT, the sampling utility is only visited based on the standard OpenFoam
controls (outputControl and outputInterval). It is recommended to use the default settings.
3.1.2 setWaveParameters
The utility setWaveParameters is a pre-processing utility, which computes all the necessary
wave parameters based on physical meaningful properties, e.g. setWaveParametes converts
information on water depth and wave period into a wave number for rst order Stokes wave
theory.
All input is written to the le <casePath>/constant/waveProperties.input and the pro-
cessed data is outputted in <casePath>/constant/waveProperties. This sub-division into two
les comes from historical reasons.
The input le waveProperties.input contains global information and information related
to each wave boundary and/or relaxation zone. The global parameters and the setup for a
boundary condition and/or relaxation zone is given in the following two sections.
26 Manual v. 0.9 (Draft) - 3 Utilities
// Insert all required data for any given relaxation zone definition
}
The details on wave types can be found in Section 4. The details on relaxation zones and
their denition can be found in Section 2.7.
3.1.2.3 Example
An example of a computational domain with two relaxation zones is shown in Code Fragment
3.9. The leftmost relaxation zone is used to generate a second order wave and the rightmost
relaxation zone is used to absorp the wave.
The applied solver is waveFoam, why the keywork porosityModel is commented.
3.1.3 relaxationZoneLayout
The utility relaxationZoneLayout can be used to study the layout of the relaxation zone. The
utility outputs three elds to the 0-folder:
relaxationZoneLayout: This eld shows the spatial extend of the relaxation zones. The
value of 1 is outside of any relaxation zone. The rst relaxation zone is given a value of
0, the second a value of 1, etc.
relaxationZoneSigmaValue: This is the spatial distribution of the -weight for the relax-
ation zones.
//porosityModel jensenJacobsenChristensen2014;
seaLevel 0.00;
initializationName outlet;
inletCoeffs
{
waveType stokesSecond;
height 0.1;
period 3.0;
depth 1.0;
phi 0.0;
direction (1.0 0.0 0.0);
debug off;
Tsoft 2.0;
relaxationZone
{
relaxationScheme Spatial;
relaxationShape Rectangular;
relaxType INLET;
startX (-15.0 0.0 -1.0);
endX (-10.0 0.0 1.0);
orientation ( 1.0 0.0 0.0);
}
};
outletCoeffs
{
waveType potentialCurrent;
U (0 0 0);
Tsoft 2;
relaxationZone
{
relaxationScheme Spatial;
relaxationShape Rectangular;
relaxType OUTLET;
startX ( 10.0 0.0 -1.0);
endX ( 15.0 0.0 1.0);
orientation ( 1.0 0.0 0.0);
}
};
3.1.4 setWaveField
The utility setWaveField is used to set the initial conditions according to a user dened wave the-
ory. The latter is dened by the keyword initializationName in the le waveProperties.input,
see Section 3.1.2.1. This can be any wave theory, but if the ramping time diers from 0, then
the prescribed initial condition will be a horizontal free surface at still water level and the water
will be stagnant. If this is the case, the warning in Code Fragment 3.10 is written to standard
output:
28 Manual v. 0.9 (Draft) - 3 Utilities
3.1.5 faceSetToSTL
The modelling of permeable structures, such as breakwaters or open lters, requires that the user
denes the location of the permeable structure is located. There are several ways of identifying
the cell indices, one of these is the usage of (non-convex) STL-surfaces and the cellSet (in
foam-extend) or topoSet (in OpenFoam) utilities. An STL-surface is essentially a triangulation
of a closed surface. The utility faceSetToSTL is a tool that creates such a STL-surface. The
tool is only easily applicable for simple structures.
The input to the case is the le stlDefinitions which is placed in <casePath>/constant/-
triSurface. There is an example located in <waves2Foam>/applications/utilities/preProcessing/-
faceSetToSTL.
There are two ways of dening the STL-surface, namely by dening all the faces of the sur-
face in a manner similar to blockMesh or by extruding one face along a given direction (Code
Fragment 3.11).
unit1
{
points 4((0 0 0) (1 0 0) (1 1 0) (0 1 0));
faces 1((0 1 2 3));
extrude true;
extrudeVector (0 0 1);
}
unit2
{
points 8((0 0 0) (1 0 0) (1 1 0) (0 1 0)
(0 0 1) (1 0 1) (1 1 1) (0 1 1));
faces 6((0 3 2 1) (4 5 6 7) (2 3 7 6)
(0 1 5 4) (1 2 6 5) (4 7 3 0));
}
3.1.6 sampleIncidentWaveField
The utility sampleIncidentWaveField allows for a fast evaluation of the incident wave eld
based on its algebraic form. The code snippet shown in Code Fragment 3.12 is inserted into
waveProperties.input, followed by execution of the commands shown in Code Fragment 3.13.
The output is an evaluation of the theoretical form of the incident wave eld evaluated in the
specied points. The surface elevation is evaluated for all active relaxation zones. The data is
Manual v. 0.9 (Draft) - 3.2 Run-time sampling 29
sampleIncidentWaveField
{
deltaT <scalar>; // [s]
endTime <scalar>; // [s]
outputted in the folder syntheticWaveField and the formatting is identical to the formatting
from the regular surface elevation tool.
3.2.2 Overtopping
The process of overtopping is the amount of water that is overtopping a structure. Overtopping
at impermeable and permeable structures is studied with waves2Foam by Jensen et al. (2014).
This functionality should be used in run-time, because the process of overtopping is very rapid,
so it is very unlikely that the process is captured at a post-processing step. Consequently, it is
recommended to evaluate the overtopping every single time step.
The following sections describe the implementation, the usage and the output.
3.2.2.1 Implementation
During the simulation the following types of face uxes are available:
3
in [m /s] is the ux of uid across a face;
in [kg/s] is the ux of uid across a face multiplied the density of the uid;
3
F in [m /s] is the ux of uid cross a face multiplied with the indicator function.
While a combination of and F would be perfect to evaluate the ux of water across a face,
this is not possible, because F is not available throughout the entire time step; consequently, it
is not available when the function objects are evaluated. Therefore, the ux of water is estimated
with the use of and instead.
In the solution to the advection of the indicator function, the following relationship is used:
= (F =1 F =0 )F + F =0 (3.1)
F =0
F = (3.2)
F =1 F =0
Knowing the ux of water (assuming that the uid is water, when F = 1), if is now possible
to evaluate the overtopping over a set of faces, F:
X Sf
q= F,f (3.3)
kSf k2
f F
where q is the volume ux in [m3 /s] and Sf is the non-unit normal vector to the face. Here,
F is positve in the direction of the normal vector and negative in the opposite direction, so the
combination gives the directional overtopping over a set of faces.
30 Manual v. 0.9 (Draft) - 3 Utilities
3.2.2.2 Usage
The function-object denition in Code Fragment 3.14 must be inserted in the controlDict.
outputControl timeStep;
outputInterval 1;
}
The reader is referred to the templates for faceSetDict and topoSetDict that are available
with the distribution of the source code on how to use faceSet and topoSet respectively.
3.2.2.3 Output
The overtopping is outputting in the le <casePath>//overtopping/<startTimeName>/overtopping.dat.
The use of <startTimeName> in the location means that it is possible to restart a simulation
without loosing data from the rst part of a simulation.
The formatting of overtopping.dat is given in Code Fragment 3.16.
Here, the quantity t0 is the time instance and <vector> is the instantaneous overtopping
volume q, i.e. it is not an accumulated quantity.
3.3.2 postProcessWaves2Foam
The utility postProcessWaves2Foam is intended for easy post-processing of the run-time sampled
properties such as the surface elevation, forces and overtopping.
postProcessWaves2Foam consists of three overall elements, namely (i) read the raw data
streams, (ii) interpolate the data stream to an equidistant time axis and (iii) process the data.
The interpolation is needed for some of the post-processing elements such as the decomposition
into incident and reected wave components for irregular waves, which is essentially based on a
FFT.
rawAlphaProbes reads the data from probes of the void-fraction ratio on a - poten-
tially - non-equidistant time axis.
Data handling
Besides this list, the utility is only documented through its application in some of the utilities.
CHAPTER 4
Wave Theories
This chapter discusses the wave theories available in waves2Foam. The information for the wave
theories are given in the le waveProperties.input and the required set of les to run external
wave theories from third-party software source (Sections 4.2.8 and 4.3).
The required information in waveProperties.input are either given in a sub-dictionary for a
given name of a boundary or as global information. The overall organisation of waveProperties.input
is described in Section 3.1.2.
Is the wave theory valid in the range of wave heights, wave periods and water depths to
be studied?
Is an experimental study sought reproduced? If yes, which wave theory did they apply in
the experimental study?
With respect to the rst question, then there are several sources available, which treat the
validity of wave theories. Regarding the second question, then it is important to stay as close as
possible to the experimental study to obtain accurate results. Here, either the appropriate wave
theory should be chosen or the actual paddle signal should be used as a boundary condition (see
e.g. Higuera et al., 2015; Jacobsen et al., In review, for the latter).
33
34 Manual v. 0.9 (Draft) - 4 Wave Theories
1
Hm = H0 1 + sin (t k x) (4.1)
N
Here,Hm is the modulated wave height, H0 is the mean wave height, is the magnitude of the
modulation, N is an integer, is the cyclic frequency of the primary wave and k is the wave
number vector. The settings are provided in Code Fragment 4.4.
The key parameter for cnoidal wave theory is the shape parameter m, which needs to be
strictly less than 1. Consequently, the utility setWaveParameters automatically increases the
write precision of m to 14 digits to ensure that m is written to waveProperties as a value
strictly smaller than 1.
1 The present version was originally typed by Jesper Skourup (DHI) and it was later ammended by Harry
Bingham (Technical University of Denmark). The source code was made available to waves2Foam by Henrik
Bredmose (Technical University of Denmark).
36 Manual v. 0.9 (Draft) - 4 Wave Theories
Code Fragment 4.7: Stream Function Theory. Note the EITHER-OR structures.
waveType streamFunction;
height <scalar>; // [m]
depth <scalar>; // [m]
N <scalar>; // [-] Number of components
Niter <scalar>; // [-] Number of iterations
phi <scalar>; // [radians]
direction <vector>; // [-]
EITHER:
specifyPeriod false; // [boolean]
waveLength <scalar>; // [m]
OR:
specifyPeriod true; // [boolean]
period <scalar>; // [s]
EITHER:
specifyEuler true; // [boolean]
eulerVelocity <scalar>; // [m/s]
OR:
specifyEuler false; // [boolean]
stokesVelocity <scalar>; // [m/s]
The second order bichromatic wave is similar to the rst order variant, but it includes all the
wave-wave interactions between two waves with dierent periods and propagation directions,
(Madsen and Fuhrman, 2006). The settings are provided in Code Fragment 4.9.
N
X
= ai cos(i t ki x + i ) (4.2)
i
Here, is the surface elevation, N is the number of wave components, ai is the amplitude of the
i'th wave component, is the cyclic frequency, k is the wave number vector and is a phase
(random or focused).
In order to give the information for the irregular waves, there are currently three classes of
information needed:
Spectral shape
Spectral discretisation
Phases
The shape determines the variation of ai with i , the discretisation determines the discrete
representation of i
and the phases determines the values of i .
It is possible to extend the present options by modications of the run-time selectable classes
located in <waves2Foam_src>/src/waves2FoamProcessing/preProcessing/setWaveProperties/-
irregular/waveSpectra. The three classes of information are implemented in the sub-directories
spectra, frequencyAxis and phases.
The following paragraphs describe the various settings needed to prescribe an incident irregular
wave eld. Some common settings are provided in Code Fragment 4.10.
JONSWAP
Pierson-Moskowitz
Information on these spectra can be found in many standard introductions to irregular wave
theory, e.g. Holthuijsen (2007). The settings for JONSWAP are provided in Code Fragment
4.11 and the settings for Pierson-Moskowitz are provided in Code Fragment 4.12.
equidistantFrequencyAxis
cosineStretchedFrequencyAxis
The latter produces a stretching of the frequency axis towards the peak of the spectrum. This
stretching (and any other non-equidistant stretching) greatly improves on the statistical prop-
erties of resulting time series for the surface elevation, see Appendix B for details.
The frequency discretisation is described in a sub-dictionary inside of the denition of the
irregular wave (Code Fragment 4.13). The keyword frequencyAxis refers to the discretisation
options metioned in the list above.
4.2.3.3 Phases
There are two types of phasing methods available and these are is either a random phase or
a phase focusing for a certain location, x0 at a certain time instance t0 . The settings for the
random phases are provided in Code Fragment 4.14 and the settings for the phase focusing are
provided in Code Fragment 4.15.
If a value for the seeding is not provided (Code Fragment 4.14), then the seeding for the
random number generator is based on the clock time. Applying a xed seeding ensures that the
results can be reproduced.
4.2.3.4 Example
A compilation of all of the various components is exemplied in Code Fragmentcode:irregularExample.
This example produces an irregular wave with 100 wave components described with the JON-
SWAP spectrum with a peak enhancement factor of 3.3. The spectral wave height is 1 m, the
Manual v. 0.9 (Draft) - 4.2 Algebraic wave theories 39
peak wave period is 10 s and the water depth if 10 m. The phases are random (but repro-
ducible) with a xed seeding of 10. The frequency axis is equidistantly discretised and user
dened frequency cut-os are specied.
frequencyAxis
{
discretisation equidistantFrequencyAxis;
lowerFrequencyCutoff 0.01;
upperFrequencyCutoff 0.4;
writeSpectrum false;
}
Please note that a combination of e.g. potentialCurrent with stokesFirst does not aect
the evaluation of the wave number, i.e. the Doppler Eect is not included. Tailored wave
theories are required to correctly model wave-current interaction.
The combined waves is convenient, if the same properties are required on multiple boundaries.
The method is not intended to be used with mesh motion, but in certain cases the mesh motion
is the relaxation zone is so small that it is safe to ignore that eect. If ignoreMeshMotion is set
to false/no, then the simulation will stop in case of mesh motion.
The keyword searchTolerance is related to the interpolation routine between the unique
values of x, y and z . If a unique point within the distance of searchTolerance is found, then
no interpolation is executed.
4.3.3 OceanWave3D
waves2Foam is coupled with the third-party software OceanWave3D, which is able to evaluate
fully nonlinear wave propagation (Engsig-Karup et al., 2009). The coupling between Ocean-
42 Manual v. 0.9 (Draft) - 4 Wave Theories
Wave3D and waves2Foam is described in Paulsen et al. (2014a) and the current implementation
is streamlined with the general external source functionality in waves2Foam by Bo T. Paulsen
and Niels G. Jacobsen. The settings are provided in Code Fragment 4.24.
externalForcingCoeffs
{
waveType oceanWave3D;
4.3.3.1 Output
The output from OceanWave3D consists of three elements:
Kinematics* and *.fort les. The output in these les cannot be used, because the time
stepping is controlled by OpenFoam, hence the time stamps on these les are wrong.
waveGauges.dat contains ASCII-formatted wave gauge data, which comes in the same
format as that for the standard surfaceElevation data in waves2Foam. The time stamp is
correct.
Hot-start les are written in synchronisation with the OpenFoam results. The les are out-
putted to the folder <casePath>/OCW3Dhotstart. The naming convection is OceanWave3D.-
<timeIndex>, where <timeIndex> is the time index in the OpenFoam simulation. This
index can be retrieved in the le <timeName>/uniform/time.
Steps to finalise:
1. Copy the directory to the correct wave type in waves2Foam/src/ \
waveTheories
2. Insert the needed variables and expressions for eta, U, etc.
3. Add a line in waves2Foam/src/Make/files to include the new theory in
the compilation.
4. Done.
Is it possible to start the external source at a time dierent from t=0 s? If not, it should
be possible to take several time steps in the external source before activating OpenFoam
simulation, if the latter needs restarting;
If it is possible to restart the external source, then make sure to save data for the external
source at the same time instances as data is saved in the OpenFoam simulation;
For a proper integration of the external source with waves2Foam, it should be possible to
control the time stepping of the external source through OpenFoam;
For an optimal integration of the external source with waves2Foam, the external source
should be compatible with a variable time steps;
Alternatively, a time integration scheme between an equidistant time stepping in the ex-
ternal source and OpenFoam should be implemented and consequently a time control of
the external source that allows for the external force to be ahead in time by one or more
time steps.
CHAPTER 5
Solvers
5.1 waveFoam
The waveFoam solver is a dedicated solver to the study of wave interaction and propagation
in a static computational domain. There may be one or more xed structures, but permeable
layers are not included.
5.2 porousWaveFoam
The porousWaveFoam solver is similar to waveFoam (Section 5.1) with the addition that one
can specify one or more permeable layers.
Moving meshes: The weights in the relaxation zone are re-calculated every time step in
case of moving meshes.
Topological changes: If there are topological changes in the computational mesh due to
e.g. mesh renement or addition or removal of computational cells, the location of the
relaxation zones are recomputed every time step.
waves2Foam has already been used with moving meshes in several works (see Section ??).
Make changes to the interDyMFoam les, see Section 5.3.1.1 for details;
45
46 Manual v. 0.9 (Draft) - 5 Solvers
Code Fragment 5.1: Example code to compare les in order to understand mod-
ications made from interFoam to waveFoam
#!/bin/bash
list=`ls *C *H`
for i in $list
do
echo "============ BEGIN: "$i" ============"
if [ "$i" == "waveFoam.C" ]
then
diff $i $FOAM_APP/solvers/multiphase/interFoam/interFoam.C
else
diff $i $FOAM_APP/solvers/multiphase/interFoam/$i
fi
echo
echo "============= END: "$i" ============="
echo
done
Place the script in the waveFoam directory for the installed (and sourced) version of waves2Foam.
Execute the commands given in Code Fragment 5.2.
After the required changes have been identied, copy the les belonging tointerDyMFoam to a
folder next to waveFoam, incorporate the changes and rename interDyMFoam.C to waveDyMFoam.C.
EXE = $(WAVES_APPBIN)/waveDyMFoam
CHAPTER 6
Tutorials
6.1 Execute a tutorial
The handling of cross-version compatibility means that several actions are required prior to
execution of the tutorial. Due to this, all cases come with an Allrun-script. It is simply a
matter of executing this script according to Code Fragment 6.1 to run the tutorial. Opening
the script furthermore outlines the used commands.
6.2 waveFoam
6.2.1 standingWave
This tutorial shows how to handle wave generation and a fully reecting sea wall utilising the
relaxation zone technique.
The following utilities and solver relevant for waves2Foam are used:
setWaveParameters
setWaveField
waveFoam
6.2.2 waveFlume
This tutorial shows the user how to use the waveProperties.input dictionary to set-up the
wave properties, relaxation zones and initialization specications. Furthermore, the tutorial
illustrates the physical wave transformation that occurs if an invalid wave theory is used at the
inlet (see e.g. experimental work by Chapalain et al., 1992).
The following utilities and solver relevant for waves2Foam are used:
waveGaugesNprobes
setWaveParameters
setWaveField
waveFoam
postProcessWaves2Foam
49
50 Manual v. 0.9 (Draft) - 6 Tutorials
6.2.3 bejiBattjes
This tutorial provides the experimental setup from Beji and Battjes (1993) and a matlab-script,
which can be used to compare the experimental data and the simulation. This tutorial is not
optimised to work as validation case.
The following utilities and solver relevant for waves2Foam are used:
waveGaugesNprobes
setWaveParameters
setWaveField
waveFoam
6.2.4 couplingOceanWave3D
This tutorial shows how waves2Foam can be coupled with the nonlinear potential wave model
for wave transformation: OceanWave3D.
The following utilities and solver relevant for waves2Foam are used:
waveGaugesNprobes
setWaveParameters
setWaveField
waveFoam
6.2.5 periodicSolitary
This tutorial initialises the numerical wave tank with solitary wave. The computational domain
is cyclic in the direction of wave propagation and there are no relaxation zones. Note that the
simulation generates a spurious wave propagating in the opposite direction of the solitary wave.
This is thought to be due to the low order of the solitary wave theory.
The following utilities and solver relevant for waves2Foam are used:
setWaveParameters
setWaveField
waveFoam
6.2.6 3Dwaves
This tutorial shows the use of relaxation zones in 3D. There are 3 inlet relaxation zones and
one outlet relaxation zone. In the middle of the wave tank there is a vertical internal wall on
which the waves are reected. The waves, which are generated in the 3 inlet relaxation zones,
have dierent directions relative to the x-axis.
The following utilities and solver relevant for waves2Foam are used:
setWaveParameters
setWaveField
waveFoam
6.2.7 squarePile
This tutorial shows how to use the cylindrical relaxation zone. A unidirectional current is
the target function all the way around, hence one relaxation zone acts as both generation and
absorption. The relaxation zone removes the internally generated surface disturbances. It could
be interesting to have it tested for ships waves. Alternatively, a better shape for that purpose,
e.g. an elliptical relaxation zone shape could be implemented.
The following utilities and solver relevant for waves2Foam are used:
setWaveParameters
setWaveField
waveFoam
Manual v. 0.9 (Draft) - 6.3 porousWaveFoam 51
6.3 porousWaveFoam
6.3.1 porousDamBreak
This tutorial gives an example of the use of porousWaveFoam. The case is of a dambreak
through a permeable structure and there are post-processing scripts available to compare with
experimental data by Liu et al. (1999). The comparison is reported in Jensen et al. (2014).
The following utilities and solver relevant for waves2Foam are used:
setWaveParameters
waveGaugesNProbes
porousWaveFoam
postProcessWaves2Foam
6.4 Miscellaneous
6.4.1 relaxationZoneLayout
This tutorial will show how to use the utility to obtain a visual representation of the relaxation
zone(s). This could be helpful to detect potential problems in the setup.
The following utility relevant for waves2Foam are used:
relaxationZoneLayout
CHAPTER 7
Validation
This chapter is intended as a community eort, where all users of waves2Foam can provide
small text pieces. The text pieces should put the work with waves2Foam into perspective of the
existing literature and present cases, where OpenFoam and waves2Foam are validated. Each
section shows the list of author(s) and their aliation.
How to contribute? Please send text (LaTeX-format), references (bib-format) and graphics
1
53
54 Manual v. 0.9 (Draft) - 7 Validation
likely due to a combination of factors, include the presence of a nearby sea wall, the seaward inclination
of the bridge, entrained sediment and entrapped air between the girders.
Dean, R. G., Dalrymple, R. A., 1991. Water Wave Mechanics for Engineers and Scientists, 1st Edition.
Vol. 2 of Advanced Series on Ocean Engineering. World Scientic.
del Jesus, M., Lara, J. L., Losada, I. J., 2012. Three-dimensional interaction of waves and porous coastal
structures. Part I: Numerical model formulation. Coastal Engineering , 5672.
Devolder, B., Rauwoens, P., Troch, P., 2016. Numerical simulation of wave-induced roll of a 2-D rect-
angular barge using OpenFOAM. In: Proceedings of the 2nd International Conference on Renewable
Energies Oshore, RENEW. Lisbo, Portugal.
Devolder, B., Rauwoens, P., Troch, P., 2017. Application of a buoyancy-modied k SST turbulence
model to simulation wave run-up around a monopile subjected to regular waves using OpenFOAM
R.
57
58 BIBLIOGRAPHY
Engelund, F., 1953. On the laminar and turbulent ows of ground water through homogeneous sand.
Vol. 3 of Transactions of the Danish Academy of Technical Sciences. Danish Academy of Technical
Sciences.
Engsig-Karup, A., August 2006. Unstructured Nodal DG-FEM Solution of High-Order Boussinesq-Type
Equations. Ph.D. thesis, Technical University of Denmark.
Engsig-Karup, A. P., Bingham, H. B., Lindberg, O., 2009. An ecient exible-order model for 3D
nonlinear water waves. Journal of Computational Physics 228 (6), 21002118.
Ertekin, R. C., Becker, J. M., 1998. Nonlinear Diraction of Waves by a Submerged Shelf in Shallow
Water. J. Oshore Mech. Arct. Eng. 120, pp. 212220.
Ertekin, R. C., Wehausen, J. V., 1986. Some Soliton Calculations. In: Webster, W. (Ed.), Proc. 16th
Symp. on Naval Hydrodynamics, Berkeley. National Academy Press, pp. 167184.
Fenton, J. D., 1985. A 5th-order Stokes theory for steady waves. Journal of Waterway, Port, Coastal and
Ocean Engineering 111 (2), 216234.
Fenton, J. D., 1988. The Numerical-Solution of Steady Water-Wave Problems. Computers & Geosciences
14 (3), 357368.
Fenton, J. D., 1990. Nonlinear Wave Theories. Wiley, Ch. 1, pp. 325, from The Sea. Ideas and Obser-
vations on Progress in the Study of the Seas. Part A. Editors: B. Le Mhaut and D. M. Hanes.
Fernandez-Mora, A., Ribberink, J. S., Van der Zanden, J., Van der Werf, J. J., Jacobsen, N. G., 2016.
RANS-VOF modelling of hydrodynamics and sand transport under full-scale non-breaking and break-
ing waves. Proceeding to Coastal Engineering Conference, 115.
Fuhrman, D. R., Madsen, P. A., Bingham, H. B., 2006. Numerical simulation of lowest-order short-
crested wave instabilities. Journal of Fluid Mechanics 563, 415441.
Gteman, M., Engstrm, J., Eriksson, M., Hann, M., Ransley, E., Greaves, D., Leijon, M., 2015. Scale
tests on the survivability of point-absorbing wave energy converters - part i. Journal of Ocean and
Wind Energy 2, 176181.
Guanche, R., Losada, I. J., Lara, J. L., 2009. Numerical analysis of wave loads for coastal structure
stability. Coastal Engineering 56, 543558.
Hann, M., Greaves, D., Raby, A., 2015. Snatch loading of a single taut moored oating wave energy
converter due to focussed wave groups. Ocean Engineering 96, 258271.
Hayatdavoodi, M., Ertekin, R. C., Robertson, I. N., Riggs, H. R., 2015a. Vulnerability assessment of
coastal bridges on oahu impacted by storm surge and waves. Natural Hazards 79 (2), 11331157.
Hayatdavoodi, M., Seiert, B., Ertekin, R. C., 2014. Experiments and computations of solitary-wave
forces on a coastal-bridge deck. Part II: Deck with girders. Coastal Engineering 88, 210228.
Hayatdavoodi, M., Seiert, B., Ertekin, R. C., 2015b. Experiments and calculations of cnoidal wave
loads on a at plate in shallow-water. Journal of Ocean Engineering and Marine Energy 1 (1), 7799.
Higuera, P., 2015. Application of computational uid dynamics to wave action on structures. Ph.D.
thesis, Universidad de Cantabria.
Higuera, P., Lara, J. L., Losada, I. J., 2014. Three-dimensional interaction of waves and porous coastal
structures using OpenFoam
R . Part I: Formulation and validation. Coastal Engineering 83, 243258.
Higuera, P., Losada, I. J., Lara, J. L., 2015. Three-dimensional numerical wave generation with moving
boundaries. Coastal Engineering 101, 3547.
Holthuijsen, L. H., 2007. Waves in Oceanic and Coastal Waters, 1st Edition. Cambridge University Press.
Jacobsen, N. G., 2011. A full hydro- and morphodynamic description of breaker bar develop-
ment. Ph.D. thesis, Department of Mechanical Engineering, Technical University of Denmark,
http://orbit.dtu.dk/recid/313371.
Jacobsen, N. G., Borsboom, M., Van Gent, M. R. A., In preparation. Investigation of the KC -dependency
in the extended Darcy-Forchheimer resistance formulation. (), .
Jacobsen, N. G., Fredse, J., 2014a. Cross-Shore Redistribution of Nourished Sand Near a Breaker Bar.
Journal of Waterway, Port, Coastal and Ocean Engineering 140 (2), 125134.
Jacobsen, N. G., Fredse, J., 2014b. Formation and Development of a Breaker Bar under Regular Waves.
Part 2: Sediment Transport and Morphology. Coastal Engineering 88, 5568.
Jacobsen, N. G., Fredse, J., Jensen, J. H., 2014. Formation and Development of a Breaker Bar under
Regular Waves. Part 1: Model Description and Hydrodynamics. Coastal Engineering 88, 182193.
BIBLIOGRAPHY 59
Jacobsen, N. G., Fuhrman, D. R., Fredse, J., 2012. A Wave Generation Toolbox for the Open-Source
CFD Library: OpenFoam
R . International Journal for Numerical Methods in Fluids 70 (9), 10731088.
Jacobsen, N. G., Van Gent, M. R. A., Capel, A., Borsboom, M., In review. Numerical prediction of wave
loads on crest walls on top of rubble mound structures. Coastal Engineering , .
Jacobsen, N. G., Van Gent, M. R. A., Wolters, G., 2015. Numerical analysis of the interaction of irregular
waves with two dimensional permeable coastal structures. Coastal Engineering 102, 1329.
Jakobsen, M. M., Iglesias, G., Kramer, M., Vidal, E., 2014. Experimental study of forces on point
absorber. In: Proceedings of the 5th International Conference Coastlab 14. Varna, Bulgaria.
Jensen, B., Jacobsen, N. G., Christensen, E. D., 2014. Investigations on the porous media equations and
resistance coecients for coastal structures. Coastal Engineering 84, 5672.
Kudella, M., Oumeraci, H., De Groot, M., Meijers, P., 2006. Large-scale experiments on pore pres-
sure generation underneath a caisson breakwater. Journal of Waterway, Port, Coastal, and Ocean
Engineering 132 (4), 310324.
Kulicki, J. M., Mertz, D. R., 2008. Guide Specications for Bridges Vulnerable to Coastal Storms.
AASHTO.
Liu, P. L. F., Lin, P., Chang, K. A., Sakakiyama, T., 1999. Numerical modeling of wave interaction with
porous structures. Journal of Waterway, Port, Coastal and Ocean Engineering 125, 322330.
Losada, I. J., Lara, J. L., Del Jesus, M., 2016. Modeling the interaction of water waves with porous
coastal structures. Journal of Waterway, Port, Coastal and Ocean Engineering 142 (6), 118.
Losada, I. J., Lara, J. L., Guanche, R., Conzalez-Ondina, J. M., 2008. Numerical analysis of wave
overtopping of rubble mound breakwaters. Coastal Engineering 55, 4762.
Madsen, P. A., Fuhrman, D. R., 2006. Third-order theory for bichromatic bi-directional water waves.
Journal of Fluid Mechanics 557, 369397.
Madsen, P. A., Fuhrman, D. R., 2012. Third-order theory for multi-directional irregular waves. Journal
of Fluid Mechanics 698, 304334.
Mayer, S., Madsen, P. A., 2000. Simulation of Breaking Waves in the Surf Zone using a Navier-Stokes
Solver. Proceeding to Coastal Engineering Conference I, 928941.
McPherson, R. L., 2008. Hurricane Induced Wave and Surge Forces on Bridge Decks. Ph.D. thesis, Texas
A&M University.
Moradi, N., 2015. Numerical simulation of uid resonance in the narrow gap of twin bodies in close
proximity. Ph.D. thesis, School of Civil, Environmental and Mining Engineering, The University of
Western Australia.
Palm, J., Eskilsson, C., Paredes, G. M., Bergdahl, L., 2016. Coupled mooring analysis for oating wave
energy converters using CFD: formulation and validation. International Journal of Marine Energy 16,
8399.
Patarapanich, M., 1984. Forces and moment on a horizontal plate due to wave scattering. Coastal
Engineering 8 (3), 279301.
Paulsen, B. T., Bredmose, H., Bingham, H. B., 2014a. An ecient domain decomposition strategy for
wave loads on surface piercing circular cylinders. Coastal Engineering 86, 5776.
Paulsen, B. T., Bredmose, H., Bingham, H. B., Jacobsen, N. G., 2014b. Forcing of a bottom-mounted
circular cylinder by steep regular water waves at nite depth. Journal of Fluid Mechanics 755, 134.
Raee, A., Fivez, J., 2015. Numerical prediction of extreme loads on the ceto wave energy converter.
In: Proceedings of the 11th European Wave and Tidal Energy Conference (EWTEC). Nantes, france.
Ransley, E., 2015. Survivability of wave energy converter and mooring coupled system using cfd. Ph.D.
thesis, Plymouth University.
Ransley, E., Greaves, D., Raby, A., Simmonds, D., Hann, M., 2017a. Survivability of wave energy
converters using CFD. Renewavle Energy 109, 235247.
Ransley, E., Greaves, D., Raby, A., Simmonds, D., Jakobsen, M., Kramer, M., 2017b. RANS-VOF
modelling of the wavestar point absorber. Renewavle Energy 109, 4965.
Rienecker, M. M., Fenton, J. D., 1981. A Fourier Approximation Method for Steady Water-Waves.
Journal of Fluid Mechanics 104, 119137.
Rusche, H., December 2002. Computational Fluid Dynamics of Dispersed Two-Phase Flows at High
Phase Fractions. Ph.D. thesis, Imperical College of Science, Technology and Medicine, available at:
http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/docs/HenrikRuschePhD2002.pdf.
60 BIBLIOGRAPHY
Scott, C. P., 2005. Large-Scale Laboratory Observations of Wave Breaking Turbulence on a Fixed Barred
Beach. Master thesis.
Scott, C. P., Cox, D. T., Maddux, T. B., Long, J. W., 2005a. Large-scale laboratory observations of
turbulence on a xed barred beach. Measurement, Science & Technology 16 (10), 19031912.
Scott, C. P., Cox, D. T., Shin, S., Clayton, N., 2005b. Estimates of surf zone turbulence in a largescale
laboratory ume. Proceeding to Coastal Engineering Conference, 379391.
Seiert, B., Ertekin, R. C., Robertson, I. N., 2015. Wave loads on a coastal bridge deck and the role of
entrapped air. Applied Ocean Research 53, 91106.
Seiert, B., Hayatdavoodi, M., Ertekin, R. C., 2014. Experiments and computations of solitary-wave
forces on a coastal-bridge deck. Part I: Flat Plate. Coastal Engineering 88, 194209.
Seiert, B. R., 2014. Tsunami and storm wave impacts on coastal bridges. Ph.D. thesis, University of
Hawaii.
Seiert, B. R., Hayatdavoodi, M., Ertekin, R. C., 2015. Experiments and calculations of cnoidal wave
loads on a coastal-bridge deck with girders. European Journal of Mechanics - B/Fluids 52, 191205.
Seng, S., 2012. Slamming and whipping analysis of ships. Ph.D. thesis, Department of Mechanical
Engineering, Technical University of Denmark.
Sharma, J. N., Dean, R. G., 1981. 2nd-Order Directional Seas and Associated Wave-Forces. Society of
Petroleum Engineers Journal 21 (1), 129140.
Sjkvist, L., Wu, J., Ransley, E., Engstrm, J., Eriksson, M., Gteman, M., 2017. Numerical mod-
els for the motion and forces of point-absorbing wave energy converters in non-linear waves. Ocean
EngineeringManuscript in review.
Stahlmann, A., 2013. Experimental and Numerical Modeling of Scour at Oshore Wind Turbines. Ph.D.
thesis, Gottfried Wilhelm Leibniz Universitt Hannover.
Sun, X., 1991. Some theoretical and numerical studies on cnoidal-wave-diraction problems. Ph.D. thesis,
Masters thesis, University of Hawaii at Manoa, Honolulu.
Svendsen, I. A., Jonsson, I. G., 1982. Hydrodynamics of Coastal Regions, 1st Edition. Den Private
Ingenirfond.
Ting, F. C. K., Kirby, J. T., 1994. Observation of Undertow and Turbulence in a Laboratory Surf Zone.
Coastal Engineering 24 (1-2), 5180.
Van der A, D. A., Van der Zanden, J., O'Donoghue, T., Hurther, D., Cceres, I., McLelland, S. J.,
Ribberink, J. S., 2017. Large-scale laboratory study of breaking wave hydrodynamics over a xed bar.
Journal of Geophysical Research Oceans N/A, N/A.
Van der Zanden, J., Van der A, D. A., Hurther, D., Cceres, I., O'Donoghue, T., Ribberink, J. S., 2016.
Near-bed hydrodynamics and turbulence below a large-scale plunging breaking wave over a mobile
barred bed prole. Journal of Geophysical Research Oceans 121 (8), 64826506.
Van der Zanden, J., Van der A, D. A., Hurther, D., Cceres, I., O'Donoghue, T., Ribberink, J. S., 2017.
Suspended sediment transport around a large-scale laboratory breaker bar. Coastal Engineering 125,
5169.
Van Gent, M. R. A., 1995. Porous ow through rubble mound material. Journal of Waterway, Port,
Coastal and Ocean Engineering 121 (3), 176181.
Van Gent, M. R. A., Herrera, M. P., Molines, J., Jacobsen, N. G., 2015. Rock slopes on top of sand:
Modelling of open lters under wave loading. Proceeding to Coastal Structures, 112.
Van Gent, M. R. A., Tnjes, P., Petit, H. A. H., Van den Bosch, P., 1994. Wave action on and in
permeable structures. Proceeding to Coastal Engineering Conference, 17391753.
Vukcevi, V., Jasak, H., Malenica, S., 2016a. Decomposition model for naval hydrodynamic applications,
Part I: Computational method. Ocean Engineering 121, 3746.
Vukcevi, V., Jasak, H., Malenica, S., 2016b. Decomposition model for naval hydrodynamic applications,
Part II: Verication and validation. Ocean Engineering 121, 7688.
Wellens, P. R., January 2012. Wave Simulation in Truncated Domains for Oshore Applications. Ph.D.
thesis, Technical University of Delft.
Wellens, P. R., Borsboom, M. J. A., Van Gent, M. R. A., 2010. 3D simulation of wave interaction with
permeable structures. Proceeding to Coastal Engineering Conference, 115.
Zelt, J. A., Skjelbreia, J. A., 1992. Estimating Incident and Reected Wave Fields Using an Arbitrary
Number of Wave Gauges. Proceeding to Coastal Engineering Conference I, 777789.
Zhou, Z., Hsu, T.-J., Cox, D., Liu, X., 2017. Large-eddy simulation of wave-breaking induced turbulent
coherent structures and suspended sediment transport on a barred beach. Journal of Geophysical
Research Ocean 122 (2016JC011884).
APPENDIX A
Overview of Input Files
There is a number of les necessary to make a successful setup of a wave simulation with waves2Foam.
Some of these les are native to OpenFoam, while others are additional input les (pre- and postpro-
cessing and run-time). All les are briey discussed in this chapter to give the user an overview of the
origin and meaning of the les.
Roughly speaking, the les placed in the system-folder are related to the time control and numerical
schemes of the simulation, while the les placed in the constant-folder are related to the physical
properties of the simulation.
The following les are native to OpenFoam:
system-folder:
controlDict
fvSchemes
fvSolution
constant-folder:
dynamicMeshDict
g
transportProperties
turbulenceProperties
RASProperties
LESProperties
porosityZones
The following les are additional les native to waves2Foam:
system-folder:
None
constant-folder:
waveProperties.input
waveProperties
probeDefinitions
postProcessingProperties
wavesPorosityProperties
triSurface/stlDefinitions
In section A.1 les native to OpenFoam are described, while les native to waves2Foam are described
in section A.2
61
62 Manual v. 0.9 (Draft) - A Overview of Input Files
A.1.2 system/fvSchemes
fvSchemes controls the numerical schemes used to discretise the system. This relates to both the temporal
and spatial discretisations.
A.1.3 system/fvSolution
fvSolution controls the solution procedure for the linear systems of equation. This includes the spec-
ication of solution tolerances, linear solvers, under-relaxation and the number of iterations in the
pressure-velocity coupling.
A.1.4 constant/dynamicMeshDict
The dynamicMeshDict controls mesh motion, dynamic mesh renement or topological changes. The
keywords in this le depends on the avour of the OpenFoam-branch.
A.1.5 constant/g
This les is used to dene the direction and magnitude of the acceleration due to gravity.
A.1.6 constant/transportProperties
transportProperties is used to dene the viscosity and density of the uids. Also, the surface tension
coecent between two uids is dened in this le. In the case of free surface waves, the surface tension
is typically neglected.
A.1.7 constant/turbulenceProperties
turbulenceProperties controls, whether a laminar, RANS or LES turbulence closure is applied in the
simulation; see section 2.4 for more details on turbulence modelling and waves.
A.1.8 constant/RASProperties
If a RANS-type turbulence closure is used, the actual turbulence closure is specied in RASProperties.
A.1.9 constant/LESProperties
If a LES-type turbulence closure is used, the actual turbulence closure is specied in LESProperties.
A.1.10 constant/porosityZones
The resistance properties of porous zones are specied in porosityZones.
A.2.2 constant/waveProperties
waveProperties is a result of pre-processing of waveProperties.input. It can also be generated by
hand, but it is generally discouraged.
A.2.3 constant/probeDefinitions
probeDefinitions is used to specify the locations of wave gauges and probes.
A.2.4 constant/postProcessingProperties
postProcessingProperties is used to specify post-processing steps, e.g. zero-crossing analysis of the
evaluation of the reection of a regular wave.
A.2.5 constant/triSurface/stlDefinitions
This le is used to dene simple STL-surfaces. STL-surfaces may be used for the meshing with
snappyHexMesh or for the denition of porous zones.
APPENDIX B
Treatment of Irregular Waves
This appendix discusses the impact of two dierent methods to discretise the frequency axis for a
wave spectrum. In addition to this, the appendix describes the irregularFast approach to evaluate
an irregular wave signal (Section 4.3.2). The combination of these two components oers a way to
accelerate the evaluation of irregular incident waves; the method diers from the work by Dimakopoulos
et al. (2016), who applied Taylor expansions of the trigonometric functions.
The content of this work is realised in collaboration with Bo Terp Paulsen. The content has not been
published elsewhere. The style of the appendix has the avour of a journal contribution as this was
the original ambition, however, the lack of time prevented the nalisation of the manuscript, why it is
adapted to the manual for future reference.
B.1 Introduction
In the eld of coastal engineering it is common practice to evaluate the design of coastal structures by
means of physical experiments and numerical modelling. For the representation of a natural sea state,
irregular waves are described by a spectral distribution of the wave energy. Several wave spectra based on
sea state measurements have become standard practice both for physical experiments and for numerical
modelling, e.g., the JONSWAP spectrum and the Pierzon-Moscowitch spectrum.
For numerical models, the volume-of-uid (VOF) type models are often applied to track the free water
surface in combination with Navier-Stokes models. Also Boussinesq type models and non-linear potential
wave models are applied when a numerical approach is taken towards the evaluation of wave-structure
interaction.
In order to generate an irregular sea state based on a wave spectrum, both experimentally and nu-
merically, the incident wave spectrum must be discretised into a number of discrete frequencies. Each
discrete frequency represent a regular wave component, and the superposition of all discrete regular wave
components forms the irregular sea state.
In physical laboratory facilities the spectral discretisation is typically chosen as f = 1/Te , where f is
the frequency and Te is the duration of the experiment. Hereby an equidistant discretisation is achieved
which adds the same number of regular wave components both at the part of the wave spectrum that
contains a relatively high amount of energy and a low amount of energy.
This approach can also be used for the numerical wave modelling, however, when the combined wave
generation and reection compensation is achieved with the use of relaxation zones (see e.g. Jacobsen
et al., 2012) it become computationally expensive to evaluate thousands of wave components at every
time step. For practical applications a limited number of discrete wave components are usually applied,
e.g., in the order of 100 components. Therefore it becomes important how the discrete components are
distributed along the frequency range. As will be shown, both the discretisation and the total number
of wave components aects the return period of the signal and the wave height distribution.
First, some mathematical considerations are presented with respect to the return period of the time
series as evaluated from a spectrum with a given frequency discretisation. Secondly, the choice on
frequency discretisation and resolution is studied with an emphasis on the integrated spectral properties
and the exceedance distribution of the wave heights and wave periods. Finally, an alternative approach
to evaluate the irregular wave signal is presented, which accelerates the execution of the solvers in
waves2Foam.
63
64 Manual v. 0.9 (Draft) - B Treatment of Irregular Waves
by a calculation of the autocorrelation; either using the time series of the surface elevation or by applying
the Wiener-Khinchin theorem on the real-valued spectrum:
1
Z
R( ) = S(f ) cos 2f df (B.1)
m0 0
Here R( ) is the autocorrelation function, S(f ) is the spectrum, f is the frequency, is the correlation
time and m0 is the zero order moment of the spectrum.
The discrete version of Eq. (B.1) is given as follows using the trapezoidal integration rule:
N 1
1
(B.2)
X
Rd ( ) ' [Sd (fn ) cos(2fn ) + Sd (fn+1 ) cos(2fn+1 )] fn
2md,0 n=0
Here, sub-index 'd' refers to the discrete values. The discretisation is such that fn = fn+1 fn . N is
the number of discrete wave components in the time domain representation of the surface elevation (see
below).
The spectral discretisation of the surface elevation is transformed into the time domain by the
following linear super-position:
N
(B.3)
X
(t, x) = am cos (m t km x + m )
m=1
am is the amplitude corresponding to the cyclic frequency m , km the wave number vectors, x is the
Cartesian coordinate vector and m the random phases in the interval [0, 2]. Here,
(B.4)
p
am = [Sd (fm1 ) + Sd (fm )]fm1
and
m = (fm + fm1 ) (B.5)
Consequently, if is not a rational number, there will never be a repetition of the signal, when a
repetition is dened as the value of for which Rd = 1.
The inuence of f on Tr is exemplied in the following. For = 1/4, Tr = 1/f0 , while Tr = 4/f0
for = 4. Note, however, than the value of f also aects the magnitude of f0 , see Eq. (B.8), such
that f0 decreases with increasing f .
This analysis has shown that Tr can be aected strongly by the discrete representation of the spectrum.
This attribute is further analysed in the following sections. The simple linear expansion of the frequency
axis (Eq. (B.7)) will, however, not be analysed further, because it cannot eciently represent the peak
of the spectrum, which is typically in the middle of the discretised frequency interval.
B.2.2.1 Equidistant
The equidistant discretisation is already presented aboute in Section B.2.1.1. This discretisation is
included in the analysis, because it is the commonly adopted discretisation.
A. 10 -1
10 -2
f, [Hz]
10 -3
10 -4
0.4
0.2
0
0.2 0.25 0.3 0.35 0.4 0.45 0.5
f, [Hz]
Figure B.1: The variation of f as a function of f for the two discretisations of the frequency
axis. fL = 0.03 Hz, fU = 1.4 Hz, Tp = 3 s. A: N = 200. B: N = 35 and a
JONSWAP spectrum with a peak enhancement factor of 3.3.
A. 1
0.5
, [m]
0
-0.5
-1
0 20 40 60 80 100
B. 1
0.5
, [m]
-0.5
-1
0 20 40 60 80 100
t, [s]
Figure B.2: One realisation of the surface elevation. A: Equidistant discretisation. B: Cosine
stretching.
A. 1
R, [-]
-1
0 10 20 30 40 50
B. 1
R, [-]
-1
0 100 200 300 400 500
t, [s]
Figure B.3: The discrete autocorrelation of a given spectral discretisation. A: Equidistant dis-
cretisation. B: Cosine stretching.
and the uncertainty band is dened by one standard deviation . is the largest for the equidistant
discretisation.
The results from the zero-crossing analysis were also used to evaluate the distribution of the wave
periods. The distribution of the wave periods are depicted in Figure B.5 as well. The probability distri-
bution of the wave periods led to the same conclusions, namely that the non-equidistant discretisation
produces a time series signal that is less sensitive to the number of wave components.
68 Manual v. 0.9 (Draft) - B Treatment of Irregular Waves
A. 1.02
0.98
10 1 10 2 10 3 10 4
B. 1.02
Rel. Tm01 , [-]
0.98
10 1 10 2 10 3 10 4
C. 1.02
Rel. Tm02 , [-]
0.98
10 1 10 2 10 3 10 4
D. 1.02
Equidistant
Rel. Tm10 , [-]
Cosine stretching
0.98
10 1 10 2 10 3 10 4
N, [-]
Figure B.4: The variation in the spectral wave properties as a function of N. 'Rel.' means
normalisation with the quantity for N = 10, 000.
B.3.4 Discussion
It appears straightforward that the non-equidistant frequency discretisation has many benets over the
equidistant discretisation. This is true, if the main focus is to produce lightweight time series, which
exhibit the correct exceedance properties. However, if the analysed system has resonance frequencies
within the wave frequency band, then one should be careful in applying the lightweight discretisation
without critical analysis of the results and sensitivity to the number of frequency components.
Here, is the surface elevation, 0 is the oset from still water level, N is the number of components,
is the cyclic frequency, t is time, k is the wave number vector, x is the coordinate and is a phase. It is
apparent that the sum (Eq. B.16) must be evaluated for every coordinate in the relaxation zone every
time step, since the cosine depends on both space and time. It is known that trigonometric function are
notoriously expensive to compute.
A simple manipulation of the equation leads to this expression:
N
(B.17)
X
= 0 + an [cos(n t + n ) cos kn x sin(n t + n ) sin kn x]
n=1
Manual v. 0.9 (Draft) - B.4 Accelerated evaluation of irregular waves 69
Exceedance
Rayleigh
10 -2 10 -2
10 -4 10 -4
0 2 4 6 8 0 2 4 6 8
10 0 N = 200 10 0 N = 200
Exceedance
Wave height
10 -2 10 -2
10 -4 10 -4
0 2 4 6 8 0 2 4 6 8
0 0
10 N = 500 10 N = 500
Exceedance
Wave period
10 -2 10 -2
10 -4 10 -4
0 2 4 6 8 0 2 4 6 8
0 0
10 N = 1000 10 N = 1000
Exceedance
10 -2 10 -2
10 -4 10 -4
0 2 4 6 8 0 2 4 6 8
(H/Hrms )2 , (T/Tp )2 , [-] (H/Hrms )2 , (T/Tp )2 , [-]
Figure B.5: The probability distribution for both (H/Hrms )2 and (T /Tp )2 as a function of the
discretisation of the frequency axis (columns) and the number of wave components
(rows). Full lines is the mean values and dashed lines the mean .
This shows that it is possible to reformulate Eq. (B.16) such that each trigonometric function only
depends on space or time. Consequently, all trigonometric functions dependent on x can be evaluated
as a post-processing step prior to the time stepping. All trigonometric functions dependent on t must
be re-evaluated each time step (before relaxation), but it is cheap, as there are merely 2N evaluation,
while the number of spatial coordinates is typically much, much larger.
A similar splitting can be performed for the velocity vector, where the vertical coordinate (z ) is already
split from the remainding arguments: t, x and y .
At rst glance, Eq. (B.17) may look more computationally heavy, but since all components are pre-
computed, the nal summation is considerably faster, because multiplication and memory lookup is
outperforms evaluation of trigonometric and hyperbolic functions.
This approach is termed the split method in the following.
B.4.1 Implementation
The split method in waves2Foam IS termed irregularFast (Section 4.3.2). The implementation is
based on the external wave theories class (Section 4.3), which allows for the necessary pre-processing
steps within a time step.
The implementation is divided into three components, namely (i) global pre-processing step, (ii) local
pre-processing step within a time step, and (iii) evaluation of boundary conditions and relaxation zones:
Global pre-processing
Make a list of the unique x, y and z coordinates.
Evaluate all trigonometric and hyperbolic functions in these coordinates for all frequqency
components and store the values. These lists are eectively matrices with dimensions of the
number of coordinates and the number of frequencies.
70 Manual v. 0.9 (Draft) - B Treatment of Irregular Waves
Local pre-processing
Evaluate the trigonometric functions at the current time instance and store the values. These
lists are column vectors with the length of the number of frequencies.
Evaluate the surface elevation in all combinations of (x, y) (assume z to be vertical), since
the surface elevation is required for the relaxation zone evaluation. This step reduces the
computational requirements further.
Evaluation
Look-up the pre-calculated values and perform the necessary multiplications.
The method is only implemented for static grids, but there is a ag to ignore mesh motion, if it is
known that the mesh deformation in the relaxation zone is small (Section 4.3.2).
B.4.2 Example
An example of the computational gain is presented in Figure B.6. The execution time was measured for
both the direct evaluation of the irregular wave signal (see Eqn. (B.16)) and the proposed split method
(see Eqn. (B.17)). Here, the relative execution time was obtained by normalising by the execution time
for N = 1.
It is seen that there is a steady increase in time consumption for the direct method, while the split
method at-lines up to N = 100 (Figure ??). The at-lining essentially shows that the costs related to
the relaxing method is more expensive that the evaluation of the wave signal itself.
A. 10 3
Direct method
Split method
TN /TN =1 , [-]
10 2
10 1
10 0
10 0 10 1 10 2 10 3 10 4
B. 30
Direct over split, [-]
20
10
0
10 0 10 1 10 2 10 3 10 4
N, [-]
Figure B.6: A: The execution time of the irregular wave summation relative to the execution
time for N = 1. B: The increase in execution time between the direct and the split
methods.
The decrease in computational requirements between the two evaluation methods is a factor of 5 for
N = 100 and the requirements decreased by more than an order of magnitude for N = 1, 0001 . Conse-
quently, if 1,000 wave components are required for the generation of an irregular wave with equidistant
discretisation of the spectrum, then a computational gain of 50 can be obtained by utilising a non-
equidistant frequency discretisation in combination with the split method. Besides a faster execution
of the numerical wave ume, this will also allow for the inclusion of second order eects in the incident
wave eld (Sharma and Dean, 1981; Madsen and Fuhrman, 2012), which would otherwise have been
prohibitively expensive, because the number of second order components is N 2 .
1 It was observed that these ratios are hardware and/or compiler dependent.
APPENDIX C
Source Code History
This list is a reproduction of the information given at up to the revision covered by this document (see
front page).
71
72 Manual v. 0.9 (Draft) - C Source Code History
2015-06-06 18:22:46 r2068 Added zero-crossing functionality + porosity model can be used for non-
wave related things
2015-04-14 21:24:03 r2066 Streamlined the code (removed duplication) for the setWaveProperties
and related classes. Change in input format in waveProperties.input.
2015-03-25 09:05:40 r2064 surfaceElevation now gives correct results on moving meshes in runTime
(tested on foam-extend-3.1). Increase computational time.
2015-03-16 14:38:06 r2063 Small change to porosityCoecients. NO functional change. Also, cor-
rected bug in surfaceElevation.C, which aected foam-extend branch.
2015-03-12 15:14:46 r2062 Small change in the interface for the porosity module. No functional
change.
2015-02-05 13:28:26 r2060 Added porousWaveFoam for foam-extend-3.1
2014-10-30 11:01:34 r2057 Resolving naming match between waves2Foam and 2+ OF-versions [DO
NOT USE REVISION 2056]
2014-10-30 10:18:49 r2056 Made the porosity runTime-selectable. Currently only one method avail-
able. Commit includes derived modications.
2014-10-24 22:03:27 r2055 Directional check on wave directions in wave theories. 3Dwaves tutorial
corrected accordingly
2014-09-09 14:41:16 r2051 Small interface change in the external wave classes (constructs now with
fvMesh as well)
2014-09-04 14:43:15 r2050 Modied options les so the compilation works with local installations
of GSL
2014-09-04 11:36:01 r2049 Changes to the output location of some applications and libraries. Now
uses WAVES_APPBIN/WAVES_LIBBIN
2014-06-21 18:04:47 r2045 Compiling on foam-extend-3.1, waveFoam 3.1 and waveFoam/-
porousWaveFoam added directly from OF2.2.1 to OF2.2.2
2014-05-31 22:02:48 r2044 waveFoam support to foam-extend 3.0 + minor bug-xes + new relax-
ation zone shape
2014-05-17 11:28:34 r2043 Minor maintanence, i.e. waveProperties.input in waveFlume tutorial.
2014-04-12 17:35:52 r2042 Corrected OF2.3.0 issue with the test case bejiBattjes
2014-04-06 12:33:09 r2041 Release to facilitate planned future open-source contribution(s) [No
functional change in execution].
2014-03-27 21:17:38 r2040 Additional corrections to the tutorials to run in 2.3.0. Also corrected
periodicSolitary, so the tutorial runs for recent cyclic denition.
2014-03-26 19:22:46 r2039 Corrected tutorials, such that they can actually execute (adding the
0.org-directory)
2014-03-20 11:11:40 r2038 Added a single post-processing functionality (writeIndexLocation)
2014-03-11 20:57:55 r2037 Updated structure of tutorials to easier accommondate future changes.
Now runs for OF2.3 with alpha.water.
2014-03-01 19:05:46 r2036 Adjusted to be used with OF2.3. Furthermore, the porousDamBreak
case now oers comparison with experiments. The tutorials are not yet
adjusted to work with the changes from OF2.2 -> OF2.3.
2014-01-26 16:13:27 r2026 Compatibility of waves2Foam libraries and utilities with foam-extend-
3.0. Still no solver (waveFoam)
2013-12-28 11:43:19 r2025 Porosity module with solvers (OF1.6, 2.1.0, 2.1.1, 2.2.0, 2.2.1) and a
single tutorial.
2013-11-25 19:35:06 r2024 Modied the fatal error message in the compilation, such that it is easy
to understand how to resolve the issue with a wrong WAVES_DIR en-
vironmental variable.
2013-10-24 09:11:15 r2022 Added a new relaxationScheme and a new relaxationShape
2013-10-07 20:36:24 r2021 Modied src/waves2Foam*/Make/options.* to include XVERSION ag
2013-09-15 09:37:28 r2020 Added phase focusing as an option for irregular waves.
2013-09-05 13:31:41 r2019 Trivial bug-x, not aecting results (Thanks: Bjarne Jensen)
2013-09-03 10:38:12 r2018 Increased exibility for setting wave spectra for JONSWAP.
2013-08-12 14:40:19 r2017 Minor bug-x in src/waves2Foam/waveTheories/irregular/irregular/-
irregular.C
2013-08-07 23:34:24 r2016 Faster evaluation of irregular waves
2013-08-06 21:59:56 r2015 A bit of code maintenance/simplication
2013-07-28 12:15:35 r2014 Fourth revision on code style change according to:
www.openfoam.org/contrib/code-style.php. [No functionality change]
2013-07-27 22:03:15 r2013 Third revision on code style change according to:
www.openfoam.org/contrib/code-style.php. [No functionality change]
2013-07-27 19:31:35 r2012 Second revision on code style change according to:
www.openfoam.org/contrib/code-style.php. [No functionality change]
2013-07-22 22:53:39 r2011 First revision on code style change according to:
www.openfoam.org/contrib/code-style.php. [No functionality change]
2013-07-15 13:09:08 r2010 Corrected missing les in src/waves2FoamProcessing/Make/les
2013-07-13 11:32:48 r2009 waves2Foam now compiles under OF2.2.1
2013-07-09 15:12:25 r2008 Added an additional point distribution (user-dened) for wave gauges
2013-07-07 19:28:45 r2007 Release of pre- and post-processing utilities, overtopping sampling and
modied tutorials.
2013-07-07 18:37:43 r2004- Temporary revision: Restructuring the src-directory
r2006
2013-07-07 17:41:18 r2003 Bug in bichromatic second.
2013-06-11 20:46:14 r2000 Resolve incompatibility between version 2.2.0 and 2.2.x for waveFoam
header les
2013-06-09 09:13:39 r1997 Added a small script for the creation of new wave theories in
waves2Foam/doc/templateWaveTheory
2013-06-08 21:11:23 r1996 Updated compilation system
2013-06-07 21:38:02 r1991- Temporary commit during updating to new SVN
r1995
2012-12-03 12:52:40 r1984 Added second order bichromatic waves. Set numerical beach type to
"Empty" as defalt.
2012-11-29 15:10:18 r1983 Added wave theory. Automatic enhanced write precision for cnoidal
waves parameters. Slight change to waveTheory interface.
73
2012-11-23 15:52:01 r1982 Changed setWaveParameters so (i) parameters are read from waveProp-
erties.input and written to waveProperties and (ii) it does not depend
on the mesh. The latter speeds up the execution (a lot!).
2012-11-18 21:48:17 r1981 Added a check for validity of second order stokes in the properties le
2012-10-31 15:29:27 r1980 Bug in compiling setWaveParameters for OFVERSION >= 17. Added
pre-processor statement
2012-10-31 14:38:18 r1979 (i) Bug in bichromaticFirstProperties.C. (ii) Cosmethics in the *Prop-
erties les, when writing waveProperties-le
2012-10-18 17:00:21 r1977 (i) Added solvers for 2.1. (ii) Changed the approach used by setWavePa-
rameters to write waveProperties le. (iii) Updated headers with publi-
cation data on the journal article. (iv) Added the le sourceCodeStruc-
ture_r1923.svg in the doc directory.
2012-10-17 12:04:01 r1976 Removed all pre-processing if's related to version 15. Altered the
OFVERSION pre-processor to work on e.g. 211 and 160 rather than
21 and 16.
2012-10-01 11:49:20 r1975 Modied the tutorials, so they are also running under OF2.1
2012-09-10 21:29:21 r1973 Corrected innite loop in the computation of the wave number, when
kh > 60 (extreme deep water).
2012-08-16 09:44:50 r1972 Added an option for a local sealevel in potentialCurrent
2012-07-13 20:51:52 r1969 Added the following: (i) runTime selection of relaxation zone weights,
(ii) a local correction to relaxation weight based on the local Courant
number, (iii) update of relaxationZoneLayout to show the weight and
(iv) added interface for numerical beach in UEqn.H but still not func-
tional.
2012-06-08 12:09:21 r1967 Added some post-processing utilities to be used in matlab and modied
the misc/matlab le structure. Minor bug-x in generateStreamFile.m
so the output le is consistent with the format in waves2Foam.
2012-05-16 10:44:43 r1966 Corrected bug in matlab script for stream function theory (previous
results correct, if the program could nalise!)
2012-05-15 12:01:18 r1965 Additional output time control for the surfaceElevation utility. Espe-
cially needed under functionObject functionality
2012-05-10 14:37:47 r1961 Added a optional starting time for the surface elevation sampling
2012-05-09 14:18:23 r1960 Added phase-lag (phi_) in streamFunction.C
2012-05-03 13:22:43 r1953 Added functionObject functionality for sampledSurfaceElevation. In-
cluded in the tutorial waveFlume.
2012-05-02 10:11:01 r1952 Modication to Allwmake and src/Allwmake so "sed" also works under
Mac OSX.
2012-04-30 21:28:20 r1951 Added a post-processing utility, which can be used to extract the surface
elevation. As of now, version 1.5 is no longer supported.
2012-04-11 10:13:10 r1947 Bug in Allwmake script
2012-03-26 21:45:20 r1945 Changed the way setWaveProperties output irregular wave properties.
Adjusted irregular waveTheory accordingly.
2012-03-17 15:56:02 r1944 Solved bug in convexPolyhedral. Furthermore added an addition relax-
ation shape (semiCircular)
2012-03-13 16:13:42 r1943 Minor changes
2012-02-19 14:45:14 r1940 Added the possibility of a wind vector, which is constant in space and
time.
2012-01-29 19:15:41 r1938 Changed the Make/les and Make/options to have the output les in
FOAM_USER_LIBBIN and FOAM_USER_APPBIN.
2012-01-28 15:55:34 r1937 Added a Pierson-Moskowitz spectrum
2012-01-27 13:28:00 r1936 Added framework for irregular wave spectra - properties and wave theory
2012-01-24 13:20:58 r1935 Small changes to src/Make/les and the overall Allwmake script in order
to avoid the recompilation of waves2Foam on non-dev/ext versions of OF
2012-01-19 16:50:48 r1934 Modied the code, so PI can be used both in pre- and post-2.0 versions of
OpenFoam. It is replaced by PI_(4.0*atan(1.0)) a few neccesary places
as a protected member variable.
2011-12-04 20:07:35 r1932 Added a tutorial showing how to generate a standing wave from a fully
reecting sea wall
2011-11-22 10:02:44 r1929 Added a tutorial utilising the cylindrical relaxation zone
2011-11-19 01:01:19 r1928 Added "waveFoam" for 1.7, modied Allwmake script and added neces-
sary les to tutorials due to above change.
2011-11-16 19:22:22 r1937 setWaveParameters now also works for <tt>cnoidalFirst</tt>
2011-11-14 20:04:08 r1926 Added matlab tools for cnoidal and stream function waves
2011-11-14 17:52:52 r1925 Added a 3D wave tank tutorial
2011-11-10 11:30:30 r1923 Initial release of waves2Foam - all les
View publication stats