FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

flowRateInletVelocityFvPatchVectorField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2006-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::flowRateInletVelocityFvPatchVectorField
00026 
00027 Description
00028     Describes a volumetric/mass flow normal vector boundary condition by its
00029     magnitude as an integral over its area.
00030 
00031     The basis of the patch (volumetric or mass) is determined by the
00032     dimensions of the flux, phi.
00033     The current density is used to correct the velocity when applying the
00034     mass basis.
00035 
00036     Example of the boundary condition specification:
00037     @verbatim
00038     inlet
00039     {
00040         type            flowRateInletVelocity;
00041         flowRate        0.2;        // Volumetric/mass flow rate [m3/s or kg/s]
00042         value           uniform (0 0 0); // placeholder
00043     }
00044     @endverbatim
00045 
00046 Note
00047     - The value is positive inwards
00048     - May not work correctly for transonic inlets
00049     - Strange behaviour with potentialFoam since the U equation is not solved
00050 
00051 SourceFiles
00052     flowRateInletVelocityFvPatchVectorField.C
00053 
00054 \*---------------------------------------------------------------------------*/
00055 
00056 #ifndef flowRateInletVelocityFvPatchVectorField_H
00057 #define flowRateInletVelocityFvPatchVectorField_H
00058 
00059 #include <finiteVolume/fixedValueFvPatchFields.H>
00060 
00061 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00062 
00063 namespace Foam
00064 {
00065 /*---------------------------------------------------------------------------*\
00066                Class flowRateInletVelocityFvPatch Declaration
00067 \*---------------------------------------------------------------------------*/
00068 
00069 class flowRateInletVelocityFvPatchVectorField
00070 :
00071     public fixedValueFvPatchVectorField
00072 {
00073     // Private data
00074 
00075         //- Inlet integral flow rate
00076         scalar flowRate_;
00077 
00078         //- Name of the flux transporting the field
00079         word phiName_;
00080 
00081         //- Name of the density field used to normalize the mass flux
00082         word rhoName_;
00083 
00084 
00085 public:
00086 
00087    //- Runtime type information
00088    TypeName("flowRateInletVelocity");
00089 
00090 
00091    // Constructors
00092 
00093         //- Construct from patch and internal field
00094         flowRateInletVelocityFvPatchVectorField
00095         (
00096             const fvPatch&,
00097             const DimensionedField<vector, volMesh>&
00098         );
00099 
00100         //- Construct from patch, internal field and dictionary
00101         flowRateInletVelocityFvPatchVectorField
00102         (
00103             const fvPatch&,
00104             const DimensionedField<vector, volMesh>&,
00105             const dictionary&
00106         );
00107 
00108         //- Construct by mapping given
00109         //  flowRateInletVelocityFvPatchVectorField
00110         //  onto a new patch
00111         flowRateInletVelocityFvPatchVectorField
00112         (
00113             const flowRateInletVelocityFvPatchVectorField&,
00114             const fvPatch&,
00115             const DimensionedField<vector, volMesh>&,
00116             const fvPatchFieldMapper&
00117         );
00118 
00119         //- Construct as copy
00120         flowRateInletVelocityFvPatchVectorField
00121         (
00122             const flowRateInletVelocityFvPatchVectorField&
00123         );
00124 
00125         //- Construct and return a clone
00126         virtual tmp<fvPatchVectorField> clone() const
00127         {
00128             return tmp<fvPatchVectorField>
00129             (
00130                 new flowRateInletVelocityFvPatchVectorField(*this)
00131             );
00132         }
00133 
00134         //- Construct as copy setting internal field reference
00135         flowRateInletVelocityFvPatchVectorField
00136         (
00137             const flowRateInletVelocityFvPatchVectorField&,
00138             const DimensionedField<vector, volMesh>&
00139         );
00140 
00141         //- Construct and return a clone setting internal field reference
00142         virtual tmp<fvPatchVectorField> clone
00143         (
00144             const DimensionedField<vector, volMesh>& iF
00145         ) const
00146         {
00147             return tmp<fvPatchVectorField>
00148             (
00149                 new flowRateInletVelocityFvPatchVectorField(*this, iF)
00150             );
00151         }
00152 
00153 
00154     // Member functions
00155 
00156         // Access
00157 
00158             //- Return the flux
00159             scalar flowRate() const
00160             {
00161                 return flowRate_;
00162             }
00163 
00164             //- Return reference to the flux to allow adjustment
00165             scalar& flowRate()
00166             {
00167                 return flowRate_;
00168             }
00169 
00170 
00171         //- Update the coefficients associated with the patch field
00172         virtual void updateCoeffs();
00173 
00174         //- Write
00175         virtual void write(Ostream&) const;
00176 
00177 };
00178 
00179 
00180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00181 
00182 } // End namespace Foam
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 #endif
00187 
00188 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines