seriesProfile.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-2013 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::seriesProfile
29 
30 Description
31  Profile model where polar lift and drag coefficients are computed
32  as sum of trigonometric series by using an input angle of attack.
33 
34  \f[
35  C_d = \sum_i\left(C_{dCoeff} \cos(i \alpha) \right)
36  \f]
37 
38  \f[
39  C_l = \sum_i\left(C_{lCoeff} \sin(i \alpha) \right)
40  \f]
41 
42  where
43  \vartable
44  C_d | Drag coefficient
45  C_l | Lift coefficient
46  \alpha | Angle of attack [deg]
47  \endvartable
48 
49 Usage
50  Minimal example by using \c constant/fvOptions:
51  rotorDiskSource1
52  {
53  // Mandatory/Optional (inherited) entries
54  ...
55 
56  // Mandatory entries (runtime modifiable)
57  profiles
58  {
59  // Mandatory entries (runtime modifiable)
60  <profile1>
61  {
62  // Mandatory entries (runtime modifiable)
63  type series;
64  CdCoeffs (coeff1 coeff2 ... coeffN);
65  ClCoeffs (coeff1 coeff2 ... coeffN);
66  }
67 
68  // Mandatory/Optional (inherited) entries
69  ...
70  }
71  }
72 
73  where the entries mean:
74  \table
75  Property | Description | Type | Reqd | Dflt
76  CdCoeffs | List of drag coefficients | scalarList | yes | -
77  ClCoeffs | List of lift coefficients | scalarList | yes | -
78  \endtable
79 
80 Note
81  - Angle of attack is internally converted from [deg] to [rad].
82 
83 See also
84  - Foam::fv::rotorDiskSource
85  - Foam::profileModel
86  - Foam::seriesProfile
87 
88 SourceFiles
89  seriesProfile.C
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef seriesProfile_H
94 #define seriesProfile_H
95 
96 #include "profileModel.H"
97 #include "List.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 
104 /*---------------------------------------------------------------------------*\
105  Class seriesProfile Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class seriesProfile
109 :
110  public profileModel
111 {
112 protected:
113 
114  // Protected Data
115 
116  //- List of drag coefficient values
117  List<scalar> CdCoeffs_;
118 
119  //- List of lift coefficient values
120  List<scalar> ClCoeffs_;
121 
122 
123  // Protected Member Functions
124 
125  // Evaluation
126 
127  //- Drag
128  scalar evaluateDrag
129  (
130  const scalar& xIn,
131  const List<scalar>& values
132  ) const;
133 
134  //- Lift
135  scalar evaluateLift
136  (
137  const scalar& xIn,
138  const List<scalar>& values
139  ) const;
140 
141 
142 public:
143 
144  //- Runtime type information
145  TypeName("series");
146 
147 
148  // Constructors
149 
150  //- Constructor from dictionary and model name
151  seriesProfile(const dictionary& dict, const word& modelName);
152 
153  //- No copy construct
154  seriesProfile(const seriesProfile&) = delete;
155 
156  //- No copy assignment
157  void operator=(const seriesProfile&) = delete;
158 
159 
160  //- Destructor
161  ~seriesProfile() = default;
162 
163 
164  // Member Functions
165 
166  //- Return the Cd and Cl for a given angle-of-attack
167  virtual void Cdl(const scalar alpha, scalar& Cd, scalar& Cl) const;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Foam::seriesProfile::evaluateDrag
scalar evaluateDrag(const scalar &xIn, const List< scalar > &values) const
Drag.
Definition: seriesProfile.C:45
List.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::seriesProfile
Profile model where polar lift and drag coefficients are computed as sum of trigonometric series by u...
Definition: seriesProfile.H:137
Foam::seriesProfile::Cdl
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const
Return the Cd and Cl for a given angle-of-attack.
Definition: seriesProfile.C:121
Foam::seriesProfile::CdCoeffs_
List< scalar > CdCoeffs_
List of drag coefficient values.
Definition: seriesProfile.H:146
Foam::seriesProfile::TypeName
TypeName("series")
Runtime type information.
Foam::seriesProfile::operator=
void operator=(const seriesProfile &)=delete
No copy assignment.
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::seriesProfile::evaluateLift
scalar evaluateLift(const scalar &xIn, const List< scalar > &values) const
Lift.
Definition: seriesProfile.C:62
Foam::seriesProfile::~seriesProfile
~seriesProfile()=default
Destructor.
Foam::List< scalar >
Foam::seriesProfile::seriesProfile
seriesProfile(const dictionary &dict, const word &modelName)
Constructor from dictionary and model name.
Definition: seriesProfile.C:83
Foam::seriesProfile::ClCoeffs_
List< scalar > ClCoeffs_
List of lift coefficient values.
Definition: seriesProfile.H:149
Foam::profileModel
Base class for profile models for handling aerofoil lift and drag polar diagrams.
Definition: profileModel.H:120
profileModel.H