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 | vector | 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 actuationDiskSource_H
211 #define 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
280 
281  //- Velocity vs power coefficients
282  autoPtr<Function1<scalar>> UvsCpPtr_;
283 
284  //- Velocity vs thrust coefficients
285  autoPtr<Function1<scalar>> UvsCtPtr_;
286 
287  //- Set of cells whereat the incoming velocity is monitored
289 
290 
291  // Protected Member Functions
292 
293  //- Output file header information
294  virtual void writeFileHeader(Ostream& os);
295 
296 
297 private:
298 
299  // Private Member Functions
300 
301  //- Locate the set of cells whereat the incoming velocity is monitored
302  void setMonitorCells(const dictionary& dict);
303 
304  //- Compute the selected force computation method type
305  template<class AlphaFieldType, class RhoFieldType>
306  void calc
307  (
308  const AlphaFieldType& alpha,
309  const RhoFieldType& rho,
310  fvMatrix<vector>& eqn
311  );
312 
313  //- Compute Froude's ideal actuator disk method
314  template<class AlphaFieldType, class RhoFieldType>
315  void calcFroudeMethod
316  (
317  const AlphaFieldType& alpha,
318  const RhoFieldType& rho,
319  fvMatrix<vector>& eqn
320  );
321 
322  //- Compute variable-scaling actuator disk method
323  template<class AlphaFieldType, class RhoFieldType>
324  void calcVariableScalingMethod
325  (
326  const AlphaFieldType& alpha,
327  const RhoFieldType& rho,
328  fvMatrix<vector>& eqn
329  );
330 
331 
332 public:
333 
334  //- Runtime type information
335  TypeName("actuationDiskSource");
336 
337 
338  // Constructors
339 
340  //- No default construct
341  actuationDiskSource() = delete;
342 
343  //- Construct from components
345  (
346  const word& name,
347  const word& modelType,
348  const dictionary& dict,
349  const fvMesh& mesh
350  );
351 
352  //- No copy construct
353  actuationDiskSource(const actuationDiskSource&) = delete;
354 
355  //- No copy assignment
356  void operator=(const actuationDiskSource&) = delete;
357 
358 
359  //- Destructor
360  virtual ~actuationDiskSource() = default;
361 
362 
363  // Member Functions
364 
365  // Access
366 
367  //- Normal disk direction
368  const vector& diskDir() const
369  {
370  return diskDir_;
371  }
372 
373  //- Disk area
374  scalar diskArea() const
375  {
376  return diskArea_;
377  }
378 
379 
380  // Add explicit and implicit contributions
381 
382  //- Source term to momentum equation
383  virtual void addSup
384  (
386  const label fieldi
387  );
388 
389  //- Source term to compressible momentum equation
390  virtual void addSup
391  (
393  fvMatrix<vector>& eqn,
394  const label fieldi
395  );
396 
397  //- Source term to phase-compressible momentum equation
398  virtual void addSup
399  (
400  const volScalarField& alpha,
402  fvMatrix<vector>& eqn,
403  const label fieldi
404  );
405 
406 
407  // IO
408 
409  //- Read dictionary
410  virtual bool read(const dictionary& dict);
411 };
412 
413 
414 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
415 
416 } // End namespace fv
417 } // End namespace Foam
418 
419 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
420 
421 #ifdef NoRepository
423 #endif
424 
425 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
426 
427 #endif
428 
429 // ************************************************************************* //
Foam::fv::actuationDiskSource::diskDir_
vector diskDir_
Surface-normal vector of the actuator disk pointing downstream.
Definition: actuationDiskSource.H:416
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
writeFile.H
Foam::fv::actuationDiskSource::CELLSET
"A cellSet"
Definition: actuationDiskSource.H:388
Foam::fv::option::name
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
Foam::Enum< forceMethodType >
Foam::fv::actuationDiskSource::monitorMethodType
monitorMethodType
Options for the incoming velocity monitoring method types.
Definition: actuationDiskSource.H:385
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Definition: cellSetOption.H:163
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Function1.H
Foam::fv::actuationDiskSource::monitorMethodTypeNames
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
Definition: actuationDiskSource.H:392
Foam::fv::actuationDiskSource::diskArea_
scalar diskArea_
Actuator disk planar surface area [m2].
Definition: actuationDiskSource.H:413
Foam::fv::actuationDiskSource::operator=
void operator=(const actuationDiskSource &)=delete
No copy assignment.
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::fv::actuationDiskSource
Applies sources on velocity (i.e. U) within a specified region to enable actuator disk models for aer...
Definition: actuationDiskSource.H:365
Foam::fv::actuationDiskSource::writeFileStart_
scalar writeFileStart_
Start time for file output.
Definition: actuationDiskSource.H:407
Foam::fv::actuationDiskSource::actuationDiskSource
actuationDiskSource()=delete
No default construct.
Foam::fv::actuationDiskSource::diskArea
scalar diskArea() const
Disk area.
Definition: actuationDiskSource.H:511
Foam::fv::actuationDiskSource::forceMethod_
enum forceMethodType forceMethod_
The type of the force computation method.
Definition: actuationDiskSource.H:398
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::fv::actuationDiskSource::UvsCtPtr_
autoPtr< Function1< scalar > > UvsCtPtr_
Velocity vs thrust coefficients.
Definition: actuationDiskSource.H:422
Foam::fv::actuationDiskSource::~actuationDiskSource
virtual ~actuationDiskSource()=default
Destructor.
os
OBJstream os(runTime.globalPath()/outputName)
Foam::fv::actuationDiskSource::forceMethodTypeNames
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
Definition: actuationDiskSource.H:382
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::fv::actuationDiskSource::UvsCpPtr_
autoPtr< Function1< scalar > > UvsCpPtr_
Velocity vs power coefficients.
Definition: actuationDiskSource.H:419
Foam::fv::actuationDiskSource::writeFileHeader
virtual void writeFileHeader(Ostream &os)
Output file header information.
Definition: actuationDiskSource.C:70
fv
labelList fv(nPoints)
Foam::fv::actuationDiskSource::writeFileEnd_
scalar writeFileEnd_
End time for file output.
Definition: actuationDiskSource.H:410
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Foam::fv::actuationDiskSource::VARIABLE_SCALING
"Variable-scaling actuator disk method"
Definition: actuationDiskSource.H:378
Foam::Vector< scalar >
Foam::List< label >
Foam::fv::actuationDiskSource::read
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: actuationDiskSource.C:279
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
actuationDiskSourceTemplates.C
Foam::fv::actuationDiskSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
Definition: actuationDiskSource.C:238
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::fv::actuationDiskSource::POINTS
"A set of points"
Definition: actuationDiskSource.H:387
Foam::fv::actuationDiskSource::forceMethodType
forceMethodType
Options for the force computation method types.
Definition: actuationDiskSource.H:375
Foam::fv::actuationDiskSource::FROUDE
"Froude's ideal actuator disk method"
Definition: actuationDiskSource.H:377
Foam::fv::actuationDiskSource::TypeName
TypeName("actuationDiskSource")
Runtime type information.
Foam::fv::actuationDiskSource::sink_
label sink_
Flag for body forces to act as a source (false) or a sink (true)
Definition: actuationDiskSource.H:404
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::actuationDiskSource::monitorCells_
labelList monitorCells_
Set of cells whereat the incoming velocity is monitored.
Definition: actuationDiskSource.H:425
Foam::fv::actuationDiskSource::monitorMethod_
enum monitorMethodType monitorMethod_
The type of incoming velocity monitoring method.
Definition: actuationDiskSource.H:401
Foam::fv::actuationDiskSource::diskDir
const vector & diskDir() const
Normal disk direction.
Definition: actuationDiskSource.H:505