variableHeightFlowRateInletVelocityFvPatchVectorField.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-2012 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::variableHeightFlowRateInletVelocityFvPatchVectorField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a velocity boundary condition for
32  multphase flow based on a user-specified volumetric flow rate.
33 
34  The flow rate is made proportional to the phase fraction alpha at each
35  face of the patch and alpha is ensured to be bound between 0 and 1.
36 
37  \heading Patch usage
38 
39  \table
40  Property | Description | Required | Default value
41  flowRate | volumetric flow rate [m3/s] | yes |
42  alpha | phase-fraction field | yes |
43  \endtable
44 
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch
48  {
49  type variableHeightFlowRateInletVelocity;
50  flowRate 0.2;
51  alpha alpha.water;
52  value uniform (0 0 0); // placeholder
53  }
54  \endverbatim
55 
56 Note
57  - the value is positive into the domain
58  - may not work correctly for transonic inlets
59  - strange behaviour with potentialFoam since the momentum equation is
60  not solved
61 
62 SeeAlso
63  Foam::fixedValueFvPatchField
64 
65 SourceFiles
66  variableHeightFlowRateInletVelocityFvPatchVectorField.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef variableHeightFlowRateInletVelocityFvPatchVectorField_H
71 #define variableHeightFlowRateInletVelocityFvPatchVectorField_H
72 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 /*---------------------------------------------------------------------------*\
80  Class variableHeightFlowRateInletVelocityFvPatchVectorField Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class variableHeightFlowRateInletVelocityFvPatchVectorField
84 :
85  public fixedValueFvPatchVectorField
86 {
87  // Private data
88 
89  //- Inlet integral flow rate
90  scalar flowRate_;
91 
92  //- Name of the phase-fraction field
93  word alphaName_;
94 
95 
96 public:
97 
98  //- Runtime type information
99  TypeName("variableHeightFlowRateInletVelocity");
100 
101 
102  // Constructors
103 
104  //- Construct from patch and internal field
106  (
107  const fvPatch&,
109  );
110 
111  //- Construct from patch, internal field and dictionary
113  (
114  const fvPatch&,
116  const dictionary&
117  );
118 
119  //- Construct by mapping given
120  // variableHeightFlowRateInletVelocityFvPatchVectorField
121  // onto a new patch
123  (
125  const fvPatch&,
127  const fvPatchFieldMapper&
128  );
129 
130  //- Construct as copy
132  (
134  );
135 
136  //- Construct and return a clone
137  virtual tmp<fvPatchVectorField> clone() const
138  {
140  (
142  );
143  }
144 
145  //- Construct as copy setting internal field reference
147  (
150  );
151 
152  //- Construct and return a clone setting internal field reference
154  (
156  ) const
157  {
159  (
161  (
162  *this,
163  iF
164  )
165  );
166  }
167 
168 
169  // Member functions
170 
171  // Access
172 
173  //- Return the flux
174  scalar flowRate() const
175  {
176  return flowRate_;
177  }
178 
179  //- Return reference to the flux to allow adjustment
180  scalar& flowRate()
181  {
182  return flowRate_;
183  }
184 
185 
186  //- Update the coefficients associated with the patch field
187  virtual void updateCoeffs();
188 
189  //- Write
190  virtual void write(Ostream&) const;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
This boundary condition provides a velocity boundary condition for multphase flow based on a user-spe...
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:97
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::variableHeightFlowRateInletVelocityFvPatchVectorField::flowRate_
scalar flowRate_
Inlet integral flow rate.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:104
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::TypeName
TypeName("variableHeightFlowRateInletVelocity")
Runtime type information.
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::variableHeightFlowRateInletVelocityFvPatchVectorField
variableHeightFlowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.C:36
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.C:104
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::variableHeightFlowRateInletVelocityFvPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.C:129
fixedValueFvPatchFields.H
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::flowRate
scalar & flowRate()
Return reference to the flux to allow adjustment.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:194
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::variableHeightFlowRateInletVelocityFvPatchVectorField::clone
virtual tmp< fvPatchVectorField > clone() const
Construct and return a clone.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:151
Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::alphaName_
word alphaName_
Name of the phase-fraction field.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:107
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::variableHeightFlowRateInletVelocityFvPatchVectorField::flowRate
scalar flowRate() const
Return the flux.
Definition: variableHeightFlowRateInletVelocityFvPatchVectorField.H:188