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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2017 OpenCFD Ltd
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fanPressureFvPatchScalarField
29 
30 Group
31  grpInletBoundaryConditions grpOutletBoundaryConditions
32 
33 Description
34  This boundary condition can be applied to assign either a pressure inlet
35  or outlet total pressure condition for a fan.
36 
37  The switch nonDimensional can be used for a non-dimensional table. It needs
38  inputs rpm and dm of the fan.
39 
40  The nonDimensional flux for the table is calculate as :
41 
42  phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
43  where:
44  dm is the mean diameter.
45  omega is rad/sec.
46 
47  The nonDimensinal pressure :
48 
49  Psi = 2 deltaP/(rho*(sqr(PI*omega*dm)))
50  where:
51  deltaP is the pressure drop
52 
53  The non-dimensional table should be given as Psi = F(phi).
54 
55 Usage
56  \table
57  Property | Description | Required | Default value
58  file | fan curve file name | yes |
59  outOfBounds | out of bounds handling | yes |
60  direction | direction of flow through fan [in/out] | yes |
61  p0 | environmental total pressure | yes |
62  nonDimensional | uses non-dimensional table | no | false
63  rpm | fan rpm for non-dimensional table | no | 0.0
64  dm | mean diameter for non-dimensional table | no | 0.0
65  \endtable
66 
67  Example of the boundary condition specification:
68  \verbatim
69  inlet
70  {
71  type fanPressure;
72  file "fanCurve";
73  outOfBounds clamp;
74  direction in;
75  p0 uniform 0;
76  value uniform 0;
77  }
78 
79  outlet
80  {
81  type fanPressure;
82  file "fanCurve";
83  outOfBounds clamp;
84  direction out;
85  p0 uniform 0;
86  value uniform 0;
87  }
88  \endverbatim
89 
90 See also
91  Foam::fanFvPatchField
92  Foam::totalPressureFvPatchScalarField
93  Foam::interpolationTable
94 
95 SourceFiles
96  fanPressureFvPatchScalarField.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef fanPressureFvPatchScalarField_H
101 #define fanPressureFvPatchScalarField_H
102 
104 #include "interpolationTable.H"
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 namespace Foam
109 {
110 
111 /*---------------------------------------------------------------------------*\
112  Class fanPressureFvPatchScalarField Declaration
113 \*---------------------------------------------------------------------------*/
114 
115 class fanPressureFvPatchScalarField
116 :
117  public totalPressureFvPatchScalarField
118 {
119 
120 public:
121 
122  //- Fan flow direction
123  enum fanFlowDirection
124  {
125  ffdIn,
126  ffdOut
127  };
128 
129  //- Fan flow direction names
130  static const Enum<fanFlowDirection> fanFlowDirectionNames_;
131 
132 
133 private:
134 
135  // Private Data
136 
137  //- Tabulated fan curve
138  interpolationTable<scalar> fanCurve_;
139 
140  //- Direction of flow through the fan relative to patch
141  fanFlowDirection direction_;
142 
143  //- Fan rpm (for non-dimensional curve)
144  scalar rpm_;
145 
146  //- Fan mean diameter (for non-dimensional curve)
147  scalar dm_;
148 
149  //- Use non-dimensional curve
150  bool nonDimensional_;
151 
152 
153 public:
154 
155  //- Runtime type information
156  TypeName("fanPressure");
157 
158 
159  // Constructors
160 
161  //- Construct from patch and internal field
163  (
164  const fvPatch&,
166  );
167 
168  //- Construct from patch, internal field and dictionary
170  (
171  const fvPatch&,
173  const dictionary&
174  );
175 
176  //- Construct by mapping given
177  // fanPressureFvPatchScalarField
178  // onto a new patch
180  (
182  const fvPatch&,
184  const fvPatchFieldMapper&
185  );
186 
187  //- Construct as copy
189  (
191  );
192 
193  //- Construct and return a clone
194  virtual tmp<fvPatchScalarField> clone() const
195  {
197  (
199  );
200  }
201 
202  //- Construct as copy setting internal field reference
204  (
207  );
208 
209  //- Construct and return a clone setting internal field reference
211  (
213  ) const
214  {
216  (
218  (
219  *this,
220  iF
221  )
222  );
223  }
224 
225 
226  // Member functions
227 
228  //- Update the coefficients associated with the patch field
229  virtual void updateCoeffs();
230 
231  //- Write
232  virtual void write(Ostream& os) const;
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace Foam
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
Foam::fanPressureFvPatchScalarField
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
Definition: fanPressureFvPatchScalarField.H:154
Foam::Enum< fanFlowDirection >
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::fanPressureFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: fanPressureFvPatchScalarField.C:197
Foam::fanPressureFvPatchScalarField::ffdIn
Definition: fanPressureFvPatchScalarField.H:164
Foam::fanPressureFvPatchScalarField::ffdOut
Definition: fanPressureFvPatchScalarField.H:165
totalPressureFvPatchScalarField.H
interpolationTable.H
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: fanPressureFvPatchScalarField.C:50
Foam::totalPressureFvPatchScalarField
This boundary condition provides a total pressure condition. Four variants are possible:
Definition: totalPressureFvPatchScalarField.H:256
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::fanPressureFvPatchScalarField::fanFlowDirection
fanFlowDirection
Fan flow direction.
Definition: fanPressureFvPatchScalarField.H:162
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fanPressureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: fanPressureFvPatchScalarField.H:233
Foam::fanPressureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: fanPressureFvPatchScalarField.C:134
Foam::fanPressureFvPatchScalarField::TypeName
TypeName("fanPressure")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::interpolationTable< scalar >
Foam::fanPressureFvPatchScalarField::fanFlowDirectionNames_
static const Enum< fanFlowDirection > fanFlowDirectionNames_
Fan flow direction names.
Definition: fanPressureFvPatchScalarField.H:169
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54