fixedTrim.C
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-2017 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 \*---------------------------------------------------------------------------*/
28 
29 #include "fixedTrim.H"
31 #include "unitConversion.H"
32 #include "mathematicalConstants.H"
33 
34 using namespace Foam::constant;
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
38 namespace Foam
39 {
40  defineTypeNameAndDebug(fixedTrim, 0);
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
48 (
49  const fv::rotorDiskSource& rotor,
50  const dictionary& dict
51 )
52 :
53  trimModel(rotor, dict, typeName),
54  thetag_(rotor.cells().size(), Zero)
55 {
56  read(dict);
57 }
58 
59 
60 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
61 
63 {
65 
66  const scalar theta0 = degToRad(coeffs_.get<scalar>("theta0"));
67  const scalar theta1c = degToRad(coeffs_.get<scalar>("theta1c"));
68  const scalar theta1s = degToRad(coeffs_.get<scalar>("theta1s"));
69 
70  const List<point>& x = rotor_.x();
71  forAll(thetag_, i)
72  {
73  scalar psi = x[i].y();
74  thetag_[i] = theta0 + theta1c*cos(psi) + theta1s*sin(psi);
75  }
76 }
77 
78 
80 {
81  return tmp<scalarField>(thetag_);
82 }
83 
84 
86 (
87  const vectorField& U,
88  vectorField& force
89 )
90 {}
91 
92 
94 (
95  const volScalarField rho,
96  const vectorField& U,
97  vectorField& force
98 )
99 {}
100 
101 
102 // ************************************************************************* //
Different types of constants.
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
virtual void read(const dictionary &dict)
Read.
Definition: trimModel.C:52
Unit conversion functions.
Base class for trim models for handling blade characteristics and thrust-torque relations.
Definition: trimModel.H:107
virtual void correct(const vectorField &U, vectorField &force)
Correct the model.
Definition: fixedTrim.C:79
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:127
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
Applies cell-based momentum sources on velocity (i.e. U) within a specified cylindrical region to app...
dimensionedScalar cos(const dimensionedScalar &ds)
const cellShapeList & cells
fixedTrim(const fv::rotorDiskSource &rotor, const dictionary &dict)
Constructor from rotor and dictionary.
Definition: fixedTrim.C:41
dimensionedScalar sin(const dimensionedScalar &ds)
void read(const dictionary &dict)
Read.
Definition: fixedTrim.C:55
virtual tmp< scalarField > thetag() const
Return the geometric angle of attack [rad].
Definition: fixedTrim.C:72
Trim model where the operating characteristics of rotor (e.g. blade pitch angle) are fixed...
Definition: fixedTrim.H:75
defineTypeNameAndDebug(combustionModel, 0)
U
Definition: pEqn.H:72
const volScalarField & psi
A class for managing temporary objects.
Definition: HashPtrTable.H:50
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Namespace for OpenFOAM.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127