1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
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
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/>.
25 Foam::flowRateInletVelocityFvPatchVectorField
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
36 Example of the boundary condition specification:
40 type flowRateInletVelocity;
41 flowRate 0.2; // Volumetric/mass flow rate [m3/s or kg/s]
42 value uniform (0 0 0); // placeholder
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
52 flowRateInletVelocityFvPatchVectorField.C
54 \*---------------------------------------------------------------------------*/
56 #ifndef flowRateInletVelocityFvPatchVectorField_H
57 #define flowRateInletVelocityFvPatchVectorField_H
59 #include "fixedValueFvPatchFields.H"
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 /*---------------------------------------------------------------------------*\
66 Class flowRateInletVelocityFvPatch Declaration
67 \*---------------------------------------------------------------------------*/
69 class flowRateInletVelocityFvPatchVectorField
71 public fixedValueFvPatchVectorField
75 //- Inlet integral flow rate
78 //- Name of the flux transporting the field
81 //- Name of the density field used to normalize the mass flux
87 //- Runtime type information
88 TypeName("flowRateInletVelocity");
93 //- Construct from patch and internal field
94 flowRateInletVelocityFvPatchVectorField
97 const DimensionedField<vector, volMesh>&
100 //- Construct from patch, internal field and dictionary
101 flowRateInletVelocityFvPatchVectorField
104 const DimensionedField<vector, volMesh>&,
108 //- Construct by mapping given
109 // flowRateInletVelocityFvPatchVectorField
111 flowRateInletVelocityFvPatchVectorField
113 const flowRateInletVelocityFvPatchVectorField&,
115 const DimensionedField<vector, volMesh>&,
116 const fvPatchFieldMapper&
119 //- Construct as copy
120 flowRateInletVelocityFvPatchVectorField
122 const flowRateInletVelocityFvPatchVectorField&
125 //- Construct and return a clone
126 virtual tmp<fvPatchVectorField> clone() const
128 return tmp<fvPatchVectorField>
130 new flowRateInletVelocityFvPatchVectorField(*this)
134 //- Construct as copy setting internal field reference
135 flowRateInletVelocityFvPatchVectorField
137 const flowRateInletVelocityFvPatchVectorField&,
138 const DimensionedField<vector, volMesh>&
141 //- Construct and return a clone setting internal field reference
142 virtual tmp<fvPatchVectorField> clone
144 const DimensionedField<vector, volMesh>& iF
147 return tmp<fvPatchVectorField>
149 new flowRateInletVelocityFvPatchVectorField(*this, iF)
159 scalar flowRate() const
164 //- Return reference to the flux to allow adjustment
171 //- Update the coefficients associated with the patch field
172 virtual void updateCoeffs();
175 virtual void write(Ostream&) const;
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 } // End namespace Foam
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 // ************************************************************************* //