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 #include "engineVerticalValve.H"
27 #include "engineTime.H"
29 #include "interpolateXY.H"
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 Foam::engineVerticalValve::engineVerticalValve
37 const autoPtr<coordinateSystem>& valveCS,
38 const word& bottomPatchName,
39 const word& poppetPatchName,
40 const word& stemPatchName,
41 const word& curtainInPortPatchName,
42 const word& curtainInCylinderPatchName,
43 const word& detachInCylinderPatchName,
44 const word& detachInPortPatchName,
45 const labelList& detachFaces,
46 const graph& liftProfile,
48 const scalar minTopLayer,
49 const scalar maxTopLayer,
50 const scalar minBottomLayer,
51 const scalar maxBottomLayer,
52 const scalar diameter,
53 const word& valveHeadPatchName,
54 const scalar topLayerOffset,
55 const scalar topLayerTol,
56 const scalar bottomLayerOffset,
57 const scalar bottomLayerTol,
58 const scalar detachDistance,
59 const scalar detachTol,
60 const scalar deformationLift
71 curtainInPortPatchName,
72 curtainInCylinderPatchName,
73 detachInCylinderPatchName,
74 detachInPortPatchName,
84 valveHeadPatch_(valveHeadPatchName, mesh.boundaryMesh()),
85 topLayerOffset_(topLayerOffset),
86 topLayerTol_(topLayerTol),
87 bottomLayerOffset_(bottomLayerOffset),
88 bottomLayerTol_(bottomLayerTol),
89 detachDistance_(detachDistance),
90 detachTol_(detachTol),
91 deformationLift_(deformationLift)
95 // Construct from dictionary
96 Foam::engineVerticalValve::engineVerticalValve
100 const dictionary& dict
111 dict.lookup("valveHeadPatch"),
114 topLayerOffset_(readScalar(dict.lookup("topLayerOffset"))),
115 topLayerTol_(readScalar(dict.lookup("topLayerTol"))),
116 bottomLayerOffset_(readScalar(dict.lookup("bottomLayerOffset"))),
117 bottomLayerTol_(readScalar(dict.lookup("bottomLayerTol"))),
118 detachDistance_(readScalar(dict.lookup("detachDistance"))),
119 detachTol_(readScalar(dict.lookup("detachTol"))),
120 deformationLift_(readScalar(dict.lookup("deformationLift")))
124 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
127 void Foam::engineVerticalValve::writeDict(Ostream& os) const
129 engineValve::writeDict(os);
132 os << "headPatch " << valveHeadPatch_.name() << token::END_STATEMENT << nl
133 << "bottomLayerOffset " << bottomLayerOffset_
134 << token::END_STATEMENT << nl
135 << "bottomLayerOffsetayerTol " << bottomLayerTol_
136 << token::END_STATEMENT << nl
137 << "topLayerOffset " << topLayerOffset_ << token::END_STATEMENT << nl
138 << "topLayerTol " << topLayerTol_ << token::END_STATEMENT << nl
139 << "detachDistance " << detachDistance_ << token::END_STATEMENT << nl
140 << "detachTol " << detachTol_ << token::END_STATEMENT << nl
141 << "deformationLift " << deformationLift_ << token::END_STATEMENT << nl
142 << token::END_BLOCK << endl;
146 // ************************************************************************* //