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