waveAtmBoundaryLayerSuperposition.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-2019 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::waveAtmBoundaryLayerSuperposition
26 
27 Description
28  An extension of waveSuperposition which adds an atmospheric boundary layer
29  model to the gas velocity. The user supplies a gas velocity and a height
30  above the wave coordinate system origin at which that velocity is reached.
31  Also needed are a maximum and minimum wave height which are used to set the
32  surface roughness in the boundary layer model. It is not trivial to
33  determine these from an arbitrary superposition of differently oriented
34  wave models, so they are required as user inputs instead. For a pure
35  sinusoidal wave, the maximum and minimum wave heights can be set to
36  positive and negative amplitude, respectively.
37 
38 Usage
39  \table
40  Property | Description | Req'd? | Default
41  UGasRef | The gas velocity at the reference height | yes |
42  hRef | The reference height relative to the \\
43  origin of the wave coordinate system | yes |
44  hWaveMin | The minimum wave elevation | yes |
45  hWaveMax | The maximum wave elevation | yes |
46  \endtable
47 
48  Example specification:
49  \verbatim
50  type waveAtmBoundaryLayer;
51  // parameters for waveSuperposition ...
52  UGasRef (10 0 0);
53  hRef 10;
54  hWaveMin -2;
55  hWaveMax 3;
56  \endverbatim
57 
58 SourceFiles
59  waveAtmBoundaryLayerSuperposition.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef waveAtmBoundaryLayerSuperposition_H
64 #define waveAtmBoundaryLayerSuperposition_H
65 
66 #include "waveSuperposition.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class waveAtmBoundaryLayerSuperposition Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class waveAtmBoundaryLayerSuperposition
78 :
79  public waveSuperposition
80 {
81  // Private member data
82 
83  //- The reference velocity
84  const vector UGasRef_;
85 
86  //- The reference height
87  const scalar hRef_;
88 
89  //- The minimum wave elevation
90  const scalar hWaveMin_;
91 
92  //- The maximum wave elevation
93  const scalar hWaveMax_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("waveAtmBoundaryLayer");
101 
102  // Constructors
103 
104  //- Construct from a database
106 
107 
108  //- Destructor
110 
111 
112  // Member Functions
113 
114  //- Get the gas velocity at a given time and global positions
115  virtual tmp<vectorField> UGas
116  (
117  const scalar t,
118  const vectorField& p
119  ) const;
120 
121  //- Inherit write from regIOobject
122  using regIOobject::write;
123 
124  //- Write
125  void write(Ostream&) const;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
waveAtmBoundaryLayerSuperposition(const objectRegistry &db)
Construct from a database.
virtual tmp< vectorField > UGas(const scalar t, const vectorField &p) const
Get the gas velocity at a given time and global positions.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
TypeName("waveAtmBoundaryLayer")
Runtime type information.
virtual bool write(const bool write=true) const
Write using setting from DB.
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
Registry of regIOobjects.
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:354
Namespace for OpenFOAM.