fvMeshMoversEngine.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021 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 Class
25  Foam::fvMeshMovers::engine
26 
27 Description
28  Basic mesh motion specifically for engines.
29 
30 SourceFiles
31  fvMeshMoversEngine.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvMeshMoversEngine_H
36 #define fvMeshMoversEngine_H
37 
38 #include "fvMeshMover.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace fvMeshMovers
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class fvMeshMovers::engine Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class engine
52 :
53  public fvMeshMover
54 {
55 protected:
56 
57  // Protected Data
58 
60 
61  //- RPM
63 
64  //- Optional engine geometry parameters
69 
73 
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("engine");
82 
83 
84  // Constructors
85 
86  //- Construct from fvMesh
87  explicit engine(fvMesh& mesh);
88 
89  //- Disallow default bitwise copy construction
90  engine(const engine&) = delete;
91 
92 
93  //- Destructor
94  virtual ~engine();
95 
96 
97  // Member Functions
98 
99  //- Return the engines current operating RPM
100  const dimensionedScalar& rpm() const
101  {
102  return rpm_;
103  }
104 
105  //- Return the engines connecting-rod length
106  const dimensionedScalar& conRodLength() const
107  {
108  return conRodLength_;
109  }
110 
111  //- Return the engines bore
112  const dimensionedScalar& bore() const
113  {
114  return bore_;
115  }
116 
117  //- Return the engines stroke
118  const dimensionedScalar& stroke() const
119  {
120  return stroke_;
121  }
122 
123  //- Return the engines clearance-gap
124  const dimensionedScalar& clearance() const
125  {
126  return clearance_;
127  }
128 
129  //- Return current crank-angle
130  virtual scalar theta() const;
131 
132  //- Return crank-angle increment
133  virtual scalar deltaTheta() const;
134 
135  //- Calculate the piston position from the engine geometry
136  // and given crank angle.
137  scalar pistonPosition(const scalar theta) const;
138 
139  //- Return current piston position
141 
142  //- Return piston displacement for current time step
144 
145  //- Return piston speed for current time step
147 
148 
149  // Member Operators
150 
151  //- Disallow default bitwise assignment
152  void operator=(const engine&) = delete;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace fvMeshMovers
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:132
Basic mesh motion specifically for engines.
virtual scalar theta() const
Return current crank-angle.
dimensionedScalar conRodLength_
Optional engine geometry parameters.
const dimensionedScalar & bore() const
Return the engines bore.
virtual ~engine()
Destructor.
void operator=(const engine &)=delete
Disallow default bitwise assignment.
const dimensionedScalar & rpm() const
Return the engines current operating RPM.
dimensionedScalar pistonDisplacement() const
Return piston displacement for current time step.
TypeName("engine")
Runtime type information.
const dimensionedScalar & clearance() const
Return the engines clearance-gap.
virtual scalar deltaTheta() const
Return crank-angle increment.
dimensionedScalar pistonPosition() const
Return current piston position.
dimensionedScalar rpm_
RPM.
dimensionedScalar pistonPosition_
dimensionedScalar pistonSpeed() const
Return piston speed for current time step.
const dimensionedScalar & conRodLength() const
Return the engines connecting-rod length.
const dimensionedScalar & stroke() const
Return the engines stroke.
engine(fvMesh &mesh)
Construct from fvMesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59