profileModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::profileModel
26 
27 Description
28  Base class for profile models
29 
30 SourceFiles
31  profileModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef profileModel_H
36 #define profileModel_H
37 
38 #include "autoPtr.H"
39 #include "runTimeSelectionTables.H"
40 #include "dictionary.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class profileModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class profileModel
52 {
53 
54 protected:
55 
56  // Protected data
57 
58  //- Coefficients dictionary
59  const dictionary dict_;
60 
61  //- Name of profile model
62  const word name_;
63 
64  //- File name (optional)
66 
67 
68  // Protected Member Functions
69 
70  //- Return true if file name is set
71  bool readFromFile() const;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("profileModel");
78 
79 
80  // Declare run-time constructor selection table
82  (
83  autoPtr,
85  dictionary,
86  (
87  const dictionary& dict,
88  const word& modelName
89  ),
90  (dict, modelName)
91  );
92 
93 
94  // Selectors
95 
96  //- Return a reference to the selected fvOption model
97  static autoPtr<profileModel> New(const dictionary& dict);
98 
99 
100  //- Constructor
101  profileModel(const dictionary& dict, const word& modelName);
102 
103 
104  //- Destructor
105  virtual ~profileModel();
106 
107 
108  // Member Functions
109 
110  // Access
111 
112  //- Return const access to the source name
113  const word& name() const;
114 
115 
116  // Evaluation
117 
118  //- Return the Cd and Cl for a given angle-of-attack
119  virtual void Cdl
120  (
121  const scalar alpha,
122  scalar& Cd,
123  scalar& Cl
124  ) const = 0;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
dictionary dict
A class for handling file names.
Definition: fileName.H:79
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const word & name() const
Return const access to the source name.
Definition: profileModel.C:65
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const =0
Return the Cd and Cl for a given angle-of-attack.
virtual ~profileModel()
Destructor.
Definition: profileModel.C:59
fileName fName_
File name (optional)
Definition: profileModel.H:64
A class for handling words, derived from string.
Definition: word.H:59
Base class for profile models.
Definition: profileModel.H:50
const word name_
Name of profile model.
Definition: profileModel.H:61
TypeName("profileModel")
Runtime type information.
profileModel(const dictionary &dict, const word &modelName)
Constructor.
Definition: profileModel.C:48
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
bool readFromFile() const
Return true if file name is set.
Definition: profileModel.C:40
const dictionary dict_
Coefficients dictionary.
Definition: profileModel.H:58
static autoPtr< profileModel > New(const dictionary &dict)
Return a reference to the selected fvOption model.
Definition: profileModel.C:72
Namespace for OpenFOAM.
declareRunTimeSelectionTable(autoPtr, profileModel, dictionary,(const dictionary &dict, const word &modelName),(dict, modelName))