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 -------------------------------------------------------------------------------
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 "rpm.H"
31 #include "unitConversion.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37  namespace SRF
38  {
40 
42  (
43  SRFModel,
44  rpm,
46  );
47  }
48 }
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
52 Foam::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 // ************************************************************************* //
Foam::SRF::addToRunTimeSelectionTable
addToRunTimeSelectionTable(SRFModel, rpm, dictionary)
unitConversion.H
Unit conversion functions.
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:434
Foam::SRF::rpm
Basic SRF model whereby angular velocity is specified in terms of a (global) axis and revolutions-per...
Definition: rpm.H:54
rpm.H
Foam::SRF::SRFModel
Top level model for single rotating frame.
Definition: SRFModel.H:64
Foam::SRF::SRFModel::read
virtual bool read()
Read radiationProperties dictionary.
Definition: SRFModel.C:79
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::SRF::SRFModel::omega_
dimensionedVector omega_
Angular velocity of the frame (rad/s)
Definition: SRFModel.H:89
Foam::rpmToRads
constexpr scalar rpmToRads(const scalar rpm) noexcept
Conversion from revolutions/minute to radians/sec.
Definition: unitConversion.H:73
U
U
Definition: pEqn.H:72
SRF
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))
Foam::SRF::SRFModel::axis_
vector axis_
Axis of rotation, a direction vector which passes through the origin.
Definition: SRFModel.H:83
Foam::PtrListOps::get
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::SRF::defineTypeNameAndDebug
defineTypeNameAndDebug(rpm, 0)
Foam::SRF::rpm::read
bool read()
Read coefficients.
Definition: rpm.C:64