fixedNormalInletOutletVelocityFvPatchVectorField.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 | Copyright (C) 2014 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::fixedNormalInletOutletVelocityFvPatchVectorField
26 
27 Group
28  grpInletletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31 
32  This velocity inlet/outlet boundary condition combines a fixed normal
33  component obtained from the "normalVelocity" patchField supplied with a
34  fixed or zero-gradiented tangential component depending on the direction
35  of the flow and the setting of "fixTangentialInflow":
36  - Outflow: apply zero-gradient condition to tangential components
37  - Inflow:
38  - fixTangentialInflow is true
39  apply value provided by the normalVelocity patchField to the
40  tangential components
41  - fixTangentialInflow is false
42  apply zero-gradient condition to tangential components.
43 
44  \heading Patch usage
45 
46  \table
47  Property | Description | Required | Default value
48  phi | flux field name | no | phi
49  fixTangentialInflow | If true fix the tangential component for inflow | yes |
50  normalVelocity | patchField providing the normal velocity field | yes |
51  \endtable
52 
53  Example of the boundary condition specification:
54  \verbatim
55  myPatch
56  {
57  type fixedNormalInletOutletVelocity;
58 
59  fixTangentialInflow false;
60  normalVelocity
61  {
62  type oscillatingFixedValue;
63  refValue uniform (0 1 0);
64  offset (0 -1 0);
65  amplitude table
66  (
67  ( 0 0)
68  ( 2 0.088)
69  ( 8 0.088)
70  );
71  frequency constant 1;
72  }
73 
74  value uniform (0 0 0);
75  }
76  \endverbatim
77 
78 SourceFiles
79  fixedNormalInletOutletVelocityFvPatchVectorField.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef fixedNormalInletOutletVelocityFvPatchVectorField_H
84 #define fixedNormalInletOutletVelocityFvPatchVectorField_H
85 
86 #include "fvPatchFields.H"
88 #include "Switch.H"
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 
95 /*---------------------------------------------------------------------------*\
96  Class fixedNormalInletOutletVelocityFvPatchVectorField Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class fixedNormalInletOutletVelocityFvPatchVectorField
100 :
101  public directionMixedFvPatchVectorField
102 {
103  // Private data
104 
105  //- Flux field name
106  word phiName_;
107 
108  //- Set true to fix the tangential component for inflow
109  Switch fixTangentialInflow_;
110 
111  //- BC which provided the normal component of the velocity
112  tmp<fvPatchVectorField> normalVelocity_;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("fixedNormalInletOutletVelocity");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given
139  // fixedNormalInletOutletVelocityFvPatchVectorField onto a new patch
141  (
143  const fvPatch&,
145  const fvPatchFieldMapper&
146  );
147 
148  //- Construct as copy
150  (
152  );
153 
154  //- Construct and return a clone
155  virtual tmp<fvPatchVectorField> clone() const
156  {
158  (
160  );
161  }
162 
163  //- Construct as copy setting internal field reference
165  (
168  );
169 
170  //- Construct and return a clone setting internal field reference
172  (
174  ) const
175  {
177  (
179  );
180  }
181 
182 
183  // Member functions
184 
185  // Access
186 
187  //- Return the name of phi
188  const word& phiName() const
189  {
190  return phiName_;
191  }
192 
193  //- Return reference to the name of phi to allow adjustment
194  word& phiName()
195  {
196  return phiName_;
197  }
198 
199  Switch fixTangentialInflow() const
200  {
201  return fixTangentialInflow_;
202  }
203 
204  //- Return the BC which provides the normal component of velocity
205  const fvPatchVectorField& normalVelocity() const
206  {
207  return normalVelocity_();
208  }
209 
210 
211  // Mapping functions
212 
213  //- Map (and resize as needed) from self given a mapping object
214  virtual void autoMap
215  (
216  const fvPatchFieldMapper&
217  );
218 
219  //- Reverse map the given fvPatchField onto this fvPatchField
220  virtual void rmap
221  (
222  const fvPatchVectorField&,
223  const labelList&
224  );
225 
226 
227  //- Update the coefficients associated with the patch field
228  virtual void updateCoeffs();
229 
230  //- Write
231  virtual void write(Ostream&) const;
232 
233 
234  // Member operators
235 
236  virtual void operator=(const fvPatchField<vector>& pvf);
237 };
238 
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 } // End namespace Foam
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 #endif
247 
248 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::rmap
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:137
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::phiName
const word & phiName() const
Return the name of phi.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:207
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::operator=
virtual void operator=(const fvPatchField< vector > &pvf)
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:197
directionMixedFvPatchFields.H
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::phiName_
word phiName_
Flux field name.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:125
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:151
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::fixTangentialInflow_
Switch fixTangentialInflow_
Set true to fix the tangential component for inflow.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:128
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Switch.H
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::normalVelocity_
tmp< fvPatchVectorField > normalVelocity_
BC which provided the normal component of the velocity.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:131
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::TypeName
TypeName("fixedNormalInletOutletVelocity")
Runtime type information.
Foam::fixedNormalInletOutletVelocityFvPatchVectorField
This velocity inlet/outlet boundary condition combines a fixed normal component obtained from the "no...
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:118
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:177
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:127
Foam::fvPatchVectorField
fvPatchField< vector > fvPatchVectorField
Definition: fvPatchFieldsFwd.H:41
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::phiName
word & phiName()
Return reference to the name of phi to allow adjustment.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:213
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::fixedNormalInletOutletVelocityFvPatchVectorField
fixedNormalInletOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.C:36
fvPatchFields.H
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:174
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::fixTangentialInflow
Switch fixTangentialInflow() const
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:218
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::fixedNormalInletOutletVelocityFvPatchVectorField::normalVelocity
const fvPatchVectorField & normalVelocity() const
Return the BC which provides the normal component of velocity.
Definition: fixedNormalInletOutletVelocityFvPatchVectorField.H:224