initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / derived / fan / fanFvPatchField.H
blob6ad3f73c7674177131a5f09367773fa751031db8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::fanFvPatchField
28 Description
29     Foam::fanFvPatchField
31 SourceFiles
32     fanFvPatchField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fanFvPatchField_H
37 #define fanFvPatchField_H
39 #include "jumpCyclicFvPatchField.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class jumpCyclicFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class Type>
51 class fanFvPatchField
53     public jumpCyclicFvPatchField<Type>
55     // Private data
57         //- Fan pressure rise polynomial coefficients
58         List<scalar> f_;
60         //- "jump" field
61         Field<Type> jump_;
64 public:
66     //- Runtime type information
67     TypeName("fan");
70     // Constructors
72         //- Construct from patch and internal field
73         fanFvPatchField
74         (
75             const fvPatch&,
76             const DimensionedField<Type, volMesh>&
77         );
79         //- Construct from patch, internal field and dictionary
80         fanFvPatchField
81         (
82             const fvPatch&,
83             const DimensionedField<Type, volMesh>&,
84             const dictionary&
85         );
87         //- Construct by mapping given fanFvPatchField onto a new patch
88         fanFvPatchField
89         (
90             const fanFvPatchField<Type>&,
91             const fvPatch&,
92             const DimensionedField<Type, volMesh>&,
93             const fvPatchFieldMapper&
94         );
96         //- Construct as copy
97         fanFvPatchField
98         (
99             const fanFvPatchField<Type>&
100         );
102         //- Construct and return a clone
103         virtual tmp<fvPatchField<Type> > clone() const
104         {
105             return tmp<fvPatchField<Type> >
106             (
107                 new fanFvPatchField<Type>(*this)
108             );
109         }
111         //- Construct as copy setting internal field reference
112         fanFvPatchField
113         (
114             const fanFvPatchField<Type>&,
115             const DimensionedField<Type, volMesh>&
116         );
118         //- Construct and return a clone setting internal field reference
119         virtual tmp<fvPatchField<Type> > clone
120         (
121             const DimensionedField<Type, volMesh>& iF
122         ) const
123         {
124             return tmp<fvPatchField<Type> >
125             (
126                 new fanFvPatchField<Type>(*this, iF)
127             );
128         }
131     // Member functions
133         // Access
135             //- Return the "jump" across the patch as a "half" field 
136             virtual tmp<Field<Type> > jump() const
137             {
138                 return jump_;
139             }
142         // Mapping functions
144             //- Map (and resize as needed) from self given a mapping object
145             virtual void autoMap
146             (
147                 const fvPatchFieldMapper&
148             );
150             //- Reverse map the given fvPatchField onto this fvPatchField
151             virtual void rmap
152             (
153                 const fvPatchField<Type>&,
154                 const labelList&
155             );
157         // Evaluation functions
159             //- Update the coefficients associated with the patch field
160             virtual void updateCoeffs();
163         //- Write
164         virtual void write(Ostream&) const;
168 //- Specialisation of the jump-condition for the pressure
169 template<>
170 void fanFvPatchField<scalar>::updateCoeffs();
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 } // End namespace Foam
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #ifdef NoRepository
180 #   include "fanFvPatchField.C"
181 #endif
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //