cnoidalWaveModel.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::cnoidal
29 
30 Description
31  Cnoidal wave model
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef waveModels_cnoidal_H
36 #define waveModels_cnoidal_H
37 
38 #include "regularWaveModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace waveModels
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class cnoidal Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class cnoidal
52 :
53  public regularWaveModel
54 {
55 private:
56 
57  // Private Member Functions
58 
59  //- Initialise
60  void initialise
61  (
62  const scalar H,
63  const scalar d,
64  const scalar T,
65  scalar& mOut,
66  scalar& LOut
67  ) const;
68 
69  //- Wave height
70  scalar eta
71  (
72  const scalar H,
73  const scalar Kx,
74  const scalar x,
75  const scalar Ky,
76  const scalar y,
77  const scalar omega,
78  const scalar t,
79  const scalar phase
80  ) const;
81 
82  scalar eta1D
83  (
84  const scalar H,
85  const scalar m,
86  const scalar t,
87  const scalar T
88  ) const;
89 
90  scalar etaMeanSq
91  (
92  const scalar H,
93  const scalar m,
94  const scalar T
95  ) const;
96 
97  vector dEtaDx
98  (
99  const scalar H,
100  const scalar m,
101  const scalar uCnoidal,
102  const scalar L,
103  const scalar K,
104  const scalar E
105  ) const;
106 
107  //- Wave velocity
108  vector Uf
109  (
110  const scalar H,
111  const scalar h,
112  const scalar Kx,
113  const scalar x,
114  const scalar Ky,
115  const scalar y,
116  const scalar omega,
117  const scalar t,
118  const scalar phase,
119  const scalar z
120  ) const;
121 
122 
123 protected:
124 
125  // Protected data
126 
127  //- `m' coefficient
128  scalar m_;
129 
130 
131  // Protected Member Functions
132 
133 
134  //- Set the water level
135  virtual void setLevel
136  (
137  const scalar t,
138  const scalar tCoeff,
139  scalarField& level
140  ) const;
141 
142  //- Calculate the wave model velocity
143  virtual void setVelocity
144  (
145  const scalar t,
146  const scalar tCoeff,
147  const scalarField& level
148  );
149 
150 
151 public:
152 
153  //- Runtime type information
154  TypeName("cnoidal");
155 
156  //- Constructor
157  cnoidal
158  (
159  const dictionary& dict,
160  const fvMesh& mesh,
161  const polyPatch& patch,
162  const bool readFields = true
163  );
164 
165  //- Destructor
166  virtual ~cnoidal() = default;
167 
168 
169  // Public Member Functions
170 
171  //- Read from dictionary
172  virtual bool readDict(const dictionary& overrideDict);
173 
174  //- Info
175  virtual void info(Ostream& os) const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace waveModels
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
L
const vector L(dict.get< vector >("L"))
Foam::waveModels::cnoidal::~cnoidal
virtual ~cnoidal()=default
Destructor.
Foam::phase
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:54
H
volScalarField H(IOobject("H", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimLength, Zero))
regularWaveModel.H
Foam::IOobject::info
InfoProxy< IOobject > info() const
Return info proxy.
Definition: IOobject.H:689
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
Foam::Field< scalar >
Foam::waveModels::cnoidal::readDict
virtual bool readDict(const dictionary &overrideDict)
Read from dictionary.
Definition: cnoidalWaveModel.C:337
Foam::constant::universal::h
const dimensionedScalar h
Planck constant.
Definition: setRegionSolidFields.H:33
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::waveModels::cnoidal::TypeName
TypeName("cnoidal")
Runtime type information.
Foam::waveModels::cnoidal
Cnoidal wave model.
Definition: cnoidalWaveModel.H:50
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Vector< scalar >
Foam::waveModels::cnoidal::setLevel
virtual void setLevel(const scalar t, const scalar tCoeff, scalarField &level) const
Set the water level.
Definition: cnoidalWaveModel.C:240
Foam::waveModels::cnoidal::cnoidal
cnoidal(const dictionary &dict, const fvMesh &mesh, const polyPatch &patch, const bool readFields=true)
Constructor.
Definition: cnoidalWaveModel.C:318
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::waveModels::cnoidal::setVelocity
virtual void setVelocity(const scalar t, const scalar tCoeff, const scalarField &level)
Calculate the wave model velocity.
Definition: cnoidalWaveModel.C:271
Foam::waveModels::cnoidal::m_
scalar m_
`m' coefficient
Definition: cnoidalWaveModel.H:127
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::waveModels::regularWaveModel
Definition: regularWaveModel.H:49
y
scalar y
Definition: LISASMDCalcMethod1.H:14