Loading...
Searching...
No Matches
rpm.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) 2011 OpenFOAM Foundation
9 Copyright (C) 2018 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 "rpm.H"
31#include "unitConversion.H"
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35namespace Foam
36{
37 namespace SRF
38 {
40
42 (
44 rpm,
46 );
47 }
48}
49
50// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51
52Foam::SRF::rpm::rpm(const volVectorField& U)
53:
54 SRFModel(typeName, U),
55 rpm_(SRFModelCoeffs_.get<scalar>("rpm"))
56{
57 // The angular velocity
58 omega_.value() = axis_*rpmToRads(rpm_);
59}
60
61
62// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
63
65{
66 if (SRFModel::read())
67 {
68 SRFModelCoeffs_.readEntry("rpm", rpm_);
69
70 omega_.value() = axis_*rpmToRads(rpm_);
71
72 return true;
73 }
74
75 return false;
76}
77
78
79// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Top level model for single rotating frame.
Definition SRFModel.H:64
dimensionedVector omega_
Angular velocity of the frame (rad/s).
Definition SRFModel.H:98
vector axis_
Axis of rotation, a direction vector which passes through the origin.
Definition SRFModel.H:88
dictionary SRFModelCoeffs_
SRF model coefficients dictionary.
Definition SRFModel.H:93
tmp< volVectorField > U() const
Return velocity of SRF for complete mesh.
Definition SRFModel.C:163
virtual bool read()
Read radiationProperties dictionary.
Definition SRFModel.C:73
Basic SRF model whereby angular velocity is specified in terms of a (global) axis and revolutions-per...
Definition rpm.H:53
bool read()
Read coefficients.
Definition rpm.C:57
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
U
Definition pEqn.H:72
Namespace for single rotating frame (SRF) models.
Definition rpm.C:31
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
constexpr scalar rpmToRads() noexcept
Multiplication factor for revolutions/minute to radians/sec.
Unit conversion functions.