Skip to content

GunnsDriveShaftSpotter

joeval920 edited this page Aug 31, 2026 · 7 revisions

Background

This GUNNS Spotter class implements a drive shaft, used to couple a GunnsGasTurbine to a GunnsGasFan. Any number of turbines and fans can be attached to the shaft, which must be done during a call to the addImpeller() function.

simobj.network.fluid.driveShaft.addImpeller(simobj.network.fluid.compressor)
simobj.network.fluid.driveShaft.addImpeller(simobj.network.fluid.turbine)

The drive shaft model sums the external torques of all objects attached to it, then calculates its shaft speed. This speed is then imposed on all of the connected impellers (turbine and compressor/fan).

The spotter also makes three power calculations, based on the enthalpies into and out of each turbomachine. These variables are simply outputs that can be delivered to an external model calculating electricity generation, if needed.

mPowerOutTurb = ηturb ṁ (hturb,out - hturb,in)
mPowerInFan = ṁ (hcomp,in - hcomp,out)
mPowerExcess = mPowerOutTurb - mPowerInFan

How To Use in GunnsDraw

You'll find this spotter in the gunns/draw/libraries/GUNNS_Spotters.xml shape library. Because it is a spotter, the GunnsDriveShaftSpotter doesn't have port connections to nodes or links in the drawing. The associated gas and fan models must be added to the drive shaft with an external call to addImpeller().

Screenshot 2026-08-31 at 4 13 28 PM

Class:

Path to the link object located here: aspects/fluid/conductor/GunnsDriveShaftSpotter

ConstructorArgs:

This spotter needs no ConstructorArgs.

Configuration Data Parameters:

  • frictionConstant (default 0 N*m/rpm): This is the dynamic friction torque constant. The friction resisting the torque is equivalent to this constant times the rotational speed of the shaft.
  • frictionMinSpeed (default 0 rpm): This is the minimum speed for dynamic friction. If the current rotational speed of the shaft is below this minimum value, then the friction calculation will use this value instead (i.e., friction torque = frictionConstant * speefrictionMinSpeed). Therefore the friction just becomes constant at motor speeds below this minimum, to avoid the motor taking forever to stop.
  • inertia (default 0 kg*m2): This is the inertia of the drive shaft system. A higher inertia increases the time needed to accelerate or decelerate the shaft speed. A higher inertia can help with stability.

Input Data Parameters:

  • motorSpeed (default 0 rpm): This is the initial rotational speed of the shaft.

Common Problems:

  • The coupling of the compressor's and turbine's spin speeds makes the fluid network dangerously unstable. Before imposing a shared drive shaft to the network's compressor(s) and turbine(s), it is recommended to estimate the steady state impeller speed manually.
    • Turn off any input to the compressor and turbine motor speeds.
    • In TrickView or input file, set turbine.mMotorSpeed to the expected steady-state RPM value. Read the value of turbine.mImpellerTorque in N*m.
    • In TrickView or input file, set compressor.mMotorSpeed to the expected steady-state RPM value. Read the value of compressor.mImpellerTorque in N*m.
    • Compare the two torque values. If they do not balance (i.e., do not sum to zero) then the steady-state RPM will vary from your target value. If too far apart, the network may go unstable.
    • Adjust the two mMotorSpeed values (in sync) to see where the torques are balanced. If this new speed value is not acceptable, tune the configuration data for either the compressor or turbine to increase or decrease the resulting shaft torque.

References:

Clone this wiki locally