fanFvPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::fanFvPatchField
26 
27 Group
28  grpCoupledBoundaryConditions
29 
30 Description
31  This boundary condition provides a jump condition, using the \c cyclic
32  condition as a base.
33 
34  The jump is specified as a \c Function1 type, to enable the use of, e.g.
35  contant, polynomial, table values.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  patchType | underlying patch type should be \c cyclic| yes |
41  jumpTable | jump data, e.g. \c csvFile | yes |
42  phi | flux field name | no | phi
43  rho | density field name | no | none
44  \endtable
45 
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type fan;
51  patchType cyclic;
52  jumpTable csvFile;
53  csvFileCoeffs
54  {
55  hasHeaderLine 1;
56  refColumn 0;
57  componentColumns 1(1);
58  separator ",";
59  fileName "$FOAM_CASE/constant/pressureVsU";
60  }
61  value uniform 0;
62  }
63  \endverbatim
64 
65  The above example shows the use of a comma separated (CSV) file to specify
66  the jump condition.
67 
68 Note
69  The underlying \c patchType should be set to \c cyclic
70 
71 See also
72  Foam::Function1Types
73 
74 SourceFiles
75  fanFvPatchField.C
76  fanFvPatchFields.H
77  fanFvPatchFields.C
78  fanFvPatchFieldsFwd.H
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef fanFvPatchField_H
83 #define fanFvPatchField_H
84 
86 #include "Function1.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class fanFvPatchField Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 template<class Type>
98 class fanFvPatchField
99 :
100  public uniformJumpFvPatchField<Type>
101 {
102  // Private data
103 
104  //- Name of the flux transporting the field
105  word phiName_;
106 
107  //- Name of the density field used to normalise the mass flux
108  // if neccessary
109  word rhoName_;
110 
111 
112  // Private Member Functions
113 
114  //- Calculate the fan pressure jump
115  void calcFanJump();
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("fan");
123 
124  // Constructors
125 
126  //- Construct from patch and internal field
128  (
129  const fvPatch&,
131  );
132 
133  //- Construct from patch, internal field and dictionary
135  (
136  const fvPatch&,
138  const dictionary&
139  );
140 
141  //- Construct by mapping given fanFvPatchField onto a new patch
143  (
144  const fanFvPatchField<Type>&,
145  const fvPatch&,
147  const fvPatchFieldMapper&
148  );
149 
150  //- Construct as copy
152  (
153  const fanFvPatchField<Type>&
154  );
155 
156  //- Construct and return a clone
157  virtual tmp<fvPatchField<Type>> clone() const
158  {
159  return tmp<fvPatchField<Type>>
160  (
161  new fanFvPatchField<Type>(*this)
162  );
163  }
164 
165  //- Construct as copy setting internal field reference
167  (
168  const fanFvPatchField<Type>&,
170  );
171 
172  //- Construct and return a clone setting internal field reference
174  (
176  ) const
177  {
178  return tmp<fvPatchField<Type>>
179  (
180  new fanFvPatchField<Type>(*this, iF)
181  );
182  }
183 
184 
185  // Member functions
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190  //- Write
191  virtual void write(Ostream&) const;
192 };
193 
194 
195 //- Specialisation of the jump-condition for the pressure
196 template<>
199 template<>
201 (
202  const fvPatch&,
204  const dictionary&
205 );
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #ifdef NoRepository
215  #include "fanFvPatchField.C"
216 #endif
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #endif
221 
222 // ************************************************************************* //
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
This boundary condition provides a jump condition, using the cyclic condition as a base...
TypeName("fan")
Runtime type information.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
fanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.