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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::trimModel
29 
30 Description
31  Base class for trim models for handling
32  blade characteristics and thrust-torque relations.
33 
34 Usage
35  Minimal example by using \c constant/fvOptions:
36  rotorDiskSource1
37  {
38  // Mandatory/Optional (inherited) entries
39  ...
40 
41  // Mandatory entries (runtime modifiable)
42  trimModel <trimModel>;
43 
44  <trimModel>Coeffs
45  {
46  // Conditional mandatory entries (runtime modifiable)
47 
48  // when trimModel=fixedTrim
49  theta0 5.0;
50  theta1c 1.0;
51  theta1s 4.0;
52  }
53  }
54 
55  where the entries mean:
56  \table
57  Property | Description | Type | Reqd | Dflt
58  trimModel | Trim model specification | word | yes | -
59  file | Name of file containing profile characteristics | word | no | -
60  \endtable
61 
62  Options for the \c trimModel entry:
63  \verbatim
64  fixed | Fixed blade/angle characteristics
65  targetForce | Target thrust/torque by using time-variant blade characs.
66  \endverbatim
67 
68 See also
69  - Foam::fv::rotorDiskSource
70  - Foam::fixedTrim
71  - Foam::targetCoeffTrim
72 
73 SourceFiles
74  trimModel.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef trimModel_H
79 #define trimModel_H
80 
81 #include "rotorDiskSource.H"
82 #include "dictionary.H"
83 #include "runTimeSelectionTables.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class trimModel Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 class trimModel
95 {
96 protected:
97 
98  // Protected Data
99 
100  //- Reference to the rotor source model
101  const fv::rotorDiskSource& rotor_;
102 
103  //- Name of model
104  const word name_;
105 
106  //- Coefficients dictionary
107  dictionary coeffs_;
108 
109 
110 public:
111 
112  //- Run-time type information
113  TypeName("trimModel");
114 
115 
116  // Declare runtime constructor selection table
117 
119  (
120  autoPtr,
122  dictionary,
123  (
124  const fv::rotorDiskSource& rotor,
125  const dictionary& dict
126  ),
127  (rotor, dict)
128  );
129 
130 
131  // Constructors
132 
133  //- Construct from components
134  trimModel
135  (
136  const fv::rotorDiskSource& rotor,
137  const dictionary& dict,
138  const word& name
139  );
140 
141 
142  // Selectors
143 
144  //- Return a reference to the selected trim model
145  static autoPtr<trimModel> New
146  (
147  const fv::rotorDiskSource& rotor,
148  const dictionary& dict
149  );
150 
151 
152  //- Destructor
153  virtual ~trimModel() = default;
154 
155 
156  // Member Functions
157 
158  //- Read
159  virtual void read(const dictionary& dict);
160 
161  //- Return the geometric angle of attack [rad]
162  virtual tmp<scalarField> thetag() const = 0;
163 
164  //- Correct the model
165  virtual void correct
166  (
167  const vectorField& U,
168  vectorField& force
169  ) = 0;
170 
171  //- Correct the model for compressible flow
172  virtual void correct
173  (
174  const volScalarField rho,
175  const vectorField& U,
176  vectorField& force
177  ) = 0;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
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:43
rho
rho
Definition: readInitialConditions.H:88
Foam::trimModel::read
virtual void read(const dictionary &dict)
Read.
Definition: trimModel.C:59
Foam::Field< vector >
Foam::trimModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, trimModel, dictionary,(const fv::rotorDiskSource &rotor, const dictionary &dict),(rotor, dict))
Foam::trimModel::coeffs_
dictionary coeffs_
Coefficients dictionary.
Definition: trimModel.H:124
rotorDiskSource.H
Foam::fv::rotorDiskSource
Applies cell-based momentum sources on velocity (i.e. U) within a specified cylindrical region to app...
Definition: rotorDiskSource.H:330
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:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::trimModel
Base class for trim models for handling blade characteristics and thrust-torque relations.
Definition: trimModel.H:111
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::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
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:121
Foam::trimModel::rotor_
const fv::rotorDiskSource & rotor_
Reference to the rotor source model.
Definition: trimModel.H:118
Foam::trimModel::~trimModel
virtual ~trimModel()=default
Destructor.