OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::flowRateInletVelocityFvPatchVectorField
00027 
00028 Description
00029     Describes a volumetric/mass flow normal vector boundary condition by its
00030     magnitude as an integral over its area.
00031 
00032     The basis of the patch (volumetric or mass) is determined by the
00033     dimensions of the flux, phi.
00034     The current density is used to correct the velocity when applying the
00035     mass basis.
00036 
00037     Example of the boundary condition specification:
00038     @verbatim
00039     inlet
00040     {
00041         type            flowRateInletVelocity;
00042         flowRate        0.2;        // Volumetric/mass flow rate [m3/s or kg/s]
00043         value           uniform (0 0 0); // placeholder
00044     }
00045     @endverbatim
00046 
00047 Note
00048     - The value is positive inwards
00049     - May not work correctly for transonic inlets
00050     - Strange behaviour with potentialFoam since the U equation is not solved
00051 
00052 SourceFiles
00053     flowRateInletVelocityFvPatchVectorField.C
00054 
00055 \*---------------------------------------------------------------------------*/
00056 
00057 #ifndef flowRateInletVelocityFvPatchVectorField_H
00058 #define flowRateInletVelocityFvPatchVectorField_H
00059 
00060 #include "fixedValueFvPatchFields.H"
00061 
00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063 
00064 namespace Foam
00065 {
00066 /*---------------------------------------------------------------------------*\
00067                Class flowRateInletVelocityFvPatch Declaration
00068 \*---------------------------------------------------------------------------*/
00069 
00070 class flowRateInletVelocityFvPatchVectorField
00071 :
00072     public fixedValueFvPatchVectorField
00073 {
00074     // Private data
00075 
00076         //- Inlet integral flow rate
00077         scalar flowRate_;
00078 
00079         //- Name of the flux transporting the field
00080         word phiName_;
00081 
00082         //- Name of the density field used to normalize the mass flux
00083         word rhoName_;
00084 
00085 
00086 public:
00087 
00088    //- Runtime type information
00089    TypeName("flowRateInletVelocity");
00090 
00091 
00092    // Constructors
00093 
00094         //- Construct from patch and internal field
00095         flowRateInletVelocityFvPatchVectorField
00096         (
00097             const fvPatch&,
00098             const DimensionedField<vector, volMesh>&
00099         );
00100 
00101         //- Construct from patch, internal field and dictionary
00102         flowRateInletVelocityFvPatchVectorField
00103         (
00104             const fvPatch&,
00105             const DimensionedField<vector, volMesh>&,
00106             const dictionary&
00107         );
00108 
00109         //- Construct by mapping given
00110         //  flowRateInletVelocityFvPatchVectorField
00111         //  onto a new patch
00112         flowRateInletVelocityFvPatchVectorField
00113         (
00114             const flowRateInletVelocityFvPatchVectorField&,
00115             const fvPatch&,
00116             const DimensionedField<vector, volMesh>&,
00117             const fvPatchFieldMapper&
00118         );
00119 
00120         //- Construct as copy
00121         flowRateInletVelocityFvPatchVectorField
00122         (
00123             const flowRateInletVelocityFvPatchVectorField&
00124         );
00125 
00126         //- Construct and return a clone
00127         virtual tmp<fvPatchVectorField> clone() const
00128         {
00129             return tmp<fvPatchVectorField>
00130             (
00131                 new flowRateInletVelocityFvPatchVectorField(*this)
00132             );
00133         }
00134 
00135         //- Construct as copy setting internal field reference
00136         flowRateInletVelocityFvPatchVectorField
00137         (
00138             const flowRateInletVelocityFvPatchVectorField&,
00139             const DimensionedField<vector, volMesh>&
00140         );
00141 
00142         //- Construct and return a clone setting internal field reference
00143         virtual tmp<fvPatchVectorField> clone
00144         (
00145             const DimensionedField<vector, volMesh>& iF
00146         ) const
00147         {
00148             return tmp<fvPatchVectorField>
00149             (
00150                 new flowRateInletVelocityFvPatchVectorField(*this, iF)
00151             );
00152         }
00153 
00154 
00155     // Member functions
00156 
00157         // Access
00158 
00159             //- Return the flux
00160             scalar flowRate() const
00161             {
00162                 return flowRate_;
00163             }
00164 
00165             //- Return reference to the flux to allow adjustment
00166             scalar& flowRate()
00167             {
00168                 return flowRate_;
00169             }
00170 
00171 
00172         //- Update the coefficients associated with the patch field
00173         virtual void updateCoeffs();
00174 
00175         //- Write
00176         virtual void write(Ostream&) const;
00177 
00178 };
00179 
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 } // End namespace Foam
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 #endif
00188 
00189 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd