PiersonMoskowitz.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::PiersonMoskowitz
26 
27 Description
28  Pierson-Moskowitz wave spectrum. This spectrum has the following form:
29 
30  \f[
31  S(\omega) = \frac{\alpha g^2}{\omega^5} \exp \left(- \beta \\
32  \left( \frac{\omega_0}{\omega} \right)^4 \right)
33  \f]
34 
35  \vartable
36  \omega | angular frequency [rad/s], equal to \f$2 \pi f\f$
37  f | frequency [Hz]
38  S(\omega) | spectral density [m^2/Hz]
39  \alpha | coefficient, equal to 8.1e3
40  \beta | coefficient, equal to 0.74
41  \omega_0 | reference angular frequency, equal to \f$g/U_{19.5}\f$
42  U_{19.5} | reference velocity magnitude, 19.5 metres above the sea \\
43  surface
44  \endvartable
45 
46  References:
47  \verbatim
48  Pierson Jr, W. J., & Moskowitz, L. (1964).
49  A proposed spectral form for fully developed wind seas based on the \\
50  similarity theory of SA Kitaigorodskii.
51  Journal of geophysical research, 69(24), 5181-5190.
52  \endverbatim
53 
54  \verbatim
55  Stewart, R. H. (2008).
56  Introduction to physical oceanography.
57  Robert H. Stewart.
58  \endverbatim
59 
60 Usage
61  \table
62  Property | Description | Required? | Default
63  U19_5 | The air speed 19.5 metres above the \\
64  surface [m/s] | yes |
65  \endtable
66 
67  Example specification:
68  \verbatim
69  spectrum PiersonMoskowitz;
70 
71  PiersonMoskowitzCoeffs
72  {
73  U19_5 15;
74  }
75  \endverbatim
76 
77 SourceFiles
78  PiersonMoskowitz.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef PiersonMoskowitz_H
83 #define PiersonMoskowitz_H
84 
85 #include "waveSpectrum.H"
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 namespace Foam
90 {
91 namespace waveSpectra
92 {
93 
94 /*---------------------------------------------------------------------------*\
95  Class PiersonMoskowitz Declaration
96 \*---------------------------------------------------------------------------*/
97 
98 class PiersonMoskowitz
99 :
100  public waveSpectrum
101 {
102  // Private Data
103 
104  //- Reference velocity magnitude
105  const scalar U19_5_;
106 
107  //- Alpha coefficient
108  const scalar alpha_;
109 
110  //- Beta coefficient
111  const scalar beta_;
112 
113 
114 public:
115 
116  //- Runtime type information
117  TypeName("PiersonMoskowitz");
118 
119 
120  // Constructors
121 
122  //- Construct a copy
123  PiersonMoskowitz(const PiersonMoskowitz& spectrum);
124 
125  //- Construct from a dictionary and gravity
126  PiersonMoskowitz(const dictionary& dict, const scalar g);
127 
128  //- Construct a clone
129  virtual autoPtr<waveSpectrum> clone() const
130  {
132  }
133 
134 
135  //- Destructor
136  virtual ~PiersonMoskowitz();
137 
138 
139  // Member Functions
140 
141  //- Evaluate the wave spectral density at the given frequencies [m^2/Hz]
142  virtual tmp<scalarField> S(const scalarField& f) const;
143 
144  //- Evaluate the integral of the wave spectral density at the given
145  // frequencies [m^2]
146  virtual tmp<scalarField> integralS(const scalarField& f) const;
147 
148  //- Return the frequency below which a given fraction of the spectrum's
149  // total power falls []
150  virtual scalar fFraction(const scalar fraction) const;
151 
152  //- Write
153  virtual void write(Ostream& os) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace waveSpectra
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Pierson-Moskowitz wave spectrum. This spectrum has the following form:
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 class for managing temporary objects.
Definition: tmp.H:55
virtual autoPtr< waveSpectrum > clone() const
Construct a clone.
virtual ~PiersonMoskowitz()
Destructor.
PiersonMoskowitz(const PiersonMoskowitz &spectrum)
Construct a copy.
TypeName("PiersonMoskowitz")
Runtime type information.
virtual scalar fFraction(const scalar fraction) const
Return the frequency below which a given fraction of the spectrum's.
virtual void write(Ostream &os) const
Write.
virtual tmp< scalarField > integralS(const scalarField &f) const
Evaluate the integral of the wave spectral density at the given.
virtual tmp< scalarField > S(const scalarField &f) const
Evaluate the wave spectral density at the given frequencies [m^2/Hz].
scalar g() const
Access the gravitation acceleration [m/s^2].
Definition: waveSpectrum.H:132
Namespace for OpenFOAM.
labelList f(nPoints)
dictionary dict