Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / finiteVolume / fields / fvPatchFields / derived / timeVaryingFlowRateInletVelocity / timeVaryingFlowRateInletVelocityFvPatchVectorField.H
blob459c055806c68bbf1820604e0c3bfb4b7d9af9b7
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2006-2011 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Class
25     Foam::timeVaryingFlowRateInletVelocityFvPatchVectorField
27 Description
28     A time-varying form of a flow normal vector boundary condition. The
29     variation is specified as an interpolationTable (see
30     Foam::interpolationTable).
32     Example of the boundary condition specification:
33     \verbatim
34     inlet
35     {
36         type            timeVaryingFlowRateInletVelocity;
37         flowRate        0.2;         // Volumetric/mass flow rate [m3/s or kg/s]
38         value           uniform (0 0 0);  // placeholder
39         fileName        "$FOAM_CASE/time-series";
40         outOfBounds     repeat;           // (error|warn|clamp|repeat)
41     }
42     \endverbatim
44 Note
45     - The value is positive inwards
46     - may not work correctly for transonic inlets!
47     - strange behaviour with potentialFoam since the U equation is not solved
49 See Also
50     Foam::interpolationTable and Foam::flowRateInletVelocityFvPatchVectorField
52 SourceFiles
53     timeVaryingFlowRateInletVelocityFvPatchVectorField.C
55 \*---------------------------------------------------------------------------*/
57 #ifndef timeVaryingFlowRateInletVelocityFvPatchVectorField_H
58 #define timeVaryingFlowRateInletVelocityFvPatchVectorField_H
60 #include "flowRateInletVelocityFvPatchVectorField.H"
61 #include "interpolationTable.H"
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 namespace Foam
67 /*---------------------------------------------------------------------------*\
68         Class timeVaryingFlowRateInletVelocityFvPatch Declaration
69 \*---------------------------------------------------------------------------*/
71 class timeVaryingFlowRateInletVelocityFvPatchVectorField
73     public flowRateInletVelocityFvPatchVectorField
75     // Private data
77         //- the time series being used, including the bounding treatment
78         interpolationTable<scalar> timeSeries_;
81 public:
83     //- Runtime type information
84     TypeName("timeVaryingFlowRateInletVelocity");
87     // Constructors
89         //- Construct from patch and internal field
90         timeVaryingFlowRateInletVelocityFvPatchVectorField
91         (
92             const fvPatch&,
93             const DimensionedField<vector, volMesh>&
94         );
96         //- Construct from patch, internal field and dictionary
97         timeVaryingFlowRateInletVelocityFvPatchVectorField
98         (
99             const fvPatch&,
100             const DimensionedField<vector, volMesh>&,
101             const dictionary&
102         );
104         //- Construct by mapping given patch field onto a new patch
105         timeVaryingFlowRateInletVelocityFvPatchVectorField
106         (
107             const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
108             const fvPatch&,
109             const DimensionedField<vector, volMesh>&,
110             const fvPatchFieldMapper&
111         );
113         //- Construct as copy
114         timeVaryingFlowRateInletVelocityFvPatchVectorField
115         (
116             const timeVaryingFlowRateInletVelocityFvPatchVectorField&
117         );
119         //- Construct and return a clone
120         virtual tmp<fvPatchVectorField> clone() const
121         {
122             return tmp<fvPatchVectorField>
123             (
124                 new timeVaryingFlowRateInletVelocityFvPatchVectorField(*this)
125             );
126         }
128         //- Construct as copy setting internal field reference
129         timeVaryingFlowRateInletVelocityFvPatchVectorField
130         (
131             const timeVaryingFlowRateInletVelocityFvPatchVectorField&,
132             const DimensionedField<vector, volMesh>&
133         );
135         //- Construct and return a clone setting internal field reference
136         virtual tmp<fvPatchVectorField> clone
137         (
138             const DimensionedField<vector, volMesh>& iF
139         ) const
140         {
141             return tmp<fvPatchVectorField>
142             (
143                 new timeVaryingFlowRateInletVelocityFvPatchVectorField
144                 (
145                     *this,
146                     iF
147                 )
148             );
149         }
152     // Member functions
154         // Access
156             //- Return the time series used
157             const interpolationTable<scalar>& timeSeries() const
158             {
159                 return timeSeries_;
160             }
163         // Evaluation functions
165             //- Update the coefficients associated with the patch field
166             virtual void updateCoeffs();
169         //- Write
170         virtual void write(Ostream&) const;
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 } // End namespace Foam
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 #endif
182 // ************************************************************************* //