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-2023 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  };
124 
125  //- Fan flow directions names
127 
128 
129 private:
130 
131  // Private Data
132 
133  //- Fan curve
134  const autoPtr<Function1<scalar>> fanCurve_;
135 
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, internal field and dictionary
150  (
151  const fvPatch&,
153  const dictionary&
154  );
155 
156  //- Construct by mapping given fanPressureFvPatchScalarField
157  // onto a new patch
159  (
161  const fvPatch&,
163  const fvPatchFieldMapper&
164  );
165 
166  //- Disallow copy without setting internal field reference
168  (
170  ) = delete;
171 
172  //- Copy constructor setting internal field reference
174  (
177  );
178 
179  //- Construct and return a clone setting internal field reference
181  (
183  ) const
184  {
186  (
188  (
189  *this,
190  iF
191  )
192  );
193  }
194 
195 
196  // Member Functions
197 
198  //- Update the coefficients associated with the patch field
199  virtual void updateCoeffs();
200 
201  //- Write
202  virtual void write(Ostream&) const;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
virtual void write(Ostream &) const
Write.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("fanPressure")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
static const NamedEnum< fanFlowDirection, 2 > fanFlowDirectionNames_
Fan flow directions names.
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.