Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / finiteVolume / cfdTools / general / SRF / derivedFvPatchFields / SRFVelocityFvPatchVectorField / SRFVelocityFvPatchVectorField.H
blob87372619f39f214ef1ae5891ebc10b1701563add
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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::SRFVelocityFvPatchVectorField
27 Description
28     Velocity patch to be used with SRF model
30 SourceFiles
31     SRFVelocityFvPatchVectorField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef SRFVelocityFvPatchVectorField_H
36 #define SRFVelocityFvPatchVectorField_H
38 #include "fvPatchFields.H"
39 #include "fixedValueFvPatchFields.H"
40 #include "Switch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                Class SRFVelocityFvPatchVectorField Declaration
49 \*---------------------------------------------------------------------------*/
51 class SRFVelocityFvPatchVectorField
53     public fixedValueFvPatchVectorField
55     // Private data
57         //- Is the supplied inlet value relative to the SRF
58         Switch relative_;
60         //- Inlet value
61         vectorField inletValue_;
64 public:
66     //- Runtime type information
67     TypeName("SRFVelocity");
70     // Constructors
72         //- Construct from patch and internal field
73         SRFVelocityFvPatchVectorField
74         (
75             const fvPatch&,
76             const DimensionedField<vector, volMesh>&
77         );
79         //- Construct from patch, internal field and dictionary
80         SRFVelocityFvPatchVectorField
81         (
82             const fvPatch&,
83             const DimensionedField<vector, volMesh>&,
84             const dictionary&
85         );
87         //- Construct by mapping given SRFVelocityFvPatchVectorField
88         //  onto a new patch
89         SRFVelocityFvPatchVectorField
90         (
91             const SRFVelocityFvPatchVectorField&,
92             const fvPatch&,
93             const DimensionedField<vector, volMesh>&,
94             const fvPatchFieldMapper&
95         );
97         //- Construct as copy
98         SRFVelocityFvPatchVectorField
99         (
100             const SRFVelocityFvPatchVectorField&
101         );
103         //- Construct and return a clone
104         virtual tmp<fvPatchVectorField> clone() const
105         {
106             return tmp<fvPatchVectorField>
107             (
108                 new SRFVelocityFvPatchVectorField(*this)
109             );
110         }
112         //- Construct as copy setting internal field reference
113         SRFVelocityFvPatchVectorField
114         (
115             const SRFVelocityFvPatchVectorField&,
116             const DimensionedField<vector, volMesh>&
117         );
119         //- Construct and return a clone setting internal field reference
120         virtual tmp<fvPatchVectorField> clone
121         (
122             const DimensionedField<vector, volMesh>& iF
123         ) const
124         {
125             return tmp<fvPatchVectorField>
126             (
127                 new SRFVelocityFvPatchVectorField(*this, iF)
128             );
129         }
132     // Member functions
134         // Access
136             //- Return const access to the relative flag
137             const Switch& relative() const
138             {
139                 return relative_;
140             }
143         // Mapping functions
145             //- Map (and resize as needed) from self given a mapping object
146             virtual void autoMap
147             (
148                 const fvPatchFieldMapper&
149             );
151             //- Reverse map the given fvPatchField onto this fvPatchField
152             virtual void rmap
153             (
154                 const fvPatchVectorField&,
155                 const labelList&
156             );
159         // Evaluation functions
161             //- Update the coefficients associated with the patch field
162             virtual void updateCoeffs();
165         // I-O
167             //- Write
168             virtual void write(Ostream&) const;
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #endif
180 // ************************************************************************* //