matchedFlowRateOutletVelocityFvPatchVectorField.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) 2017 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::matchedFlowRateOutletVelocityFvPatchVectorField
26 
27 Group
28  grpOutletBoundaryConditions
29 
30 Description
31  Velocity outlet boundary condition which corrects the extrapolated velocity
32  to match the flow rate of the specified corresponding inlet patch.
33 
34 Usage
35  \table
36  Property | Description | Required | Default value
37  inletPatch | Corresponding inlet patch name | yes |
38  volumetric | Set volumetric or mass flow-rate | no | false
39  rho | density field name | no | rho
40  \endtable
41 
42  Example of the boundary condition specification for a volumetric flow rate:
43  \verbatim
44  <patchName>
45  {
46  type matchedFlowRateOutletVelocity;
47  inletPatch inlet;
48  value uniform (0 0 0);
49  }
50  \endverbatim
51 
52 See also
53  Foam::fixedValueFvPatchField
54 
55 SourceFiles
56  matchedFlowRateOutletVelocityFvPatchVectorField.C
57 
58 \*---------------------------------------------------------------------------*/
59 
60 #ifndef matchedFlowRateOutletVelocityFvPatchVectorField_H
61 #define matchedFlowRateOutletVelocityFvPatchVectorField_H
62 
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class matchedFlowRateOutletVelocityFvPatchVectorField Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class matchedFlowRateOutletVelocityFvPatchVectorField
75 :
76  public fixedValueFvPatchVectorField
77 {
78  // Private data
79 
80  //- Inlet patch name from which the corresponding flow rate is obtained
81  word inletPatchName_;
82 
83  //- Is volumetric?
84  bool volumetric_;
85 
86  //- Name of the density field used to normalize the mass flux
87  word rhoName_;
88 
89 
90  // Private member functions
91 
92  //- Update the patch values given the appropriate density type and value
93  template<class RhoType>
94  void updateValues
95  (
96  const label inletPatchID,
97  const RhoType& rhoOutlet,
98  const RhoType& rhoInlet
99  );
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("matchedFlowRateOutletVelocity");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // matchedFlowRateOutletVelocityFvPatchVectorField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchVectorField> clone() const
144  {
146  (
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  );
168  }
169 
170 
171  // Member functions
172 
173  //- Update the coefficients associated with the patch field
174  virtual void updateCoeffs();
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
TypeName("matchedFlowRateOutletVelocity")
Runtime type information.
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.