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);
41  addToRunTimeSelectionTable(trimModel, fixedTrim, dictionary);
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 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
mathematicalConstants.H
Foam::fv::cellSetOption::cells
const labelList & cells() const noexcept
Return const access to the cell selection.
Definition: cellSetOptionI.H:82
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::constant
Different types of constants.
Definition: atomicConstants.C:38
Foam::sin
dimensionedScalar sin(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:264
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
fixedTrim.H
unitConversion.H
Unit conversion functions.
rho
rho
Definition: readInitialConditions.H:88
Foam::fixedTrim::fixedTrim
fixedTrim(const fv::rotorDiskSource &rotor, const dictionary &dict)
Constructor from rotor and dictionary.
Definition: fixedTrim.C:48
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::fixedTrim::correct
virtual void correct(const vectorField &U, vectorField &force)
Correct the model.
Definition: fixedTrim.C:86
Foam::fixedTrim::read
void read(const dictionary &dict)
Read.
Definition: fixedTrim.C:62
Foam::trimModel::read
virtual void read(const dictionary &dict)
Read.
Definition: trimModel.C:59
Foam::Field< vector >
Foam::fv::rotorDiskSource
Applies cell-based momentum sources on velocity (i.e. U) within a specified cylindrical region to app...
Definition: rotorDiskSource.H:330
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
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::degToRad
constexpr scalar degToRad(const scalar deg) noexcept
Conversion from degrees to radians.
Definition: unitConversion.H:48
Foam::trimModel
Base class for trim models for handling blade characteristics and thrust-torque relations.
Definition: trimModel.H:111
U
U
Definition: pEqn.H:72
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::fixedTrim::thetag
virtual tmp< scalarField > thetag() const
Return the geometric angle of attack [rad].
Definition: fixedTrim.C:79
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::GeometricField< scalar, fvPatchField, volMesh >
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::cos
dimensionedScalar cos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:265