pressureDirectedInletOutletVelocityFvPatchVectorField.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::pressureDirectedInletOutletVelocityFvPatchVectorField
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
36 is obtained from the flux with the specified inlet direction.
37
38Usage
39 \table
40 Property | Description | Required | Default value
41 phi | flux field name | no | phi
42 rho | density field name | no | rho
43 inletDirection | inlet direction per patch face | yes |
44 \endtable
45
46 Example of the boundary condition specification:
47 \verbatim
48 <patchName>
49 {
50 type pressureDirectedInletOutletVelocity;
51 phi phi;
52 rho rho;
53 inletDirection uniform (1 0 0);
54 value uniform 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 with specified
62 direction
63
64See also
65 Foam::mixedFvPatchVectorField
66
67SourceFiles
68 pressureDirectedInletOutletVelocityFvPatchVectorField.C
69
70\*---------------------------------------------------------------------------*/
71
72#ifndef pressureDirectedInletOutletVelocityFvPatchVectorField_H
73#define pressureDirectedInletOutletVelocityFvPatchVectorField_H
74
75#include "fvPatchFields.H"
76#include "mixedFvPatchFields.H"
77
78// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79
80namespace Foam
81{
82
83/*---------------------------------------------------------------------------*\
84 Class pressureDirectedInletOutletVelocityFvPatchVectorField Declaration
85\*---------------------------------------------------------------------------*/
86
87class pressureDirectedInletOutletVelocityFvPatchVectorField
88:
89 public mixedFvPatchVectorField
90{
91 // Private data
92
93 //- Flux field name
94 word phiName_;
95
96 //- Density field name
97 word rhoName_;
98
99 //- Inlet direction
100 vectorField inletDir_;
101
102
103public:
104
105 //- Runtime type information
106 TypeName("pressureDirectedInletOutletVelocity");
107
108
109 // Constructors
110
111 //- Construct from patch and internal field
113 (
114 const fvPatch&,
116 );
117
118 //- Construct from patch, internal field and dictionary
120 (
121 const fvPatch&,
123 const dictionary&
124 );
126 //- Construct by mapping given
127 // pressureDirectedInletOutletVelocityFvPatchVectorField
128 // onto a new patch
130 (
132 const fvPatch&,
134 const fvPatchFieldMapper&
135 );
136
137 //- Construct as copy
139 (
141 );
142
143 //- Construct and return a clone
144 virtual tmp<fvPatchVectorField> clone() const
145 {
147 (
149 (
150 *this
151 )
152 );
153 }
154
155 //- Construct as copy setting internal field reference
157 (
160 );
161
162 //- Construct and return a clone setting internal field reference
164 (
166 ) const
167 {
169 (
171 (
172 *this,
173 iF
174 )
175 );
176 }
177
178
179 // Member functions
180
181 // Attributes
183 //- Return true: this patch field is altered by assignment
184 virtual bool assignable() const
185 {
186 return true;
187 }
188
189
190 // Access
191
192 //- Return the name of rho
193 const word& rhoName() const
194 {
195 return rhoName_;
196 }
197
198 //- Return reference to the name of rho to allow adjustment
199 word& rhoName()
200 {
201 return rhoName_;
202 }
204 //- Return the name of phi
205 const word& phiName() const
206 {
207 return phiName_;
208 }
209
210 //- Return reference to the name of phi to allow adjustment
211 word& phiName()
213 return phiName_;
214 }
215
216
217 // Mapping functions
219 //- Map (and resize as needed) from self given a mapping object
220 virtual void autoMap
221 (
222 const fvPatchFieldMapper&
223 );
225 //- Reverse map the given fvPatchField onto this fvPatchField
226 virtual void rmap
227 (
228 const fvPatchVectorField&,
229 const labelList&
230 );
231
232
233 //- Update the coefficients associated with the patch field
234 virtual void updateCoeffs();
235
236 //- Write
237 virtual void write(Ostream&) const;
238
239
240 // Member operators
241
242 virtual void operator=(const fvPatchField<vector>& pvf);
243};
244
245
246// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247
248} // End namespace Foam
249
250// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251
252#endif
253
254// ************************************************************************* //
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.
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.
TypeName("pressureDirectedInletOutletVelocity")
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