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 Engine mesh class for canted valves engine. Layers are added/removed on the
29 piston, while mesh is deformed close to the valves. Attach/detach boundary
30 is used. There are no sliding interfaces.
36 addLayerSmoothMeshModifiers.C
38 layerSmoothCalculate.C
39 layerSmoothInitialize.C
42 \*---------------------------------------------------------------------------*/
47 #include "engineTopoChangerMesh.H"
48 #include "simpleEnginePiston.H"
49 #include "motionSolver.H"
50 #include "polyPatchID.H"
51 #include "verticalValveBank.H"
52 #include "twoDPointCorrector.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 // Class forward declarations
61 /*---------------------------------------------------------------------------*\
62 Class lateralValves Declaration
63 \*---------------------------------------------------------------------------*/
64 class twoDPointCorrector;
68 public engineTopoChangerMesh
73 simpleEnginePiston piston_;
76 verticalValveBank valves_;
78 //- Layering-to-deformation switch in crank-angle degrees
81 //- Tolerance used when the piston faceZone is created
84 //- Distance from the piston patch
88 scalar pistonPosition_;
90 //- Virtual piston position (pistonPosition + offSet)
91 scalar virtualPistonPosition_;
97 autoPtr<motionSolver> msPtr_;
99 //- tolerance for attach/detach in the valve plane
100 scalar valvePlaneTol_;
102 // Private Member Functions
104 //- Disallow default bitwise copy construct
105 layerSmooth(const layerSmooth&);
107 //- Disallow default bitwise assignment
108 void operator=(const layerSmooth&);
110 //- Make layering modifiers live
111 void makeLayersLive();
113 //- Prepare valve attach/detach
116 //- Prepare valve attach/detach
119 //- Prepare valve attach/detach
120 void prepareValveDetach();
122 //- Check if all patches exist, then calculate virtualPistonPosition,
123 //- pistonPosition and deckHeight for the first time
124 void checkAndCalculate();
126 //- Calculate the virtualPistonPosition,
127 void setVirtualPositions();
129 bool realDeformation() const;
131 bool inCantedValve(const point& p, const label& i) const;
133 bool isACylinderHeadFace
135 const labelList& cylHeadFaces,
142 //- Runtime type information
143 TypeName("layerSmooth");
148 //- Construct from database
149 explicit layerSmooth(const IOobject& io);
152 // Destructor - default
157 inline const simpleEnginePiston& piston() const;
158 inline const verticalValveBank& valves() const;
159 inline const scalar& deformSwitch() const;
160 inline const scalar& delta() const;
161 inline const scalar& offSet() const;
162 inline const scalar& pistonPosition() const;
163 inline scalar& pistonPosition();
164 inline const scalar& virtualPistonPosition() const;
165 inline scalar& virtualPistonPosition();
166 inline const scalar& deckHeight() const;
167 inline scalar& deckHeight();
170 //- Return true for mesh deformation mode
171 bool deformation() const
174 engTime().thetaRevolution() > -deformSwitch_
175 && engTime().thetaRevolution() < deformSwitch_;
178 //- Return number of valves
179 label nValves() const
181 return valves_.size();
184 //- Add valve and piston zones and modifiers
185 void addZonesAndModifiers();
188 virtual bool update();
190 //- Set boundary velocities
191 void setBoundaryVelocity(volVectorField& U);
193 //- Generate the mesh from a series of square blocks
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 } // End namespace Foam
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 #include "layerSmoothI.H"
209 // ************************************************************************* //