initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / flowRateInletVelocity / flowRateInletVelocityFvPatchVectorField.H
blobefc904ef563719401da335b2804a72ef4244d937
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2006-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::flowRateInletVelocityFvPatchVectorField
28 Description
29     Describes a volumetric/mass flow normal vector boundary condition by its
30     magnitude as an integral over its area.
32     The basis of the patch (volumetric or mass) is determined by the
33     dimensions of the flux, phi.
34     The current density is used to correct the velocity when applying the
35     mass basis.
37     Example of the boundary condition specification:
38     @verbatim
39     inlet
40     {
41         type            flowRateInletVelocity;
42         flowRate        0.2;        // Volumetric/mass flow rate [m3/s or kg/s]
43         value           uniform (0 0 0); // placeholder
44     }
45     @endverbatim
47 Note
48     - The value is positive inwards
49     - May not work correctly for transonic inlets
50     - Strange behaviour with potentialFoam since the U equation is not solved
52 SourceFiles
53     flowRateInletVelocityFvPatchVectorField.C
55 \*---------------------------------------------------------------------------*/
57 #ifndef flowRateInletVelocityFvPatchVectorField_H
58 #define flowRateInletVelocityFvPatchVectorField_H
60 #include "fixedValueFvPatchFields.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 namespace Foam
66 /*---------------------------------------------------------------------------*\
67                Class flowRateInletVelocityFvPatch Declaration
68 \*---------------------------------------------------------------------------*/
70 class flowRateInletVelocityFvPatchVectorField
72     public fixedValueFvPatchVectorField
74     // Private data
76         //- Inlet integral flow rate
77         scalar flowRate_;
79         //- Name of the flux transporting the field
80         word phiName_;
82         //- Name of the density field used to normalize the mass flux
83         word rhoName_;
86 public:
88    //- Runtime type information
89    TypeName("flowRateInletVelocity");
92    // Constructors
94         //- Construct from patch and internal field
95         flowRateInletVelocityFvPatchVectorField
96         (
97             const fvPatch&,
98             const DimensionedField<vector, volMesh>&
99         );
101         //- Construct from patch, internal field and dictionary
102         flowRateInletVelocityFvPatchVectorField
103         (
104             const fvPatch&,
105             const DimensionedField<vector, volMesh>&,
106             const dictionary&
107         );
109         //- Construct by mapping given
110         //  flowRateInletVelocityFvPatchVectorField
111         //  onto a new patch
112         flowRateInletVelocityFvPatchVectorField
113         (
114             const flowRateInletVelocityFvPatchVectorField&,
115             const fvPatch&,
116             const DimensionedField<vector, volMesh>&,
117             const fvPatchFieldMapper&
118         );
120         //- Construct as copy
121         flowRateInletVelocityFvPatchVectorField
122         (
123             const flowRateInletVelocityFvPatchVectorField&
124         );
126         //- Construct and return a clone
127         virtual tmp<fvPatchVectorField> clone() const
128         {
129             return tmp<fvPatchVectorField>
130             (
131                 new flowRateInletVelocityFvPatchVectorField(*this)
132             );
133         }
135         //- Construct as copy setting internal field reference
136         flowRateInletVelocityFvPatchVectorField
137         (
138             const flowRateInletVelocityFvPatchVectorField&,
139             const DimensionedField<vector, volMesh>&
140         );
142         //- Construct and return a clone setting internal field reference
143         virtual tmp<fvPatchVectorField> clone
144         (
145             const DimensionedField<vector, volMesh>& iF
146         ) const
147         {
148             return tmp<fvPatchVectorField>
149             (
150                 new flowRateInletVelocityFvPatchVectorField(*this, iF)
151             );
152         }
155     // Member functions
157         // Access
159             //- Return the flux
160             scalar flowRate() const
161             {
162                 return flowRate_;
163             }
165             //- Return reference to the flux to allow adjustment
166             scalar& flowRate()
167             {
168                 return flowRate_;
169             }
172         //- Update the coefficients associated with the patch field
173         virtual void updateCoeffs();
175         //- Write
176         virtual void write(Ostream&) const;
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #endif
189 // ************************************************************************* //