YASim's Jet Engines
By Gary "Buckaroo" Neely
The good news is that Flightgear's YASim jet engine simulation is much easier to set up and somewhat easier to tune than piston-driven propeller engines. The internal code for a jet engine is simpler than propeller engines, so it's easier to follow and understand what each element is doing. Simplicity, like complexity, comes with a cost, and I'll address some of the issues and suggest some work-arounds at the end of this guide.
A typical YASim jet engine configuration looks like this:
<jet x="-33.757" y="2.7" z="0.687" mass="4567" thrust="20694" exhaust-speed="1555" egt="625" tsfc="0.518" n1-idle="30" n2-idle="60" n1-max="99.2" n2-max="102.5" epr="2.12"> <actionpt x="-35.0" y="2.7" z="0.687"/> <control-input axis="/controls/engines/engine[0]/throttle-fdm" control="THROTTLE"/> <control-input axis="/controls/engines/engine[0]/reverser" control="REVERSE_THRUST"/> <control-output prop="/surface-positions/reverser-norm[0]" control="REVERSE_THRUST"/> <control-speed control="REVERSE_THRUST" transition-time="2"/> </jet>
There are a few other interesting options like afterburners which I'll cover in this guide.
Like propeller engines, each jet engine should have its own engine definition. If your aircraft has two jet engines, you'll have two <jet> definitions, with their engine ID numbers corrresponding to the order of definition.
Jet Basics
Before configuring your YASim jet engines, you'll need to gather some data about the engine:
maximum dry or military thrust
maximum wet thrust (thrust with full afterburner) (optional)
exhaust gas temperature at takeoff
engine pressure ratio at takeoff
rotor speed at idle (n1 idle)
maximum rotor speed (n1 max)
compressor speed at idle (n2 idle)
maximum compressor speed (n2 max)
engine weight in pounds
the approximate location of the engine mass
the approximate location where thrust is applied
the direction of thrust (optional)
Most of these details are not too hard to find from engine specifications. I've had good luck finding data from published service or overhaul records. If you can't find exactly what you need, try to find information for similar components for other aircraft. A good estimate is better than a wild guess or numbers taken from another unrelated YASim FDM.
Any jet engine definition is likely to have these elements:
<jet ...> <actionpt ... /> <control-input ... control="THROTTLE"/> </jet>
Many jet engines will have a thrust-reversing mechanism, and military jet engines will often have afterburner controls as well. Let's look at the jet engine elements and their possible attributes and controls in detail.
The Jet Element
Most attributes for jet engines are optional. All you're required to populate are the engine location, the mass, and thrust. In practice, however, most should be populated with values. Refer to the above example for a typical case.
The jet element must contain the physical location (ie, center of mass) of the engine expressed as x, y, and z coordinate attributes. Remember the YASim coordinate system: X axis is forward, Y is left, and Z is up. Probably you'll have to estimate this location, unless you have really good engineering data for the aircraft. Lacking hard data, try to find a cut-away diagram showing the actual engine position within the fuselage or a nacelle and make a guestimate for the center of mass.
For mass, enter the weight of the jet engine in pounds.
Let's look at the other engine attributes.
Thrust Ratings
Thrust may be declared using a single thrust attribute. If the engine has afterburner capability, a second attribute is also used. If thrust can be reversed, a third attribute can be used:
thrust
afterburner (optional, defaults to 0)
reverse (optional, defaults to 0.2)
For simple thrust, find the engine's maximum rated no-afterburner thrust and enter that for thrust attribute. If the engine uses an afterburner, find the total afterburner or wet thrust and enter that for the afterburner attribute. This number will of course be considerably greater than the no-afterburner dry or military thrust.
In YASim, afterburner thrust creates a power ratio that is added to normal thrust after being scaled by a reheat control: thrust = thrust * (1 + reheat * (afterburner/thrust - 1)), where the reheat control varies from 0 to 1. The reheat control is a throttle on the amount of fuel being dumped into the exhaust stream. I discuss engine controls at the end of this guide.
As you might expect, using afterburners radically affects fuel consumption, consuming additional fuel at the rate of 3.5 times the afterburner/thrust factor at full reheat. Unfortunately the fuel consumption rate is set in the YASim code and can't be tuned.
Reverse is a scalar applied to thrust when reversers are engaged. For example, using the default 0.2 setting, reverse thrust is 0.2 * forward thrust. If you know how much reverse thrust the engine can produce, you can find a good reverse value by calculating reverse_thrust/thrust.
Exhaust Speed
Exhaust speed is the air leaving the turbine. (Not the bypass air leaving the fan in turbofan engines.)
exhuast-speed (defaults to 1555)
Exhaust speed may be difficult to find. The default value is 1555 knots (800m/s) and represents a somewhat early turbojet. High-bypass turbofan engines will have significantly lower exhaust speeds. As a rough guess, try numbers around 1000 knots (500m/s) for turbofans. For modern afterburning supersonic military engines, exhaust will likely be higher than the default. A high-performance pure turbojet might be very much higher. It's likely that you will have to experiment to get the behavior you want.
In YASim, maximum thrust is scaled by (1 - V0/Ve), where V0 is the velocity of the airstream and Ve is the exhaust velocity. So if the aircraft is moving at 250 kts and Ve is 800 kts, then maximum thrust would be factored by 0.6875. Essentially, thrust diminishes with airspeed. If you wanted to do Mach 2.2 at FL300, you'd be doing about 1300 kts, so Ve would have to greatly exceed 1300 or you'd never be able to accelerate to that speed in a reasonable time let alone maintain that speed.
Force equals mass times acceleration, so in a real turbofan, the lowering of exhaust speed is offset by the larger mass of air moved by the fan. Potential airspeeds are lower for a turbofan (assuming no afterburning) but efficiency at those speeds is significantly improved, yielding lower tsfc numbers and higher bonuses for airline CEO's. In my opinion, YASim doesn't represent this well. If you lower the exhaust speed from the default value, the difference between the solver's lift and drag results will increase. This is YASim compensating for what it believes is a weaker engine. This is not necessarily reasonable if the engine has a greater bypass ratio to offset the lower turbine exhaust speed. Thrust is thrust, but I think YASim could benefit from a bypass ratio attribute for turbofans, compensating for lesser exhaust speeds with the effect peaking at some specified optimum airspeed.
N1 and N2
Most jet engines have a low-pressure rotor (often called a spool) and a high-pressure rotor. Part of the N1 spool is the big fan you can often see at the front of a jet engine. The components of the N2 spool are internal. Rather than use RPM, their speeds are represented by a value compared against a nominal 100% maximum-power rating. These values are N1 and N2 respectively. Depending on the engine manufacturer, N1 is often used as the rating for thrust (others use EPR). N2 is often used on engine start-up to indicate when the engine is sufficiently spooled-up to being introducing fuel. In YASim these are represented by:
n1-idle (defaults to 55)
n2-idle (defaults to 73)
n1-max (defaults to 102)
n2-max (defaults to 103)
Information about N1 and N2 can be somewhat hard to find, particularly minimums, unless you have a flight manual. If an attribute is not provided, YASim will default to the values shown. Real values vary considerably from the defaults, especially for more modern jet engines and particularly with regard to minimums. If you are planning to do a comprehensive engine simulation that includes start-up procedures, you really need to find the true values.
YASim thrust is tied to the N1 value. Some simpler engines use a single rotor and a few use three rotors. YASim doesn't directly allow you to simulate these cases, though you could fake it with some Nasal scripting, as long as it's understood that thrust is tied to N1's value.
Engine Pressure Ratio
Engine pressure ratio (EPR, pronounced ee-per, I think) is the total pressure ratio across the engine-- the pressure of air leaving the engine is greater than the pressure of air ingested.
epr (defaults to 3)
In YASim, a glance at the code suggests EPR is doing something important and interesting, but closer inspection suggests it's used only for calculating an instrument response for EPR; it appears that it could be factored out of other uses, which makes me wonder if the code could be simplified. In any case, it has no significant effect on solver results.
Try to find your engine's maximum takeoff EPR and use that value. If you lack a manual, you might be able to find this by examining instrument readouts, particularly if the aircraft uses analog gauges. Whatever you do, don't set EPR to 1, as this gets into the division by 0 realm and makes the solver freak-out. Besides, a value of 1 in real life would mean your engine isn't doing anything but passing ingested air. There's a bad joke lurking there, but let's move on to EGT.
Exhaust Gas Temperature
This is the exhaust gas temperature in degrees Kelvin, measured at takeoff.
egt (defaults to 1050)
It's unfortunate that the documentation doesn't make the units clear, since YASim outputs the resulting EGT in degrees Fahrenheit. The default value is 1050 K (777 C).
EGT has no effect on the solver. It's simply a maximum temperature that is linearly interpreted from the atmosphere temperature as EPR rises. It is used only for instrumentation output: egt-degf.
Thrust-Specific Fuel Consumption
TSFC is the ratio of the engine fuel mass flow rate to the amount of thrust produced, in other words, a measure of efficiency.
tsfc (defaults to 0.8)
In YASim, TSFC is used to compute fuel flow. Usually you can pull this number from a reference. I believe the units are (Kg/Hr)/N, as internally YASim converts thrust to Newtons and fuel flow in kg/s. As long as thrust and fuel are measured in the same units, it shouldn't matter since TSFC is a ratio. Modern turbofans will have TSFC values much lower than the default.
This number is not terribly important to YASim. Use it to make a rough estimate at fuel consumption. Try to get real fuel consumption data from flight profiles and conduct test flights to compare the simulated numbers against real data. You can use TSFC to adjust the fuel consumption, or you can modify the Nasal script that handles fuel consumption for YASim aircraft. For more information about the latter, see the section of my guide that concerns YASim fuel tanks.
Spool Time
Spool-time controls the response of the engine to throttle changes. Essentially, it's an inertia delay while the rotors accellerate or decellerate.
spool-time (defaults to 4)
The documentation reads, "Time, in seconds, for the engine to respond to 90% of a commanded power setting." So this is not the maximum time required to go from idle to maximum thrust, it is the time time to respond to /any/ power setting change. In my opinion this is not an optimal attribute. It should be the time required to spool-up from idle to maximum thrust. Older jet engines responded fairly quickly to power changes at cruise settings, but going to or from idle could take a while. Modern engines apparently have much better response times, but there may still be differences, and YASim spool-time won't let you represent that. Do not set spool-time to 0.
Action Point and Direction Subelements
The jet element should contain an action point subelement with attributes of x, y, z:
<actionpt x="-35.0" y="2.7" z="0.687"/>This is the point on the aircraft where the thrust is actually applied. I believe it defaults to the engine location, but I am not certain. In any case, you should specify an action point as it will likely not be at the exact center of mass. What I do is find a diagram of the engine and locate the approximate position of the thrust bearings and use that location as my action point.
The direction subelement is optional. If used, this is a vector to offset the thrust from the usual forward, station-line vector. For example, if thrust were offset 3 degrees up from the station-line, you would include the following subelement in your propeller definition:
<dir x="0.9986" y="0.0" z="0.05234" />
Here, most of the thrust is forward in the x axis, but a small fraction is diverted upward along the z axis.
Both action point and direction subelements should be located between the <jet></jet> tags. For most situations you will not need a direction element. It will default to x="1", y="0", z="0".
Control Subelements
Control-input elements allow you to map a Flightgear property to a YASim value, allowing you to channel user input to be used for that YASim value. In YASim, the channel is called an "axis". Control-ouput elements allow you to create a Flightgear property that contains the current value of a YASim control channel or axis. This is particularly helpful for animations. You are also able to control the rate-of-change of a control channel through use of the control-speed element. Control subelements should be located between the <jet></jet> tags.
Now let's look at the possible controls for a YASim jet engine:
<control-input axis="/controls/engines/engine[0]/throttle" control="THROTTLE"/> <control-input axis="/controls/engines/engine[0]/reverser" control="REVERSE_THRUST"/> <control-input axis="/controls/engines/engine[0]/reheat" control="REHEAT"/> <control-input axis="/controls/engines/engine[0]/vector-angle" control="VECTOR"/>
You will always have a throttle control, but the others are optional. All controls should be placed between the <jet></jet> tags. Make sure the engine index number matches the correct engine being defined. Axis property names are yours to define. Make sure they are the same property names used in your animations and keyboard controls, etc.
The THROTTLE and REHEAT channels allow an input range of 0 to 1. REVERSE_THRUST input should be 0 or 1 (boolean false/true). VECTOR allows an input of +/-degrees.
I said earlier that control-outputs are useful for animations. Say you want to display the position of thrust reversers on the aft end of an engine nacelle based on the status of reverse thrust. First, you would map the control channel to a Flightgear property
<control-output prop="/surface-positions/reverser-norm[0]" control="REVERSE_THRUST"/>
In this case, the current value of the YASim REVERSE_THRUST channel is copied to the output property, which YASim creates for you. Your animations can then reference this property, controlling the location of the model object based on the property value.
To make this animation more fluid rather than an on-off position, you could add a control-speed element to the control:
<control-speed control="REVERSE_THRUST" transition-time="2"/>
In this case, it would take 2 seconds for the REVERSE_THRUST channel to transition from 0 to 1. Note that it's likely the reverser will be functionally engaged given any input value other than 0.
YASim Jet Issues
Thrust and Standard Temperatures
Engine thrust values are rated at certain test environment conditions, usually sea level and some standard temperature. The rating temperature may not be the same as YASim's standard atmosphere temperature of 25C. If the standards are different, you could ignore it, especially if the difference is small, but you could also calculate the difference in thrust. Various online tools and sites are helpful in doing this. I did this for my MD-81 model, but it was a while back and I can't recall which sites and tools I used to calculate the adjusted thrust value. Yeah, OK, I'm useless. I'll revise this with notes if I ever remember how I did it.
Engine Idling
In my experience, YASim jet engines idle much too low, often sitting at near 0 thrust on idle. This also means fuel flow at idle drops to almost nothing which is terribly unrealistic given that airlines go to great lengths to reduce engine use on the ground to save on fuel expenses-- starting engines only when necessary, sometimes operating on one engine until ready for takeoff, etc.
There are at least two methods to deal with this. One method is to set an input range on the throttle control. For example:
<control-input axis="/controls/engines/engine[0]/throttle" control="THROTTLE" src0="0" src1="1" dst0="0.07" dst1="1"/>
This maps the input range of 0 to 1 to a THROTTLE input range of 0.07 to 1 on the YASim side. So when the throttle appears to be sitting on 0 or full retarded, it is actually sending a value of 0.07, delivering a small but significant amount of thrust, and perhaps more importantly, a realistic idle fuel consumption. The value of 0.07 is used in my MD-81 model and was calculated using figures from the flight manual.
A more flexible but complex method to handle this is to maintain two properties, one for the YASim throttle control property, and another for user control and animation feedback. A Nasal listener function then watches for changes to the user/animation property. Upon a change, the listener performs an interpolation on the property similar to the control-input interpolation above, and copies the result to the property used to control the YASim THROTTLE channel. This is the method used in the MD-81 model. It has the advantage of being subject to other factors if desired, and the interpolation range can be changed during the simulation.
Engine Startup/Shutdown
YASim jet engines have no real startup/shutdown methods. As long as they have fuel, they are running. The controlling parameter is the engine "out-of-fuel" boolean value:
/engines/engine[n]/out-of-fuel
The engine will always run as long as this value is false. Toggle the fuel supply off, and the engine stops running. Toggle the fuel supply on, and the engine is suddenly running again. YASim has no provisions for anything fancier than that.
Obviously this is not optimal, but while jet engine startup is not usually complex it does have a few procedures that would be difficult for YASim to simulate sufficiently broadly for most applications. A typical (simplified) startup procedure might go something like this:
provide a startup power source (electric or pneumatic)
engage necessary fuel pumps
set the igniter switch
enable the starter
watch for N2 to rise to some required % range
open fuel valve
watch for N2 to rise to another required % range
hope nothing nasty happens
disengage the starter
In addition to these things, it's necessary to provide instrumenation results for engine properties that YASim isn't providing when the engine isn't running. For example, until the engine is running, YASim will not report N1 and N2 at any values other than 0%, but in reality, once a starter is engaged N1 and especially N2 should be reporting non-0% values. This means the developer has to intercede and provide meaningful values during the pre-ignition startup stages.
For an example of a complete and by-the-book startup procedure and implementation, feel free to have a look at my MD-81 model.
Jet Engines as Black Boxes
Since YASim's jet engine simulation is somewhat simplistic, it can lead to arguments over whether YASim can realistically simulate this or that. For example, the SR-71 Blackbird at cruise speeds actually gets most of its thrust from inlet air that bypasses the turbine and is burned, effectively a ramjet. The turbine itself serves as a kind of pump to keep the process going. YASim has no provisions to simulate this. Nor does it balance fan bypass airmass vs. exhaust speeds, or the effects of afterburners on exhaust speeds and temperatures. These issues can get ugly fast.
The solution, at least for speeds that are transsonic or less, is to treat the engine as a black box that makes thrust at a certain point and vector on the airframe and not worry about how it works. Tune the performance and behavior as best you can, and don't worry about the mechanics.
Supersonic Issues
A YASim FDM can be made to be realistic or at least reasonable at speeds up to and including the transsonic region. YASim does not appear to have been designed to account for supersonic regions. Nothing says you can't design an FDM that flies in those realms, but the simulation becomes less ideal. I address YASim and supersonic issues elsewhere in my guide.