1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
26 Foam::flowRateInletVelocityFvPatchVectorField
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
37 Example of the boundary condition specification:
41 type flowRateInletVelocity;
42 flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
43 value uniform (0 0 0); // placeholder
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
53 flowRateInletVelocityFvPatchVectorField.C
55 \*---------------------------------------------------------------------------*/
57 #ifndef flowRateInletVelocityFvPatchVectorField_H
58 #define flowRateInletVelocityFvPatchVectorField_H
60 #include "fixedValueFvPatchFields.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 /*---------------------------------------------------------------------------*\
67 Class flowRateInletVelocityFvPatch Declaration
68 \*---------------------------------------------------------------------------*/
70 class flowRateInletVelocityFvPatchVectorField
72 public fixedValueFvPatchVectorField
76 //- Inlet integral flow rate
79 //- Name of the flux transporting the field
82 //- Name of the density field used to normalize the mass flux
88 //- Runtime type information
89 TypeName("flowRateInletVelocity");
94 //- Construct from patch and internal field
95 flowRateInletVelocityFvPatchVectorField
98 const DimensionedField<vector, volMesh>&
101 //- Construct from patch, internal field and dictionary
102 flowRateInletVelocityFvPatchVectorField
105 const DimensionedField<vector, volMesh>&,
109 //- Construct by mapping given
110 // flowRateInletVelocityFvPatchVectorField
112 flowRateInletVelocityFvPatchVectorField
114 const flowRateInletVelocityFvPatchVectorField&,
116 const DimensionedField<vector, volMesh>&,
117 const fvPatchFieldMapper&
120 //- Construct as copy
121 flowRateInletVelocityFvPatchVectorField
123 const flowRateInletVelocityFvPatchVectorField&
126 //- Construct and return a clone
127 virtual tmp<fvPatchVectorField> clone() const
129 return tmp<fvPatchVectorField>
131 new flowRateInletVelocityFvPatchVectorField(*this)
135 //- Construct as copy setting internal field reference
136 flowRateInletVelocityFvPatchVectorField
138 const flowRateInletVelocityFvPatchVectorField&,
139 const DimensionedField<vector, volMesh>&
142 //- Construct and return a clone setting internal field reference
143 virtual tmp<fvPatchVectorField> clone
145 const DimensionedField<vector, volMesh>& iF
148 return tmp<fvPatchVectorField>
150 new flowRateInletVelocityFvPatchVectorField(*this, iF)
160 scalar flowRate() const
165 //- Return reference to the flux to allow adjustment
172 //- Update the coefficients associated with the patch field
173 virtual void updateCoeffs();
176 virtual void write(Ostream&) const;
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 // ************************************************************************* //