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-2015 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 DataEntry type, to enable the use of, e.g.
35  contant, polynomial, table values.
36 
37  \heading Patch usage
38 
39  \table
40  Property | Description | Required | Default value
41  patchType | underlying patch type should be \c cyclic| yes |
42  jumpTable | jump data, e.g. \c csvFile | yes |
43  phi | flux field name | no | phi
44  rho | density field name | no | none
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  myPatch
50  {
51  type fan;
52  patchType cyclic;
53  jumpTable csvFile;
54  csvFileCoeffs
55  {
56  hasHeaderLine 1;
57  refColumn 0;
58  componentColumns 1(1);
59  separator ",";
60  fileName "$FOAM_CASE/constant/pressureVsU";
61  }
62  value uniform 0;
63  }
64  \endverbatim
65 
66  The above example shows the use of a comma separated (CSV) file to specify
67  the jump condition.
68 
69 Note
70  The underlying \c patchType should be set to \c cyclic
71 
72 SeeAlso
73  Foam::DataEntry
74 
75 SourceFiles
76  fanFvPatchField.C
77  fanFvPatchFields.H
78  fanFvPatchFields.C
79  fanFvPatchFieldsFwd.H
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef fanFvPatchField_H
84 #define fanFvPatchField_H
85 
87 #include "DataEntry.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 
94 /*---------------------------------------------------------------------------*\
95  Class fanFvPatchField Declaration
96 \*---------------------------------------------------------------------------*/
97 
98 template<class Type>
99 class fanFvPatchField
100 :
101  public uniformJumpFvPatchField<Type>
102 {
103  // Private data
104 
105  //- Name of the flux transporting the field
106  word phiName_;
107 
108  //- Name of the density field used to normalise the mass flux
109  // if neccessary
110  word rhoName_;
111 
112  //- Reverse direction relative to patch normal
113  Switch reversed_;
114 
115  // Private Member Functions
116 
117  //- Calculate the fan pressure jump
118  void calcFanJump();
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("fan");
125 
126 
127  // Constructors
128 
129  //- Construct from patch and internal field
131  (
132  const fvPatch&,
134  );
135 
136  //- Construct from patch, internal field and dictionary
138  (
139  const fvPatch&,
141  const dictionary&
142  );
143 
144  //- Construct by mapping given fanFvPatchField onto a new patch
146  (
147  const fanFvPatchField<Type>&,
148  const fvPatch&,
150  const fvPatchFieldMapper&
151  );
152 
153  //- Construct as copy
155  (
156  const fanFvPatchField<Type>&
157  );
158 
159  //- Construct and return a clone
160  virtual tmp<fvPatchField<Type> > clone() const
161  {
162  return tmp<fvPatchField<Type> >
163  (
164  new fanFvPatchField<Type>(*this)
165  );
166  }
167 
168  //- Construct as copy setting internal field reference
170  (
171  const fanFvPatchField<Type>&,
173  );
174 
175  //- Construct and return a clone setting internal field reference
176  virtual tmp<fvPatchField<Type> > clone
177  (
179  ) const
180  {
181  return tmp<fvPatchField<Type> >
182  (
183  new fanFvPatchField<Type>(*this, iF)
184  );
185  }
186 
187 
188  // Member functions
189 
190  //- Update the coefficients associated with the patch field
191  virtual void updateCoeffs();
192 };
193 
194 
195 //- Specialisation of the jump-condition for the pressure
196 template<>
198 
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 // ************************************************************************* //
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fanFvPatchField::phiName_
word phiName_
Name of the flux transporting the field.
Definition: fanFvPatchField.H:130
Foam::fanFvPatchField::calcFanJump
void calcFanJump()
Calculate the fan pressure jump.
Definition: fanFvPatchField.C:31
Foam::fanFvPatchField::reversed_
Switch reversed_
Reverse direction relative to patch normal.
Definition: fanFvPatchField.H:137
Foam::fanFvPatchField::TypeName
TypeName("fan")
Runtime type information.
Foam::uniformJumpFvPatchField
This boundary condition provides a jump condition, using the cyclic condition as a base....
Definition: uniformJumpFvPatchField.H:100
DataEntry.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
fanFvPatchField.C
uniformJumpFvPatchField.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fanFvPatchField::clone
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
Definition: fanFvPatchField.H:184
Foam::fanFvPatchField
This boundary condition provides a jump condition, using the cyclic condition as a base.
Definition: fanFvPatchField.H:123
Foam::fanFvPatchField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fanFvPatchField.C:102
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::fanFvPatchField::fanFvPatchField
fanFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
Definition: fanFvPatchField.C:44
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::fanFvPatchField::rhoName_
word rhoName_
Name of the density field used to normalise the mass flux.
Definition: fanFvPatchField.H:134