SRFModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Namespace
25  Foam::SRF
26 
27 Description
28  Namespace for single rotating frame (SRF) models
29 
30 Class
31  Foam::SRF::SRFModel
32 
33 Description
34  Top level model for single rotating frame
35  - Steady state only - no time derivatives included
36 
37 SourceFiles
38  SRFModel.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef SRFModel_H
43 #define SRFModel_H
44 
45 #include "IOdictionary.H"
46 #include "autoPtr.H"
47 #include "runTimeSelectionTables.H"
48 #include "fvMesh.H"
49 #include "volFields.H"
50 #include "vectorField.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace SRF
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class SRFModel Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 class SRFModel
64 :
65  public IOdictionary
66 {
67 
68 protected:
69 
70  // Protected data
71 
72  //- Reference to the relative velocity field
73  const volVectorField& Urel_;
74 
75  //- Reference to the mesh
76  const fvMesh& mesh_;
77 
78  //- Origin of the axis
80 
81  //- Axis of rotation, a direction vector which passes through the origin
82  vector axis_;
83 
84  //- SRF model coeficients dictionary
86 
87  //- Angular velocity of the frame (rad/s)
89 
90 
91 private:
92 
93  // Private Member Functions
94 
95  //- Disallow default bitwise copy construct
96  SRFModel(const SRFModel&);
97 
98  //- Disallow default bitwise assignment
99  void operator=(const SRFModel&);
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("SRFModel");
106 
107 
108  // Declare runtime constructor selection table
109 
111  (
112  autoPtr,
113  SRFModel,
114  dictionary,
115  (
116  const volVectorField& Urel
117  ),
118  (Urel)
119  );
120 
121 
122  // Constructors
123 
124  //- Construct from components
125  SRFModel
126  (
127  const word& type,
128  const volVectorField& Urel
129  );
130 
131 
132  // Selectors
133 
134  //- Return a reference to the selected SRF model
135  static autoPtr<SRFModel> New
136  (
137  const volVectorField& Urel
138  );
139 
140 
141  //- Destructor
142  virtual ~SRFModel();
143 
144 
145  // Member Functions
146 
147  // Edit
148 
149  //- Read radiationProperties dictionary
150  virtual bool read();
151 
152 
153  // Access
154 
155  //- Return the origin of rotation
156  const dimensionedVector& origin() const;
157 
158  //- Return the axis of rotation
159  const vector& axis() const;
160 
161  //- Return the angular velocity field [rad/s]
162  const dimensionedVector& omega() const;
163 
164  //- Return the coriolis force
166 
167  //- Return the centrifugal force
169 
170  //- Source term component for momentum equation
172 
173  //- Return velocity vector from positions
174  vectorField velocity(const vectorField& positions) const;
175 
176  //- Return velocity of SRF for complete mesh
177  tmp<volVectorField> U() const;
178 
179  //- Return absolute velocity for complete mesh
180  tmp<volVectorField> Uabs() const;
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace SRF
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
tmp< DimensionedField< vector, volMesh > > Su() const
Source term component for momentum equation.
Definition: SRFModel.C:164
dimensionedVector origin_
Origin of the axis.
Definition: SRFModel.H:78
tmp< volVectorField > Uabs() const
Return absolute velocity for complete mesh.
Definition: SRFModel.C:207
tmp< volVectorField > U() const
Return velocity of SRF for complete mesh.
Definition: SRFModel.C:186
const dimensionedVector & origin() const
Return the origin of rotation.
Definition: SRFModel.C:103
Macros to ease declaration of run-time selection tables.
A class for handling words, derived from string.
Definition: word.H:59
const vector & axis() const
Return the axis of rotation.
Definition: SRFModel.C:109
Urel
Definition: pEqn.H:53
const fvMesh & mesh_
Reference to the mesh.
Definition: SRFModel.H:75
Top level model for single rotating frame.
Definition: SRFModel.H:62
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
dimensionedVector omega_
Angular velocity of the frame (rad/s)
Definition: SRFModel.H:87
Namespace for OpenFOAM.
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))
declareRunTimeSelectionTable(autoPtr, SRFModel, dictionary,( const volVectorField &Urel ),(Urel))
vector axis_
Axis of rotation, a direction vector which passes through the origin.
Definition: SRFModel.H:81
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
virtual ~SRFModel()
Destructor.
Definition: SRFModel.C:74
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
vectorField velocity(const vectorField &positions) const
Return velocity vector from positions.
Definition: SRFModel.C:171
TypeName("SRFModel")
Runtime type information.
const dimensionedVector & omega() const
Return the angular velocity field [rad/s].
Definition: SRFModel.C:115
tmp< DimensionedField< vector, volMesh > > Fcentrifugal() const
Return the centrifugal force.
Definition: SRFModel.C:143
tmp< DimensionedField< vector, volMesh > > Fcoriolis() const
Return the coriolis force.
Definition: SRFModel.C:122
dictionary SRFModelCoeffs_
SRF model coeficients dictionary.
Definition: SRFModel.H:84
const volVectorField & Urel_
Reference to the relative velocity field.
Definition: SRFModel.H:72
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
A class for managing temporary objects.
Definition: PtrList.H:118
static autoPtr< SRFModel > New(const volVectorField &Urel)
Return a reference to the selected SRF model.
Definition: SRFModelNew.C:31
virtual bool read()
Read radiationProperties dictionary.
Definition: SRFModel.C:80