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-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::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 Usage
35  \table
36  Property | Description | Required | Default value
37  fileName | fan curve file name | yes |
38  outOfBounds | out of bounds handling | yes |
39  direction | direction of flow through fan [in/out] | yes |
40  p0 | environmental total pressure | yes |
41  \endtable
42 
43  Example of the boundary condition specification:
44  \verbatim
45  inlet
46  {
47  type fanPressure;
48  fileName "fanCurve";
49  outOfBounds clamp;
50  direction in;
51  p0 uniform 0;
52  value uniform 0;
53  }
54 
55  outlet
56  {
57  type fanPressure;
58  fileName "fanCurve";
59  outOfBounds clamp;
60  direction out;
61  p0 uniform 0;
62  value uniform 0;
63  }
64  \endverbatim
65 
66 See also
67  Foam::fanFvPatchField
68  Foam::totalPressureFvPatchScalarField
69  Foam::interpolationTable
70 
71 SourceFiles
72  fanPressureFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef fanPressureFvPatchScalarField_H
77 #define fanPressureFvPatchScalarField_H
78 
80 #include "interpolationTable.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class fanPressureFvPatchScalarField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class fanPressureFvPatchScalarField
92 :
93  public totalPressureFvPatchScalarField
94 {
95 
96 public:
97 
98  //- Fan flow direction
99  enum fanFlowDirection
100  {
101  ffdIn,
102  ffdOut
103  };
104 
105  //- Fan flow directions names
106  static const NamedEnum<fanFlowDirection, 2> fanFlowDirectionNames_;
107 
108 
109 private:
110 
111  // Private data
112 
113  //- Tabulated fan curve
114  interpolationTable<scalar> fanCurve_;
116  //- Direction of flow through the fan relative to patch
117  fanFlowDirection direction_;
118 
119 
120 public:
121 
122  //- Runtime type information
123  TypeName("fanPressure");
124 
126  // Constructors
127 
128  //- Construct from patch and internal field
130  (
131  const fvPatch&,
133  );
134 
135  //- Construct from patch, internal field and dictionary
137  (
138  const fvPatch&,
140  const dictionary&
141  );
142 
143  //- Construct by mapping given
144  // fanPressureFvPatchScalarField
145  // onto a new patch
147  (
149  const fvPatch&,
151  const fvPatchFieldMapper&
152  );
153 
154  //- Construct as copy
156  (
158  );
159 
160  //- Construct and return a clone
161  virtual tmp<fvPatchScalarField> clone() const
162  {
164  (
166  );
167  }
168 
169  //- Construct as copy setting internal field reference
171  (
174  );
175 
176  //- Construct and return a clone setting internal field reference
178  (
180  ) const
181  {
183  (
185  (
186  *this,
187  iF
188  )
189  );
190  }
191 
192 
193  // Member functions
194 
195  //- Update the coefficients associated with the patch field
196  virtual void updateCoeffs();
197 
198  //- Write
199  virtual void write(Ostream&) const;
200 };
201 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
TypeName("fanPressure")
Runtime type information.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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 can be applied to assign either a pressure inlet or outlet total pressure con...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
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
static const NamedEnum< fanFlowDirection, 2 > fanFlowDirectionNames_
Fan flow directions names.
Namespace for OpenFOAM.
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual void write(Ostream &) const
Write.