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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::seriesProfile
28 
29 Description
30  Series-up based profile data - drag and lift coefficients computed as
31  sum of cosine series
32 
33  Cd = sum_i(CdCoeff)*cos(i*AOA)
34  Cl = sum_i(ClCoeff)*sin(i*AOA)
35 
36  where:
37  AOA = angle of attack [deg] converted to [rad] internally
38  Cd = drag coefficient
39  Cl = lift coefficient
40 
41  Input in two (arbitrary length) lists:
42 
43  CdCoeffs (coeff1 coeff2 ... coeffN);
44  ClCoeffs (coeff1 coeff2 ... coeffN);
45 
46 SourceFiles
47  seriesProfile.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef seriesProfile_H
52 #define seriesProfile_H
53 
54 #include "profileModel.H"
55 #include "List.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class seriesProfile Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class seriesProfile
67 :
68  public profileModel
69 {
70 protected:
71 
72  // Protected data
73 
74  //- List of drag coefficient values
76 
77  //- List of lift coefficient values
79 
80 
81  // Protected Member Functions
82 
83  // Evaluate
84 
85  //- Drag
86  scalar evaluateDrag
87  (
88  const scalar& xIn,
89  const List<scalar>& values
90  ) const;
91 
92  //- Lift
93  scalar evaluateLift
94  (
95  const scalar& xIn,
96  const List<scalar>& values
97  ) const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("series");
104 
105  //- Constructor
106  seriesProfile(const dictionary& dict, const word& modelName);
107 
108  //- Destructor
109  ~seriesProfile() = default;
110 
111 
112  // Member functions
113 
114  //- Return the Cd and Cl for a given angle-of-attack
115  virtual void Cdl(const scalar alpha, scalar& Cd, scalar& Cl) const;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::seriesProfile::evaluateDrag
scalar evaluateDrag(const scalar &xIn, const List< scalar > &values) const
Drag.
Definition: seriesProfile.C:44
List.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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
Series-up based profile data - drag and lift coefficients computed as sum of cosine series.
Definition: seriesProfile.H:65
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:118
Foam::seriesProfile::CdCoeffs_
List< scalar > CdCoeffs_
List of drag coefficient values.
Definition: seriesProfile.H:74
Foam::seriesProfile::TypeName
TypeName("series")
Runtime type information.
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::seriesProfile::evaluateLift
scalar evaluateLift(const scalar &xIn, const List< scalar > &values) const
Lift.
Definition: seriesProfile.C:61
Foam::seriesProfile::~seriesProfile
~seriesProfile()=default
Destructor.
Foam::List< scalar >
Foam::seriesProfile::seriesProfile
seriesProfile(const dictionary &dict, const word &modelName)
Constructor.
Definition: seriesProfile.C:82
Foam::seriesProfile::ClCoeffs_
List< scalar > ClCoeffs_
List of lift coefficient values.
Definition: seriesProfile.H:77
Foam::profileModel
Base class for profile models.
Definition: profileModel.H:52
profileModel.H