OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

engineTime Class Reference

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

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 dictionaryengineDict () const
 Return the engine geometry dictionary.
const dimensionedScalarrpm () const
 Return the engines current operating RPM.
const dimensionedScalarconRodLength () const
 Return the engines connecting-rod length.
const dimensionedScalarbore () const
 Return the engines bore.
const dimensionedScalarstroke () const
 Return the engines stroke.
const dimensionedScalarclearance () 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.

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;

    conRodLength    conRodLength  [0 1 0 0 0] 0.0;
    bore            bore          [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 64 of file engineTime.H.


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 43 of file engineTime.C.

virtual ~engineTime (  )  [inline, virtual]

Definition at line 110 of file engineTime.H.


Member Function Documentation

Foam::scalar degToRad ( const scalar  rad  )  const

Convert degrees to radians.

Definition at line 117 of file engineTime.C.

Foam::scalar degToTime ( const scalar  theta  )  const

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

Definition at line 123 of file engineTime.C.

Foam::scalar timeToDeg ( const scalar  t  )  const

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

Definition at line 130 of file engineTime.C.

Referenced by engineTime::thetaRevolution().

Here is the caller graph for this function:

Foam::scalar pistonPosition ( const scalar  theta  )  const

Calculate the piston position from the engine geometry.

and given crank angle.

Definition at line 169 of file engineTime.C.

const dictionary& engineDict (  )  const [inline]

Return the engine geometry dictionary.

Definition at line 137 of file engineTime.H.

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

Here is the caller graph for this function:

const dimensionedScalar& rpm (  )  const [inline]

Return the engines current operating RPM.

Definition at line 143 of file engineTime.H.

const dimensionedScalar& conRodLength (  )  const [inline]

Return the engines connecting-rod length.

Definition at line 149 of file engineTime.H.

const dimensionedScalar& bore (  )  const [inline]

Return the engines bore.

Definition at line 155 of file engineTime.H.

const dimensionedScalar& stroke (  )  const [inline]

Return the engines stroke.

Definition at line 161 of file engineTime.H.

const dimensionedScalar& clearance (  )  const [inline]

Return the engines clearance-gap.

Definition at line 167 of file engineTime.H.

Foam::scalar theta (  )  const

Return current crank-angle.

Definition at line 137 of file engineTime.C.

Referenced by engineValve::curVelocity().

Here is the caller graph for this function:

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 145 of file engineTime.C.

References engineTime::timeToDeg().

Here is the call graph for this function:

Foam::scalar deltaTheta (  )  const

Return crank-angle increment.

Definition at line 163 of file engineTime.C.

Foam::dimensionedScalar pistonPosition (  )  const

Return current piston position.

Definition at line 188 of file engineTime.C.

Foam::dimensionedScalar pistonDisplacement (  )  const

Return piston displacement for current time step.

Definition at line 199 of file engineTime.C.

Foam::dimensionedScalar pistonSpeed (  )  const

Return piston speed for current time step.

Definition at line 210 of file engineTime.C.

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

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

Reimplemented from TimeState.

Definition at line 221 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 227 of file engineTime.C.

void readDict (  )  [virtual]

Read the control dictionary and set the write controls etc.

Reimplemented from Time.

Definition at line 95 of file engineTime.C.

Referenced by engineTime::read().

Here is the caller graph for this function:

bool read (  )  [virtual]

Read the controlDict and set all the parameters.

Reimplemented from Time.

Definition at line 103 of file engineTime.C.

References engineTime::readDict().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd