pressureInletOutletVelocityFvPatchVectorField.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::pressureInletOutletVelocityFvPatchVectorField
28
29Group
30 grpInletBoundaryConditions grpOutletBoundaryConditions
31
32Description
33 This velocity inlet/outlet boundary condition is applied to velocity
34 boundaries where the pressure is specified. A zero-gradient condition is
35 applied for outflow (as defined by the flux); for inflow, the velocity is
36 obtained from the patch-face normal component of the internal-cell value.
37
38 The tangential patch velocity can be optionally specified.
39
40Usage
41 \table
42 Property | Description | Required | Default value
43 phi | flux field name | no | phi
44 tangentialVelocity | tangential velocity field | no |
45 \endtable
46
47 Example of the boundary condition specification:
48 \verbatim
49 <patchName>
50 {
51 type pressureInletOutletVelocity;
52 phi phi;
53 tangentialVelocity uniform (0 0 0);
54 value uniform (0 0 0);
55 }
56 \endverbatim
57
58Note
59 Sign conventions:
60 - positive flux (out of domain): apply zero-gradient condition
61 - negative flux (into of domain): derive from the flux in the patch-normal
62 direction
63
64SourceFiles
65 pressureInletOutletVelocityFvPatchVectorField.C
66
67\*---------------------------------------------------------------------------*/
68
69#ifndef pressureInletOutletVelocityFvPatchVectorField_H
70#define pressureInletOutletVelocityFvPatchVectorField_H
71
72#include "fvPatchFields.H"
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77namespace Foam
78{
79
80/*---------------------------------------------------------------------------*\
81 Class pressureInletOutletVelocityFvPatchVectorField Declaration
82\*---------------------------------------------------------------------------*/
83
84class pressureInletOutletVelocityFvPatchVectorField
85:
86 public directionMixedFvPatchVectorField
87{
88 // Private data
89
90 //- Flux field name
91 word phiName_;
92
93 //- Optional tangential velocity component
94 vectorField tangentialVelocity_;
95
96
97public:
99 //- Runtime type information
100 TypeName("pressureInletOutletVelocity");
101
102
103 // Constructors
104
105 //- Construct from patch and internal field
107 (
108 const fvPatch&,
110 );
111
112 //- Construct from patch, internal field and dictionary
115 const fvPatch&,
117 const dictionary&
118 );
119
120 //- Construct by mapping given
121 // pressureInletOutletVelocityFvPatchVectorField onto a new patch
123 (
125 const fvPatch&,
127 const fvPatchFieldMapper&
128 );
129
130 //- Construct as copy
132 (
134 );
135
136 //- Construct and return a clone
137 virtual tmp<fvPatchVectorField> clone() const
138 {
140 (
142 );
143 }
144
145 //- Construct as copy setting internal field reference
147 (
150 );
152 //- Construct and return a clone setting internal field reference
154 (
156 ) const
157 {
159 (
161 );
162 }
163
164
165 // Member functions
166
167 // Attributes
168
169 //- Return true: this patch field is altered by assignment
170 virtual bool assignable() const
171 {
172 return true;
173 }
174
175
176 // Access
177
178 //- Return the name of phi
179 const word& phiName() const
180 {
181 return phiName_;
182 }
183
184 //- Return reference to the name of phi to allow adjustment
185 word& phiName()
186 {
187 return phiName_;
188 }
189
190 //- Return the tangential velocity
191 const vectorField& tangentialVelocity() const
192 {
193 return tangentialVelocity_;
194 }
195
196 //- Reset the tangential velocity
198
200 // Mapping functions
201
202 //- Map (and resize as needed) from self given a mapping object
203 virtual void autoMap
204 (
206 );
207
208 //- Reverse map the given fvPatchField onto this fvPatchField
209 virtual void rmap
210 (
211 const fvPatchVectorField&,
212 const labelList&
213 );
214
215
216 //- Update the coefficients associated with the patch field
217 virtual void updateCoeffs();
218
219 //- Write
220 virtual void write(Ostream&) const;
221
222
223 // Member operators
224
225 virtual void operator=(const fvPatchField<vector>& pvf);
226};
227
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace Foam
232
233// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234
235#endif
236
237// ************************************************************************* //
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
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This velocity inlet/outlet boundary condition is applied to velocity boundaries where the pressure is...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
word & phiName()
Return reference to the name of phi to allow adjustment.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
void setTangentialVelocity(const vectorField &tangentialVelocity)
Reset the tangential velocity.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const vectorField & tangentialVelocity() const
Return the tangential velocity.
TypeName("pressureInletOutletVelocity")
Runtime type information.
virtual bool assignable() const
Return true: this patch field is altered by assignment.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
Field< vector > vectorField
Specialisation of Field<T> for vector.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73