33 Foam::scalar Foam::engineValve::adjustCrankAngle(
const scalar theta)
const
35 if (theta < liftProfileStart_)
37 scalar adjustedTheta = theta;
39 while (adjustedTheta < liftProfileStart_)
41 adjustedTheta += liftProfileEnd_ - liftProfileStart_;
46 else if (theta > liftProfileEnd_)
48 scalar adjustedTheta = theta;
50 while (adjustedTheta > liftProfileEnd_)
52 adjustedTheta -= liftProfileEnd_ - liftProfileStart_;
67 Foam::engineValve::engineValve
72 const word& bottomPatchName,
73 const word& poppetPatchName,
74 const word& stemPatchName,
75 const word& curtainInPortPatchName,
76 const word& curtainInCylinderPatchName,
77 const word& detachInCylinderPatchName,
78 const word& detachInPortPatchName,
80 const graph& liftProfile,
82 const scalar minTopLayer,
83 const scalar maxTopLayer,
84 const scalar minBottomLayer,
85 const scalar maxBottomLayer,
91 engineDB_(refCast<const engineTime>(mesh.
time())),
96 curtainInPortPatch_(curtainInPortPatchName, mesh.
boundaryMesh()),
97 curtainInCylinderPatch_(curtainInCylinderPatchName, mesh.
boundaryMesh()),
98 detachInCylinderPatch_(detachInCylinderPatchName, mesh.
boundaryMesh()),
99 detachInPortPatch_(detachInPortPatchName, mesh.
boundaryMesh()),
100 detachFaces_(detachFaces),
101 liftProfile_(liftProfile),
102 liftProfileStart_(
min(liftProfile_.x())),
103 liftProfileEnd_(
max(liftProfile_.x())),
105 minTopLayer_(minTopLayer),
106 maxTopLayer_(maxTopLayer),
107 minBottomLayer_(minBottomLayer),
108 maxBottomLayer_(maxBottomLayer),
114 Foam::engineValve::engineValve
123 engineDB_(refCast<const engineTime>(mesh_.time())),
129 dict.
subDict(
"coordinateSystem")
137 dict.
lookup(
"curtainInPortPatch"),
140 curtainInCylinderPatch_
142 dict.
lookup(
"curtainInCylinderPatch"),
145 detachInCylinderPatch_
147 dict.
lookup(
"detachInCylinderPatch"),
152 dict.
lookup(
"detachInPortPatch"),
155 detachFaces_(dict.
lookup(
"detachFaces")),
156 liftProfile_(
"theta",
"lift", name_, dict.
lookup(
"liftProfile")),
157 liftProfileStart_(
min(liftProfile_.x())),
158 liftProfileEnd_(
max(liftProfile_.x())),
177 adjustCrankAngle(theta),
186 return lift(engineDB_.theta()) >= minLift_;
194 lift(engineDB_.theta()),
207 lift(engineDB_.theta() - engineDB_.deltaTheta()),
210 )/(engineDB_.deltaT().value() + VSMALL);
219 if (bottomPatch_.active())
221 mpIDs[nMpIDs] = bottomPatch_.index();
225 if (poppetPatch_.active())
227 mpIDs[nMpIDs] = poppetPatch_.index();
246 <<
"curtainInPortPatch " << curtainInPortPatch_.name()
248 <<
"curtainInCylinderPatch " << curtainInCylinderPatch_.name()
250 <<
"detachInCylinderPatch " << detachInCylinderPatch_.name()
252 <<
"detachInPortPatch " << detachInPortPatch_.name()
255 <<
"liftProfile " <<
nl << token::BEGIN_BLOCK