fanPressureFvPatchScalarField.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-2012 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::fanPressureFvPatchScalarField
26 
27 Group
28  grpInletBoundaryConditions grpOutletBoundaryConditions
29 
30 Description
31  This boundary condition can be applied to assign either a pressure inlet
32  or outlet total pressure condition for a fan.
33 
34  \heading Patch usage
35 
36  \table
37  Property | Description | Required | Default value
38  fileName | fan curve file name | yes |
39  outOfBounds | out of bounds handling | yes |
40  direction | direction of flow through fan [in/out] | yes |
41  p0 | environmental total pressure | yes |
42  \endtable
43 
44  Example of the boundary condition specification:
45  \verbatim
46  inlet
47  {
48  type fanPressure;
49  fileName "fanCurve";
50  outOfBounds clamp;
51  direction in;
52  p0 uniform 0;
53  value uniform 0;
54  }
55 
56  outlet
57  {
58  type fanPressure;
59  fileName "fanCurve";
60  outOfBounds clamp;
61  direction out;
62  p0 uniform 0;
63  value uniform 0;
64  }
65  \endverbatim
66 
67 See Also
68  Foam::fanFvPatchField
69  Foam::totalPressureFvPatchScalarField
70  Foam::interpolationTable
71 
72 SourceFiles
73  fanPressureFvPatchScalarField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef fanPressureFvPatchScalarField_H
78 #define fanPressureFvPatchScalarField_H
79 
81 #include "interpolationTable.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class fanPressureFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class fanPressureFvPatchScalarField
93 :
94  public totalPressureFvPatchScalarField
95 {
96 
97 public:
98 
99  //- Fan flow direction
100  enum fanFlowDirection
101  {
102  ffdIn,
103  ffdOut
104  };
105 
106  //- Fan flow directions names
107  static const NamedEnum<fanFlowDirection, 2> fanFlowDirectionNames_;
108 
109 
110 private:
111 
112  // Private data
113 
114  //- Tabulated fan curve
115  interpolationTable<scalar> fanCurve_;
117  //- Direction of flow through the fan relative to patch
118  fanFlowDirection direction_;
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("fanPressure");
125 
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
145  // fanPressureFvPatchScalarField
146  // onto a new patch
148  (
150  const fvPatch&,
152  const fvPatchFieldMapper&
153  );
154 
155  //- Construct as copy
157  (
159  );
160 
161  //- Construct and return a clone
162  virtual tmp<fvPatchScalarField> clone() const
163  {
165  (
167  );
168  }
169 
170  //- Construct as copy setting internal field reference
172  (
175  );
176 
177  //- Construct and return a clone setting internal field reference
179  (
181  ) const
182  {
184  (
186  (
187  *this,
188  iF
189  )
190  );
191  }
192 
193 
194  // Member functions
195 
196  //- Update the coefficients associated with the patch field
197  virtual void updateCoeffs();
198 
199  //- Write
200  virtual void write(Ostream&) const;
201 };
202 
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 
206 } // End namespace Foam
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 #endif
211 
212 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void write(Ostream &) const
Write.
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
static const NamedEnum< fanFlowDirection, 2 > fanFlowDirectionNames_
Fan flow directions names.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
A class for managing temporary objects.
Definition: PtrList.H:118
TypeName("fanPressure")
Runtime type information.