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-2024 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  //- Name of profile model
59  const word name_;
60 
61  //- File name (optional)
63 
64 
65  // Protected Member Functions
66 
67  //- Return true if file name is set
68  bool readFromFile() const;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("profileModel");
75 
76 
77  // Declare run-time constructor selection table
79  (
80  autoPtr,
82  dictionary,
83  (
84  const dictionary& dict,
85  const word& modelName
86  ),
87  (dict, modelName)
88  );
89 
90 
91  // Selectors
92 
93  //- Return a reference to the selected fvModel model
95 
96 
97  //- Constructor
98  profileModel(const dictionary& dict, const word& modelName);
99 
100 
101  //- Destructor
102  virtual ~profileModel();
103 
104 
105  // Member Functions
106 
107  // Access
108 
109  //- Return const access to the source name
110  const word& name() const;
111 
112 
113  // Evaluation
114 
115  //- Return the Cd and Cl for a given angle-of-attack
116  virtual void Cdl
117  (
118  const scalar alpha,
119  scalar& Cd,
120  scalar& Cl
121  ) const = 0;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for handling file names.
Definition: fileName.H:82
Base class for profile models.
Definition: profileModel.H:51
virtual ~profileModel()
Destructor.
Definition: profileModel.C:58
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const =0
Return the Cd and Cl for a given angle-of-attack.
bool readFromFile() const
Return true if file name is set.
Definition: profileModel.C:40
fileName fName_
File name (optional)
Definition: profileModel.H:61
profileModel(const dictionary &dict, const word &modelName)
Constructor.
Definition: profileModel.C:48
declareRunTimeSelectionTable(autoPtr, profileModel, dictionary,(const dictionary &dict, const word &modelName),(dict, modelName))
const word & name() const
Return const access to the source name.
Definition: profileModel.C:64
static autoPtr< profileModel > New(const dictionary &dict)
Return a reference to the selected fvModel model.
Definition: profileModel.C:71
TypeName("profileModel")
Runtime type information.
const word name_
Name of profile model.
Definition: profileModel.H:58
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
dictionary dict