waveSurfacePressureFvPatchScalarField.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) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::waveSurfacePressureFvPatchScalarField
28
29Group
30 grpInletBoundaryConditions
31
32Description
33 This is a pressure boundary condition, whose value is calculated as
34 the hydrostatic pressure based on a given displacement:
35
36 \f[
37 p = -\rho*g*\zeta
38 \f]
39
40 \vartable
41 \rho | density [kg/m3]
42 g | acceleration due to gravity [m/s2]
43 \zeta | wave amplitude [m]
44 \endvartable
45
46 The wave amplitude is updated as part of the calculation, derived from the
47 local volumetric flux.
48
49Usage
50 \table
51 Property | Description | Required | Default value
52 phi | flux field name | no | phi
53 rho | density field name | no | rho
54 zeta | wave amplitude field name | no | zeta
55 \endtable
56
57 Example of the boundary condition specification:
58 \verbatim
59 <patchName>
60 {
61 type waveSurfacePressure;
62 phi phi;
63 rho rho;
64 zeta zeta;
65 value uniform 0; // place holder
66 }
67 \endverbatim
68
69 The density field is only required if the flux is mass-based as opposed to
70 volumetric-based.
71
72See also
73 Foam::fixedValueFvPatchField
74
75SourceFiles
76 waveSurfacePressureFvPatchScalarField.C
77
78\*---------------------------------------------------------------------------*/
79
80#ifndef waveSurfacePressureFvPatchScalarField_H
81#define waveSurfacePressureFvPatchScalarField_H
82
84#include "Enum.H"
85
86// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87
88namespace Foam
89{
90
91/*---------------------------------------------------------------------------*\
92 Class waveSurfacePressureFvPatchScalarField Declaration
93\*---------------------------------------------------------------------------*/
94
95class waveSurfacePressureFvPatchScalarField
96:
97 public fixedValueFvPatchScalarField
98{
99public:
100
101 // Public data
102
103 //- Enumeration defining the available ddt schemes
104 enum ddtSchemeType
105 {
106 tsEuler,
109 };
110
111
112private:
113
114 // Private data
115
116 //- Flux field name
117 word phiName_;
118
119 //- Wave height field name
120 word zetaName_;
121
122 //- Density field for mass-based flux evaluations
123 word rhoName_;
124
125 //- Time scheme type names
126 static const Enum<ddtSchemeType> ddtSchemeTypeNames_;
127
128
129public:
130
131 //- Runtime type information
132 TypeName("waveSurfacePressure");
133
134
135 // Constructors
136
137 //- Construct from patch and internal field
139 (
140 const fvPatch&,
142 );
143
144 //- Construct from patch, internal field and dictionary
146 (
147 const fvPatch&,
149 const dictionary&
150 );
151
152 //- Construct by mapping given waveSurfacePressureFvPatchScalarField
153 // onto a new patch
155 (
157 const fvPatch&,
159 const fvPatchFieldMapper&
160 );
161
162 //- Construct as copy
164 (
166 );
167
168 //- Construct and return a clone
169 virtual tmp<fvPatchScalarField> clone() const
170 {
172 (
174 );
175 }
176
177 //- Construct as copy setting internal field reference
179 (
182 );
183
184 //- Construct and return a clone setting internal field reference
186 (
188 ) const
189 {
191 (
193 );
194 }
195
196
197 // Member functions
198
199 // Evaluation functions
201 //- Update the coefficients associated with the patch field
202 virtual void updateCoeffs();
203
204
205 //- Write
206 virtual void write(Ostream&) const;
207};
208
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212} // End namespace Foam
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216#endif
217
218// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:65
This is a pressure boundary condition, whose value is calculated as the hydrostatic pressure based on...
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("waveSurfacePressure")
Runtime type information.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
ddtSchemeType
Enumeration defining the available ddt schemes.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73