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

swirlFlowRateInletVelocityFvPatchVectorField.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) 2010-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 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::swirlFlowRateInletVelocityFvPatchVectorField
00027 
00028 Description
00029     Describes a volumetric/mass flow normal vector boundary condition by its
00030     magnitude as an integral over its area with a swirl component determined
00031     by the RPM
00032 
00033     The basis of the patch (volumetric or mass) is determined by the
00034     dimensions of the flux, phi.
00035     The current density is used to correct the velocity when applying the
00036     mass basis.
00037 
00038     Example of the boundary condition specification:
00039     @verbatim
00040     inlet
00041     {
00042         type            swirlFlowRateInletVelocity;
00043         flowRate        0.2;        // Volumetric/mass flow rate [m3/s or kg/s]
00044         rpm             100;
00045     }
00046     @endverbatim
00047 
00048 Note
00049     - The value is positive inwards
00050 
00051 SourceFiles
00052     swirlFlowRateInletVelocityFvPatchVectorField.C
00053 
00054 \*---------------------------------------------------------------------------*/
00055 
00056 #ifndef swirlFlowRateInletVelocityFvPatchVectorField_H
00057 #define swirlFlowRateInletVelocityFvPatchVectorField_H
00058 
00059 #include <finiteVolume/fixedValueFvPatchFields.H>
00060 
00061 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00062 
00063 namespace Foam
00064 {
00065 /*---------------------------------------------------------------------------*\
00066       Class swirlFlowRateInletVelocityFvPatchVectorField Declaration
00067 \*---------------------------------------------------------------------------*/
00068 
00069 class swirlFlowRateInletVelocityFvPatchVectorField
00070 :
00071     public fixedValueFvPatchVectorField
00072 {
00073     // Private data
00074 
00075         //- Inlet integral flow rate
00076         const scalar flowRate_;
00077 
00078         //- Name of the flux transporting the field
00079         const word phiName_;
00080 
00081         //- Name of the density field used to normalize the mass flux
00082         const word rhoName_;
00083 
00084         //- RPM
00085         const scalar rpm_;
00086 
00087 
00088 public:
00089 
00090    //- Runtime type information
00091    TypeName("swirlFlowRateInletVelocity");
00092 
00093 
00094    // Constructors
00095 
00096         //- Construct from patch and internal field
00097         swirlFlowRateInletVelocityFvPatchVectorField
00098         (
00099             const fvPatch&,
00100             const DimensionedField<vector, volMesh>&
00101         );
00102 
00103         //- Construct from patch, internal field and dictionary
00104         swirlFlowRateInletVelocityFvPatchVectorField
00105         (
00106             const fvPatch&,
00107             const DimensionedField<vector, volMesh>&,
00108             const dictionary&
00109         );
00110 
00111         //- Construct by mapping given
00112         //  flowRateInletVelocityFvPatchVectorField
00113         //  onto a new patch
00114         swirlFlowRateInletVelocityFvPatchVectorField
00115         (
00116             const swirlFlowRateInletVelocityFvPatchVectorField&,
00117             const fvPatch&,
00118             const DimensionedField<vector, volMesh>&,
00119             const fvPatchFieldMapper&
00120         );
00121 
00122         //- Construct as copy
00123         swirlFlowRateInletVelocityFvPatchVectorField
00124         (
00125             const swirlFlowRateInletVelocityFvPatchVectorField&
00126         );
00127 
00128         //- Construct and return a clone
00129         virtual tmp<fvPatchVectorField> clone() const
00130         {
00131             return tmp<fvPatchVectorField>
00132             (
00133                 new swirlFlowRateInletVelocityFvPatchVectorField(*this)
00134             );
00135         }
00136 
00137         //- Construct as copy setting internal field reference
00138         swirlFlowRateInletVelocityFvPatchVectorField
00139         (
00140             const swirlFlowRateInletVelocityFvPatchVectorField&,
00141             const DimensionedField<vector, volMesh>&
00142         );
00143 
00144         //- Construct and return a clone setting internal field reference
00145         virtual tmp<fvPatchVectorField> clone
00146         (
00147             const DimensionedField<vector, volMesh>& iF
00148         ) const
00149         {
00150             return tmp<fvPatchVectorField>
00151             (
00152                 new swirlFlowRateInletVelocityFvPatchVectorField(*this, iF)
00153             );
00154         }
00155 
00156 
00157     // Member functions
00158 
00159         // Access
00160 
00161             //- Return the flux
00162             scalar flowRate() const
00163             {
00164                 return flowRate_;
00165             }
00166 
00167 
00168         //- Update the coefficients associated with the patch field
00169         virtual void updateCoeffs();
00170 
00171         //- Write
00172         virtual void write(Ostream&) const;
00173 
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 } // End namespace Foam
00180 
00181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00182 
00183 #endif
00184 
00185 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines