36 Foam::scalar Foam::engineValve::adjustCrankAngle(
const scalar theta)
const
38 if (theta < liftProfileStart_)
40 scalar adjustedTheta = theta;
42 while (adjustedTheta < liftProfileStart_)
44 adjustedTheta += liftProfileEnd_ - liftProfileStart_;
49 else if (theta > liftProfileEnd_)
51 scalar adjustedTheta = theta;
53 while (adjustedTheta > liftProfileEnd_)
55 adjustedTheta -= liftProfileEnd_ - liftProfileStart_;
69 Foam::engineValve::engineValve
73 const autoPtr<coordinateSystem>& valveCS,
74 const word& bottomPatchName,
75 const word& poppetPatchName,
76 const word& stemPatchName,
77 const word& curtainInPortPatchName,
78 const word& curtainInCylinderPatchName,
79 const word& detachInCylinderPatchName,
80 const word& detachInPortPatchName,
82 const graph& liftProfile,
84 const scalar minTopLayer,
85 const scalar maxTopLayer,
86 const scalar minBottomLayer,
87 const scalar maxBottomLayer,
94 csysPtr_(valveCS.clone()),
95 bottomPatch_(bottomPatchName,
mesh.boundaryMesh()),
96 poppetPatch_(poppetPatchName,
mesh.boundaryMesh()),
97 stemPatch_(stemPatchName,
mesh.boundaryMesh()),
98 curtainInPortPatch_(curtainInPortPatchName,
mesh.boundaryMesh()),
99 curtainInCylinderPatch_(curtainInCylinderPatchName,
mesh.boundaryMesh()),
100 detachInCylinderPatch_(detachInCylinderPatchName,
mesh.boundaryMesh()),
101 detachInPortPatch_(detachInPortPatchName,
mesh.boundaryMesh()),
102 detachFaces_(detachFaces),
103 liftProfile_(liftProfile),
104 liftProfileStart_(
min(liftProfile_.
x())),
105 liftProfileEnd_(
max(liftProfile_.
x())),
107 minTopLayer_(minTopLayer),
108 maxTopLayer_(maxTopLayer),
109 minBottomLayer_(minBottomLayer),
110 maxBottomLayer_(maxBottomLayer),
115 Foam::engineValve::engineValve
149 curtainInCylinderPatch_
154 detachInCylinderPatch_
165 liftProfile_(
"theta",
"lift", name_,
dict.
lookup(
"liftProfile")),
166 liftProfileStart_(
min(liftProfile_.
x())),
167 liftProfileEnd_(
max(liftProfile_.
x())),
168 minLift_(
dict.
get<scalar>(
"minLift")),
169 minTopLayer_(
dict.
get<scalar>(
"minTopLayer")),
170 maxTopLayer_(
dict.
get<scalar>(
"maxTopLayer")),
171 minBottomLayer_(
dict.
get<scalar>(
"minBottomLayer")),
172 maxBottomLayer_(
dict.
get<scalar>(
"maxBottomLayer")),
173 diameter_(
dict.
get<scalar>(
"diameter"))
183 adjustCrankAngle(theta),
192 return lift(engineDB_.theta()) >= minLift_;
200 lift(engineDB_.theta()),
213 lift(engineDB_.theta() - engineDB_.deltaTheta()),
216 )/(engineDB_.deltaTValue() + VSMALL);
225 if (bottomPatch_.active())
227 mpIDs[nMpIDs] = bottomPatch_.index();
231 if (poppetPatch_.active())
233 mpIDs[nMpIDs] = poppetPatch_.index();
247 cs().writeEntry(coordinateSystem::typeName_(),
os);
252 <<
"curtainInPortPatch " << curtainInPortPatch_.name()
254 <<
"curtainInCylinderPatch " << curtainInCylinderPatch_.name()
256 <<
"detachInCylinderPatch " << detachInCylinderPatch_.name()
258 <<
"detachInPortPatch " << detachInPortPatch_.name()