OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

engineValve.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::engineValve
00027 
00028 Description
00029     Foam::engineValve
00030 
00031 SourceFiles
00032     engineValve.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef engineValve_H
00037 #define engineValve_H
00038 
00039 #include "word.H"
00040 #include "coordinateSystem.H"
00041 #include "polyPatchID.H"
00042 #include "graph.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 // Forward declaration of classes
00050 class polyMesh;
00051 class engineTime;
00052 
00053 /*---------------------------------------------------------------------------*\
00054                           Class engineValve Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 class engineValve
00058 {
00059     // Private data
00060 
00061         //- Name of valve
00062         word name_;
00063 
00064         //- Reference to engine mesh
00065         const polyMesh& mesh_;
00066 
00067         //- Reference to engine database
00068         const engineTime& engineDB_;
00069 
00070         //- Coordinate system
00071         autoPtr<coordinateSystem> csPtr_;
00072 
00073 
00074         // Patch and zone names
00075 
00076             //- Valve bottom patch
00077             polyPatchID bottomPatch_;
00078 
00079             //- Valve poppet patch
00080             polyPatchID poppetPatch_;
00081 
00082             //- Valve stem patch
00083             polyPatchID stemPatch_;
00084 
00085             //- Valve curtain manifold patch
00086             polyPatchID curtainInPortPatch_;
00087 
00088             //- Valve curtain cylinder patch
00089             polyPatchID curtainInCylinderPatch_;
00090 
00091             //- Valve detach in cylinder patch
00092             polyPatchID detachInCylinderPatch_;
00093 
00094             //- Valve detach in port patch
00095             polyPatchID detachInPortPatch_;
00096 
00097             //- Faces to detach
00098             labelList detachFaces_;
00099 
00100 
00101         // Valve lift data
00102 
00103             //- Valve lift profile
00104             graph liftProfile_;
00105 
00106             //- Lift curve start angle
00107             scalar liftProfileStart_;
00108 
00109             //- Lift curve end angle
00110             scalar liftProfileEnd_;
00111 
00112             //- Minimum valve lift.  On this lift the valve is considered closed
00113             const scalar minLift_;
00114 
00115 
00116             // Valve layering data
00117 
00118                 //- Min top layer thickness
00119                 const scalar minTopLayer_;
00120 
00121                 //- Max top layer thickness
00122                 const scalar maxTopLayer_;
00123 
00124                 //- Min bottom layer thickness
00125                 const scalar minBottomLayer_;
00126 
00127                 //- Max bottom layer thickness
00128                 const scalar maxBottomLayer_;
00129 
00130 
00131             //- Valve diameter
00132             const scalar diameter_;
00133 
00134 
00135     // Private Member Functions
00136 
00137         //- Disallow default bitwise copy construct
00138         engineValve(const engineValve&);
00139 
00140         //- Disallow default bitwise assignment
00141         void operator=(const engineValve&);
00142 
00143 
00144         //- Adjust crank angle to drop within the limits of the lift profile
00145         scalar adjustCrankAngle(const scalar theta) const;
00146 
00147 public:
00148 
00149     // Static data members
00150 
00151 
00152     // Constructors
00153 
00154         //- Construct from components
00155         engineValve
00156         (
00157             const word& name,
00158             const polyMesh& mesh,
00159             const autoPtr<coordinateSystem>& valveCS,
00160             const word& bottomPatchName,
00161             const word& poppetPatchName,
00162             const word& stemPatchName,
00163             const word& curtainInPortPatchName,
00164             const word& curtainInCylinderPatchName,
00165             const word& detachInCylinderPatchName,
00166             const word& detachInPortPatchName,
00167             const labelList& detachFaces,
00168             const graph& liftProfile,
00169             const scalar minLift,
00170             const scalar minTopLayer,
00171             const scalar maxTopLayer,
00172             const scalar minBottomLayer,
00173             const scalar maxBottomLayer,
00174             const scalar diameter
00175 
00176         );
00177 
00178         //- Construct from dictionary
00179         engineValve
00180         (
00181             const word& name,
00182             const polyMesh& mesh,
00183             const dictionary& dict
00184         );
00185 
00186 
00187     // Destructor - default
00188 
00189 
00190     // Member Functions
00191 
00192         //- Return name
00193         const word& name() const
00194         {
00195             return name_;
00196         }
00197 
00198         //- Return coordinate system
00199         const coordinateSystem& cs() const
00200         {
00201             return csPtr_();
00202         }
00203 
00204         //- Return lift profile
00205         const graph& liftProfile() const
00206         {
00207             return liftProfile_;
00208         }
00209 
00210         //- Return valve diameter
00211         scalar diameter() const
00212         {
00213             return diameter_;
00214         }
00215 
00216 
00217         // Valve patches
00218 
00219             //- Return ID of bottom patch
00220             const polyPatchID& bottomPatchID() const
00221             {
00222                 return bottomPatch_;
00223             }
00224 
00225             //- Return ID of poppet patch
00226             const polyPatchID& poppetPatchID() const
00227             {
00228                 return poppetPatch_;
00229             }
00230 
00231             //- Return ID of stem patch
00232             const polyPatchID& stemPatchID() const
00233             {
00234                 return stemPatch_;
00235             }
00236 
00237             //- Return ID of curtain in cylinder patch
00238             const polyPatchID& curtainInCylinderPatchID() const
00239             {
00240                 return curtainInCylinderPatch_;
00241             }
00242 
00243             //- Return ID of curtain in port patch
00244             const polyPatchID& curtainInPortPatchID() const
00245             {
00246                 return curtainInPortPatch_;
00247             }
00248 
00249 
00250             //- Return ID of detach in cylinder patch
00251             const polyPatchID& detachInCylinderPatchID() const
00252             {
00253                 return detachInCylinderPatch_;
00254             }
00255 
00256             //- Return ID of detach in port patch
00257             const polyPatchID& detachInPortPatchID() const
00258             {
00259                 return detachInPortPatch_;
00260             }
00261 
00262             //- Return face labels of detach curtain
00263             const labelList& detachFaces() const
00264             {
00265                 return detachFaces_;
00266             }
00267 
00268 
00269         // Valve layering thickness
00270 
00271             scalar minTopLayer() const
00272             {
00273                 return minTopLayer_;
00274             }
00275 
00276             scalar maxTopLayer() const
00277             {
00278                 return maxTopLayer_;
00279             }
00280 
00281             scalar minBottomLayer() const
00282             {
00283                 return minBottomLayer_;
00284             }
00285 
00286             scalar maxBottomLayer() const
00287             {
00288                 return maxBottomLayer_;
00289             }
00290 
00291 
00292         // Valve position and velocity
00293 
00294             //- Return valve lift given crank angle in degrees
00295             scalar lift(const scalar theta) const;
00296 
00297             //- Is the valve open?
00298             bool isOpen() const;
00299 
00300             //- Return current lift
00301             scalar curLift() const;
00302 
00303             //- Return valve velocity for current time-step
00304             scalar curVelocity() const;
00305 
00306             //- Return list of active patch labels for the valve head
00307             //  (stem is excluded)
00308             labelList movingPatchIDs() const;
00309 
00310 
00311         //- Write dictionary
00312         void writeDict(Ostream&) const;
00313 };
00314 
00315 
00316 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00317 
00318 } // End namespace Foam
00319 
00320 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00321 
00322 #endif
00323 
00324 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd