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