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-------------------------------------------------------------------------------
12License
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
28Class
29 Foam::fv::actuationDiskSource
30
31Group
32 grpFvOptionsSources
33
34Description
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
124Usage
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
204SourceFiles
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
219namespace Foam
220{
221namespace fv
222{
223
224/*---------------------------------------------------------------------------*\
225 Class actuationDiskSource Declaration
226\*---------------------------------------------------------------------------*/
227
228class actuationDiskSource
229:
230 public fv::cellSetOption,
231 public functionObjects::writeFile
232{
233protected:
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
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
297private:
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
332public:
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
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
376 return diskArea_;
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
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// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base class for writing single files from the function objects.
Definition: writeFile.H:120
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Applies sources on velocity (i.e. U) within a specified region to enable actuator disk models for aer...
actuationDiskSource()=delete
No default construct.
static const Enum< monitorMethodType > monitorMethodTypeNames
Names for monitorMethodType.
autoPtr< Function1< scalar > > UvsCtPtr_
Velocity vs thrust coefficients.
actuationDiskSource(const actuationDiskSource &)=delete
No copy construct.
void operator=(const actuationDiskSource &)=delete
No copy assignment.
TypeName("actuationDiskSource")
Runtime type information.
static const Enum< forceMethodType > forceMethodTypeNames
Names for forceMethodType.
virtual ~actuationDiskSource()=default
Destructor.
scalar diskArea() const
Disk area.
vector diskDir_
Surface-normal vector of the actuator disk pointing downstream.
monitorMethodType
Options for the incoming velocity monitoring method types.
scalar writeFileEnd_
End time for file output.
virtual bool read(const dictionary &dict)
Read dictionary.
const vector & diskDir() const
Normal disk direction.
scalar writeFileStart_
Start time for file output.
enum monitorMethodType monitorMethod_
The type of incoming velocity monitoring method.
enum forceMethodType forceMethod_
The type of the force computation method.
forceMethodType
Options for the force computation method types.
@ FROUDE
"Froude's ideal actuator disk method"
@ VARIABLE_SCALING
"Variable-scaling actuator disk method"
labelList monitorCells_
Set of cells whereat the incoming velocity is monitored.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
virtual void writeFileHeader(Ostream &os)
Output file header information.
autoPtr< Function1< scalar > > UvsCpPtr_
Velocity vs power coefficients.
label sink_
Flag for body forces to act as a source (false) or a sink (true)
scalar diskArea_
Actuator disk planar surface area [m2].
Intermediate abstract class for handling cell-set options for the derived fvOptions.
const word & name() const noexcept
Return const access to the source name.
Definition: fvOptionI.H:31
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
labelList fv(nPoints)
volScalarField & alpha
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73