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/>.
24 \*---------------------------------------------------------------------------*/
26 #ifndef simpleEngineTopoFvMesh_H
27 #define simpleEngineTopoFvMesh_H
29 #include "engineTopoChangerMesh.H"
30 #include "valveBank.H"
31 #include "simpleEnginePiston.H"
32 #include "motionSolver.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 /*---------------------------------------------------------------------------*\
40 Class simpleEngineTopoFvMesh Declaration
41 \*---------------------------------------------------------------------------*/
43 class simpleEngineTopoFvMesh
45 public engineTopoChangerMesh
53 simpleEnginePiston piston_;
56 autoPtr<motionSolver> msPtr_;
58 //- Layering-to-deformation switch in crank-angle degrees
61 //- Valve position tolerance. Used in mask calculations
65 // Private Member Functions
67 //- Disallow default bitwise copy construct
68 simpleEngineTopoFvMesh(const simpleEngineTopoFvMesh&);
70 //- Disallow default bitwise assignment
71 void operator=(const simpleEngineTopoFvMesh&);
74 //- Add valve and piston zones and modifiers
75 void addZonesAndModifiers();
77 //- Make layering modifiers live
78 void makeLayersLive();
80 //- Make sliding modifiers live
81 void makeSlidersLive();
83 //- Prepare valve attach/detach
84 void prepareValveDetach();
86 //- Return true if sliders are attached
87 bool attached() const;
89 //- Set valve and piston motion boundary conditions for deformation
90 void setBoundaryMotion();
92 //- Set valve and piston position for layering
93 void setBoundaryPosition();
98 //- Runtime type information
99 TypeName("simpleEngineTopoFvMesh");
104 //- Construct from database
105 explicit simpleEngineTopoFvMesh(const IOobject& io);
110 virtual ~simpleEngineTopoFvMesh()
116 //- Return valve bank
117 const valveBank& valves() const
122 //- Return number of valves
123 label nValves() const
125 return valves().size();
128 const simpleEnginePiston& piston() const
133 //- Return true for mesh deformation mode
134 bool deformation() const
137 engineTime_.thetaRevolution() > -deformSwitch_
138 && engineTime_.thetaRevolution() < deformSwitch_;
141 //- Update the mesh for both mesh motion and topology change
142 virtual bool update();
144 //- Set boundary velocities
145 virtual void setBoundaryVelocity(volVectorField& U)
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 // ************************************************************************* //