How does KIVA4 calculate piston location, with and without wrist pin offsets?

Acknowledgements to Mike Bergin (ERC) and Dick Steeper (Sandia Nat'l lab) for their assistance with this page.

On this page discussion about piston location without a wrist pin offset is given first, followed by a discussion about piston location with an offset.  Note that KIVA4 must be (slightly) modified to calculate piston location with a wrist pin offset.

zpistn is the KIVA4 variable name for piston location in the z direction.  The calculation for zpistn is explained with the aid of the three images below.  The left-most image shows the piston at top-dead-center (TDC).  Since there is no wrist-pin-offset, the main bearing, crank pin and wrist pin are all inline at TDC.  The crank throw radius is given as 1/2 * Stroke, the connecting rod length is shown (also given as conrod) and the crank rotation is counter-clockwise in this example.

The middle image shows the crank throw position after rotation through an angle, θr. For this middle image it is assumed that the connecting rod maintains its vertical orientation during travel.  Accounting just for crank rotation the piston will have moved down (1/2 * Stroke - 1/2 * Stroke*cos(θr)), as depicted in the image. To account for full piston travel over θr the wrist pin must be brought back to its line of travel, i.e., it must be brought vertical with the main bearing, as is demonstrated in going from the middle to right images.  The associated downward piston travel is (conrod - sqr), as depicted in the image.

Therefore, the total piston travel over θr is

del = ½ Stroke - ½ Stroke * cos(θr)  + conrod – sqr

In KIVA4, zpistn is calculated as

zpistn = stroke - del + zpbot

where zpbot is the bottom-most z location when the piston is at bottom-dead-center (BDC).  Note that zpbot is typically 0.0.  Entering values for θr of 0 and 180 crank deg., stroke = 10, conrod = 15, yields these results:

θr = 0:
sqr = 15
del = 1/2 * 10 - 1/2 * 10 * cos(0) + 15 - 15 = 5 - 5 + 15 - 15 = 0.0
zpistn = 10 - 0 + 0 = 10.

θr = 180:
sqr = 15
del = 1/2 * 10 - 1/2 * 10 * cos(180) + 15 - 15 = 5 + 5 + 15 - 15 = 10.0
zpistn = 10 - 10 + 0 = 0.

Therefore, the total piston travel, [ zpistn(θr=0) - zpistn(θr=180) ], is equal to the stroke.

Next consider a wrist-pin-offset (below image).  Now, when the connecting rod is vertical it is not inline with the main bearing as it was in the zero offset case. (The zero wrist-pin-offset case is in gray.)  At this time a few notes and definitions regarding TDC and BDC for offset pistons are appropriate. These definitions hold for zero and non-zero offsets. 1. TDC is the crank angle when the crank throw is vertical upward. 2. BDC is the crank angle when the crank throw is vertical downward. 3. TDCpiston is the crank angle when the piston is at its highest point in the cycle. 4. BDCpiston is the crank angle when the piston is at is lowest point in the cycle. Notes: 1. For zero offset, TDC = TDCpiston and BDC = BDCpiston. 2. For non-zero offset neither equality holds. 3. Neither the crank nor the piston are at TDC or BDC in this image. 4. TDCpiston occurs when the crank throw and connecting rod are collinear and point in the same direction. 5. BDCpiston occurs when the crank throw and connecting rod are collinear and point in opposite directions. 6. Minimum in-cylinder volume occurs at TDCpiston. 7. Maximum in-cylinder volume occurs at BDCpiston. 8. Assuming counter-clockwise rotation, TDCpiston occurs earlier than TDC and BDCpiston occurs earlier than BDC.

Using a similar approach to that above, consider the zpistn change in two steps.  The first step (middle image) accounts for the change in piston location due to crank rotation, θr.  Just as in the zero offset case, this change equals ( 1/2 * Stroke - 1/2 * Stroke * cos(θr) ) as is depicted in the image below. What differs from a non-zero offset is now, when bringing the wrist pin to its rightful location it is not brought in line with the main bearing, but instead it is brought in line with its line of travel, which is offset from the main bearing (see right image).  Therefore, in the calculation of piston height, what differs from the zero offset case is the calculation of sqr.  Plugging in the same numbers as used in the above example and assigning offset = -1.0 yields,

θr= 0.0:
sqr = sqrt( 15^2 - (0 - 1.0)^2 ) = 14.97
del = 1/2 * 10 - 1/2 * 10 * cos(0) + 15 - 14.97 = 5 - 5 + 15 - 14.97 = 0.033
zpistn = 10 - 0.033 + 0 = 9.967

θr = 180.0:
sqr = sqrt( 15^2 - (0 - 1.0)^2 ) = 14.97
del = 1/2 * 10 - 1/2 * 10 * cos(180) + 15 - 14.97 = 10.033
zpistn = 10 - 10.033 + 0 = -0.033

The difference in piston location between θr=0 and θr=180 is still the stroke (9.967 - (-0.033) = 10).  This is because the crank pin location changed by 10 between θr=0 and θr=180 and the piston has a fixed kinematic relationship to the crank via the connection rod.  But, this does not mean that the total piston travel is still equal to the stroke, as will be explained next.

The graph below compares the in-cylinder volume vs. crank angle for an engine, first neglecting, then accounting for wrist-pin-offset.  The engine is an automotive research engine at Sandia Nat'l Laboratories.  Engine specifications include conrod = 16.67 cm, stroke = 9.525 cm, wrist-pin-offset = -1.6 cm.  The actual offset is -0.16 cm, but the larger value was used to exaggerate the wrist-pin-offset effect. Note that: 1. A negative offset phases the volume change earlier in crank angle space. 2. Compression ratio increases with offset (piston travels farther between BDCpiston and TDCpiston). 3. Minimum volume (TDCpiston) does not occur at TDC for the offset case. 4. Maximum volume (BDCpiston) does not occur at BDC for the offset case. 5. The net volume change between TDC and BDC are the same for both cases.
 Volume, cm3, at various crank angles Crank Angle @ minimum volume (TDCpiston) Crank Angle @ maximum volume (BDCpiston) Minimum volume Maximum volume CR No offset 0 180 65.54 695.82 10.62 Offset -4 171 64.43 698.39 10.84
Values of interest are given in the table.  Note that the crank angles of minimum and maximum volume are not symmetric in crank angle space.

In conclusion, when using realistic wrist-pin-offset values, which are much smaller than the example value used here, changes in piston location and volume are barely noticeable in graphs like those presented here.  But even though the differences are small, accounting for wrist-pin-offset is important, because offset can cause significant effects, as in the calculation of IMEP for example.  With high rates of heat release IMEP can vary by several percent when an offset is added.  This is because IMEP is sensitive to the rate of change in volume with respect to crank angle, which goes to zero at TDCpiston. Therefore, the modeler is encouraged to include the offset in simulations, because the better the model represents the engine, the better the results will be.

Besides reading the wristpin value correctly and making it available for calculations, KIVA4 requires two subroutines to be modified for wrist-pin-offset calculations, adjpistn.f and piston.f.  Modifications for both routines are to add "-wristpin" to the hrs calculation (see below).  wristpin units are cm.

hrs=0.5*stroke*sin(thetr)-wristpin

IMPORTANT NOTE:  Subroutine adjpistn.f does require more modifications than the one mentioned above. The modifications are too extensive for this FAQ, but can be made available upon request.

Click to play or download an animation comparing piston motion for no offset (left side) to offset = -1.6 cm cases.  Output is every crank angle degree from -180 to +180 crank degrees.  Click to play or download the same animation over the limited crank angle range from TDCpiston to BDCpiston.  The reference for this site is www.erc.wisc.edu/~hessel