trimModel.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) 2012-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::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 "dictionary.H"
39 #include "vectorField.H"
40 #include "volFieldsFwd.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 namespace fv { class rotorDisk; }
49 
50 /*---------------------------------------------------------------------------*\
51  Class trimModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class trimModel
55 {
56 
57 protected:
58 
59  // Protected data
60 
61  //- Reference to the rotor source model
62  const fv::rotorDisk& rotor_;
63 
64  //- Name of model
65  const word name_;
66 
67  //- Coefficients dictionary
69 
70 
71 public:
72 
73  //- Run-time type information
74  TypeName("trimModel");
75 
76 
77  // Declare runtime constructor selection table
78 
80  (
81  autoPtr,
82  trimModel,
83  dictionary,
84  (
85  const fv::rotorDisk& rotor,
86  const dictionary& dict
87  ),
88  (rotor, dict)
89  );
90 
91 
92  // Constructors
93 
94  //- Construct from components
95  trimModel
96  (
97  const fv::rotorDisk& rotor,
98  const dictionary& dict,
99  const word& name
100  );
101 
102 
103  // Selectors
104 
105  //- Return a reference to the selected trim model
106  static autoPtr<trimModel> New
107  (
108  const fv::rotorDisk& rotor,
109  const dictionary& dict
110  );
111 
112 
113  //- Destructor
114  virtual ~trimModel();
115 
116 
117  // Member Functions
118 
119  //- Read
120  virtual void read(const dictionary& dict);
121 
122  //- Return the geometric angle of attack [rad]
123  virtual tmp<scalarField> thetag() const = 0;
124 
125  //- Correct the model
126  virtual void correct
127  (
128  const vectorField& U,
129  vectorField& force
130  ) const = 0;
131 
132  //- Correct the model for compressible flow
133  virtual void correct
134  (
135  const volScalarField rho,
136  const vectorField& U,
137  vectorField& force
138  ) const = 0;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
Generic GeometricField class.
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Cell based momentum source which approximates the mean effects of rotor forces on a cylindrical regio...
Definition: rotorDisk.H:125
A class for managing temporary objects.
Definition: tmp.H:55
Trim model base class.
Definition: trimModel.H:54
trimModel(const fv::rotorDisk &rotor, const dictionary &dict, const word &name)
Construct from components.
Definition: trimModel.C:40
virtual void read(const dictionary &dict)
Read.
Definition: trimModel.C:61
virtual void correct(const vectorField &U, vectorField &force) const =0
Correct the model.
dictionary coeffs_
Coefficients dictionary.
Definition: trimModel.H:67
const fv::rotorDisk & rotor_
Reference to the rotor source model.
Definition: trimModel.H:61
virtual ~trimModel()
Destructor.
Definition: trimModel.C:55
declareRunTimeSelectionTable(autoPtr, trimModel, dictionary,(const fv::rotorDisk &rotor, const dictionary &dict),(rotor, dict))
TypeName("trimModel")
Run-time type information.
virtual tmp< scalarField > thetag() const =0
Return the geometric angle of attack [rad].
static autoPtr< trimModel > New(const fv::rotorDisk &rotor, const dictionary &dict)
Return a reference to the selected trim model.
Definition: trimModelNew.C:31
const word name_
Name of model.
Definition: trimModel.H:64
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
labelList fv(nPoints)
Macros to ease declaration of run-time selection tables.
dictionary dict