FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

engineTime Class Reference

Manage time in terms of engine RPM and crank-angle. More...

#include <engine/engineTime.H>


Detailed Description

Manage time in terms of engine RPM and crank-angle.

When engineTime is in effect, the userTime is reported in degrees crank-angle instead of in seconds. The RPM to be used is specified in constant/engineGeometry. If only a time conversion is required, the geometric engine parameters can be dropped or set to zero.

For example,

rpm rpm  [0 0 -1 0 0]  2000;

conRodLengthconRodLength  [0 1 0 0 0] 0.0;
borebore  [0 1 0 0 0] 0.0;
stroke  stroke[0 1 0 0 0] 0.0;
clearance   clearance [0 1 0 0 0] 0.0;
Note:
The engineTime can currently only be selected at compile-time.
Source files

Definition at line 69 of file engineTime.H.

Inheritance diagram for engineTime:
Collaboration diagram for engineTime:

List of all members.

Public Member Functions

 engineTime (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.
virtual  ~engineTime ()
scalar  degToRad (const scalar rad) const
 Convert degrees to radians.
scalar  degToTime (const scalar theta) const
 Convert degrees to seconds (for given engine speed in RPM)
scalar  timeToDeg (const scalar t) const
 Convert seconds to degrees (for given engine speed in RPM)
scalar  pistonPosition (const scalar theta) const
 Calculate the piston position from the engine geometry.
const dictionary &  engineDict () const
 Return the engine geometry dictionary.
const dimensionedScalar &  rpm () const
 Return the engines current operating RPM.
const dimensionedScalar &  conRodLength () const
 Return the engines connecting-rod length.
const dimensionedScalar &  bore () const
 Return the engines bore.
const dimensionedScalar &  stroke () const
 Return the engines stroke.
const dimensionedScalar &  clearance () const
 Return the engines clearance-gap.
scalar  theta () const
 Return current crank-angle.
scalar  thetaRevolution () const
 Return current crank-angle translated to a single revolution.
scalar  deltaTheta () const
 Return crank-angle increment.
dimensionedScalar  pistonPosition () const
 Return current piston position.
dimensionedScalar  pistonDisplacement () const
 Return piston displacement for current time step.
dimensionedScalar  pistonSpeed () const
 Return piston speed for current time step.
virtual scalar  userTimeToTime (const scalar theta) const
 Convert the user-time (CA deg) to real-time (s).
virtual scalar  timeToUserTime (const scalar t) const
 Convert the real-time (s) into user-time (CA deg)
virtual void  readDict ()
 Read the control dictionary and set the write controls etc.
virtual bool  read ()
 Read the controlDict and set all the parameters.

Constructor & Destructor Documentation

engineTime ( 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.

Definition at line 51 of file engineTime.C.

References dimensioned< Type >::readIfPresent().

virtual ~engineTime (  ) [inline, virtual]

Definition at line 115 of file engineTime.H.


Member Function Documentation

Foam::scalar degToRad ( const scalar   rad  ) const

Convert degrees to radians.

Definition at line 125 of file engineTime.C.

References Foam::mathematicalConstant::pi().

Foam::scalar degToTime ( const scalar   theta  ) const

Convert degrees to seconds (for given engine speed in RPM)

Definition at line 131 of file engineTime.C.

Foam::scalar timeToDeg ( const scalar   t  ) const

Convert seconds to degrees (for given engine speed in RPM)

Definition at line 138 of file engineTime.C.

Foam::scalar pistonPosition ( const scalar   theta  ) const

Calculate the piston position from the engine geometry.

and given crank angle.

Definition at line 177 of file engineTime.C.

References Foam::cos(), Foam::sin(), Foam::sqr(), and Foam::sqrt().

const dictionary& engineDict (  ) const [inline]

Return the engine geometry dictionary.

Definition at line 140 of file engineTime.H.

Referenced by fvMotionSolverEngineMesh::fvMotionSolverEngineMesh(), and layeredEngineMesh::layeredEngineMesh().

const dimensionedScalar& rpm (  ) const [inline]

Return the engines current operating RPM.

Definition at line 146 of file engineTime.H.

const dimensionedScalar& conRodLength (  ) const [inline]

Return the engines connecting-rod length.

Definition at line 152 of file engineTime.H.

const dimensionedScalar& bore (  ) const [inline]

Return the engines bore.

Definition at line 158 of file engineTime.H.

const dimensionedScalar& stroke (  ) const [inline]

Return the engines stroke.

Definition at line 164 of file engineTime.H.

const dimensionedScalar& clearance (  ) const [inline]

Return the engines clearance-gap.

Definition at line 170 of file engineTime.H.

Foam::scalar theta (  ) const

Return current crank-angle.

Definition at line 145 of file engineTime.C.

Foam::scalar thetaRevolution (  ) const

Return current crank-angle translated to a single revolution.

(value between -180 and 180 with 0 = top dead centre)

Definition at line 153 of file engineTime.C.

Foam::scalar deltaTheta (  ) const

Return crank-angle increment.

Definition at line 171 of file engineTime.C.

Foam::dimensionedScalar pistonPosition (  ) const

Return current piston position.

Definition at line 196 of file engineTime.C.

References Foam::dimLength.

Foam::dimensionedScalar pistonDisplacement (  ) const

Return piston displacement for current time step.

Definition at line 207 of file engineTime.C.

References Foam::dimLength.

Referenced by layeredEngineMesh::move(), and fvMotionSolverEngineMesh::move().

Foam::dimensionedScalar pistonSpeed (  ) const

Return piston speed for current time step.

Definition at line 218 of file engineTime.C.

References Foam::dimVelocity.

Foam::scalar userTimeToTime ( const scalar   theta  ) const [virtual]

Convert the user-time (CA deg) to real-time (s).

Reimplemented from TimeState.

Definition at line 229 of file engineTime.C.

Foam::scalar timeToUserTime ( const scalar   t  ) const [virtual]

Convert the real-time (s) into user-time (CA deg)

Reimplemented from TimeState.

Definition at line 235 of file engineTime.C.

void readDict (  ) [virtual]

Read the control dictionary and set the write controls etc.

Reimplemented from Time.

Definition at line 103 of file engineTime.C.

References Time::readDict().

bool read (  ) [virtual]

Read the controlDict and set all the parameters.

Reimplemented from Time.

Definition at line 111 of file engineTime.C.

References Time::read().


The documentation for this class was generated from the following files: