enginePiston.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::enginePiston
28 
29 Description
30  Foam::enginePiston
31 
32 SourceFiles
33  enginePiston.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef enginePiston_H
38 #define enginePiston_H
39 
40 #include "polyPatchID.H"
41 #include "coordinateSystem.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyMesh;
50 class engineTime;
51 
52 /*---------------------------------------------------------------------------*\
53  Class enginePiston Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class enginePiston
57 {
58  // Private data
59 
60  //- Reference to engine mesh
61  const polyMesh& mesh_;
62 
63  //- Reference to engine database
64  const engineTime& engineDB_;
65 
66  //- Piston patch
67  polyPatchID patchID_;
68 
69  //- Coordinate system
71 
72 
73  // Piston layering data
74 
75  //- Min layer thickness
76  const scalar minLayer_;
77 
78  //- Max layer thickness
79  const scalar maxLayer_;
80 
81 
82  // Private Member Functions
83 
84  //- No copy construct
85  enginePiston(const enginePiston&) = delete;
86 
87  //- No copy assignment
88  void operator=(const enginePiston&) = delete;
89 
90 
91 public:
92 
93  // Static data members
94 
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const polyMesh& mesh,
102  const word& pistonPatchName,
103  const autoPtr<coordinateSystem>& pistonCS,
104  const scalar minLayer,
105  const scalar maxLayer
106 
107  );
108 
109  //- Construct from dictionary
111  (
112  const polyMesh& mesh,
113  const dictionary& dict
114  );
115 
116 
117  //- Destructor
118  ~enginePiston() = default;
119 
120 
121  // Member Functions
122 
123  //- Return coordinate system
124  const coordinateSystem& cs() const
125  {
126  return *csysPtr_;
127  }
128 
129  //- Return ID of piston patch
130  const polyPatchID& patchID() const
131  {
132  return patchID_;
133  }
134 
135  // Piston layering thickness
136 
137  scalar minLayer() const
138  {
139  return minLayer_;
140  }
141 
142  scalar maxLayer() const
143  {
144  return maxLayer_;
145  }
146 
147 
148  //- Write dictionary
149  void writeDict(Ostream&) const;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::DynamicID< polyBoundaryMesh >
coordinateSystem.H
Foam::enginePiston::~enginePiston
~enginePiston()=default
Destructor.
Foam::enginePiston
Foam::enginePiston.
Definition: enginePiston.H:55
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
polyPatchID.H
Foam::enginePiston::maxLayer
scalar maxLayer() const
Definition: enginePiston.H:141
Foam::enginePiston::cs
const coordinateSystem & cs() const
Return coordinate system.
Definition: enginePiston.H:123
Foam::enginePiston::writeDict
void writeDict(Ostream &) const
Write dictionary.
Definition: enginePiston.C:73
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::engineTime
An abstract class for the time description of the piston motion.
Definition: engineTime.H:54
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::enginePiston::patchID
const polyPatchID & patchID() const
Return ID of piston patch.
Definition: enginePiston.H:129
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::enginePiston::minLayer
scalar minLayer() const
Definition: enginePiston.H:136
Foam::coordinateSystem
Base class for coordinate system specification, the default coordinate system type is cartesian .
Definition: coordinateSystem.H:132