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, to enable actuator disk models
36  for aero/hydro thrust loading of horizontal axis turbines on surrounding
37  flow field in terms of energy conversion processes.
38 
39  Available options for force computations:
40  \verbatim
41  Froude | Froude's one-dimensional ideal actuator disk method
42  variableScaling | Variable-scaling actuator disk method
43  \endverbatim
44 
45  The expressions for \c Froude method:
46  \f[
47  T = 2 \rho A | \vec{U_o} \cdot \vec{n} |^2 a (1-a)
48  \f]
49  with
50  \f[
51  a = 1 - \frac{C_p}{C_T}
52  \f]
53  where
54  \vartable
55  T | Thrust magnitude
56  \rho | Monitored incoming fluid density
57  A | Actuator disk planar surface area
58  \vec{U_o} | Incoming velocity spatial-averaged on monitored region
59  \vec{n} | Surface-normal vector of the actuator disk pointing upstream
60  a | Axial induction factor
61  C_p | Power coefficient
62  C_T | Thrust coefficient
63  \endvartable
64 
65  The expressions for \c variableScaling method:
66  \f[
67  T = 0.5 \rho A | \vec{U_m} \cdot \vec{n} |^2 C_T^*
68  \f]
69  with
70  \f[
71  C_T^* = C_T \left( \frac{ |\vec{U_{ref}}| }{ |\vec{U_m}| } \right)^2
72  \f]
73  where
74  \vartable
75  T | Thrust magnitude
76  \rho | Monitored incoming fluid density
77  A | Actuator disk planar surface area
78  \vec{U_m} | Incoming velocity spatial-averaged on actuator disk
79  \vec{n} | Surface-normal vector of the actuator disk pointing upstream
80  \vec{U_{ref}} | Incoming velocity spatial-averaged on monitored region
81  C_T | Thrust coefficient
82  C_T^* | Calibrated thrust coefficient
83  \endvartable
84 
85  Reference
86  \verbatim
87  Froude's one-dimensional ideal actuator disk (tags:F,BJSB):
88  Froude, R. E. (1889).
89  On the part played in propulsion by differences of fluid pressure.
90  Trans. Inst. Naval Architects, 30, 390.
91 
92  Burton, T., Jenkins, N., Sharpe, D., & Bossanyi, E. (2011).
93  Wind energy handbook, 2nd edition.
94  Chichester, the United Kingdom. John Wiley & Sons.
95  Print ISBN:978-0-470-69975-1
96  DOI:10.1002/9781119992714
97 
98  Variable-scaling method (tags:LSRMKT,LS):
99  van der Laan, M. P., Sørensen, N. N., Réthoré, P. E.,
100  Mann, J., Kelly, M. C., & Troldborg, N. (2015).
101  The k‐ε‐fP model applied to double wind turbine
102  wakes using different actuator disk force methods.
103  Wind Energy, 18(12), 2223-2240.
104  DOI:10.1002/we.1816
105 
106  van der Laan, M. P., Sørensen, N. N., Réthoré, P. E., Mann, J.,
107  Kelly, M. C., Troldborg, N., Hansen, K. S., & Murcia, J. P. (2015).
108  The k‐ε‐fP model applied to wind farms.
109  Wind Energy, 18(12), 2065-2084.
110  DOI:10.1002/we.1804
111  \endverbatim
112 
113  Corrections applied to:
114  \verbatim
115  U | Velocity [m/s]
116  \endverbatim
117 
118  Required fields:
119  \verbatim
120  U | Velocity [m/s]
121  \endverbatim
122 
123 Usage
124  Example by using \c constant/fvOptions:
125  \verbatim
126  actuationDiskSource1
127  {
128  // Mandatory entries (unmodifiable)
129  type actuationDiskSource;
130 
131  // Mandatory (inherited) entries (unmodifiable)
132  selectionMode <mode>; // e.g. cellSet as shown below
133  cellSet <cellSetName>;
134 
135  // Mandatory entries (runtime modifiable)
136  diskArea 40.0;
137  diskDir (1 0 0);
138  Cp <Function1>;
139  Ct <Function1>;
140 
141  // Conditional optional entries (unmodifiable)
142  monitorMethod <points|cellSet>;
143  monitorCoeffs
144  {
145  // Option-1
146  points
147  (
148  (p1x p1y p1z)
149  (p2x p2y p2z)
150  ...
151  );
152 
153  // Option-2
154  cellSet <monitorCellSet>;
155  }
156 
157  // Optional entries (unmodifiable)
158  variant <forceMethod>;
159 
160  // Optional entries (runtime modifiable)
161  sink true;
162  writeFileStart 0;
163  writeFileEnd 100;
164 
165  // Optional (inherited) entries
166  ...
167  }
168  \endverbatim
169 
170  where the entries mean:
171  \table
172  Property | Description | Type | Req'd | Dflt
173  type | Type name: actuationDiskSource | word | yes | -
174  diskArea | Actuator disk planar surface area | scalar | yes | -
175  diskDir | Surface-normal vector of the actuator disk <!--
176  --> pointing upstream | vector | yes | -
177  Cp | Power coefficient | Function1 | yes | -
178  Ct | Thrust coefficient | Function1 | yes | -
179  monitorMethod | Type of incoming velocity monitoring method <!--
180  --> - see below | word | no | points
181  variant | Type of the force computation method - see below <!--
182  --> | word | no | Froude
183  sink | Flag for body forces to act as a source (true) <!--
184  --> or a sink (false) | bool | no | true
185  writeFileStart | Start time for file output | scalar | no | 0
186  writeFileEnd | End time for file output | scalar | no | VGREAT
187  \endtable
188 
189  The inherited entries are elaborated in:
190  - \link fvOption.H \endlink
191  - \link cellSetOption.H \endlink
192  - \link writeFile.H \endlink
193  - \link Function1.H \endlink
194 
195  Options for the \c monitorMethod entry:
196  \verbatim
197  points | Monitor incoming velocity field at a given set of points
198  cellSet | Monitor incoming velocity field at a given cellSet
199  \endverbatim
200 
201  Options for the \c variant entry:
202  \verbatim
203  Froude | Froude's one-dimensional ideal actuator disk method
204  variableScaling | Variable-scaling actuator disk method
205  \endverbatim
206 
207 SourceFiles
208  actuationDiskSource.C
209  actuationDiskSourceTemplates.C
210 
211 \*---------------------------------------------------------------------------*/
212 
213 #ifndef actuationDiskSource_H
214 #define actuationDiskSource_H
215 
216 #include "cellSetOption.H"
217 #include "writeFile.H"
218 #include "Function1.H"
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 namespace Foam
223 {
224 namespace fv
225 {
226 
227 /*---------------------------------------------------------------------------*\
228  Class actuationDiskSource Declaration
229 \*---------------------------------------------------------------------------*/
230 
231 class actuationDiskSource
232 :
233  public cellSetOption,
234  public functionObjects::writeFile
235 {
236 protected:
237 
238  // Protected Enumerations
239 
240  //- Options for the force computation method types
241  enum forceMethodType
242  {
243  FROUDE,
245  };
246 
247  //- Names for forceMethodType
248  static const Enum<forceMethodType> forceMethodTypeNames;
249 
250  //- Options for the incoming velocity monitoring method types
251  enum monitorMethodType
252  {
253  POINTS,
254  CELLSET
255  };
256 
257  //- Names for monitorMethodType
258  static const Enum<monitorMethodType> monitorMethodTypeNames;
259 
260 
261  // Protected Data
262 
263  //- The type of the force computation method
264  const enum forceMethodType forceMethod_;
265 
266  //- The type of incoming velocity monitoring method
268 
269  //- Flag for body forces to act as a source (true) or a sink (false)
270  label sink_;
271 
272  //- Start time for file output
273  scalar writeFileStart_;
274 
275  //- End time for file output
276  scalar writeFileEnd_;
277 
278  //- Actuator disk planar surface area [m2]
279  scalar diskArea_;
280 
281  //- Surface-normal vector of the actuator disk pointing upstream
283 
284  //- Velocity vs power coefficients
285  autoPtr<Function1<scalar>> UvsCpPtr_;
286 
287  //- Velocity vs thrust coefficients
288  autoPtr<Function1<scalar>> UvsCtPtr_;
289 
290  //- Set of cells whereat the incoming velocity is monitored
292 
293 
294  // Protected Member Functions
295 
296  //- Output file header information
297  virtual void writeFileHeader(Ostream& os);
298 
299 
300 private:
301 
302  // Private Member Functions
303 
304  //- Locate the set of cells whereat the incoming velocity is monitored
305  void setMonitorCells(const dictionary& dict);
306 
307  //- Compute the selected force computation method type
308  template<class AlphaFieldType, class RhoFieldType>
309  void calc
310  (
311  const AlphaFieldType& alpha,
312  const RhoFieldType& rho,
313  fvMatrix<vector>& eqn
314  );
315 
316  //- Compute Froude's ideal actuator disk method
317  template<class AlphaFieldType, class RhoFieldType>
318  void calcFroudeMethod
319  (
320  const AlphaFieldType& alpha,
321  const RhoFieldType& rho,
322  fvMatrix<vector>& eqn
323  );
324 
325  //- Compute variable-scaling actuator disk method
326  template<class AlphaFieldType, class RhoFieldType>
327  void calcVariableScalingMethod
328  (
329  const AlphaFieldType& alpha,
330  const RhoFieldType& rho,
331  fvMatrix<vector>& eqn
332  );
333 
334 
335 public:
336 
337  //- Runtime type information
338  TypeName("actuationDiskSource");
339 
340 
341  // Constructors
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  (
392  const volScalarField& rho,
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 upstream.
Definition: actuationDiskSource.H:419
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
writeFile.H
Foam::fv::actuationDiskSource::CELLSET
"A cellSet"
Definition: actuationDiskSource.H:391
Foam::Enum< forceMethodType >
Foam::fv::actuationDiskSource::monitorMethodType
monitorMethodType
Options for the incoming velocity monitoring method types.
Definition: actuationDiskSource.H:388
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fv::cellSetOption
Cell-set options abstract base class. Provides a base set of controls, e.g.:
Definition: cellSetOption.H:72
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:30
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:395
Foam::fv::actuationDiskSource::diskArea_
scalar diskArea_
Actuator disk planar surface area [m2].
Definition: actuationDiskSource.H:416
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, to enable actuator disk models for aero/hydro thrust loading of ...
Definition: actuationDiskSource.H:368
Foam::fv::actuationDiskSource::writeFileStart_
scalar writeFileStart_
Start time for file output.
Definition: actuationDiskSource.H:410
Foam::fv::actuationDiskSource::actuationDiskSource
actuationDiskSource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from components.
Definition: actuationDiskSource.C:165
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:401
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:121
Foam::fv::actuationDiskSource::UvsCtPtr_
autoPtr< Function1< scalar > > UvsCtPtr_
Velocity vs thrust coefficients.
Definition: actuationDiskSource.H:425
Foam::fv::actuationDiskSource::~actuationDiskSource
virtual ~actuationDiskSource()=default
Destructor.
Foam::fv::actuationDiskSource::forceMethodTypeNames
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
Definition: actuationDiskSource.H:385
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
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:422
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:413
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::fv::actuationDiskSource::VARIABLE_SCALING
"Variable-scaling actuator disk method"
Definition: actuationDiskSource.H:381
Foam::Vector< scalar >
Foam::List< label >
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:36
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:76
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:106
Foam::fv::actuationDiskSource::POINTS
"A set of points"
Definition: actuationDiskSource.H:390
Foam::fv::actuationDiskSource::forceMethodType
forceMethodType
Options for the force computation method types.
Definition: actuationDiskSource.H:378
Foam::fv::actuationDiskSource::FROUDE
"Froude's ideal actuator disk method"
Definition: actuationDiskSource.H:380
Foam::fv::actuationDiskSource::TypeName
TypeName("actuationDiskSource")
Runtime type information.
Foam::fv::actuationDiskSource::sink_
label sink_
Flag for body forces to act as a source (true) or a sink (false)
Definition: actuationDiskSource.H:407
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:428
Foam::fv::actuationDiskSource::monitorMethod_
enum monitorMethodType monitorMethod_
The type of incoming velocity monitoring method.
Definition: actuationDiskSource.H:404
Foam::fv::actuationDiskSource::diskDir
const vector & diskDir() const
Normal disk direction.
Definition: actuationDiskSource.H:505