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-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::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 
55  fanCurve table;
56  file "$FOAM_CASE/constant/pressureVsQ";
57  format csv;
58  nHeaderLine 1;
59  columns (0 1);
60  separator ",";
61  mergeSeparators no;
62  outOfBounds clamp;
63  interpolationScheme linear;
64 
65  value uniform 0;
66  }
67  \endverbatim
68 
69 See also
70  Foam::Function1s
71 
72 SourceFiles
73  fanPressureJumpFvPatchScalarField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef fanPressureJumpFvPatchScalarField_H
78 #define fanPressureJumpFvPatchScalarField_H
79 
80 #include "fixedJumpFvPatchFields.H"
81 #include "Function1.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class fanPressureJumpFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class fanPressureJumpFvPatchScalarField
93 :
94  public fixedJumpFvPatchScalarField
95 {
96  // Private Data
97 
98  //- Name of the flux transporting the field
99  const word phiName_;
100 
101  //- Name of the density field used to normalise the mass flux
102  // if necessary
103  const word rhoName_;
104 
105  //- Fan curve
106  autoPtr<Function1<scalar>> fanCurve_;
107 
108  //- Jump table (backward compatibility)
109  autoPtr<Function1<scalar>> jumpTable_;
110 
111  //- Set true to reverse jump direction
112  const Switch reverse_;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("fanPressureJump");
119 
120 
121  // Constructors
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given patch onto a new patch
133  (
135  const fvPatch&,
137  const fieldMapper&
138  );
139 
140  //- Disallow copy without setting internal field reference
142  (
144  ) = delete;
145 
146  //- Copy constructor setting internal field reference
148  (
151  );
152 
153  //- Construct and return a clone setting internal field reference
155  (
157  ) const
158  {
160  (
161  new fanPressureJumpFvPatchScalarField(*this, iF)
162  );
163  }
164 
165 
166  // Member Functions
167 
168  //- Update the coefficients associated with the patch field
169  virtual void updateCoeffs();
170 
171  //- Write
172  virtual void write(Ostream&) const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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.