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-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::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 Usage
39  The parameters of this model are identical to those used by the Airy model
40 
41 See also:
42  Foam::waveModels::Airy
43 
44 SourceFiles
45  Stokes5.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef Stokes5_H
50 #define Stokes5_H
51 
52 #include "Stokes2.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace waveModels
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class Stokes5 Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class Stokes5
66 :
67  public Stokes2
68 {
69 protected:
70 
71  // Protected Member Functions
72 
73  //- The wave celerity [m/s]
74  static scalar celerity(const AiryCoeffs&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("Stokes5");
81 
82 
83  // Constructors
84 
85  //- Construct from a dictionary and gravity
86  Stokes5
87  (
88  const dictionary& dict,
89  const scalar g,
90  const word& modelName = Stokes5::typeName,
91  scalar (*celerityPtr)(const AiryCoeffs&) = &Stokes5::celerity
92  );
93 
94  //- Construct a clone
95  virtual autoPtr<waveModel> clone() const
96  {
97  return autoPtr<waveModel>(new Stokes5(*this));
98  }
99 
100 
101  //- Destructor
102  virtual ~Stokes5();
103 
104 
105  // Member Functions
106 
107  //- The wave celerity [m/s]
108  virtual scalar celerity() const;
109 
110  //- Get the wave elevation at a given time and local coordinates. Local
111  // x is aligned with the direction of propagation.
113  (
114  const scalar t,
115  const scalarField& x
116  ) const;
117 
118  //- Get the wave velocity at a given time and local coordinates. Local
119  // x is aligned with the direction of propagation, and z with negative
120  // gravity.
122  (
123  const scalar t,
124  const vector2DField& xz
125  ) const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 } // End namespace waveModels
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
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
scalar g() const
Get the value of gravity.
Definition: waveModel.H:117
Calculation engine for the Airy wave model and other models that are a correction on top of the Airy ...
Definition: AiryCoeffs.H:52
Second-order wave model.
Definition: Stokes2.H:68
Fifth-order wave model.
Definition: Stokes5.H:67
virtual ~Stokes5()
Destructor.
Definition: Stokes5.C:81
Stokes5(const dictionary &dict, const scalar g, const word &modelName=Stokes5::typeName, scalar(*celerityPtr)(const AiryCoeffs &)=&Stokes5::celerity)
Construct from a dictionary and gravity.
Definition: Stokes5.C:68
virtual scalar celerity() const
The wave celerity [m/s].
Definition: Stokes5.C:87
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
virtual autoPtr< waveModel > clone() const
Construct a clone.
Definition: Stokes5.H:94
TypeName("Stokes5")
Runtime type information.
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:163
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict