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