~ubuntu-branches/ubuntu/precise/flightgear/precise

« back to all changes in this revision

Viewing changes to src/FDM/JSBSim/models/propulsion/FGPiston.h

  • Committer: Bazaar Package Importer
  • Author(s): Ove Kaaven
  • Date: 2011-01-30 15:46:35 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110130154635-rlynmg9n5hzxq5xe
Tags: 2.0.0-3
* Recommend fgfs-aircraft-base and fgfs-models-base.
  Closes. #610276.
* Added note about scenery SharedModels.tgz to README.Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 Author:       Jon S. Berndt
5
5
 Date started: 09/12/2000
6
6
 
7
 
 ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) --------------
 
7
 ------------- Copyright (C) 2000  Jon S. Berndt (jon@jsbsim.org) --------------
8
8
 
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41
41
 
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"
45
45
 
46
46
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47
47
DEFINITIONS
67
67
@code
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>
96
103
</piston_engine>
97
104
@endcode
98
105
 
116
123
      some way of getting the boost control cutout lever position (on or off)
117
124
      from FlightGear first.
118
125
 
 
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
 
129
 
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
184
195
  /// Destructor
185
196
  ~FGPiston();
186
197
 
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);
189
200
 
190
201
  double Calculate(void);
191
202
  double GetPowerAvailable(void) {return PowerAvailable;}
205
216
  double getRPM(void) {return RPM;}
206
217
 
207
218
protected:
208
 
  double ThrottlePos;
209
 
 
 
219
  double ThrottleAngle;
210
220
 
211
221
private:
212
222
  int crank_counter;
213
223
 
214
 
  double BrakeHorsePower;
 
224
  double IndicatedHorsePower;
 
225
  double PMEP;
 
226
  double FMEP;
215
227
  double SpeedSlope;
216
228
  double SpeedIntercept;
217
229
  double AltitudeSlope;
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
 
258
 
245
259
 
246
260
  FGTable *Lookup_Combustion_Efficiency;
247
 
  FGTable *Power_Mixture_Correlation;
248
261
  FGTable *Mixture_Efficiency_Correlation;
249
262
 
250
263
  //
252
265
  //
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
 
285
 
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
288
316
 
289
317
  //
290
318
  // Inputs (in addition to those in FGEngine).
291
319
  //
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;
299
327
  int Magnetos;
300
328
 
301
 
 
302
329
  //
303
330
  // Outputs (in addition to those in FGEngine).
304
331
  //
305
332
  double rho_air;
306
333
  double volumetric_efficiency;
307
 
  double suction_loss;
 
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;
312
338
  double HP;
313
339
  double combustion_efficiency;
314
340
  double ExhaustGasTemp_degK;
317
343
  double CylinderHeadTemp_degK;
318
344
  double OilPressure_psi;
319
345
  double OilTemp_degK;
 
346
  double MeanPistonSpeed_fps;
320
347
 
321
348
  void Debug(int from);
322
349
};