propellerDisk.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) 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::fv::propellerDisk
26 
27 Description
28  Disk momentum source which approximates a propeller based on a given
29  propeller curve.
30 
31  Reference:
32  \verbatim
33  Hough, G. R., & Ordway, D. E. (1964).
34  The generalized actuator disk.
35  Developments in theoretical and applied mechanics, 2, 317-336.
36  \endverbatim
37 
38 Usage
39  Example usage:
40  \verbatim
41  diskSource
42  {
43  type propellerDisk;
44 
45  selectionMode cellZone;
46  cellZone propeller;
47 
48  diskNormal (1 0 0); // Normal direction of the disk
49 
50  n 26.03; // Rotation speed [1/s]
51 
52  dPropeller 0.203; // Propeller diameter
53  dHub 0.039179; // Hub diameter
54 
55  propellerCurve
56  {
57  type table;
58 
59  // J Kt Kq
60  values
61  (
62  (0.10 (0.3267 0.03748))
63  (0.15 (0.3112 0.03629))
64  (0.20 (0.2949 0.03500))
65  (0.25 (0.2777 0.03361))
66  (0.30 (0.2598 0.03210))
67  (0.35 (0.2410 0.03047))
68  (0.40 (0.2214 0.02871))
69  (0.45 (0.2010 0.02682))
70  (0.50 (0.1798 0.02479))
71  (0.55 (0.1577 0.02261))
72  (0.60 (0.1349 0.02027))
73  (0.65 (0.1112 0.01777))
74  (0.70 (0.0867 0.01509))
75  (0.75 (0.0614 0.01224))
76  (0.80 (0.0353 0.00921))
77  );
78  }
79  }
80  \endverbatim
81 
82 SourceFiles
83  propellerDisk.C
84  propellerDiskTemplates.C
85 
86 \*---------------------------------------------------------------------------*/
87 
88 #ifndef propellerDisk_H
89 #define propellerDisk_H
90 
91 #include "fvModel.H"
92 #include "logFile.H"
93 #include "fvCellSet.H"
94 #include "Function1.H"
95 #include "vector2D.H"
96 #include "forces.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 namespace fv
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class propellerDisk Declaration
108 \*---------------------------------------------------------------------------*/
109 
110 class propellerDisk
111 :
112  public fvModel
113 {
114 protected:
115 
116  // Protected Data
117 
118  //- The set of cells the fvConstraint applies to
119  fvCellSet set_;
120 
121  //- The name of the phase to which this fvModel applies
123 
124  //- Name of the velocity field
125  word UName_;
126 
127  //- Disk normal direction
129 
130  //- Rotation speed [1/s]
131  scalar n_;
132 
133  //- Rotation direction (obtained from the sign of n_)
134  scalar rotationDir_;
135 
136  //- Propeller diameter
137  scalar dProp_;
138 
139  //- Hub diameter
140  scalar dHub_;
141 
142  //- Propeller function
144 
145  //- Optional switch to enable logging of integral properties
146  Switch log_;
147 
148  //- Optional log file
150 
151 
152  // Protected Member Functions
153 
154  //- Return the rotation speed
155  virtual scalar n() const
156  {
157  return n_;
158  }
159 
160  //- No rotation speed correction
161  virtual void correctn(const scalar T) const
162  {}
163 
164  //- Computes the disk centre
165  vector diskCentre() const;
166 
167  //- Computes the thickness of the disk in streamwise direction
168  scalar diskThickness(const vector& centre) const;
169 
170  //- Return the normalised flow-rate through the disk
171  scalar J(const vectorField& U, const vector& nHat) const;
172 
173 
174 private:
175 
176  // Private Member Functions
177 
178  //- Read the model coefficients
179  void readCoeffs(const dictionary& dict);
180 
181  //- Add resistance to the UEqn
182  template<class AlphaFieldType, class RhoFieldType>
183  void addActuationDiskAxialInertialResistance
184  (
185  vectorField& Usource,
186  const AlphaFieldType& alpha,
187  const RhoFieldType& rho,
189  ) const;
190 
191 
192 public:
193 
194  //- Runtime type information
195  TypeName("propellerDisk");
196 
197 
198  // Constructors
199 
200  //- Construct from components
202  (
203  const word& name,
204  const word& modelType,
205  const fvMesh& mesh,
206  const dictionary& dict
207  );
208 
209  //- Disallow default bitwise copy construction
210  propellerDisk(const propellerDisk&) = delete;
211 
212 
213  //- Destructor
214  virtual ~propellerDisk()
215  {}
216 
217 
218  // Member Functions
219 
220  // Checks
221 
222  //- Return the list of fields for which the fvModel adds source term
223  // to the transport equation
224  virtual wordList addSupFields() const;
225 
226 
227  // Add explicit and implicit contributions
228 
229  //- Source term to momentum equation
230  virtual void addSup
231  (
232  const volVectorField& U,
233  fvMatrix<vector>& eqn
234  ) const;
235 
236  //- Source term to compressible momentum equation
237  virtual void addSup
238  (
239  const volScalarField& rho,
240  const volVectorField& U,
241  fvMatrix<vector>& eqn
242  ) const;
243 
244  //- Explicit and implicit sources for phase equations
245  virtual void addSup
246  (
247  const volScalarField& alpha,
248  const volScalarField& rho,
249  const volVectorField& U,
250  fvMatrix<vector>& eqn
251  ) const;
252 
253 
254  // Mesh changes
255 
256  //- Update for mesh motion
257  virtual bool movePoints();
258 
259  //- Update topology using the given map
260  virtual void topoChange(const polyTopoChangeMap&);
261 
262  //- Update from another mesh using the given map
263  virtual void mapMesh(const polyMeshMap&);
264 
265  //- Redistribute or update using the given distribution map
266  virtual void distribute(const polyDistributionMap&);
267 
268 
269  // IO
270 
271  //- Read dictionary
272  virtual bool read(const dictionary& dict);
273 
274 
275  // Member Operators
276 
277  //- Disallow default bitwise assignment
278  void operator=(const propellerDisk&) = delete;
279 };
280 
281 
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
283 
284 } // End namespace fv
285 } // End namespace Foam
286 
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
288 
289 #ifdef NoRepository
290  #include "propellerDiskTemplates.C"
291 #endif
292 
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
294 
295 #endif
296 
297 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
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:162
General run-time selected cell set selection class for fvMesh.
Definition: fvCellSet.H:88
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Disk momentum source which approximates a propeller based on a given propeller curve.
virtual scalar n() const
Return the rotation speed.
scalar dProp_
Propeller diameter.
virtual bool movePoints()
Update for mesh motion.
virtual void addSup(const volVectorField &U, fvMatrix< vector > &eqn) const
Source term to momentum equation.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
word UName_
Name of the velocity field.
word phaseName_
The name of the phase to which this fvModel applies.
TypeName("propellerDisk")
Runtime type information.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
scalar dHub_
Hub diameter.
virtual bool read(const dictionary &dict)
Read dictionary.
void operator=(const propellerDisk &)=delete
Disallow default bitwise assignment.
scalar diskThickness(const vector &centre) const
Computes the thickness of the disk in streamwise direction.
virtual ~propellerDisk()
Destructor.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
autoPtr< Function1< vector2D > > propellerFunction_
Propeller function.
vector diskNormal_
Disk normal direction.
scalar rotationDir_
Rotation direction (obtained from the sign of n_)
fvCellSet set_
The set of cells the fvConstraint applies to.
virtual void correctn(const scalar T) const
No rotation speed correction.
scalar J(const vectorField &U, const vector &nHat) const
Return the normalised flow-rate through the disk.
propellerDisk(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from components.
autoPtr< functionObjects::logFile > logFile_
Optional log file.
scalar n_
Rotation speed [1/s].
Switch log_
Optional switch to enable logging of integral properties.
vector diskCentre() const
Computes the disk centre.
Definition: propellerDisk.C:98
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
labelList fv(nPoints)
dictionary dict