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
25 \*---------------------------------------------------------------------------*/
27 #include "enginePiston.H"
28 #include "engineTime.H"
30 #include "interpolateXY.H"
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 // Construct from components
35 Foam::enginePiston::enginePiston
38 const word& pistonPatchName,
39 const autoPtr<coordinateSystem>& pistonCS,
40 const scalar minLayer,
41 const scalar maxLayer,
42 const word& pistonPointSetName,
43 const word& pistonFaceSetName,
44 const word& pistonCellSetName,
45 const word& bowlInPistonPatchName,
46 const word& bowlInCylinderPatchName
57 pistonPointSetName_(pistonPointSetName),
58 pistonFaceSetName_(pistonFaceSetName),
59 pistonCellSetName_(pistonPointSetName),
60 bowlInPistonPatchID_(bowlInPistonPatchName, mesh.boundaryMesh()),
61 bowlInCylinderPatchID_(bowlInCylinderPatchName, mesh.boundaryMesh())
65 // Construct from dictionary
66 Foam::enginePiston::enginePiston
69 const dictionary& dict
72 simpleEnginePiston(mesh, dict),
73 pistonPointSetName_(dict.lookup("pistonPointSetName")),
74 pistonFaceSetName_(dict.lookup("pistonFaceSetName")),
75 pistonCellSetName_(dict.lookup("pistonCellSetName")),
78 dict.lookup("bowlInPistonPatchName"),
81 bowlInCylinderPatchID_
83 dict.lookup("bowlInCylinderPatchName"),
89 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
92 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 void Foam::enginePiston::writeDict(Ostream& os) const
96 simpleEnginePiston::writeDict(os);
97 os << nl << token::BEGIN_BLOCK
98 << "pistonPointSetName " << pistonPointSetName_
99 << token::END_STATEMENT << nl
100 << "pistonFaceSetName " << pistonFaceSetName_
101 << token::END_STATEMENT << nl
102 << "pistonCellSetName " << pistonCellSetName_
103 << token::END_STATEMENT << nl
104 << token::END_BLOCK << endl;
108 // ************************************************************************* //