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 Engine mesh class for canted valves engine. Layers are added/removed on the
30 piston, while mesh is deformed close to the valves. Attach/detach boundary
31 is used. There are no sliding interfaces.
34 // ------------------------------------------------------------------------- //
36 #ifndef accordionEngineMesh_H
37 #define accordionEngineMesh_H
39 #include "engineTopoChangerMesh.H"
40 #include "enginePiston.H"
41 #include "motionSolver.H"
42 #include "polyPatchID.H"
43 #include "thoboisValveBank.H"
44 #include "twoDPointCorrector.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Class forward declarations
57 /*---------------------------------------------------------------------------*\
58 Class lateralValves Declaration
59 \*---------------------------------------------------------------------------*/
60 class twoDPointCorrector;
62 class accordionEngineMesh
64 public engineTopoChangerMesh
72 thoboisValveBank valves_;
74 //- Layering-to-deformation switch in crank-angle degrees
77 //- Tolerance used when the piston faceZone is created
80 //- Distance from the piston patch
84 scalar pistonPosition_;
86 //- Virtual piston position (pistonPosition + offSet)
87 scalar virtualPistonPosition_;
93 autoPtr<motionSolver> msPtr_;
95 //- Cylinder head name
96 word cylinderHeadName_;
98 //- Cylinder head name
102 word pistonAuxPoints_;
106 // Private Member Functions
108 //- Disallow default bitwise copy construct
109 accordionEngineMesh(const accordionEngineMesh&);
111 //- Disallow default bitwise assignment
112 void operator=(const accordionEngineMesh&);
114 //- Make layering modifiers live
115 void makeLayersLive();
117 //- Make attach-detach live
118 void makeDetachLive();
120 //- Prepare valve attach/detach
123 //- Prepare valve attach/detach
126 //- Prepare valve attach/detach
127 void prepareValveDetach();
129 //- Check if all patches exist, then calculate virtualPistonPosition,
130 //- pistonPosition and deckHeight for the first time
131 void checkAndCalculate();
133 //- Calculate the virtualPistonPosition,
134 void setVirtualPositions();
136 bool realDeformation() const;
140 //- Runtime type information
141 TypeName("accordionEngineMesh");
146 //- Construct from database
147 explicit accordionEngineMesh(const IOobject& io);
150 // Destructor - default
155 inline const enginePiston& piston() const;
156 inline const thoboisValveBank& valves() const;
157 inline const scalar& deformSwitch() const;
158 inline const scalar& delta() const;
159 inline const scalar& offSet() const;
160 inline const scalar& pistonPosition() const;
161 inline scalar& pistonPosition();
162 inline const scalar& virtualPistonPosition() const;
163 inline scalar& virtualPistonPosition();
164 inline const scalar& deckHeight() const;
165 inline scalar& deckHeight();
168 //- Return true for mesh deformation mode
169 bool deformation() const
172 engTime().thetaRevolution() > -deformSwitch_
173 && engTime().thetaRevolution() < deformSwitch_;
176 //- Return number of valves
177 label nValves() const
179 return valves_.size();
182 //- Add valve and piston zones and modifiers
183 void addZonesAndModifiers();
186 virtual bool update();
188 //- Set boundary velocities
189 void setBoundaryVelocity(volVectorField& U);
191 //- Generate the mesh from a series of square blocks
192 void generateMesh(){};
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 #include "accordionEngineMeshI.H"
205 // ************************************************************************* //