profileModel.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::profileModel
28 
29 Description
30  Base class for profile models
31 
32 SourceFiles
33  profileModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef profileModel_H
38 #define profileModel_H
39 
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "dictionary.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class profileModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class profileModel
54 {
55 protected:
56 
57  // Protected data
58 
59  //- Coefficients dictionary
60  const dictionary dict_;
61 
62  //- Name of profile model
63  const word name_;
64 
65  //- File name (optional)
67 
68 
69  // Protected Member Functions
70 
71  //- Return ture if file name is set
72  bool readFromFile() const;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("profileModel");
79 
80 
81  // Declare run-time constructor selection table
83  (
84  autoPtr,
86  dictionary,
87  (
88  const dictionary& dict,
89  const word& modelName
90  ),
91  (dict, modelName)
92  );
93 
94 
95  // Selectors
96 
97  //- Return a reference to the selected fvOption model
99 
100 
101  //- Constructor
102  profileModel(const dictionary& dict, const word& modelName);
103 
104 
105  //- Destructor
106  virtual ~profileModel() = default;
107 
108 
109  // Member functions
110 
111  // Access
112 
113  //- Return const access to the source name
114  const word& name() const;
115 
116 
117  // Evaluation
118 
119  //- Return the Cd and Cl for a given angle-of-attack
120  virtual void Cdl
121  (
122  const scalar alpha,
123  scalar& Cd,
124  scalar& Cl
125  ) const = 0;
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::profileModel::readFromFile
bool readFromFile() const
Return ture if file name is set.
Definition: profileModel.C:43
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::profileModel::name
const word & name() const
Return const access to the source name.
Definition: profileModel.C:61
Foam::profileModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, profileModel, dictionary,(const dictionary &dict, const word &modelName),(dict, modelName))
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::profileModel::~profileModel
virtual ~profileModel()=default
Destructor.
Foam::profileModel::Cdl
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const =0
Return the Cd and Cl for a given angle-of-attack.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::profileModel::TypeName
TypeName("profileModel")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::profileModel::profileModel
profileModel(const dictionary &dict, const word &modelName)
Constructor.
Definition: profileModel.C:51
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::profileModel::New
static autoPtr< profileModel > New(const dictionary &dict)
Return a reference to the selected fvOption model.
Definition: profileModel.C:68
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::profileModel::fName_
fileName fName_
File name (optional)
Definition: profileModel.H:65
Foam::profileModel::dict_
const dictionary dict_
Coefficients dictionary.
Definition: profileModel.H:59
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::profileModel::name_
const word name_
Name of profile model.
Definition: profileModel.H:62
Foam::profileModel
Base class for profile models.
Definition: profileModel.H:52
autoPtr.H