matchedFlowRateOutletVelocityFvPatchVectorField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2023 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 Description
28  Velocity outlet boundary condition which corrects the extrapolated velocity
29  to match the flow rate of the specified corresponding inlet patch.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  inletPatch | Corresponding inlet patch name | yes |
35  volumetric | Set volumetric or mass flow-rate | no | false
36  rho | density field name | no | rho
37  \endtable
38 
39  Example of the boundary condition specification for a volumetric flow rate:
40  \verbatim
41  <patchName>
42  {
43  type matchedFlowRateOutletVelocity;
44  inletPatch inlet;
45  value uniform (0 0 0);
46  }
47  \endverbatim
48 
49 See also
50  Foam::fixedValueFvPatchField
51 
52 SourceFiles
53  matchedFlowRateOutletVelocityFvPatchVectorField.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef matchedFlowRateOutletVelocityFvPatchVectorField_H
58 #define matchedFlowRateOutletVelocityFvPatchVectorField_H
59 
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class matchedFlowRateOutletVelocityFvPatchVectorField Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class matchedFlowRateOutletVelocityFvPatchVectorField
72 :
73  public fixedValueFvPatchVectorField
74 {
75  // Private Data
76 
77  //- Inlet patch name from which the corresponding flow rate is obtained
78  word inletPatchName_;
79 
80  //- Is volumetric?
81  bool volumetric_;
82 
83  //- Name of the density field used to normalise the mass flux
84  word rhoName_;
85 
86 
87  // Private Member Functions
88 
89  //- Update the patch values given the appropriate density type and value
90  template<class RhoType>
91  void updateValues
92  (
93  const label inletPatchID,
94  const RhoType& rhoOutlet,
95  const RhoType& rhoInlet
96  );
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("matchedFlowRateOutletVelocity");
103 
104 
105  // Constructors
106 
107  //- Construct from patch, internal field and dictionary
109  (
110  const fvPatch&,
112  const dictionary&
113  );
114 
115  //- Construct by mapping given
116  // matchedFlowRateOutletVelocityFvPatchVectorField
117  // onto a new patch
119  (
121  const fvPatch&,
123  const fvPatchFieldMapper&
124  );
125 
126  //- Disallow copy without setting internal field reference
128  (
130  ) = delete;
131 
132  //- Copy constructor setting internal field reference
134  (
137  );
138 
139  //- Construct and return a clone setting internal field reference
141  (
143  ) const
144  {
146  (
148  );
149  }
150 
151 
152  // Member Functions
153 
154  //- Update the coefficients associated with the patch field
155  virtual void updateCoeffs();
156 
157  //- Write
158  virtual void write(Ostream&) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
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:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Velocity outlet boundary condition which corrects the extrapolated velocity to match the flow rate of...
virtual tmp< fvPatchVectorField > clone(const DimensionedField< vector, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("matchedFlowRateOutletVelocity")
Runtime type information.
matchedFlowRateOutletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
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