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 /*---------------------------------------------------------------------------*\
108  Class propellerDisk Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 class propellerDisk
112 :
113  public fvModel
114 {
115 protected:
116 
117  // Protected Data
118 
119  //- The cellZone the fvConstraint applies to
121 
122  //- The name of the phase to which this fvModel applies
124 
125  //- Name of the velocity field
126  word UName_;
127 
128  //- Propeller disk centre
129  vector centre_;
130 
131  //- Propeller disk normal direction
132  vector normal_;
133 
134  //- Rotation speed [1/s]
135  scalar n_;
136 
137  //- Rotation direction (obtained from the sign of n_)
138  scalar rotationDir_;
139 
140  //- Propeller diameter
141  scalar dProp_;
142 
143  //- Hub diameter
144  scalar dHub_;
145 
146  //- Propeller function
148 
150 
151  //- Current force of the fluid on the propeller
152  mutable vector force_;
153 
154  //- Current moment of the fluid on the propeller
155  mutable vector moment_;
156 
157  //- Optional switch to enable logging of integral properties
158  Switch log_;
159 
160  //- Optional log file
162 
163 
164  // Protected Member Functions
165 
166  //- Read the model coefficients
167  virtual void readCoeffs(const dictionary& dict);
168 
169  //- Return the propeller normal
170  virtual vector normal() const
171  {
172  return normal_;
173  }
174 
175  //- Return the rotation speed
176  virtual scalar n() const
177  {
178  return n_;
179  }
180 
181  //- No rotation speed correction
182  virtual void correctn(const scalar T) const
183  {}
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 
192 private:
193 
194  // Private Member Functions
195 
196  //- Add resistance to the UEqn
197  template<class AlphaFieldType, class RhoFieldType>
198  void addActuationDiskAxialInertialResistance
199  (
200  vectorField& Usource,
201  const AlphaFieldType& alpha,
202  const RhoFieldType& rho,
204  ) const;
205 
206 
207 public:
208 
209  //- Runtime type information
210  TypeName("propellerDisk");
211 
212 
213  // Constructors
214 
215  //- Construct from components
217  (
218  const word& name,
219  const word& modelType,
220  const fvMesh& mesh,
221  const dictionary& dict
222  );
223 
224  //- Disallow default bitwise copy construction
225  propellerDisk(const propellerDisk&) = delete;
226 
227 
228  //- Destructor
229  virtual ~propellerDisk()
230  {}
231 
232 
233  // Member Functions
234 
235  //- Return the propeller centre
236  virtual vector centre() const
237  {
238  return centre_;
239  }
240 
241  //- Return the current force of the fluid on the propeller
242  vector force() const
243  {
244  return force_;
245  }
246 
247  //- Return the current moment of the fluid on the propeller
248  vector moment() const
249  {
250  return moment_;
251  }
252 
253 
254  // Checks
255 
256  //- Return the list of fields for which the fvModel adds source term
257  // to the transport equation
258  virtual wordList addSupFields() const;
259 
260 
261  // Add explicit and implicit contributions
262 
263  //- Source term to momentum equation
264  virtual void addSup
265  (
266  const volVectorField& U,
267  fvMatrix<vector>& eqn
268  ) const;
269 
270  //- Source term to compressible momentum equation
271  virtual void addSup
272  (
273  const volScalarField& rho,
274  const volVectorField& U,
275  fvMatrix<vector>& eqn
276  ) const;
277 
278  //- Explicit and implicit sources for phase equations
279  virtual void addSup
280  (
281  const volScalarField& alpha,
282  const volScalarField& rho,
283  const volVectorField& U,
284  fvMatrix<vector>& eqn
285  ) const;
286 
287 
288  // Mesh changes
289 
290  //- Update for mesh motion
291  virtual bool movePoints();
292 
293  //- Update topology using the given map
294  virtual void topoChange(const polyTopoChangeMap&);
295 
296  //- Update from another mesh using the given map
297  virtual void mapMesh(const polyMeshMap&);
298 
299  //- Redistribute or update using the given distribution map
300  virtual void distribute(const polyDistributionMap&);
301 
302 
303  // IO
304 
305  //- Read dictionary
306  virtual bool read(const dictionary& dict);
307 
308 
309  // Member Operators
310 
311  //- Disallow default bitwise assignment
312  void operator=(const propellerDisk&) = delete;
313 };
314 
315 
316 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
317 
318 } // End namespace fv
319 } // End namespace Foam
320 
321 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
322 
323 #ifdef NoRepository
324  #include "propellerDiskTemplates.C"
325 #endif
326 
327 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
328 
329 #endif
330 
331 // ************************************************************************* //
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:96
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
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.
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:48
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_
virtual ~propellerDisk()
Destructor.
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< Function1< vector2D > > propellerFunction_
Propeller function.
scalar rotationDir_
Rotation direction (obtained from the sign of n_)
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.
vector force_
Current force of the fluid on the propeller.
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: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(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
labelList fv(nPoints)
dictionary dict