Airy.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2017 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::Airy
26 
27 Description
28  First-order wave model.
29 
30  Reference:
31  \verbatim
32  "On the Theory of Oscillatory Waves"
33  G G Stokes
34  Transactions of the Cambridge Philosophical Society (1847), Volume 8,
35  Pages 441-455, Equations 18 and 19 (leading terms only)
36  \endverbatim
37 
38 SourceFiles
39  Airy.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef Airy_H
44 #define Airy_H
45 
46 #include "waveModel.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace waveModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class Airy Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class Airy
60 :
61  public waveModel
62 {
63 public:
64 
65  //- Runtime type information
66  TypeName("Airy");
67 
68 
69  // Constructors
70 
71  //- Construct from a database and a dictionary
72  Airy(const objectRegistry& db, const dictionary& dict);
73 
74  //- Construct a clone
75  virtual autoPtr<waveModel> clone() const
76  {
77  return autoPtr<waveModel>(new Airy(*this));
78  }
79 
80 
81  //- Destructor
82  virtual ~Airy();
83 
84 
85  // Member Functions
86 
87  //- Get the wave elevation at a given time, mean velocity and local
88  // coordinates. Local x is aligned with the mean velocity.
90  (
91  const scalar t,
92  const scalar u,
93  const scalarField& x
94  ) const;
95 
96  //- Get the wave velocity at a given time, mean velocity and local
97  // coordinates. Local x is aligned with the mean velocity, and z with
98  // negative gravity.
100  (
101  const scalar t,
102  const scalar u,
103  const vector2DField& xz
104  ) const;
105 };
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 } // End namespace waveModels
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #endif
116 
117 // ************************************************************************* //
Airy(const objectRegistry &db, const dictionary &dict)
Construct from a database and a dictionary.
Definition: Airy.C:44
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual autoPtr< waveModel > clone() const
Construct a clone.
Definition: Airy.H:74
First-order wave model.
Definition: Airy.H:58
TypeName("Airy")
Runtime type information.
Generic base class for waves. Derived classes must implement field functions which return the elevati...
Definition: waveModel.H:55
virtual tmp< vector2DField > velocity(const scalar t, const scalar u, const vector2DField &xz) const
Get the wave velocity at a given time, mean velocity and local.
Definition: Airy.C:73
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
Registry of regIOobjects.
virtual ~Airy()
Destructor.
Definition: Airy.C:55
Namespace for OpenFOAM.
virtual tmp< scalarField > elevation(const scalar t, const scalar u, const scalarField &x) const
Get the wave elevation at a given time, mean velocity and local.
Definition: Airy.C:62