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"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
37 namespace SRF
38 {
40
42 (
44 rpm,
46 );
47 }
48}
49
50// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51
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:67
dimensionedVector omega_
Angular velocity of the frame (rad/s)
Definition: SRFModel.H:89
vector axis_
Axis of rotation, a direction vector which passes through the origin.
Definition: SRFModel.H:83
virtual bool read()
Read radiationProperties dictionary.
Definition: SRFModel.C:79
Basic SRF model whereby angular velocity is specified in terms of a (global) axis and revolutions-per...
Definition: rpm.H:57
bool read()
Read coefficients.
Definition: rpm.C:64
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const Type & value() const
Return const reference to value.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
constexpr scalar rpmToRads() noexcept
Multiplication factor for revolutions/minute to radians/sec.
Info<< "Reading field p\n"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field Urel\n"<< endl;volVectorField Urel(IOobject("Urel", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading/calculating face flux field phi\n"<< endl;surfaceScalarField phi(IOobject("phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), linearInterpolate(Urel) &mesh.Sf());label pRefCell=0;scalar pRefValue=0.0;setRefCell(p, pimple.dict(), pRefCell, pRefValue);mesh.setFluxRequired(p.name());Info<< "Creating SRF model\n"<< endl;autoPtr< SRF::SRFModel > SRF(SRF::SRFModel::New(Urel))
Unit conversion functions.