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

timeVaryingFlowRateInletVelocityFvPatchVectorField.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::timeVaryingFlowRateInletVelocityFvPatchVectorField
00026 
00027 Description
00028     A time-varying form of a flow normal vector boundary condition.
00029 
00030     Example of the boundary condition specification:
00031     @verbatim
00032     inlet
00033     {
00034         type            timeVaryingFlowRateInletVelocity;
00035         flowRate        0.2;         // Volumetric/mass flow rate [m3/s or kg/s]
00036         value           uniform (0 0 0);  // placeholder
00037         fileName        "$FOAM_CASE/time-series";
00038         outOfBounds     repeat;           // (error|warn|clamp|repeat)
00039     }
00040     @endverbatim
00041 
00042 Note
00043     - The value is positive inwards
00044     - may not work correctly for transonic inlets!
00045     - strange behaviour with potentialFoam since the U equation is not solved
00046 
00047 See Also
00048     Foam::interpolationTable and Foam::flowRateInletVelocityFvPatchVectorField
00049 
00050 SourceFiles
00051     timeVaryingFlowRateInletVelocityFvPatchVectorField.C
00052 
00053 \*---------------------------------------------------------------------------*/
00054 
00055 #ifndef timeVaryingFlowRateInletVelocityFvPatchVectorField_H
00056 #define timeVaryingFlowRateInletVelocityFvPatchVectorField_H
00057 
00058 #include <finiteVolume/flowRateInletVelocityFvPatchVectorField.H>
00059 #include <OpenFOAM/interpolationTable.H>
00060 
00061 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00062 
00063 namespace Foam
00064 {
00065 /*---------------------------------------------------------------------------*\
00066         Class timeVaryingFlowRateInletVelocityFvPatch Declaration
00067 \*---------------------------------------------------------------------------*/
00068 
00069 class timeVaryingFlowRateInletVelocityFvPatchVectorField
00070 :
00071     public flowRateInletVelocityFvPatchVectorField
00072 {
00073     // Private data
00074 
00075         //- the time series being used, including the bounding treatment
00076         interpolationTable<scalar> timeSeries_;
00077 
00078 
00079 public:
00080 
00081     //- Runtime type information
00082     TypeName("timeVaryingFlowRateInletVelocity");
00083 
00084 
00085     // Constructors
00086 
00087         //- Construct from patch and internal field
00088         timeVaryingFlowRateInletVelocityFvPatchVectorField
00089         (
00090             const fvPatch&,
00091             const DimensionedField<vector, volMesh>&
00092         );
00093 
00094         //- Construct from patch, internal field and dictionary
00095         timeVaryingFlowRateInletVelocityFvPatchVectorField
00096         (
00097             const fvPatch&,
00098             const DimensionedField<vector, volMesh>&,
00099             const dictionary&
00100         );
00101 
00102         //- Construct by mapping given patch field onto a new patch
00103         timeVaryingFlowRateInletVelocityFvPatchVectorField
00104         (
00105             const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
00106             const fvPatch&,
00107             const DimensionedField<vector, volMesh>&,
00108             const fvPatchFieldMapper&
00109         );
00110 
00111         //- Construct as copy
00112         timeVaryingFlowRateInletVelocityFvPatchVectorField
00113         (
00114             const timeVaryingFlowRateInletVelocityFvPatchVectorField&
00115         );
00116 
00117         //- Construct and return a clone
00118         virtual tmp<fvPatchVectorField> clone() const
00119         {
00120             return tmp<fvPatchVectorField>
00121             (
00122                 new timeVaryingFlowRateInletVelocityFvPatchVectorField(*this)
00123             );
00124         }
00125 
00126         //- Construct as copy setting internal field reference
00127         timeVaryingFlowRateInletVelocityFvPatchVectorField
00128         (
00129             const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
00130             const DimensionedField<vector, volMesh>&
00131         );
00132 
00133         //- Construct and return a clone setting internal field reference
00134         virtual tmp<fvPatchVectorField> clone
00135         (
00136             const DimensionedField<vector, volMesh>& iF
00137         ) const
00138         {
00139             return tmp<fvPatchVectorField>
00140             (
00141                 new timeVaryingFlowRateInletVelocityFvPatchVectorField
00142                 (
00143                     *this,
00144                     iF
00145                 )
00146             );
00147         }
00148 
00149 
00150     // Member functions
00151 
00152         // Access
00153 
00154             //- Return the time series used
00155             const interpolationTable<scalar>& timeSeries() const
00156             {
00157                 return timeSeries_;
00158             }
00159 
00160 
00161         // Evaluation functions
00162 
00163             //- Update the coefficients associated with the patch field
00164             virtual void updateCoeffs();
00165 
00166 
00167         //- Write
00168         virtual void write(Ostream&) const;
00169 };
00170 
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 } // End namespace Foam
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #endif
00179 
00180 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines