Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / finiteVolume / fields / fvPatchFields / derived / fan / fanFvPatchField.H
blob6f5687904f9ae5b971c1c637d1fc580f3340c3ec
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::fanFvPatchField
27 Description
28     Foam::fanFvPatchField
30 SourceFiles
31     fanFvPatchField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef fanFvPatchField_H
36 #define fanFvPatchField_H
38 #include "jumpCyclicFvPatchField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                           Class fanFvPatchField Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class fanFvPatchField
52     public jumpCyclicFvPatchField<Type>
54     // Private data
56         //- Fan pressure rise polynomial coefficients
57         List<scalar> f_;
59         //- "jump" field
60         Field<Type> jump_;
63 public:
65     //- Runtime type information
66     TypeName("fan");
69     // Constructors
71         //- Construct from patch and internal field
72         fanFvPatchField
73         (
74             const fvPatch&,
75             const DimensionedField<Type, volMesh>&
76         );
78         //- Construct from patch, internal field and dictionary
79         fanFvPatchField
80         (
81             const fvPatch&,
82             const DimensionedField<Type, volMesh>&,
83             const dictionary&
84         );
86         //- Construct by mapping given fanFvPatchField onto a new patch
87         fanFvPatchField
88         (
89             const fanFvPatchField<Type>&,
90             const fvPatch&,
91             const DimensionedField<Type, volMesh>&,
92             const fvPatchFieldMapper&
93         );
95         //- Construct as copy
96         fanFvPatchField
97         (
98             const fanFvPatchField<Type>&
99         );
101         //- Construct and return a clone
102         virtual tmp<fvPatchField<Type> > clone() const
103         {
104             return tmp<fvPatchField<Type> >
105             (
106                 new fanFvPatchField<Type>(*this)
107             );
108         }
110         //- Construct as copy setting internal field reference
111         fanFvPatchField
112         (
113             const fanFvPatchField<Type>&,
114             const DimensionedField<Type, volMesh>&
115         );
117         //- Construct and return a clone setting internal field reference
118         virtual tmp<fvPatchField<Type> > clone
119         (
120             const DimensionedField<Type, volMesh>& iF
121         ) const
122         {
123             return tmp<fvPatchField<Type> >
124             (
125                 new fanFvPatchField<Type>(*this, iF)
126             );
127         }
130     // Member functions
132         // Access
134             //- Return the "jump" across the patch as a "half" field
135             virtual tmp<Field<Type> > jump() const
136             {
137                 return jump_;
138             }
141         // Mapping functions
143             //- Map (and resize as needed) from self given a mapping object
144             virtual void autoMap
145             (
146                 const fvPatchFieldMapper&
147             );
149             //- Reverse map the given fvPatchField onto this fvPatchField
150             virtual void rmap
151             (
152                 const fvPatchField<Type>&,
153                 const labelList&
154             );
156         // Evaluation functions
158             //- Update the coefficients associated with the patch field
159             virtual void updateCoeffs();
162         //- Write
163         virtual void write(Ostream&) const;
167 //- Specialisation of the jump-condition for the pressure
168 template<>
169 void fanFvPatchField<scalar>::updateCoeffs();
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #ifdef NoRepository
179 #   include "fanFvPatchField.C"
180 #endif
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #endif
186 // ************************************************************************* //