flowRateInletVelocityFvPatchVectorField.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) 2011-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::flowRateInletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a velocity boundary condition, derived
32  from the flux (volumetric or mass-based), whose direction is assumed
33  to be normal to the patch.
34 
35  For a mass-based flux:
36  - the flow rate should be provided in kg/s
37  - if \c rhoName is "none" the flow rate is in m3/s
38  - otherwise \c rhoName should correspond to the name of the density field
39  - if the density field cannot be found in the database, the user must
40  specify the inlet density using the \c rhoInlet entry
41 
42  For a volumetric-based flux:
43  - the flow rate is in m3/s
44 
45  \heading Patch usage
46 
47  \table
48  Property | Description | Required | Default value
49  massFlowRate | mass flow rate [kg/s] | no |
50  volumetricFlowRate | volumetric flow rate [m3/s]| no |
51  rhoInlet | inlet density | no |
52  \endtable
53 
54  Example of the boundary condition specification for a volumetric flow rate:
55  \verbatim
56  myPatch
57  {
58  type flowRateInletVelocity;
59  volumetricFlowRate 0.2;
60  value uniform (0 0 0); // placeholder
61  }
62  \endverbatim
63 
64  Example of the boundary condition specification for a mass flow rate:
65  \verbatim
66  myPatch
67  {
68  type flowRateInletVelocity;
69  massFlowRate 0.2;
70  rho rho;
71  rhoInlet 1.0;
72  }
73  \endverbatim
74 
75  The \c flowRate entry is a \c DataEntry type, meaning that it can be
76  specified as constant, a polynomial fuction of time, and ...
77 
78 Note
79  - \c rhoInlet is required for the case of a mass flow rate, where the
80  density field is not available at start-up
81  - the value is positive into the domain (as an inlet)
82  - may not work correctly for transonic inlets
83  - strange behaviour with potentialFoam since the U equation is not solved
84 
85 SeeAlso
86  Foam::DataEntry
87  Foam::fixedValueFvPatchField
88 
89 SourceFiles
90  flowRateInletVelocityFvPatchVectorField.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef flowRateInletVelocityFvPatchVectorField_H
95 #define flowRateInletVelocityFvPatchVectorField_H
96 
98 #include "DataEntry.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 /*---------------------------------------------------------------------------*\
105  Class flowRateInletVelocityFvPatchVectorField Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class flowRateInletVelocityFvPatchVectorField
109 :
110  public fixedValueFvPatchVectorField
111 {
112  // Private data
113 
114  //- Inlet integral flow rate
115  autoPtr<DataEntry<scalar> > flowRate_;
116 
117  //- Is volumetric?
118  bool volumetric_;
119 
120  //- Name of the density field used to normalize the mass flux
121  word rhoName_;
122 
123  //- Rho initialisation value (for start; if value not supplied)
124  scalar rhoInlet_;
125 
126 
127 public:
128 
129  //- Runtime type information
130  TypeName("flowRateInletVelocity");
131 
132 
133  // Constructors
134 
135  //- Construct from patch and internal field
137  (
138  const fvPatch&,
140  );
141 
142  //- Construct from patch, internal field and dictionary
144  (
145  const fvPatch&,
147  const dictionary&
148  );
149 
150  //- Construct by mapping given
151  // flowRateInletVelocityFvPatchVectorField
152  // onto a new patch
154  (
156  const fvPatch&,
158  const fvPatchFieldMapper&
159  );
160 
161  //- Construct as copy
163  (
165  );
166 
167  //- Construct and return a clone
168  virtual tmp<fvPatchVectorField> clone() const
169  {
171  (
173  );
174  }
175 
176  //- Construct as copy setting internal field reference
178  (
181  );
182 
183  //- Construct and return a clone setting internal field reference
185  (
187  ) const
188  {
190  (
192  );
193  }
194 
195 
196  // Member functions
197 
198  //- Update the coefficients associated with the patch field
199  virtual void updateCoeffs();
200 
201  //- Write
202  virtual void write(Ostream&) const;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
Foam::flowRateInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: flowRateInletVelocityFvPatchVectorField.C:191
Foam::flowRateInletVelocityFvPatchVectorField::TypeName
TypeName("flowRateInletVelocity")
Runtime type information.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::flowRateInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: flowRateInletVelocityFvPatchVectorField.H:187
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::flowRateInletVelocityFvPatchVectorField::rhoInlet_
scalar rhoInlet_
Rho initialisation value (for start; if value not supplied)
Definition: flowRateInletVelocityFvPatchVectorField.H:143
DataEntry.H
Foam::flowRateInletVelocityFvPatchVectorField::flowRateInletVelocityFvPatchVectorField
flowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: flowRateInletVelocityFvPatchVectorField.C:36
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::flowRateInletVelocityFvPatchVectorField::volumetric_
bool volumetric_
Is volumetric?
Definition: flowRateInletVelocityFvPatchVectorField.H:137
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: flowRateInletVelocityFvPatchVectorField.C:144
Foam::flowRateInletVelocityFvPatchVectorField::rhoName_
word rhoName_
Name of the density field used to normalize the mass flux.
Definition: flowRateInletVelocityFvPatchVectorField.H:140
Foam::flowRateInletVelocityFvPatchVectorField
This boundary condition provides a velocity boundary condition, derived from the flux (volumetric or ...
Definition: flowRateInletVelocityFvPatchVectorField.H:127
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
fixedValueFvPatchFields.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::flowRateInletVelocityFvPatchVectorField::flowRate_
autoPtr< DataEntry< scalar > > flowRate_
Inlet integral flow rate.
Definition: flowRateInletVelocityFvPatchVectorField.H:134
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51