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-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::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  libs ("libpropellerDisk.so");
46 
47  cellZone propeller;
48 
49  normal (1 0 0); // Normal direction of the propeller
50 
51  n 26.03; // Rotation speed [1/s]
52 
53  dPropeller 0.203; // Propeller diameter
54  dHub 0.039179; // Hub diameter
55 
56  propellerCurve
57  {
58  type table;
59 
60  // J Kt Kq
61  values
62  (
63  (0.10 (0.3267 0.03748))
64  (0.15 (0.3112 0.03629))
65  (0.20 (0.2949 0.03500))
66  (0.25 (0.2777 0.03361))
67  (0.30 (0.2598 0.03210))
68  (0.35 (0.2410 0.03047))
69  (0.40 (0.2214 0.02871))
70  (0.45 (0.2010 0.02682))
71  (0.50 (0.1798 0.02479))
72  (0.55 (0.1577 0.02261))
73  (0.60 (0.1349 0.02027))
74  (0.65 (0.1112 0.01777))
75  (0.70 (0.0867 0.01509))
76  (0.75 (0.0614 0.01224))
77  (0.80 (0.0353 0.00921))
78  );
79  }
80  }
81  \endverbatim
82 
83 SourceFiles
84  propellerDisk.C
85  propellerDiskTemplates.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef propellerDisk_H
90 #define propellerDisk_H
91 
92 #include "fvModel.H"
93 #include "logFile.H"
94 #include "fvCellZone.H"
95 #include "Function1.H"
96 #include "vector2D.H"
97 #include "forces.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 namespace fv
105 {
106 
107 class propellerDiskAdjustment;
108 
109 /*---------------------------------------------------------------------------*\
110  Class propellerDisk Declaration
111 \*---------------------------------------------------------------------------*/
112 
113 class propellerDisk
114 :
115  public fvModel
116 {
117 protected:
118 
119  // Protected Data
120 
121  //- The cellZone the fvConstraint applies to
123 
124  //- The name of the phase to which this fvModel applies
126 
127  //- Name of the velocity field
128  word UName_;
129 
130  //- Propeller disk centre
131  vector centre_;
132 
133  //- Propeller disk normal direction
134  vector normal_;
135 
136  //- Rotation speed [1/s]
137  scalar n_;
138 
139  //- Rotation direction (obtained from the sign of n_)
140  scalar rotationDir_;
141 
142  //- Propeller diameter
143  scalar dProp_;
144 
145  //- Hub diameter
146  scalar dHub_;
147 
148  //- Propeller function
150 
152 
153  //- Current force of the fluid on the propeller
154  mutable vector force_;
155 
156  //- Current moment of the fluid on the propeller
157  mutable vector moment_;
158 
159  //- Optional switch to enable logging of integral properties
160  Switch log_;
161 
162  //- Optional log file
164 
166 
167 
168  // Protected Member Functions
169 
170  //- Read the model coefficients
171  virtual void readCoeffs(const dictionary& dict);
172 
173  //- Return the propeller normal
174  virtual vector normal() const
175  {
176  return normal_;
177  }
178 
179  //- Return the rotation speed
180  scalar n() const;
181 
182  //- Rotation speed correction
183  void correctn(const scalar T) const;
184 
185  //- Computes the thickness of the disk in streamwise direction
186  scalar diskThickness(const vector& centre) const;
187 
188  //- Return the normalised flow-rate through the disk
189  scalar J(const vectorField& U, const vector& nHat) const;
190 
191  friend class propellerDiskAdjustment;
192 
193 
194 private:
195 
196  // Private Member Functions
197 
198  //- Add resistance to the UEqn
199  template<class AlphaFieldType, class RhoFieldType>
200  void addActuationDiskAxialInertialResistance
201  (
202  vectorField& Usource,
203  const AlphaFieldType& alpha,
204  const RhoFieldType& rho,
206  ) const;
207 
208 
209 public:
210 
211  //- Runtime type information
212  TypeName("propellerDisk");
213 
214 
215  // Constructors
216 
217  //- Construct from components
219  (
220  const word& name,
221  const word& modelType,
222  const fvMesh& mesh,
223  const dictionary& dict
224  );
225 
226  //- Disallow default bitwise copy construction
227  propellerDisk(const propellerDisk&) = delete;
228 
229 
230  //- Destructor
231  virtual ~propellerDisk();
232 
233 
234  // Member Functions
235 
236  //- Return the propeller centre
237  virtual vector centre() const
238  {
239  return centre_;
240  }
241 
242  //- Return the current force of the fluid on the propeller
243  vector force() const
244  {
245  return force_;
246  }
247 
248  //- Return the current moment of the fluid on the propeller
249  vector moment() const
250  {
251  return moment_;
252  }
253 
254 
255  // Checks
256 
257  //- Return the list of fields for which the fvModel adds source term
258  // to the transport equation
259  virtual wordList addSupFields() const;
260 
261 
262  // Add explicit and implicit contributions
263 
264  //- Source term to momentum equation
265  virtual void addSup
266  (
267  const volVectorField& U,
268  fvMatrix<vector>& eqn
269  ) const;
270 
271  //- Source term to compressible momentum equation
272  virtual void addSup
273  (
274  const volScalarField& rho,
275  const volVectorField& U,
276  fvMatrix<vector>& eqn
277  ) const;
278 
279  //- Explicit and implicit sources for phase equations
280  virtual void addSup
281  (
282  const volScalarField& alpha,
283  const volScalarField& rho,
284  const volVectorField& U,
285  fvMatrix<vector>& eqn
286  ) const;
287 
288 
289  // Mesh changes
290 
291  //- Update for mesh motion
292  virtual bool movePoints();
293 
294  //- Update topology using the given map
295  virtual void topoChange(const polyTopoChangeMap&);
296 
297  //- Update from another mesh using the given map
298  virtual void mapMesh(const polyMeshMap&);
299 
300  //- Redistribute or update using the given distribution map
301  virtual void distribute(const polyDistributionMap&);
302 
303 
304  // IO
305 
306  //- Read dictionary
307  virtual bool read(const dictionary& dict);
308 
309 
310  // Member Operators
311 
312  //- Disallow default bitwise assignment
313  void operator=(const propellerDisk&) = delete;
314 };
315 
316 
317 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
318 
319 } // End namespace fv
320 } // End namespace Foam
321 
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323 
324 #ifdef NoRepository
325  #include "propellerDiskTemplates.C"
326 #endif
327 
328 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
329 
330 #endif
331 
332 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
cellZone selection or generation class with caching of zone volume
Definition: fvCellZone.H:94
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:98
Finite volume model abstract base class.
Definition: fvModel.H:60
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Automatic adjustment option for the propellerDisk momentum source.
Disk momentum source which approximates a propeller based on a given propeller curve.
scalar dProp_
Propeller diameter.
virtual bool movePoints()
Update for mesh motion.
virtual ~propellerDisk()
Destructor.
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.
vector centre_
Propeller disk centre.
word UName_
Name of the velocity field.
virtual void readCoeffs(const dictionary &dict)
Read the model coefficients.
Definition: propellerDisk.C:49
word phaseName_
The name of the phase to which this fvModel applies.
fvCellZone zone_
The cellZone the fvConstraint applies to.
virtual vector normal() const
Return the propeller normal.
vector force() const
Return the current force of the fluid on the propeller.
TypeName("propellerDisk")
Runtime type information.
vector moment_
Current moment of the fluid on the propeller.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
vector normal_
Propeller disk normal direction.
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.
autoPtr< volVectorField::Internal > forcePtr_
vector moment() const
Return the current moment of the fluid on the propeller.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
autoPtr< propellerDiskAdjustment > adjustment_
autoPtr< Function1< vector2D > > propellerFunction_
Propeller function.
scalar rotationDir_
Rotation direction (obtained from the sign of n_)
scalar n() const
Return the rotation speed.
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.
vector force_
Current force of the fluid on the propeller.
void correctn(const scalar T) const
Rotation speed correction.
scalar n_
Rotation speed [1/s].
virtual vector centre() const
Return the propeller centre.
Switch log_
Optional switch to enable logging of integral properties.
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:63
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
void T(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
labelList fv(nPoints)
dictionary dict
Typedefs for UniformDimensionedField.