void Foam::engineTime::timeAdjustment() { deltaT_ = degToTime(deltaT_); endTime_ = degToTime(endTime_); if ( writeControl_ == wcRunTime || writeControl_ == wcAdjustableRunTime ) { writeInterval_ = degToTime(writeInterval_); } }
//- Construct from objectRegistry arguments Foam::engineTime::engineTime ( const word& name, const fileName& rootPath, const fileName& caseName, const fileName& systemName, const fileName& constantName, const fileName& dictName ) : Time ( name, rootPath, caseName, systemName, constantName ), dict_ ( IOobject ( "engineGeometry", constant(), *this, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) ), rpm_(dict_.lookup("rpm")), conRodLength_(dimensionedScalar("conRodLength", dimLength, 0)), bore_(dimensionedScalar("bore", dimLength, 0)), stroke_(dimensionedScalar("stroke", dimLength, 0)), clearance_(dimensionedScalar("clearance", dimLength, 0)) { // geometric parameters are not strictly required for Time dict_.readIfPresent("conRodLength", conRodLength_); dict_.readIfPresent("bore", bore_); dict_.readIfPresent("stroke", stroke_); dict_.readIfPresent("clearance", clearance_); timeAdjustment(); startTime_ = degToTime(startTime_); value() = degToTime(value()); deltaTSave_ = deltaT_; deltaT0_ = deltaT_; }
void DCMotorControl::left(double deg) { setMotorL(speedL, true); setMotorR(speedR); delay(degToTime(deg)); }
void DCMotorControl::right(double deg) { setMotorL(speedL); setMotorR(speedR, true); delay(degToTime(deg)); }
Foam::scalar Foam::engineTime::userTimeToTime(const scalar theta) const { return degToTime(theta); }