fanPressureJumpFvPatchScalarField.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-2024 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::fanPressureJumpFvPatchScalarField
26 
27 Description
28  This boundary condition provides a fan pressure jump condition, using the
29  \c cyclic condition as a base. The jump is specified as a \c Function1,
30  which returns the pressure jump as a function of the total volumetric flow
31  rate through the patch.
32 
33  A backwards-compatibility option is also provided to specify the pressure
34  jump as a function of local velocity. In this mode the boundary condition
35  serves as a direct replacement for the old fanFvPatchField.
36 
37 Usage
38  \table
39  Property | Description | Required | Default value
40  patchType | underlying patch type (should be \c cyclic) | yes |
41  fanCurve | fan curve function | yes |
42  jumpTable | jump table function (backward compatibility mode) | no |
43  reverse | reverse jump direction | no | false
44  phi | flux field name | no | phi
45  rho | density field name | no | rho
46  \endtable
47 
48  Example of the boundary condition specification:
49  \verbatim
50  <patchName>
51  {
52  type fanPressureJump;
53  patchType cyclic;
54  fanCurve table;
55  fanCurveCoeffs
56  {
57  file "$FOAM_CASE/constant/pressureVsQ";
58  format csv;
59  nHeaderLine 1;
60  columns (0 1);
61  separator ",";
62  mergeSeparators no;
63  outOfBounds clamp;
64  interpolationScheme linear;
65  }
66  value uniform 0;
67  }
68  \endverbatim
69 
70 See also
71  Foam::Function1s
72 
73 SourceFiles
74  fanPressureJumpFvPatchScalarField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef fanPressureJumpFvPatchScalarField_H
79 #define fanPressureJumpFvPatchScalarField_H
80 
81 #include "fixedJumpFvPatchFields.H"
82 #include "Function1.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class fanPressureJumpFvPatchScalarField Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class fanPressureJumpFvPatchScalarField
94 :
95  public fixedJumpFvPatchScalarField
96 {
97  // Private Data
98 
99  //- Name of the flux transporting the field
100  const word phiName_;
101 
102  //- Name of the density field used to normalise the mass flux
103  // if necessary
104  const word rhoName_;
105 
106  //- Fan curve
107  autoPtr<Function1<scalar>> fanCurve_;
108 
109  //- Jump table (backward compatibility)
110  autoPtr<Function1<scalar>> jumpTable_;
111 
112  //- Set true to reverse jump direction
113  const Switch reverse_;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("fanPressureJump");
120 
121 
122  // Constructors
123 
124  //- Construct from patch, internal field and dictionary
126  (
127  const fvPatch&,
129  const dictionary&
130  );
131 
132  //- Construct by mapping given patch onto a new patch
134  (
136  const fvPatch&,
138  const fieldMapper&
139  );
140 
141  //- Disallow copy without setting internal field reference
143  (
145  ) = delete;
146 
147  //- Copy constructor setting internal field reference
149  (
152  );
153 
154  //- Construct and return a clone setting internal field reference
156  (
158  ) const
159  {
161  (
162  new fanPressureJumpFvPatchScalarField(*this, iF)
163  );
164  }
165 
166 
167  // Member Functions
168 
169  //- Update the coefficients associated with the patch field
170  virtual void updateCoeffs();
171 
172  //- Write
173  virtual void write(Ostream&) const;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
This boundary condition provides a fan pressure jump condition, using the cyclic condition as a base....
fanPressureJumpFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("fanPressureJump")
Runtime type information.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
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.