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-2025 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 function | 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 
44  fanCurve table;
45  file "$FOAM_CASE/constant/pressureVsQ";
46  format csv;
47  nHeaderLine 1;
48  columns (0 1);
49  separator ",";
50  mergeSeparators no;
51  outOfBounds clamp;
52  interpolationScheme linear;
53 
54  direction in;
55  p0 uniform 0;
56  value uniform 0;
57  }
58 
59  outlet
60  {
61  type fanPressure;
62 
63  fanCurve table;
64  file "$FOAM_CASE/constant/pressureVsQ";
65  format csv;
66  nHeaderLine 1;
67  columns (0 1);
68  separator ",";
69  mergeSeparators no;
70  outOfBounds clamp;
71  interpolationScheme linear;
72 
73  direction out;
74  p0 uniform 0;
75  value uniform 0;
76  }
77  \endverbatim
78 
79  The above example shows the use of a comma separated (CSV) file to specify
80  the condition.
81 
82 See also
83  Foam::totalPressureFvPatchScalarField
84  Foam::Function1s
85 
86 SourceFiles
87  fanPressureFvPatchScalarField.C
88 
89 \*---------------------------------------------------------------------------*/
90 
91 #ifndef fanPressureFvPatchScalarField_H
92 #define fanPressureFvPatchScalarField_H
93 
95 #include "Function1.H"
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 namespace Foam
100 {
101 
102 /*---------------------------------------------------------------------------*\
103  Class fanPressureFvPatchScalarField Declaration
104 \*---------------------------------------------------------------------------*/
105 
106 class fanPressureFvPatchScalarField
107 :
108  public totalPressureFvPatchScalarField
109 {
110 public:
111 
112  // Public Enumerations
113 
114  //- Fan flow direction
115  enum fanFlowDirection
116  {
117  ffdIn,
118  ffdOut
119  };
120 
121  //- Fan flow directions names
123 
124 
125 private:
126 
127  // Private Data
128 
129  //- Fan curve
130  const autoPtr<Function1<scalar>> fanCurve_;
131 
132  //- Direction of flow through the fan relative to patch
133  const fanFlowDirection direction_;
134 
135 
136 public:
137 
138  //- Runtime type information
139  TypeName("fanPressure");
140 
141 
142  // Constructors
143 
144  //- Construct from patch, internal field and dictionary
146  (
147  const fvPatch&,
149  const dictionary&
150  );
151 
152  //- Construct by mapping given fanPressureFvPatchScalarField
153  // onto a new patch
155  (
157  const fvPatch&,
159  const fieldMapper&
160  );
161 
162  //- Disallow copy without setting internal field reference
164  (
166  ) = delete;
167 
168  //- Copy constructor setting internal field reference
170  (
173  );
174 
175  //- Construct and return a clone setting internal field reference
177  (
179  ) const
180  {
182  (
184  (
185  *this,
186  iF
187  )
188  );
189  }
190 
191 
192  // Member Functions
193 
194  //- Update the coefficients associated with the patch field
195  virtual void updateCoeffs();
196 
197  //- Write
198  virtual void write(Ostream&) const;
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
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.
Abstract base class for field mapping.
Definition: fieldMapper.H:48
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.