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-------------------------------------------------------------------------------
11License
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"
33
34using namespace Foam::constant;
35
36// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37
38namespace Foam
39{
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// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
virtual bool read()
Re-read model coefficients if they have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Trim model where the operating characteristics of rotor (e.g. blade pitch angle) are fixed,...
Definition: fixedTrim.H:82
virtual tmp< scalarField > thetag() const
Return the geometric angle of attack [rad].
Definition: fixedTrim.C:79
void read(const dictionary &dict)
Read.
Definition: fixedTrim.C:62
Applies cell-based momentum sources on velocity (i.e. U) within a specified cylindrical region to app...
A class for managing temporary objects.
Definition: tmp.H:65
Base class for trim models for handling blade characteristics and thrust-torque relations.
Definition: trimModel.H:112
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
U
Definition: pEqn.H:72
const volScalarField & psi
const cellShapeList & cells
Different types of constants.
Namespace for OpenFOAM.
dimensionedScalar sin(const dimensionedScalar &ds)
constexpr scalar degToRad() noexcept
Multiplication factor for degrees to radians conversion.
dimensionedScalar cos(const dimensionedScalar &ds)
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Unit conversion functions.