36Foam::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_;
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()),
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),
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();
249 csysPtr_->writeEntry(
os);
255 <<
"curtainInPortPatch " << curtainInPortPatch_.name()
257 <<
"curtainInCylinderPatch " << curtainInCylinderPatch_.name()
259 <<
"detachInCylinderPatch " << detachInCylinderPatch_.name()
261 <<
"detachInPortPatch " << detachInPortPatch_.name()
void setSize(const label n)
Alias for resize()
virtual const fileName & name() const
Read/write access to the name of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Base class for coordinate system specification, the default coordinate system type is cartesian .
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An abstract class for the time description of the piston motion.
bool isOpen() const
Is the valve open?
scalar lift(const scalar theta) const
Return valve lift given crank angle in degrees.
labelList movingPatchIDs() const
Return list of active patch labels for the valve head.
scalar curLift() const
Return current lift.
scalar curVelocity() const
Return valve velocity for current time-step.
Foam::dictionary writeDict() const
Write to dictionary.
Class to create, store and output qgraph files.
A class for handling keywords in dictionaries.
Mesh consisting of general polyhedral cells.
Lookup type of boundary radiation properties.
@ BEGIN_BLOCK
Begin block [isseparator].
@ END_BLOCK
End block [isseparator].
@ END_STATEMENT
End entry [isseparator].
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Interpolates y values from one curve to another with a different x distribution.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
To & refCast(From &r)
Reference type cast template function.
Field< Type > interpolateXY(const scalarField &xNew, const scalarField &xOld, const Field< Type > &yOld)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)