Stokes5.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) 2017-2021 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::waveModels::Stokes5
26 
27 Description
28  Fifth-order wave model.
29 
30  Reference:
31  \verbatim
32  Fenton, J. D. (1985).
33  A fifth-order Stokes theory for steady waves.
34  Journal of waterway, port, coastal, and ocean engineering, 111(2),
35  216-234.
36  \endverbatim
37 
38 SourceFiles
39  Stokes5.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef Stokes5_H
44 #define Stokes5_H
45 
46 #include "Stokes2.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace waveModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Stokes5 Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class Stokes5
60 :
61  public Stokes2
62 {
63 protected:
64 
65  // Protected Member Functions
66 
67  //- The wave celerity [m/s]
68  static scalar celerity
69  (
70  const scalar depth,
71  const scalar amplitude,
72  const scalar length,
73  const scalar g
74  );
75 
76  //- The wave celerity [m/s]
77  virtual scalar celerity() const
78  {
79  return celerity(depth(), amplitude(), length(), g());
80  }
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("Stokes5");
87 
88 
89  // Constructors
90 
91  //- Construct from a dictionary and gravity
92  Stokes5
93  (
94  const dictionary& dict,
95  const scalar g,
96  const word& modelName = Stokes5::typeName,
97  scalar (*modelCelerity)(scalar, scalar, scalar, scalar) =
99  );
100 
101  //- Construct a clone
102  virtual autoPtr<waveModel> clone() const
103  {
104  return autoPtr<waveModel>(new Stokes5(*this));
105  }
106 
107 
108  //- Destructor
109  virtual ~Stokes5();
110 
111 
112  // Member Functions
113 
114  //- Get the wave elevation at a given time and local coordinates. Local
115  // x is aligned with the direction of propagation.
117  (
118  const scalar t,
119  const scalarField& x
120  ) const;
121 
122  //- Get the wave velocity at a given time and local coordinates. Local
123  // x is aligned with the direction of propagation, and z with negative
124  // gravity.
126  (
127  const scalar t,
128  const vector2DField& xz
129  ) const;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 } // End namespace waveModels
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
dictionary dict
virtual scalar celerity() const
The wave celerity [m/s].
Definition: Stokes5.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual autoPtr< waveModel > clone() const
Construct a clone.
Definition: Stokes5.H:101
virtual ~Stokes5()
Destructor.
Definition: Stokes5.C:87
scalar g() const
Get the value of gravity.
Definition: waveModel.H:119
virtual tmp< vector2DField > velocity(const scalar t, const vector2DField &xz) const
Get the wave velocity at a given time and local coordinates. Local.
Definition: Stokes5.C:160
A class for handling words, derived from string.
Definition: word.H:59
scalar length() const
Get the length.
Definition: Airy.H:206
scalar depth() const
Get the depth.
Definition: Airy.H:188
TypeName("Stokes5")
Runtime type information.
virtual tmp< scalarField > elevation(const scalar t, const scalarField &x) const
Get the wave elevation at a given time and local coordinates. Local.
Definition: Stokes5.C:94
scalar amplitude() const
Get the amplitude at steady state.
Definition: Airy.H:200
Second-order wave model.
Definition: Stokes2.H:59
Fifth-order wave model.
Definition: Stokes5.H:58
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Stokes5(const dictionary &dict, const scalar g, const word &modelName=Stokes5::typeName, scalar(*modelCelerity)(scalar, scalar, scalar, scalar)=&Stokes5::celerity)
Construct from a dictionary and gravity.
Definition: Stokes5.C:74
Namespace for OpenFOAM.