waveVelocityFvPatchVectorField.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::waveVelocityFvPatchVectorField
26 
27 Group
28  grpGenericBoundaryConditions
29 
30 Description
31  This boundary condition provides a waveVelocity condition. This sets the
32  velocity to that specified by a superposition of wave models. The
33  corresponding phase fraction condition looks this condition up and re-uses
34  the wave modelling.
35 
36 Usage
37  \table
38  Property | Description | Req'd? | Default
39  origin | origin of the wave coordinate system | yes |
40  direction | direction of the mean flow | yes |
41  speed | speed of the mean flow | yes |
42  waves | list of wave models to superimpose | yes |
43  scale | scale factor along the mean flow direction | no | None
44  crossScale | scale factor across the mean flow direction | no | None
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type waveVelocity;
52  origin (0 25 0);
53  direction (1 0 0);
54  speed 2;
55  waves
56  (
57  Airy
58  {
59  length 40;
60  amplitude 0.5;
61  phase 0;
62  angle 0;
63  }
64  Airy
65  {
66  length 20;
67  amplitude 0.25;
68  phase 1.5708;
69  angle 0;
70  }
71  );
72  scale table ((100 1) (200 0));
73  crossScale constant 1;
74  }
75  \endverbatim
76 
77 SourceFiles
78  waveVelocityFvPatchVectorField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef waveVelocityFvPatchVectorField_H
83 #define waveVelocityFvPatchVectorField_H
84 
86 #include "waveSuperposition.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class waveVelocityFvPatchVectorField Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 class waveVelocityFvPatchVectorField
98 :
99  public directionMixedFvPatchVectorField
100 {
101  // Private data
102 
103  //- Wave superposition
104  const waveSuperposition waves_;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("waveVelocity");
111 
112 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const fvPatch&,
119  const DimensionedField<vector, volMesh>&
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const fvPatch&,
126  const DimensionedField<vector, volMesh>&,
127  const dictionary&
128  );
129 
130  //- Construct by mapping given mixedTypeFvPatchField onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchVectorField> clone() const
147  {
149  (
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
169  new waveVelocityFvPatchVectorField(*this, iF)
170  );
171  }
172 
173 
174  // Member functions
175 
176  // Access
177 
178  //- Access the wave models
179  const waveSuperposition& waves() const
180  {
181  return waves_;
182  }
183 
184 
185  // Evaluation functions
186 
187  //- Return the current modelled velocity field
188  tmp<vectorField> U() const;
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 
193 
194  //- Write
195  virtual void write(Ostream&) const;
196 };
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 
206 #endif
207 
208 // ************************************************************************* //
A wrapper around a list of wave models. Superimposes the modelled values of elevation and velocity...
waveVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Foam::fvPatchFieldMapper.
TypeName("waveVelocity")
Runtime type information.
This boundary condition provides a waveVelocity condition. This sets the velocity to that specified b...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const waveSuperposition & waves() const
Access the wave models.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
tmp< vectorField > U() const
Return the current modelled velocity field.