1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 class for engine meshes with vertical valves
34 \*---------------------------------------------------------------------------*/
36 #ifndef thoboisSlidingValve_H
37 #define thoboisSlidingValve_H
40 #include "coordinateSystem.H"
41 #include "polyPatchID.H"
43 #include "engineValve.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Class forward declarations
57 /*---------------------------------------------------------------------------*\
58 Class engineVerticalValve Declaration
59 \*---------------------------------------------------------------------------*/
61 class thoboisSlidingValve
64 //- Adjust crank angle to drop within the limits of the lift profile
65 scalar adjustCrankAngle(const scalar theta) const;
72 //- Reference to engine mesh
73 const polyMesh& mesh_;
75 //- Reference to engine database
76 const engineTime& engineDB_;
79 autoPtr<coordinateSystem> csPtr_;
82 // Patch and zone names
84 //- Valve bottom patch
85 polyPatchID bottomPatch_;
87 //- Valve poppet patch
88 polyPatchID poppetPatch_;
90 //- Valve poppet patch
91 polyPatchID sidePatch_;
94 polyPatchID stemPatch_;
96 //- Valve sliding in cylinder patch
97 polyPatchID curtainInCylinderPatch_;
99 //- Valve sliding in port patch
100 polyPatchID curtainInPortPatch_;
102 //- Valve detach in cylinder patch
103 polyPatchID detachInCylinderPatch_;
105 //- Valve detach in port patch
106 polyPatchID detachInPortPatch_;
109 labelList detachFaces_;
113 //- Valve lift profile
116 //- Lift curve start angle
117 scalar liftProfileStart_;
119 //- Lift curve end angle
120 scalar liftProfileEnd_;
122 //- Minimum valve lift. On this lift the valve is considered closed
123 const scalar minLift_;
126 const scalar diameter_;
128 //- Tolerance for deformation/layering
129 scalar deformationLift_;
134 //- Name of the faceSet for the valveTop layer
135 word layeringFacesTopName_;
137 //- Name of thefaceSet for the valveBottom layer
138 word layeringFacesBottomName_;
141 //- Name of thefaceSet for the valveBottom layer
142 word movingCellsTopName_;
144 //- Name of thefaceSet for the valveBottom layer
145 word movingCellsBottomName_;
147 //- Name of thefaceSet for the valveBottom layer
148 word movingPointsTopName_;
150 //- Name of thefaceSet for the valveBottom layer
151 word movingPointsBottomName_;
153 const scalar minTopLayer_;
155 const scalar maxTopLayer_;
157 const scalar minBottomLayer_;
159 const scalar maxBottomLayer_;
161 //- Name of the pointSet for the static points
162 word staticPointsName_;
164 //- Name of the pointSet for the moving points
165 word movingPointsName_;
167 //- Name of the pointSet for the moving internal points
168 // word movingInternalPointsName_;
170 //- Name of the cellSet for the static cells
171 word staticCellsName_;
173 //- Name of the cellSet for the moving cells
174 word movingCellsName_;
177 // Private Member Functions
179 //- Disallow default bitwise copy construct
180 thoboisSlidingValve(const thoboisSlidingValve&);
182 //- Disallow default bitwise assignment
183 void operator=(const thoboisSlidingValve&);
189 // Static data members
194 //- Construct from components
198 const polyMesh& mesh,
199 const autoPtr<coordinateSystem>& valveCS,
200 const word& bottomPatchName,
201 const word& sidePatchName,
202 const word& poppetPatchName,
203 const word& stemPatchName,
204 const word& curtainInPortPatchName,
205 const word& curtainInCylinderPatchName,
206 const word& detachInCylinderPatchName,
207 const word& detachInPortPatchName,
208 const labelList& detachFaces,
209 const graph& liftProfile,
210 const scalar minLift,
211 const scalar diameter,
212 const scalar deformationLift,
213 const word& layeringFacesTopName,
214 const word& layeringFacesBottomName,
215 const word& movingCellsTopName,
216 const word& movingCellsBottomName,
217 const word& movingPointsTopName,
218 const word& movingPointsBottomName,
219 const scalar minTopLayer,
220 const scalar maxTopLayer,
221 const scalar minBottomLayer,
222 const scalar maxBottomLayer,
223 const word& staticPointsName,
224 const word& movingPointsName,
225 const word& staticCellsName,
226 const word& movingCellsName
229 //- Construct from dictionary
233 const polyMesh& mesh,
234 const dictionary& dict
238 // Destructor - default
244 const word& name() const
249 //- Return coordinate system
250 const coordinateSystem& cs() const
255 //- Return lift profile
256 const graph& liftProfile() const
261 //- Return valve min Lift
262 scalar minLift() const
268 //- Return valve diameter
269 scalar diameter() const
274 const scalar& deformationLift() const
276 return deformationLift_;
281 //- Return ID of bottom patch
282 const polyPatchID& bottomPatchID() const
287 //- Return ID of poppet patch
288 const polyPatchID& poppetPatchID() const
293 //- Return ID of side patch
294 const polyPatchID& sidePatchID() const
299 //- Return ID of stem patch
300 const polyPatchID& stemPatchID() const
306 //- Return ID of sliding in port patch
307 const polyPatchID& curtainInPortPatchID() const
309 return curtainInPortPatch_;
312 //- Return ID of sliding in cylinder patch
313 const polyPatchID& curtainInCylinderPatchID() const
315 return curtainInCylinderPatch_;
318 //- Return ID of detach in cylinder patch
319 const polyPatchID& detachInCylinderPatchID() const
321 return detachInCylinderPatch_;
324 //- Return ID of detach in port patch
325 const polyPatchID& detachInPortPatchID() const
327 return detachInPortPatch_;
330 //- Return face labels of detach curtain
331 const labelList& detachFaces() const
336 const word& layeringFacesTopName() const
338 return layeringFacesTopName_;
340 const word& layeringFacesBottomName() const
342 return layeringFacesBottomName_;
345 const word& movingCellsTopName() const
347 return movingCellsTopName_;
349 const word& movingCellsBottomName() const
351 return movingCellsBottomName_;
354 const word& movingPointsTopName() const
356 return movingPointsTopName_;
358 const word& movingPointsBottomName() const
360 return movingPointsBottomName_;
363 // Valve position and velocity
365 //- Return valve lift given crank angle in degrees
366 scalar lift(const scalar theta) const;
368 //- Is the valve open?
371 //- Return current lift
372 scalar curLift() const;
374 //- Return valve velocity for current time-step
375 scalar curVelocity() const;
377 //- Return list of active patch labels for the valve head
378 // (stem is excluded)
379 labelList movingPatchIDs() const;
381 //- Return min valveTop layer
382 scalar minTopLayer() const
386 //- Return max valveTop layer
387 scalar maxTopLayer() const
391 //- Return min valveBottom layer
392 scalar minBottomLayer() const
394 return minBottomLayer_;
396 //- Return max valveBottom layer
397 scalar maxBottomLayer() const
399 return maxBottomLayer_;
402 const word& staticPointsName() const
404 return staticPointsName_;
407 const word& movingPointsName() const
409 return movingPointsName_;
413 const word& staticCellsName() const
415 return staticCellsName_;
418 const word& movingCellsName() const
420 return movingCellsName_;
426 void writeDict(Ostream&) const;
430 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
432 } // End namespace Foam
434 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
438 // ************************************************************************* //