trimModel.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 | Copyright (C) 2012-2014 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::trimModel
26 
27 Description
28  Trim model base class
29 
30 SourceFiles
31  trimModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef trimModel_H
36 #define trimModel_H
37 
38 #include "rotorDiskSource.H"
39 #include "dictionary.H"
40 #include "runTimeSelectionTables.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class trimModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class trimModel
52 {
53 
54 protected:
55 
56  // Protected data
57 
58  //- Reference to the rotor source model
60 
61  //- Name of model
62  const word name_;
63 
64  //- Coefficients dictionary
66 
67 
68 public:
69 
70  //- Run-time type information
71  TypeName("trimModel");
72 
73 
74  // Declare runtime constructor selection table
75 
77  (
78  autoPtr,
79  trimModel,
80  dictionary,
81  (
82  const fv::rotorDiskSource& rotor,
83  const dictionary& dict
84  ),
85  (rotor, dict)
86  );
87 
88 
89  // Constructors
90 
91  //- Construct from components
92  trimModel
93  (
94  const fv::rotorDiskSource& rotor,
95  const dictionary& dict,
96  const word& name
97  );
98 
99 
100  // Selectors
101 
102  //- Return a reference to the selected trim model
103  static autoPtr<trimModel> New
104  (
105  const fv::rotorDiskSource& rotor,
106  const dictionary& dict
107  );
108 
109 
110  //- Destructor
111  virtual ~trimModel();
112 
113 
114  // Member functions
115 
116  //- Read
117  virtual void read(const dictionary& dict);
118 
119  //- Return the geometric angle of attack [rad]
120  virtual tmp<scalarField> thetag() const = 0;
121 
122  //- Correct the model
123  virtual void correct
124  (
125  const vectorField& U,
126  vectorField& force
127  ) = 0;
128 
129  //- Correct the model for compressible flow
130  virtual void correct
131  (
132  const volScalarField rho,
133  const vectorField& U,
134  vectorField& force
135  ) = 0;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
static autoPtr< trimModel > New(const fv::rotorDiskSource &rotor, const dictionary &dict)
Return a reference to the selected trim model.
Definition: trimModelNew.C:31
dictionary dict
U
Definition: pEqn.H:83
TypeName("trimModel")
Run-time type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~trimModel()
Destructor.
Definition: trimModel.C:55
virtual void read(const dictionary &dict)
Read.
Definition: trimModel.C:61
Trim model base class.
Definition: trimModel.H:50
const word name_
Name of model.
Definition: trimModel.H:61
Rotor disk source.
dictionary coeffs_
Coefficients dictionary.
Definition: trimModel.H:64
A class for handling words, derived from string.
Definition: word.H:59
declareRunTimeSelectionTable(autoPtr, trimModel, dictionary,(const fv::rotorDiskSource &rotor, const dictionary &dict),(rotor, dict))
virtual tmp< scalarField > thetag() const =0
Return the geometric angle of attack [rad].
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
virtual void correct(const vectorField &U, vectorField &force)=0
Correct the model.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:54
trimModel(const fv::rotorDiskSource &rotor, const dictionary &dict, const word &name)
Construct from components.
Definition: trimModel.C:40
Namespace for OpenFOAM.
const fv::rotorDiskSource & rotor_
Reference to the rotor source model.
Definition: trimModel.H:58