BoussinesqWaveModel.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015 IH-Cantabria
9  Copyright (C) 2016-2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::waveModels::Boussinesq
29 
30 Description
31  Boussinesq wave model
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef waveModels_Boussinesq_H
36 #define waveModels_Boussinesq_H
37 
38 #include "solitaryWaveModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace waveModels
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class Boussinesq Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class Boussinesq
52 :
53  public solitaryWaveModel
54 {
55 private:
56 
57  // Private Member Functions
58 
59  //- Wave height
60  scalar eta
61  (
62  const scalar H,
63  const scalar h,
64  const scalar x,
65  const scalar y,
66  const scalar theta,
67  const scalar t,
68  const scalar X0
69  ) const;
70 
71  //- Wave
72  vector Deta
73  (
74  const scalar H,
75  const scalar h,
76  const scalar x,
77  const scalar y,
78  const scalar theta,
79  const scalar t,
80  const scalar X0
81  ) const;
82 
83  //- Wave velocity
84  vector Uf
85  (
86  const scalar H,
87  const scalar h,
88  const scalar x,
89  const scalar y,
90  const scalar theta,
91  const scalar t,
92  const scalar X0,
93  const scalar z
94  ) const;
95 
96 
97 protected:
98 
99  // Protected Member Functions
100 
101  //- Set the water level
102  virtual void setLevel
103  (
104  const scalar t,
105  const scalar tCoeff,
106  scalarField& level
107  ) const;
108 
109  //- Calculate the wave model velocity
110  virtual void setVelocity
111  (
112  const scalar t,
113  const scalar tCoeff,
114  const scalarField& level
115  );
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("Boussinesq");
122 
123  //- Constructor
124  Boussinesq
125  (
126  const dictionary& dict,
127  const fvMesh& mesh,
128  const polyPatch& patch,
129  const bool readFields = true
130  );
131 
132  //- Destructor
133  virtual ~Boussinesq() = default;
134 
135 
136  // Public Member Functions
137 
138  //- Read from dictionary
139  virtual bool readDict(const dictionary& overrideDict);
140 
141  //- Info
142  virtual void info(Ostream& os) const;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace waveModels
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
virtual void setLevel(const scalar t, const scalar tCoeff, scalarField &level) const
Set the water level.
scalar y
volScalarField H(IOobject("H", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
virtual ~Boussinesq()=default
Destructor.
dynamicFvMesh & mesh
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
Boussinesq wave model.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void setVelocity(const scalar t, const scalar tCoeff, const scalarField &level)
Calculate the wave model velocity.
OBJstream os(runTime.globalPath()/outputName)
const dimensionedScalar h
Planck constant.
scalarList X0(nSpecie, Zero)
Boussinesq(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:79
const std::string patch
OpenFOAM patch number as a std::string.
InfoProxy< IOobject > info() const
Return info proxy, for printing information to a stream.
Definition: IOobject.H:865
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
TypeName("Boussinesq")
Runtime type information.
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
Namespace for OpenFOAM.