1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 class for engine meshes with vertical valves
33 \*---------------------------------------------------------------------------*/
35 #ifndef thoboisSlidingValve_H
36 #define thoboisSlidingValve_H
39 #include "coordinateSystem.H"
40 #include "polyPatchID.H"
42 #include "engineValve.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 // Class forward declarations
56 /*---------------------------------------------------------------------------*\
57 Class engineVerticalValve Declaration
58 \*---------------------------------------------------------------------------*/
60 class thoboisSlidingValve
63 //- Adjust crank angle to drop within the limits of the lift profile
64 scalar adjustCrankAngle(const scalar theta) const;
71 //- Reference to engine mesh
72 const polyMesh& mesh_;
74 //- Reference to engine database
75 const engineTime& engineDB_;
78 autoPtr<coordinateSystem> csPtr_;
81 // Patch and zone names
83 //- Valve bottom patch
84 polyPatchID bottomPatch_;
86 //- Valve poppet patch
87 polyPatchID poppetPatch_;
89 //- Valve poppet patch
90 polyPatchID sidePatch_;
93 polyPatchID stemPatch_;
95 //- Valve sliding in cylinder patch
96 polyPatchID curtainInCylinderPatch_;
98 //- Valve sliding in port patch
99 polyPatchID curtainInPortPatch_;
101 //- Valve detach in cylinder patch
102 polyPatchID detachInCylinderPatch_;
104 //- Valve detach in port patch
105 polyPatchID detachInPortPatch_;
108 labelList detachFaces_;
112 //- Valve lift profile
115 //- Lift curve start angle
116 scalar liftProfileStart_;
118 //- Lift curve end angle
119 scalar liftProfileEnd_;
121 //- Minimum valve lift. On this lift the valve is considered closed
122 const scalar minLift_;
125 const scalar diameter_;
127 //- Tolerance for deformation/layering
128 scalar deformationLift_;
133 //- Name of the faceSet for the valveTop layer
134 word layeringFacesTopName_;
136 //- Name of thefaceSet for the valveBottom layer
137 word layeringFacesBottomName_;
140 //- Name of thefaceSet for the valveBottom layer
141 word movingCellsTopName_;
143 //- Name of thefaceSet for the valveBottom layer
144 word movingCellsBottomName_;
146 //- Name of thefaceSet for the valveBottom layer
147 word movingPointsTopName_;
149 //- Name of thefaceSet for the valveBottom layer
150 word movingPointsBottomName_;
152 const scalar minTopLayer_;
154 const scalar maxTopLayer_;
156 const scalar minBottomLayer_;
158 const scalar maxBottomLayer_;
160 //- Name of the pointSet for the static points
161 word staticPointsName_;
163 //- Name of the pointSet for the moving points
164 word movingPointsName_;
166 //- Name of the pointSet for the moving internal points
167 // word movingInternalPointsName_;
169 //- Name of the cellSet for the static cells
170 word staticCellsName_;
172 //- Name of the cellSet for the moving cells
173 word movingCellsName_;
176 // Private Member Functions
178 //- Disallow default bitwise copy construct
179 thoboisSlidingValve(const thoboisSlidingValve&);
181 //- Disallow default bitwise assignment
182 void operator=(const thoboisSlidingValve&);
188 // Static data members
193 //- Construct from components
197 const polyMesh& mesh,
198 const autoPtr<coordinateSystem>& valveCS,
199 const word& bottomPatchName,
200 const word& sidePatchName,
201 const word& poppetPatchName,
202 const word& stemPatchName,
203 const word& curtainInPortPatchName,
204 const word& curtainInCylinderPatchName,
205 const word& detachInCylinderPatchName,
206 const word& detachInPortPatchName,
207 const labelList& detachFaces,
208 const graph& liftProfile,
209 const scalar minLift,
210 const scalar diameter,
211 const scalar deformationLift,
212 const word& layeringFacesTopName,
213 const word& layeringFacesBottomName,
214 const word& movingCellsTopName,
215 const word& movingCellsBottomName,
216 const word& movingPointsTopName,
217 const word& movingPointsBottomName,
218 const scalar minTopLayer,
219 const scalar maxTopLayer,
220 const scalar minBottomLayer,
221 const scalar maxBottomLayer,
222 const word& staticPointsName,
223 const word& movingPointsName,
224 const word& staticCellsName,
225 const word& movingCellsName
228 //- Construct from dictionary
232 const polyMesh& mesh,
233 const dictionary& dict
237 // Destructor - default
243 const word& name() const
248 //- Return coordinate system
249 const coordinateSystem& cs() const
254 //- Return lift profile
255 const graph& liftProfile() const
260 //- Return valve min Lift
261 scalar minLift() const
267 //- Return valve diameter
268 scalar diameter() const
273 const scalar& deformationLift() const
275 return deformationLift_;
280 //- Return ID of bottom patch
281 const polyPatchID& bottomPatchID() const
286 //- Return ID of poppet patch
287 const polyPatchID& poppetPatchID() const
292 //- Return ID of side patch
293 const polyPatchID& sidePatchID() const
298 //- Return ID of stem patch
299 const polyPatchID& stemPatchID() const
305 //- Return ID of sliding in port patch
306 const polyPatchID& curtainInPortPatchID() const
308 return curtainInPortPatch_;
311 //- Return ID of sliding in cylinder patch
312 const polyPatchID& curtainInCylinderPatchID() const
314 return curtainInCylinderPatch_;
317 //- Return ID of detach in cylinder patch
318 const polyPatchID& detachInCylinderPatchID() const
320 return detachInCylinderPatch_;
323 //- Return ID of detach in port patch
324 const polyPatchID& detachInPortPatchID() const
326 return detachInPortPatch_;
329 //- Return face labels of detach curtain
330 const labelList& detachFaces() const
335 const word& layeringFacesTopName() const
337 return layeringFacesTopName_;
339 const word& layeringFacesBottomName() const
341 return layeringFacesBottomName_;
344 const word& movingCellsTopName() const
346 return movingCellsTopName_;
348 const word& movingCellsBottomName() const
350 return movingCellsBottomName_;
353 const word& movingPointsTopName() const
355 return movingPointsTopName_;
357 const word& movingPointsBottomName() const
359 return movingPointsBottomName_;
362 // Valve position and velocity
364 //- Return valve lift given crank angle in degrees
365 scalar lift(const scalar theta) const;
367 //- Is the valve open?
370 //- Return current lift
371 scalar curLift() const;
373 //- Return valve velocity for current time-step
374 scalar curVelocity() const;
376 //- Return list of active patch labels for the valve head
377 // (stem is excluded)
378 labelList movingPatchIDs() const;
380 //- Return min valveTop layer
381 scalar minTopLayer() const
385 //- Return max valveTop layer
386 scalar maxTopLayer() const
390 //- Return min valveBottom layer
391 scalar minBottomLayer() const
393 return minBottomLayer_;
395 //- Return max valveBottom layer
396 scalar maxBottomLayer() const
398 return maxBottomLayer_;
401 const word& staticPointsName() const
403 return staticPointsName_;
406 const word& movingPointsName() const
408 return movingPointsName_;
412 const word& staticCellsName() const
414 return staticCellsName_;
417 const word& movingCellsName() const
419 return movingCellsName_;
425 void writeDict(Ostream&) const;
429 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
431 } // End namespace Foam
433 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
437 // ************************************************************************* //