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