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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "fixedTrim.H"
30 #include "unitConversion.H"
31 #include "mathematicalConstants.H"
32 
33 using namespace Foam::constant;
34 
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39  defineTypeNameAndDebug(fixedTrim, 0);
40 
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::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
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:96
Foam::fixedTrim::fixedTrim
fixedTrim(const fv::rotorDiskSource &rotor, const dictionary &dict)
Constructor.
Definition: fixedTrim.C:48
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
Foam::fv::cellSetOption::cells
const labelList & cells() const
Return const access to the cell set.
Definition: cellSetOptionI.H:75
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:58
Foam::Field< vector >
Foam::fv::rotorDiskSource
Rotor disk source.
Definition: rotorDiskSource.H:127
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:121
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
Trim model base class.
Definition: trimModel.H:52
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: HashTable.H:102
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