41 void Foam::crankConRod::timeAdjustment()
43 deltaT_ = degToTime(deltaT_);
44 endTime_ = degToTime(endTime_);
49 || writeControl_ == writeControl::adjustableRunTime
52 writeInterval_ = degToTime(writeInterval_);
77 rpm_(dict_.lookup(
"rpm")),
85 dict_.readIfPresent(
"bore", bore_);
86 dict_.readIfPresent(
"stroke", stroke_);
87 dict_.readIfPresent(
"clearance", clearance_);
91 startTime_ = degToTime(startTime_);
92 value() = degToTime(value());
94 deltaTSave_ = deltaT_;
125 return theta/(6.0*rpm_.value());
132 return t*(6.0*rpm_.value());
138 return timeToDeg(value());
168 return timeToDeg(deltaTValue());
176 conRodLength_.value()
177 + stroke_.value()/2.0
184 sqr(conRodLength_.value())
194 return degToTime(theta);
virtual void readDict()
Read the control dictionary and set the write controls etc.
A class for handling file names.
virtual scalar theta() const
Return current crank-angle.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Unit conversion functions.
dimensionedScalar sqrt(const dimensionedScalar &ds)
bool readIfPresent(const dictionary &)
Update the value of dimensioned<Type> if found in the dictionary.
dimensionedScalar pistonPosition() const
Return current piston position.
An abstract class for the time description of the piston motion.
crankConRod(const word &name, const fileName &rootPath, const fileName &caseName, const fileName &systemName="system", const fileName &constantName="constant", const fileName &dictName="engineGeometry")
Construct from objectRegistry arguments.
Macros for easy insertion into run-time selection tables.
scalar degToRad(const scalar deg)
Conversion from degrees to radians.
scalar timeToDeg(const scalar t) const
Convert seconds to degrees (for given engine speed in RPM)
virtual scalar deltaTheta() const
Return crank-angle increment.
virtual bool read()
Read the controlDict and set all the parameters.
dimensionedScalar cos(const dimensionedScalar &ds)
A class for handling words, derived from string.
virtual scalar timeToUserTime(const scalar t) const
Convert the real-time (s) into user-time (CA deg)
dimensionedScalar sin(const dimensionedScalar &ds)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual void readDict()
Read the control dictionary and set the write controls etc.
scalar degToTime(const scalar theta) const
Convert degrees to seconds (for given engine speed in RPM)
defineTypeNameAndDebug(combustionModel, 0)
virtual scalar userTimeToTime(const scalar theta) const
Convert the user-time (CA deg) to real-time (s).
virtual bool read()
Read control dictionary, update controls and time.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual scalar timeToUserTimeRatio() const
Ratio between real-time and user-time.
virtual word unit() const
Return time unit.
scalar thetaRevolution() const
Return current crank-angle translated to a single revolution.