Loading...
Searching...
No Matches
engineValve.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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::engineValve
28
29Description
30 Foam::engineValve
31
32SourceFiles
33 engineValve.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef engineValve_H
38#define engineValve_H
39
40#include "word.H"
41#include "coordinateSystem.H"
42#include "polyPatchID.H"
43#include "graph.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward declarations
51class polyMesh;
52class engineTime;
54/*---------------------------------------------------------------------------*\
55 Class engineValve Declaration
56\*---------------------------------------------------------------------------*/
57
58class engineValve
59{
60 // Private data
61
62 //- Name of valve
63 word name_;
64
65 //- Reference to engine mesh
66 const polyMesh& mesh_;
67
68 //- Reference to engine database
69 const engineTime& engineDB_;
70
71 //- Coordinate system
73
74
75 // Patch and zone names
76
77 //- Valve bottom patch
78 polyPatchID bottomPatch_;
79
80 //- Valve poppet patch
81 polyPatchID poppetPatch_;
82
83 //- Valve stem patch
84 polyPatchID stemPatch_;
85
86 //- Valve curtain manifold patch
87 polyPatchID curtainInPortPatch_;
88
89 //- Valve curtain cylinder patch
90 polyPatchID curtainInCylinderPatch_;
91
92 //- Valve detach in cylinder patch
93 polyPatchID detachInCylinderPatch_;
94
95 //- Valve detach in port patch
96 polyPatchID detachInPortPatch_;
97
98 //- Faces to detach
99 labelList detachFaces_;
100
101
102 // Valve lift data
103
104 //- Valve lift profile
105 graph liftProfile_;
106
107 //- Lift curve start angle
108 scalar liftProfileStart_;
109
110 //- Lift curve end angle
111 scalar liftProfileEnd_;
112
113 //- Minimum valve lift. On this lift the valve is considered closed
114 const scalar minLift_;
115
116
117 // Valve layering data
118
119 //- Min top layer thickness
120 const scalar minTopLayer_;
121
122 //- Max top layer thickness
123 const scalar maxTopLayer_;
124
125 //- Min bottom layer thickness
126 const scalar minBottomLayer_;
127
128 //- Max bottom layer thickness
129 const scalar maxBottomLayer_;
130
131
132 //- Valve diameter
133 const scalar diameter_;
134
135
136 // Private Member Functions
137
138 //- No copy construct
139 engineValve(const engineValve&) = delete;
140
141 //- No copy assignment
142 void operator=(const engineValve&) = delete;
143
144
145 //- Adjust crank angle to drop within the limits of the lift profile
146 scalar adjustCrankAngle(const scalar theta) const;
147
148public:
149
150 // Constructors
151
152 //- Construct from components
153 engineValve
154 (
155 const word& name,
156 const polyMesh& mesh,
157 const autoPtr<coordinateSystem>& valveCS,
158 const word& bottomPatchName,
159 const word& poppetPatchName,
160 const word& stemPatchName,
161 const word& curtainInPortPatchName,
162 const word& curtainInCylinderPatchName,
163 const word& detachInCylinderPatchName,
164 const word& detachInPortPatchName,
165 const labelList& detachFaces,
166 const graph& liftProfile,
167 const scalar minLift,
168 const scalar minTopLayer,
169 const scalar maxTopLayer,
170 const scalar minBottomLayer,
171 const scalar maxBottomLayer,
172 const scalar diameter
173 );
174
175 //- Construct from dictionary
176 engineValve
177 (
178 const word& name,
179 const polyMesh& mesh,
180 const dictionary& dict
181 );
182
183
184 //- Destructor
185 ~engineValve() = default;
186
187
188 // Member Functions
189
190 //- Return name
191 const word& name() const
192 {
193 return name_;
194 }
195
196 //- Return coordinate system
197 const coordinateSystem& cs() const
198 {
199 return *csysPtr_;
200 }
201
202 //- Return lift profile
203 const graph& liftProfile() const
204 {
205 return liftProfile_;
206 }
207
208 //- Return valve diameter
209 scalar diameter() const
210 {
211 return diameter_;
212 }
213
214
215 // Valve patches
216
217 //- Return ID of bottom patch
218 const polyPatchID& bottomPatchID() const
219 {
220 return bottomPatch_;
221 }
222
223 //- Return ID of poppet patch
224 const polyPatchID& poppetPatchID() const
225 {
226 return poppetPatch_;
227 }
228
229 //- Return ID of stem patch
230 const polyPatchID& stemPatchID() const
231 {
232 return stemPatch_;
233 }
235 //- Return ID of curtain in cylinder patch
237 {
238 return curtainInCylinderPatch_;
239 }
240
241 //- Return ID of curtain in port patch
243 {
244 return curtainInPortPatch_;
245 }
246
247
248 //- Return ID of detach in cylinder patch
251 return detachInCylinderPatch_;
252 }
253
254 //- Return ID of detach in port patch
255 const polyPatchID& detachInPortPatchID() const
256 {
257 return detachInPortPatch_;
259
260 //- Return face labels of detach curtain
261 const labelList& detachFaces() const
262 {
263 return detachFaces_;
264 }
265
267 // Valve layering thickness
268
269 scalar minTopLayer() const
270 {
271 return minTopLayer_;
272 }
273
274 scalar maxTopLayer() const
275 {
276 return maxTopLayer_;
278
279 scalar minBottomLayer() const
280 {
281 return minBottomLayer_;
282 }
283
284 scalar maxBottomLayer() const
286 return maxBottomLayer_;
287 }
288
289
290 // Valve position and velocity
291
292 //- Return valve lift given crank angle in degrees
293 scalar lift(const scalar theta) const;
294
295 //- Is the valve open?
296 bool isOpen() const;
297
298 //- Return current lift
299 scalar curLift() const;
300
301 //- Return valve velocity for current time-step
302 scalar curVelocity() const;
303
304 //- Return list of active patch labels for the valve head
305 // (stem is excluded)
307
308
309 //- Write dictionary
310 void writeDict(Ostream& os) const;
311};
312
313
314// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
315
316} // End namespace Foam
317
318// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
319
320#endif
321
322// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Base class for coordinate system specification, the default coordinate system type is cartesian .
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
An abstract class for the time description of the piston motion.
Definition engineTime.H:53
bool isOpen() const
Is the valve open?
const polyPatchID & curtainInPortPatchID() const
Return ID of curtain in port patch.
scalar maxTopLayer() const
const polyPatchID & poppetPatchID() const
Return ID of poppet patch.
scalar minBottomLayer() const
scalar maxBottomLayer() const
scalar lift(const scalar theta) const
Return valve lift given crank angle in degrees.
scalar diameter() const
Return valve diameter.
const word & name() const
Return name.
labelList movingPatchIDs() const
Return list of active patch labels for the valve head.
const polyPatchID & detachInPortPatchID() const
Return ID of detach in port patch.
scalar curLift() const
Return current lift.
const coordinateSystem & cs() const
Return coordinate system.
const graph & liftProfile() const
Return lift profile.
scalar minTopLayer() const
const polyPatchID & curtainInCylinderPatchID() const
Return ID of curtain in cylinder patch.
const labelList & detachFaces() const
Return face labels of detach curtain.
scalar curVelocity() const
Return valve velocity for current time-step.
void writeDict(Ostream &os) const
Write dictionary.
const polyPatchID & stemPatchID() const
Return ID of stem patch.
const polyPatchID & bottomPatchID() const
Return ID of bottom patch.
const polyPatchID & detachInCylinderPatchID() const
Return ID of detach in cylinder patch.
~engineValve()=default
Destructor.
Class to create, store and output qgraph files.
Definition graph.H:56
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
DynamicID< polyBoundaryMesh > polyPatchID
Foam::polyPatchID.
Definition polyPatchID.H:34
dictionary dict