BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / derived / flowRateInletVelocity / flowRateInletVelocityFvPatchVectorField.H
blobb00368a5a579ee63b37306254183a1b152a8ebed
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::flowRateInletVelocityFvPatchVectorField
27 Description
28     Describes a volumetric/mass flow normal vector boundary condition by its
29     magnitude as an integral over its area.
31     The basis of the patch (volumetric or mass) is determined by the
32     dimensions of the flux, phi.
33     The current density is used to correct the velocity when applying the
34     mass basis.
36     Example of the boundary condition specification:
37     \verbatim
38     inlet
39     {
40         type        flowRateInletVelocity;
41         flowRate    0.2;        // Volumetric/mass flow rate [m3/s or kg/s]
42         value       uniform (0 0 0); // placeholder
43     }
44     \endverbatim
46 Note
47     - The value is positive inwards
48     - May not work correctly for transonic inlets
49     - Strange behaviour with potentialFoam since the U equation is not solved
51 SourceFiles
52     flowRateInletVelocityFvPatchVectorField.C
54 \*---------------------------------------------------------------------------*/
56 #ifndef flowRateInletVelocityFvPatchVectorField_H
57 #define flowRateInletVelocityFvPatchVectorField_H
59 #include "fixedValueFvPatchFields.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 namespace Foam
65 /*---------------------------------------------------------------------------*\
66                Class flowRateInletVelocityFvPatch Declaration
67 \*---------------------------------------------------------------------------*/
69 class flowRateInletVelocityFvPatchVectorField
71     public fixedValueFvPatchVectorField
73     // Private data
75         //- Inlet integral flow rate
76         scalar flowRate_;
78         //- Name of the flux transporting the field
79         word phiName_;
81         //- Name of the density field used to normalize the mass flux
82         word rhoName_;
85 public:
87    //- Runtime type information
88    TypeName("flowRateInletVelocity");
91    // Constructors
93         //- Construct from patch and internal field
94         flowRateInletVelocityFvPatchVectorField
95         (
96             const fvPatch&,
97             const DimensionedField<vector, volMesh>&
98         );
100         //- Construct from patch, internal field and dictionary
101         flowRateInletVelocityFvPatchVectorField
102         (
103             const fvPatch&,
104             const DimensionedField<vector, volMesh>&,
105             const dictionary&
106         );
108         //- Construct by mapping given
109         //  flowRateInletVelocityFvPatchVectorField
110         //  onto a new patch
111         flowRateInletVelocityFvPatchVectorField
112         (
113             const flowRateInletVelocityFvPatchVectorField&,
114             const fvPatch&,
115             const DimensionedField<vector, volMesh>&,
116             const fvPatchFieldMapper&
117         );
119         //- Construct as copy
120         flowRateInletVelocityFvPatchVectorField
121         (
122             const flowRateInletVelocityFvPatchVectorField&
123         );
125         //- Construct and return a clone
126         virtual tmp<fvPatchVectorField> clone() const
127         {
128             return tmp<fvPatchVectorField>
129             (
130                 new flowRateInletVelocityFvPatchVectorField(*this)
131             );
132         }
134         //- Construct as copy setting internal field reference
135         flowRateInletVelocityFvPatchVectorField
136         (
137             const flowRateInletVelocityFvPatchVectorField&,
138             const DimensionedField<vector, volMesh>&
139         );
141         //- Construct and return a clone setting internal field reference
142         virtual tmp<fvPatchVectorField> clone
143         (
144             const DimensionedField<vector, volMesh>& iF
145         ) const
146         {
147             return tmp<fvPatchVectorField>
148             (
149                 new flowRateInletVelocityFvPatchVectorField(*this, iF)
150             );
151         }
154     // Member functions
156         // Access
158             //- Return the flux
159             scalar flowRate() const
160             {
161                 return flowRate_;
162             }
164             //- Return reference to the flux to allow adjustment
165             scalar& flowRate()
166             {
167                 return flowRate_;
168             }
171         //- Update the coefficients associated with the patch field
172         virtual void updateCoeffs();
174         //- Write
175         virtual void write(Ostream&) const;
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 } // End namespace Foam
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 #endif
188 // ************************************************************************* //