4
4
Author: Jon S. Berndt
5
5
Date started: 09/12/2000
7
------------- Copyright (C) 2000 Jon S. Berndt (jsb@hal-pc.org) --------------
7
------------- Copyright (C) 2000 Jon S. Berndt (jon@jsbsim.org) --------------
9
9
This program is free software; you can redistribute it and/or modify it under
10
10
the terms of the GNU Lesser General Public License as published by the Free Software
40
40
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42
42
#include "FGEngine.h"
43
#include <math/FGTable.h>
44
#include <input_output/FGXMLElement.h>
43
#include "math/FGTable.h"
44
#include "input_output/FGXMLElement.h"
46
46
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68
68
<piston_engine name="{string}">
69
69
<minmp unit="{INHG | PA | ATM}"> {number} </minmp> <!-- Depricated -->
70
<maxmp unit="{INHG | PA | ATM}"> {number} </maxmp> <!-- Depricated -->
70
<maxmp unit="{INHG | PA | ATM}"> {number} </maxmp>
71
71
<displacement unit="{IN3 | LTR | CC}"> {number} </displacement>
72
<bore unit="{IN | M}"> {number} </bore>
73
<stroke unit="{IN | M}"> {number} </stroke>
74
<cylinders> {number} </cylinders>
75
<compression-ratio> {number} </compression-ratio>
72
76
<sparkfaildrop> {number} </sparkfaildrop>
73
77
<maxhp unit="{HP | WATTS}"> {number} </maxhp>
74
78
<cycles> {number} </cycles>
76
80
<maxrpm> {number} </maxrpm>
77
81
<maxthrottle> {number} </maxthrottle>
78
82
<minthrottle> {number} </minthrottle>
83
<bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsfc>
84
<volumetric-efficiency> {number} </volumetric-efficiency>
79
85
<numboostspeeds> {number} </numboostspeeds>
80
<bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsft>
81
<volumetric_efficiency> {number} </volumetric_efficiency>
82
86
<boostoverride> {0 | 1} </boostoverride>
87
<boostmanual> {0 | 1} </boostmanual>
83
88
<ratedboost1 unit="{INHG | PA | ATM}"> {number} </ratedboost1>
84
89
<ratedpower1 unit="{HP | WATTS}"> {number} </ratedpower1>
85
90
<ratedrpm1> {number} </ratedrpm1>
93
98
<ratedrpm3> {number} </ratedrpm3>
94
99
<ratedaltitude3 unit="{FT | M}"> {number} </ratedaltitude3>
95
100
<takeoffboost unit="{INHG | PA | ATM}"> {number} </takeoffboost>
101
<air-intake-impedance-factor> {number} </air-intake-impedance-factor>
102
<ram-air-factor> {number} </ram-air-factor>
116
123
some way of getting the boost control cutout lever position (on or off)
117
124
from FlightGear first.
126
- BOOSTMANUAL - whether a multispeed supercharger will manually or
127
automatically shift boost speeds. On manual shifting the boost speeds
128
is accomplished by controling propulsion/engine/boostspeed
119
130
- The next items are all appended with either 1, 2 or 3 depending on which
120
131
boost speed they refer to, eg RATEDBOOST1. The rated values seems to have
121
132
been a common convention at the time to express the maximum continuously
187
string GetEngineLabels(string delimeter);
188
string GetEngineValues(string delimeter);
198
std::string GetEngineLabels(const std::string& delimiter);
199
std::string GetEngineValues(const std::string& delimiter);
190
201
double Calculate(void);
191
202
double GetPowerAvailable(void) {return PowerAvailable;}
242
254
const double calorific_value_fuel; // W/Kg (approximate)
243
255
const double Cp_air; // J/KgK
244
256
const double Cp_fuel; // J/KgK
257
const double standard_pressure; //Pa
246
260
FGTable *Lookup_Combustion_Efficiency;
247
FGTable *Power_Mixture_Correlation;
248
261
FGTable *Mixture_Efficiency_Correlation;
253
266
double MinManifoldPressure_inHg; // Inches Hg
254
267
double MaxManifoldPressure_inHg; // Inches Hg
268
double MaxManifoldPressure_Percent; // MaxManifoldPressure / 29.92
255
269
double Displacement; // cubic inches
270
double displacement_SI; // cubic meters
256
271
double MaxHP; // horsepower
257
272
double SparkFailDrop; // drop of power due to spark failure
258
273
double Cycles; // cycles/power stroke
259
274
double IdleRPM; // revolutions per minute
260
275
double MaxRPM; // revolutions per minute
276
double Bore; // inches
277
double Stroke; // inches
278
double Cylinders; // number
279
double CompressionRatio; // number
280
double Z_airbox; // number representing intake impediance before the throttle
281
double Z_throttle; // number representing slope of throttle impediance
282
double PeakMeanPistonSpeed_fps; // ft/sec speed where intake valves begin to choke. Typically 33-50 fps
283
double RatedMeanPistonSpeed_fps; // ft/sec derived from MaxRPM and stroke.
284
double Ram_Air_Factor; // number
261
286
double StarterHP; // initial horsepower of starter motor
262
287
int BoostSpeeds; // Number of super/turbocharger boost speeds - zero implies no turbo/supercharging.
263
288
int BoostSpeed; // The current boost-speed (zero-based).
264
289
bool Boosted; // Set true for boosted engine.
290
int BoostManual; // The raw value read in from the config file - should be 1 or 0 - see description below.
291
bool bBoostManual; // Set true if pilot must manually control the boost speed.
265
292
int BoostOverride; // The raw value read in from the config file - should be 1 or 0 - see description below.
266
293
bool bBoostOverride; // Set true if pilot override of the boost regulator was fitted.
267
294
// (Typically called 'war emergency power').
284
311
double minMAP; // Pa
285
312
double maxMAP; // Pa
286
313
double MAP; // Pa
287
double BSFC; // brake specific fuel consumption [lbs/horsepower*hour
314
double TMAP; // Pa - throttle manifold pressure e.g. before the supercharger boost
315
double ISFC; // Indicated specific fuel consumption [lbs/horsepower*hour
290
318
// Inputs (in addition to those in FGEngine).
292
320
double p_amb; // Pascals
293
double p_amb_sea_level; // Pascals
321
double p_ram; // Pascals
294
322
double T_amb; // degrees Kelvin
295
323
double RPM; // revolutions per minute
296
324
double IAS; // knots
298
326
bool Magneto_Right;
303
330
// Outputs (in addition to those in FGEngine).
306
333
double volumetric_efficiency;
334
double map_coefficient;
308
335
double m_dot_air;
309
336
double equivalence_ratio;
310
337
double m_dot_fuel;
311
double Percentage_Power;
313
339
double combustion_efficiency;
314
340
double ExhaustGasTemp_degK;