actuationDiskSource.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 ENERCON GmbH
10  Copyright (C) 2020 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::fv::actuationDiskSource
30 
31 Group
32  grpFvOptionsSources
33 
34 Description
35  Applies sources on velocity (i.e. \c U) within a specified region
36  to enable actuator disk models for aero/hydro thrust loading of
37  horizontal axis turbines on surrounding flow field in terms of
38  energy conversion processes.
39 
40  Available options for force computations:
41  \verbatim
42  Froude | Froude's one-dimensional ideal actuator disk method
43  variableScaling | Variable-scaling actuator disk method
44  \endverbatim
45 
46  The expressions for \c Froude method:
47  \f[
48  T = 2 \rho A | \vec{U_o} \cdot \vec{n} |^2 a (1-a)
49  \f]
50  with
51  \f[
52  a = 1 - \frac{C_p}{C_T}
53  \f]
54  where
55  \vartable
56  T | Thrust magnitude
57  \rho | Monitored incoming fluid density
58  A | Actuator disk planar surface area
59  \vec{U_o} | Incoming velocity spatial-averaged on monitored region
60  \vec{n} | Surface-normal vector of the actuator disk pointing downstream
61  a | Axial induction factor
62  C_p | Power coefficient
63  C_T | Thrust coefficient
64  \endvartable
65 
66  The expressions for \c variableScaling method:
67  \f[
68  T = 0.5 \rho A | \vec{U_m} \cdot \vec{n} |^2 C_T^*
69  \f]
70  with
71  \f[
72  C_T^* = C_T \left( \frac{ |\vec{U_{ref}}| }{ |\vec{U_m}| } \right)^2
73  \f]
74  where
75  \vartable
76  T | Thrust magnitude
77  \rho | Monitored incoming fluid density
78  A | Actuator disk planar surface area
79  \vec{U_m} | Incoming velocity spatial-averaged on actuator disk
80  \vec{n} | Surface-normal vector of the actuator disk pointing downstream
81  \vec{U_{ref}} | Incoming velocity spatial-averaged on monitored region
82  C_T | Thrust coefficient
83  C_T^* | Calibrated thrust coefficient
84  \endvartable
85 
86  Reference
87  \verbatim
88  Froude's one-dimensional ideal actuator disk (tags:F,BJSB):
89  Froude, R. E. (1889).
90  On the part played in propulsion by differences of fluid pressure.
91  Trans. Inst. Naval Architects, 30, 390.
92 
93  Burton, T., Jenkins, N., Sharpe, D., & Bossanyi, E. (2011).
94  Wind energy handbook, 2nd edition.
95  Chichester, the United Kingdom. John Wiley & Sons.
96  Print ISBN:978-0-470-69975-1
97  DOI:10.1002/9781119992714
98 
99  Variable-scaling method (tags:LSRMKT,LS):
100  van der Laan, M. P., Sørensen, N. N., Réthoré, P. E.,
101  Mann, J., Kelly, M. C., & Troldborg, N. (2015).
102  The k‐ε‐fP model applied to double wind turbine
103  wakes using different actuator disk force methods.
104  Wind Energy, 18(12), 2223-2240.
105  DOI:10.1002/we.1816
106 
107  van der Laan, M. P., Sørensen, N. N., Réthoré, P. E., Mann, J.,
108  Kelly, M. C., Troldborg, N., Hansen, K. S., & Murcia, J. P. (2015).
109  The k‐ε‐fP model applied to wind farms.
110  Wind Energy, 18(12), 2065-2084.
111  DOI:10.1002/we.1804
112  \endverbatim
113 
114  Sources applied to:
115  \verbatim
116  U | Velocity [m/s]
117  \endverbatim
118 
119  Required fields:
120  \verbatim
121  U | Velocity [m/s]
122  \endverbatim
123 
124 Usage
125  Minimal example by using \c constant/fvOptions:
126  \verbatim
127  actuationDiskSource1
128  {
129  // Mandatory entries (unmodifiable)
130  type actuationDiskSource;
131 
132  // Mandatory entries (runtime modifiable)
133  diskArea 40.0;
134  diskDir (1 0 0);
135  Cp <Function1>;
136  Ct <Function1>;
137 
138  // Conditional optional entries (unmodifiable)
139  monitorMethod <points|cellSet>;
140  monitorCoeffs
141  {
142  // Option-1
143  points
144  (
145  (p1x p1y p1z)
146  (p2x p2y p2z)
147  ...
148  );
149 
150  // Option-2
151  cellSet <monitorCellSet>;
152  }
153 
154  // Optional entries (unmodifiable)
155  variant <forceMethod>;
156 
157  // Optional entries (runtime modifiable)
158  sink true;
159  writeFileStart 0;
160  writeFileEnd 100;
161 
162  // Mandatory/Optional (inherited) entries
163  ...
164  }
165  \endverbatim
166 
167  where the entries mean:
168  \table
169  Property | Description | Type | Reqd | Dflt
170  type | Type name: actuationDiskSource | word | yes | -
171  diskArea | Actuator disk planar surface area | scalar | yes | -
172  diskDir | Surface-normal vector of the actuator disk <!--
173  --> pointing downstream | Function1 | yes | -
174  Cp | Power coefficient | Function1 | yes | -
175  Ct | Thrust coefficient | Function1 | yes | -
176  monitorMethod | Type of incoming velocity monitoring method <!--
177  --> - see below | word | no | points
178  variant | Type of the force computation method - see below <!--
179  --> | word | no | Froude
180  sink | Flag for body forces to act as a source (false) <!--
181  --> or a sink (true) | bool | no | true
182  writeFileStart | Start time for file output | scalar | no | 0
183  writeFileEnd | End time for file output | scalar | no | VGREAT
184  \endtable
185 
186  The inherited entries are elaborated in:
187  - \link fvOption.H \endlink
188  - \link cellSetOption.H \endlink
189  - \link writeFile.H \endlink
190  - \link Function1.H \endlink
191 
192  Options for the \c monitorMethod entry:
193  \verbatim
194  points | Monitor incoming velocity field at a given set of points
195  cellSet | Monitor incoming velocity field at a given cellSet
196  \endverbatim
197 
198  Options for the \c variant entry:
199  \verbatim
200  Froude | Froude's one-dimensional ideal actuator disk method
201  variableScaling | Variable-scaling actuator disk method
202  \endverbatim
203 
204 SourceFiles
205  actuationDiskSource.C
206  actuationDiskSourceTemplates.C
207 
208 \*---------------------------------------------------------------------------*/
209 
210 #ifndef Foam_actuationDiskSource_H
211 #define Foam_actuationDiskSource_H
212 
213 #include "cellSetOption.H"
214 #include "writeFile.H"
215 #include "Function1.H"
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 namespace Foam
220 {
221 namespace fv
222 {
223 
224 /*---------------------------------------------------------------------------*\
225  Class actuationDiskSource Declaration
226 \*---------------------------------------------------------------------------*/
227 
228 class actuationDiskSource
229 :
230  public fv::cellSetOption,
231  public functionObjects::writeFile
232 {
233 protected:
234 
235  // Protected Enumerations
236 
237  //- Options for the force computation method types
238  enum forceMethodType
239  {
240  FROUDE,
242  };
243 
244  //- Names for forceMethodType
245  static const Enum<forceMethodType> forceMethodTypeNames;
246 
247  //- Options for the incoming velocity monitoring method types
248  enum monitorMethodType
249  {
250  POINTS,
251  CELLSET
252  };
253 
254  //- Names for monitorMethodType
255  static const Enum<monitorMethodType> monitorMethodTypeNames;
256 
257 
258  // Protected Data
259 
260  //- The type of the force computation method
261  const enum forceMethodType forceMethod_;
262 
263  //- The type of incoming velocity monitoring method
265 
266  //- Flag for body forces to act as a source (false) or a sink (true)
267  label sink_;
268 
269  //- Start time for file output
270  scalar writeFileStart_;
271 
272  //- End time for file output
273  scalar writeFileEnd_;
274 
275  //- Actuator disk planar surface area [m2]
276  scalar diskArea_;
277 
278  //- Surface-normal vector of the actuator disk pointing downstream
279  //- as a function of time
280  autoPtr<Function1<vector>> diskDir_;
281 
282  //- Velocity vs power coefficients
283  autoPtr<Function1<scalar>> UvsCpPtr_;
284 
285  //- Velocity vs thrust coefficients
286  autoPtr<Function1<scalar>> UvsCtPtr_;
287 
288  //- Set of cells whereat the incoming velocity is monitored
290 
291 
292  // Protected Member Functions
293 
294  //- Output file header information
295  virtual void writeFileHeader(Ostream& os);
296 
297 
298 private:
299 
300  // Private Member Functions
301 
302  //- Locate the set of cells whereat the incoming velocity is monitored
303  void setMonitorCells(const dictionary& dict);
304 
305  //- Compute the selected force computation method type
306  template<class AlphaFieldType, class RhoFieldType>
307  void calc
308  (
309  const AlphaFieldType& alpha,
310  const RhoFieldType& rho,
311  fvMatrix<vector>& eqn
312  );
313 
314  //- Compute Froude's ideal actuator disk method
315  template<class AlphaFieldType, class RhoFieldType>
316  void calcFroudeMethod
317  (
318  const AlphaFieldType& alpha,
319  const RhoFieldType& rho,
320  fvMatrix<vector>& eqn
321  );
322 
323  //- Compute variable-scaling actuator disk method
324  template<class AlphaFieldType, class RhoFieldType>
325  void calcVariableScalingMethod
326  (
327  const AlphaFieldType& alpha,
328  const RhoFieldType& rho,
329  fvMatrix<vector>& eqn
330  );
331 
332 
333 public:
334 
335  //- Runtime type information
336  TypeName("actuationDiskSource");
337 
338 
339  // Constructors
340 
341  //- No default construct
342  actuationDiskSource() = delete;
343 
344  //- Construct from components
346  (
347  const word& name,
348  const word& modelType,
349  const dictionary& dict,
350  const fvMesh& mesh
351  );
352 
353  //- No copy construct
354  actuationDiskSource(const actuationDiskSource&) = delete;
355 
356  //- No copy assignment
357  void operator=(const actuationDiskSource&) = delete;
358 
359 
360  //- Destructor
361  virtual ~actuationDiskSource() = default;
362 
363 
364  // Member Functions
365 
366  // Access
367 
368  //- Normal disk direction, evaluated at timeOutputValue
369  vector diskDir() const;
370 
371  //- Disk area
372  scalar diskArea() const noexcept
373  {
374  return diskArea_;
375  }
377 
378  // Add explicit and implicit contributions
379 
380  //- Source term to momentum equation
381  virtual void addSup
382  (
383  fvMatrix<vector>& eqn,
384  const label fieldi
385  );
386 
387  //- Source term to compressible momentum equation
388  virtual void addSup
389  (
391  fvMatrix<vector>& eqn,
392  const label fieldi
393  );
394 
395  //- Source term to phase-compressible momentum equation
396  virtual void addSup
397  (
398  const volScalarField& alpha,
399  const volScalarField& rho,
400  fvMatrix<vector>& eqn,
401  const label fieldi
402  );
403 
405  // IO
406 
407  //- Read dictionary
408  virtual bool read(const dictionary& dict);
409 };
410 
411 
412 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
413 
414 } // End namespace fv
415 } // End namespace Foam
416 
417 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
418 
419 #ifdef NoRepository
421 #endif
422 
423 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
425 #endif
426 
427 // ************************************************************************* //
label sink_
Flag for body forces to act as a source (false) or a sink (true)
TypeName("actuationDiskSource")
Runtime type information.
dictionary dict
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:30
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
scalar writeFileEnd_
End time for file output.
autoPtr< Function1< scalar > > UvsCpPtr_
Velocity vs power coefficients.
forceMethodType
Options for the force computation method types.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
virtual void writeFileHeader(Ostream &os)
Output file header information.
"Variable-scaling actuator disk method"
void operator=(const actuationDiskSource &)=delete
No copy assignment.
autoPtr< Function1< scalar > > UvsCtPtr_
Velocity vs thrust coefficients.
enum forceMethodType forceMethod_
The type of the force computation method.
actuationDiskSource()=delete
No default construct.
"Froude&#39;s ideal actuator disk method"
virtual ~actuationDiskSource()=default
Destructor.
labelList fv(nPoints)
vector diskDir() const
Normal disk direction, evaluated at timeOutputValue.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:64
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:24
autoPtr< Function1< vector > > diskDir_
Surface-normal vector of the actuator disk pointing downstream as a function of time.
const direction noexcept
Definition: Scalar.H:258
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
virtual bool read(const dictionary &dict)
Read dictionary.
monitorMethodType
Options for the incoming velocity monitoring method types.
List< label > labelList
A List of labels.
Definition: List.H:62
labelList monitorCells_
Set of cells whereat the incoming velocity is monitored.
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
scalar diskArea_
Actuator disk planar surface area [m2].
enum monitorMethodType monitorMethod_
The type of incoming velocity monitoring method.
Namespace for OpenFOAM.
scalar writeFileStart_
Start time for file output.
scalar diskArea() const noexcept
Disk area.