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-2023 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 | Required? | Default
41  UGasRef | The gas velocity at the reference \\
42  height | yes |
43  hRef | The reference height relative to the \\
44  origin of the wave coordinate system | yes |
45  hWaveMin | The minimum wave elevation | yes |
46  hWaveMax | The maximum wave elevation | yes |
47  \endtable
48 
49  Example specification:
50  \verbatim
51  type waveAtmBoundaryLayer;
52 
53  // parameters for waveSuperposition ...
54 
55  UGasRef (10 0 0);
56 
57  hRef 10;
58 
59  hWaveMin -2;
60 
61  hWaveMax 3;
62  \endverbatim
63 
64 SourceFiles
65  waveAtmBoundaryLayerSuperposition.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef waveAtmBoundaryLayerSuperposition_H
70 #define waveAtmBoundaryLayerSuperposition_H
71 
72 #include "waveSuperposition.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class waveAtmBoundaryLayerSuperposition Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class waveAtmBoundaryLayerSuperposition
84 :
85  public waveSuperposition
86 {
87  // Private member data
88 
89  //- The reference velocity
90  const vector UGasRef_;
91 
92  //- The reference height
93  const scalar hRef_;
94 
95  //- The minimum wave elevation
96  const scalar hWaveMin_;
97 
98  //- The maximum wave elevation
99  const scalar hWaveMax_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("waveAtmBoundaryLayer");
106 
107 
108  // Constructors
109 
110  //- Construct from a database
112 
113 
114  //- Destructor
116 
117 
118  // Member Functions
119 
120  //- Get the gas velocity at a given time and global positions
121  virtual tmp<vectorField> UGas
122  (
123  const scalar t,
124  const vectorField& p
125  ) const;
126 
127  //- Inherit write from regIOobject
128  using regIOobject::write;
129 
130  //- Write
131  void write(Ostream&) const;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:312
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Registry of regIOobjects.
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for managing temporary objects.
Definition: tmp.H:55
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.
virtual bool write(const bool write=true) const
Inherit write from regIOobject.
TypeName("waveAtmBoundaryLayer")
Runtime type information.
Namespace for OpenFOAM.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
volScalarField & p