freeSurfacePressureFvPatchScalarField.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) 2019 Zeljko Tukovic, FSB Zagreb.
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::freeSurfacePressureFvPatchScalarField
28
29Group
30 grpGenericBoundaryConditions
31
32Description
33 This boundary condition provides static pressure condition for p_rgh,
34 calculated as:
35
36 \f[
37 p = pa - \vec{g} \cdot \vec{r}
38 \f]
39
40 where
41 \vartable
42 p | Free surface modified pressure
43 pa | Free surface ambient pressure
44 g | acceleration due to gravity [m/s^2]
45 \endtable
46
47Usage
48 \table
49 Property | Description | Required | Default value
50 pa | static ambient pressure | yes | 0
51 \endtable
52
53 Example of the boundary condition specification:
54 \verbatim
55 <patchName>
56 {
57 type freeSurfacePressure;
58 pa uniform 0;
59 value uniform 0; // optional initial value
60 }
61 \endverbatim
62
63See also
64 Foam::fixedValueFvPatchScalarField
65
66SourceFiles
67 freeSurfacePressureFvPatchScalarField.C
68
69\*---------------------------------------------------------------------------*/
70
71#ifndef freeSurfacePressureFvPatchScalarField_H
72#define freeSurfacePressureFvPatchScalarField_H
73
75
76// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77
78namespace Foam
79{
80
81/*---------------------------------------------------------------------------*\
82 Class freeSurfacePressureFvPatchScalarField Declaration
83\*---------------------------------------------------------------------------*/
84
85class freeSurfacePressureFvPatchScalarField
86:
87 public fixedValueFvPatchScalarField
88{
89protected:
90
91 // Protected data
92
93 //- Ambient pressure
95
96public:
97
98 //- Runtime type information
99 TypeName("freeSurfacePressure");
100
101
102 // Constructors
103
104 //- Construct from patch and internal field
107 const fvPatch&,
109 );
110
111 //- Construct from patch, internal field and dictionary
113 (
114 const fvPatch&,
116 const dictionary&
117 );
118
119 //- Construct by mapping given
120 // freeSurfacePressureFvPatchScalarField onto a new patch
122 (
124 const fvPatch&,
126 const fvPatchFieldMapper&
127 );
128
129 //- Construct as copy
131 (
133 );
134
135 //- Construct and return a clone
136 virtual tmp<fvPatchScalarField> clone() const
137 {
139 (
141 );
142 }
143
144 //- Construct as copy setting internal field reference
146 (
149 );
150
151 //- Construct and return a clone setting internal field reference
153 (
155 ) const
156 {
158 (
160 );
161 }
162
163
164 // Member functions
165
166 // Access
167
168 //- Return the ambient pressure
169 const scalarField& pa() const
170 {
171 return pa_;
172 }
174 //- Return reference to the ambient pressure to allow adjustment
175 scalarField& pa()
176 {
177 return pa_;
178 }
179
180
181 // Mapping functions
182
183 //- Map (and resize as needed) from self given a mapping object
184 virtual void autoMap
185 (
186 const fvPatchFieldMapper&
187 );
188
189 //- Reverse map the given fvPatchField onto this fvPatchField
190 virtual void rmap
191 (
192 const fvPatchScalarField&,
193 const labelList&
194 );
195
197 // Evaluation functions
198
199 //- Update the coefficients associated with the patch field
200 virtual void updateCoeffs();
201
202
203 //- Write
204 virtual void write(Ostream&) const;
205};
206
207
208// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209
210} // End namespace Foam
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214#endif
215
216// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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
This boundary condition provides static pressure condition for p_rgh, calculated as:
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
freeSurfacePressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
const scalarField & pa() const
Return the ambient pressure.
TypeName("freeSurfacePressure")
Runtime type information.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
scalarField & pa()
Return reference to the ambient pressure to allow adjustment.
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
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73