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-2020 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  fanCurve | fan curve file name | yes |
35  p0 | environmental total pressure | yes |
36  \endtable
37 
38  Example of the boundary condition specification:
39  \verbatim
40  inlet
41  {
42  type fanPressure;
43  fanCurve table;
44  fanCurveCoeffs
45  {
46  file "$FOAM_CASE/constant/pressureVsQ";
47  format csv;
48  nHeaderLine 1;
49  refColumn 0;
50  componentColumns 1(1);
51  separator ",";
52  mergeSeparators no;
53  outOfBounds clamp;
54  interpolationScheme linear;
55  }
56  direction in;
57  p0 uniform 0;
58  value uniform 0;
59  }
60 
61  outlet
62  {
63  type fanPressure;
64  fanCurve table;
65  fanCurveCoeffs
66  {
67  file "$FOAM_CASE/constant/pressureVsQ";
68  format csv;
69  nHeaderLine 1;
70  refColumn 0;
71  componentColumns 1(1);
72  separator ",";
73  mergeSeparators no;
74  outOfBounds clamp;
75  interpolationScheme linear;
76  }
77  direction out;
78  p0 uniform 0;
79  value uniform 0;
80  }
81  \endverbatim
82 
83  The above example shows the use of a comma separated (CSV) file to specify
84  the condition.
85 
86 See also
87  Foam::totalPressureFvPatchScalarField
88  Foam::Function1s
89 
90 SourceFiles
91  fanPressureFvPatchScalarField.C
92 
93 \*---------------------------------------------------------------------------*/
94 
95 #ifndef fanPressureFvPatchScalarField_H
96 #define fanPressureFvPatchScalarField_H
97 
99 #include "Function1.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class fanPressureFvPatchScalarField Declaration
108 \*---------------------------------------------------------------------------*/
109 
110 class fanPressureFvPatchScalarField
111 :
112  public totalPressureFvPatchScalarField
113 {
114 public:
115 
116  // Public Enumerations
117 
118  //- Fan flow direction
119  enum fanFlowDirection
120  {
121  ffdIn,
122  ffdOut
123  };
125  //- Fan flow directions names
127 
128 
129 private:
130 
131  // Private Data
132 
133  //- Fan curve
134  const autoPtr<Function1<scalar>> fanCurve_;
136  //- Direction of flow through the fan relative to patch
137  const fanFlowDirection direction_;
138 
139 
140 public:
141 
142  //- Runtime type information
143  TypeName("fanPressure");
144 
145 
146  // Constructors
147 
148  //- Construct from patch and internal field
150  (
151  const fvPatch&,
153  );
154 
155  //- Construct from patch, internal field and dictionary
157  (
158  const fvPatch&,
160  const dictionary&
161  );
162 
163  //- Construct by mapping given fanPressureFvPatchScalarField
164  // onto a new patch
166  (
168  const fvPatch&,
170  const fvPatchFieldMapper&
171  );
172 
173  //- Disallow copy without setting internal field reference
175  (
177  ) = delete;
178 
179  //- Copy constructor setting internal field reference
181  (
184  );
185 
186  //- Construct and return a clone setting internal field reference
188  (
190  ) const
191  {
193  (
195  (
196  *this,
197  iF
198  )
199  );
200  }
201 
203  // Member Functions
204 
205  //- Update the coefficients associated with the patch field
206  virtual void updateCoeffs();
207 
208  //- Write
209  virtual void write(Ostream&) const;
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
TypeName("fanPressure")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
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.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
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.