JONSWAP.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::JONSWAP
26 
27 Description
28  JONSWAP wave spectrum. This is similar to the Pierson-Moskowitz spectrum,
29  but with an additional empirical correction to account for the fetch
30  (distance to the lee shore).
31 
32  References:
33  \verbatim
34  Hasselmann, K., Barnett, T. P., Bouws, E., Carlson, H., Cartwright, \\
35  D. E., Enke, K., ... & Walden, H. (1973).
36  Measurements of wind-wave growth and swell decay during the Joint \\
37  North Sea Wave Project (JONSWAP).
38  Ergaenzungsheft zur Deutschen Hydrographischen Zeitschrift, Reihe A.
39  \endverbatim
40 
41  \verbatim
42  Stewart, R. H. (2008).
43  Introduction to physical oceanography.
44  Robert H. Stewart.
45  \endverbatim
46 
47 Usage
48  \table
49  Property | Description | Required? | Default
50  U10 | The air speed 10 metres above the \\
51  surface [m/s] | yes |
52  F | The fetch (distance from the lee \\
53  shore) [m] | yes |
54  gamma | Peaked-ness parameter | no | 3.3
55  \endtable
56 
57  Example specification:
58  \verbatim
59  spectrum JONSWAP;
60 
61  JONSWAPCoeffs
62  {
63  U10 10;
64  F 200e3;
65  }
66  \endverbatim
67 
68 See also
69  Foam::waveSpectra::PiersonMoskowitz
70 
71 SourceFiles
72  JONSWAP.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef JONSWAP_H
77 #define JONSWAP_H
78 
79 #include "waveSpectrum.H"
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 namespace waveSpectra
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class JONSWAP Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class JONSWAP
93 :
94  public waveSpectrum
95 {
96  // Private Data
97 
98  //- Reference velocity magnitude [m/s]
99  const scalar U10_;
100 
101  //- Fetch (distance from the lee shore) [m]
102  const scalar F_;
103 
104  //- Peaked-ness parameter
105  const scalar gamma_;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("JONSWAP");
112 
113 
114  // Constructors
115 
116  //- Construct a copy
117  JONSWAP(const JONSWAP& spectrum);
118 
119  //- Construct from a dictionary and gravity
120  JONSWAP(const dictionary& dict, const scalar g);
121 
122  //- Construct a clone
123  virtual autoPtr<waveSpectrum> clone() const
124  {
125  return autoPtr<waveSpectrum>(new JONSWAP(*this));
126  }
127 
128 
129  //- Destructor
130  virtual ~JONSWAP();
131 
132 
133  // Member Functions
134 
135  //- Evaluate the wave spectral density at the given frequencies [m^2/Hz]
136  virtual tmp<scalarField> S(const scalarField& f) const;
137 
138  //- Return the frequency below which a given fraction of the spectrum's
139  // total energy falls []
140  virtual scalar fFraction(const scalar fraction) const;
141 
142  //- Write
143  virtual void write(Ostream& os) const;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace waveSpectra
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
JONSWAP wave spectrum. This is similar to the Pierson-Moskowitz spectrum, but with an additional empi...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for managing temporary objects.
Definition: tmp.H:55
virtual autoPtr< waveSpectrum > clone() const
Construct a clone.
Definition: JONSWAP.H:138
TypeName("JONSWAP")
Runtime type information.
virtual ~JONSWAP()
Destructor.
Definition: JONSWAP.C:73
JONSWAP(const JONSWAP &spectrum)
Construct a copy.
Definition: JONSWAP.C:47
virtual scalar fFraction(const scalar fraction) const
Return the frequency below which a given fraction of the spectrum's.
Definition: JONSWAP.C:93
virtual void write(Ostream &os) const
Write.
Definition: JONSWAP.C:101
virtual tmp< scalarField > S(const scalarField &f) const
Evaluate the wave spectral density at the given frequencies [m^2/Hz].
Definition: JONSWAP.C:80
scalar g() const
Access the gravitation acceleration [m/s^2].
Definition: waveSpectrum.H:132
Namespace for OpenFOAM.
labelList f(nPoints)
dictionary dict