]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGPiston.cpp
Update from JSBSim - fix bugs reported by Gonzalo Peralta with CHT and
[flightgear.git] / src / FDM / JSBSim / FGPiston.cpp
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Module:       FGPiston.cpp
4  Author:       Jon S. Berndt, JSBSim framework
5                Dave Luff, Piston engine model
6  Date started: 09/12/2000
7  Purpose:      This module models a Piston engine
8
9  ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) --------------
10
11  This program is free software; you can redistribute it and/or modify it under
12  the terms of the GNU General Public License as published by the Free Software
13  Foundation; either version 2 of the License, or (at your option) any later
14  version.
15
16  This program is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
19  details.
20
21  You should have received a copy of the GNU General Public License along with
22  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
23  Place - Suite 330, Boston, MA  02111-1307, USA.
24
25  Further information about the GNU General Public License can also be found on
26  the world wide web at http://www.gnu.org.
27
28 FUNCTIONAL DESCRIPTION
29 --------------------------------------------------------------------------------
30
31 This class descends from the FGEngine class and models a Piston engine based on
32 parameters given in the engine config file for this class
33
34 HISTORY
35 --------------------------------------------------------------------------------
36 09/12/2000  JSB  Created
37
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 INCLUDES
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41
42 #include "FGPiston.h"
43 #include "FGPropulsion.h"
44
45 static const char *IdSrc = "$Id$";
46 static const char *IdHdr = ID_PISTON;
47
48 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 CLASS IMPLEMENTATION
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
51
52 FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
53   CONVERT_CUBIC_INCHES_TO_METERS_CUBED(1.638706e-5),
54   R_air(287.3),
55   rho_fuel(800),                 // estimate
56   calorific_value_fuel(47.3e6),
57   Cp_air(1005),
58   Cp_fuel(1700)
59 {
60   string token;
61
62   MinManifoldPressure_inHg = 6.5;
63   MaxManifoldPressure_inHg = 28.5;
64   Displacement = 360;
65   MaxHP = 200;
66   Cycles = 2;
67   IdleRPM = 600;
68
69   Name = Eng_cfg->GetValue("NAME");
70   Eng_cfg->GetNextConfigLine();
71   while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
72     *Eng_cfg >> token;
73     if      (token == "MINMP") *Eng_cfg >> MinManifoldPressure_inHg;
74     else if (token == "MAXMP") *Eng_cfg >> MaxManifoldPressure_inHg;
75     else if (token == "DISPLACEMENT") *Eng_cfg >> Displacement;
76     else if (token == "MAXHP") *Eng_cfg >> MaxHP;
77     else if (token == "CYCLES") *Eng_cfg >> Cycles;
78     else if (token == "IDLERPM") *Eng_cfg >> IdleRPM;
79     else if (token == "MAXTHROTTLE") *Eng_cfg >> MaxThrottle;
80     else if (token == "MINTHROTTLE") *Eng_cfg >> MinThrottle;
81     else cerr << "Unhandled token in Engine config file: " << token << endl;
82   }
83
84   Type = etPiston;
85   crank_counter = 0;
86   EngineNumber = 0;
87   OilTemp_degK = 298;
88   ManifoldPressure_inHg = Atmosphere->GetPressure() * 0.014138; // psf to in Hg
89
90   dt = State->Getdt();
91
92   // Initialisation
93   volumetric_efficiency = 0.8;  // Actually f(speed, load) but this will get us running
94
95   // First column is thi, second is neta (combustion efficiency)
96   Lookup_Combustion_Efficiency = new FGTable(12);
97   *Lookup_Combustion_Efficiency << 0.00 << 0.980;
98   *Lookup_Combustion_Efficiency << 0.90 << 0.980;
99   *Lookup_Combustion_Efficiency << 1.00 << 0.970;
100   *Lookup_Combustion_Efficiency << 1.05 << 0.950;
101   *Lookup_Combustion_Efficiency << 1.10 << 0.900;
102   *Lookup_Combustion_Efficiency << 1.15 << 0.850;
103   *Lookup_Combustion_Efficiency << 1.20 << 0.790;
104   *Lookup_Combustion_Efficiency << 1.30 << 0.700;
105   *Lookup_Combustion_Efficiency << 1.40 << 0.630;
106   *Lookup_Combustion_Efficiency << 1.50 << 0.570;
107   *Lookup_Combustion_Efficiency << 1.60 << 0.525;
108   *Lookup_Combustion_Efficiency << 2.00 << 0.345;
109
110   Power_Mixture_Correlation = new FGTable(13);
111   *Power_Mixture_Correlation << (14.7/1.6) << 78.0;
112   *Power_Mixture_Correlation << 10 <<  86.0;
113   *Power_Mixture_Correlation << 11 <<  93.5;
114   *Power_Mixture_Correlation << 12 <<  98.0;
115   *Power_Mixture_Correlation << 13 << 100.0;
116   *Power_Mixture_Correlation << 14 <<  99.0;
117   *Power_Mixture_Correlation << 15 <<  96.4;
118   *Power_Mixture_Correlation << 16 <<  92.5;
119   *Power_Mixture_Correlation << 17 <<  88.0;
120   *Power_Mixture_Correlation << 18 <<  83.0;
121   *Power_Mixture_Correlation << 19 <<  78.5;
122   *Power_Mixture_Correlation << 20 <<  74.0;
123   *Power_Mixture_Correlation << (14.7/0.6) << 58;
124
125   Debug(0); // Call Debug() routine from constructor if needed
126 }
127
128 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
129
130 FGPiston::~FGPiston()
131 {
132   Debug(1); // Call Debug() routine from constructor if needed
133 }
134
135 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136
137 double FGPiston::Calculate(double PowerRequired)
138 {
139   ConsumeFuel();
140
141   Throttle = FCS->GetThrottlePos(EngineNumber);
142   Mixture = FCS->GetMixturePos(EngineNumber);
143
144   //
145   // Input values.
146   //
147
148   p_amb = Atmosphere->GetPressure() * 48;              // convert from lbs/ft2 to Pa
149   p_amb_sea_level = Atmosphere->GetPressureSL() * 48;
150   T_amb = Atmosphere->GetTemperature() * (5.0 / 9.0);  // convert from Rankine to Kelvin
151
152   RPM = Propulsion->GetThruster(EngineNumber)->GetRPM();
153   //if (RPM < IdleRPM) RPM = IdleRPM;  // kludge
154     
155   IAS = Auxiliary->GetVcalibratedKTS();
156
157     doEngineStartup();
158     doManifoldPressure();
159     doAirFlow();
160     doFuelFlow();
161
162   //Now that the fuel flow is done check if the mixture is too lean to run the engine
163   //Assume lean limit at 22 AFR for now - thats a thi of 0.668
164   //This might be a bit generous, but since there's currently no audiable warning of impending
165   //cutout in the form of misfiring and/or rough running its probably reasonable for now.
166   if (equivalence_ratio < 0.668)
167     Running = false;
168
169   doEnginePower();
170     doEGT();
171     doCHT();
172     doOilTemperature();
173     doOilPressure();
174
175   PowerAvailable = (HP * hptoftlbssec) - PowerRequired;
176   return PowerAvailable;
177 }
178
179 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180 /**
181  * Start or stop the engine.
182  */
183
184 void FGPiston::doEngineStartup(void)
185 {
186   // Check parameters that may alter the operating state of the engine. 
187   // (spark, fuel, starter motor etc)
188   bool spark;
189   bool fuel;
190
191   // Check for spark
192   Magneto_Left = false;
193   Magneto_Right = false;
194   // Magneto positions:
195   // 0 -> off
196   // 1 -> left only
197   // 2 -> right only
198   // 3 -> both
199   if (Magnetos != 0) {
200     spark = true;
201   } else {
202     spark = false;
203   }  // neglects battery voltage, master on switch, etc for now.
204   
205   if ((Magnetos == 1) || (Magnetos > 2)) Magneto_Left = true;
206   if (Magnetos > 1)  Magneto_Right = true;
207
208   // Assume we have fuel for now
209   fuel = !Starved;
210
211   // Check if we are turning the starter motor
212   if (Cranking != Starter) {
213     // This check saves .../cranking from getting updated every loop - they
214     // only update when changed.
215     Cranking = Starter;
216     crank_counter = 0;
217   }
218
219   //Check mode of engine operation
220   if (Cranking) {
221     crank_counter++;
222     if (RPM <= 480) {
223       // Do nothing !! - cranking power output is now handled in the doPower section
224     } else {
225       // consider making a horrible noise if the starter is engaged with
226       // the engine running
227     }
228   }
229   
230   // if ((!Running) && (spark) && (fuel) && (crank_counter > 120)) {
231
232   if ((!Running) && (spark) && (fuel)) {
233   // start the engine if revs high enough
234     if (Cranking) {
235       if ((RPM > 450) && (crank_counter > 175)) {
236         //Add a little delay to startup on the starter
237         Running = true;
238       }
239     } else {
240       if (RPM > 450) {
241         Running = true;
242         //This allows us to in-air start when windmilling
243       }
244     }
245   }
246
247   if ( (Running) && ((!spark)||(!fuel)) ) {
248     // Cut the engine
249     // note that we only cut the power - the engine may continue to
250     // spin if the prop is in a moving airstream
251     Running = false;
252   }
253
254   // And finally a last check for stalling
255   if (Running) { 
256     //Check if we have stalled the engine
257     if (RPM == 0) {
258       Running = false;
259     } else if ((RPM <= 480) && (Cranking)) {
260       // Make sure the engine noise dosn't play if the engine won't
261             // start due to eg mixture lever pulled out.
262       Running = false;
263     }
264   }
265 }
266
267 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268
269 /**
270  * Calculate the nominal manifold pressure in inches hg
271  *
272  * This function calculates nominal manifold pressure directly
273  * from the throttle position, and does not adjust it for the
274  * difference between the pressure at sea level and the pressure
275  * at the current altitude (that adjustment takes place in
276  * {@link #doEnginePower}).
277  *
278  * TODO: changes in MP should not be instantaneous -- introduce
279  * a lag between throttle changes and MP changes, to allow pressure
280  * to build up or disperse.
281  *
282  * Inputs: MinManifoldPressure_inHg, MaxManifoldPressure_inHg, Throttle
283  *
284  * Outputs: ManifoldPressure_inHg
285  */
286
287 void FGPiston::doManifoldPressure(void)
288 {
289   if (Running || Cranking) {
290     ManifoldPressure_inHg = MinManifoldPressure_inHg +
291             (Throttle * (MaxManifoldPressure_inHg - MinManifoldPressure_inHg));
292   } else {
293     ManifoldPressure_inHg = Atmosphere->GetPressure() * 0.014138; // psf to in Hg
294   }  
295 }
296
297 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298 /**
299  * Calculate the air flow through the engine.
300  *
301  * At this point, ManifoldPressure_inHg still represents the sea-level
302  * MP, not adjusted for altitude.
303  *
304  * Inputs: p_amb, R_air, T_amb, ManifoldPressure_inHg, Displacement,
305  *   RPM, volumetric_efficiency
306  *
307  * Outputs: rho_air, m_dot_air
308  */
309
310 void FGPiston::doAirFlow(void)
311 {
312   rho_air = p_amb / (R_air * T_amb);
313   double rho_air_manifold = rho_air * ManifoldPressure_inHg / 29.6;
314   double displacement_SI = Displacement * CONVERT_CUBIC_INCHES_TO_METERS_CUBED;
315   double swept_volume = (displacement_SI * (RPM/60)) / 2;
316   double v_dot_air = swept_volume * volumetric_efficiency;
317   m_dot_air = v_dot_air * rho_air_manifold;
318 }
319
320 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321 /**
322  * Calculate the fuel flow into the engine.
323  *
324  * Inputs: Mixture, thi_sea_level, p_amb_sea_level, p_amb, m_dot_air
325  *
326  * Outputs: equivalence_ratio, m_dot_fuel
327  */
328
329 void FGPiston::doFuelFlow(void)
330 {
331   double thi_sea_level = 1.3 * Mixture;
332   equivalence_ratio = thi_sea_level * p_amb_sea_level / p_amb;
333   m_dot_fuel = m_dot_air / 14.7 * equivalence_ratio;
334   FuelFlow_gph = m_dot_fuel
335     * 3600                      // seconds to hours
336     * 2.2046                    // kg to lb
337     / 6.6;                      // lb to gal_us of kerosene
338 }
339
340 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341 /**
342  * Calculate the power produced by the engine.
343  *
344  * Currently, the JSBSim propellor model does not allow the
345  * engine to produce enough RPMs to get up to a high horsepower.
346  * When tested with sufficient RPM, it has no trouble reaching
347  * 200HP.
348  *
349  * Inputs: ManifoldPressure_inHg, p_amb, p_amb_sea_level, RPM, T_amb, 
350  *   equivalence_ratio, Cycles, MaxHP
351  *
352  * Outputs: Percentage_Power, HP
353  */
354
355 void FGPiston::doEnginePower(void)
356 {
357   ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
358   if (Running) {        
359     double ManXRPM = ManifoldPressure_inHg * RPM;
360         // FIXME: this needs to be generalized
361     Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;
362     double T_amb_degF = (T_amb * 1.8) - 459.67;
363     double T_amb_sea_lev_degF = (288 * 1.8) - 459.67; 
364     Percentage_Power =
365       Percentage_Power + ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
366     double Percentage_of_best_power_mixture_power =
367       Power_Mixture_Correlation->GetValue(14.7 / equivalence_ratio);
368     Percentage_Power =
369       Percentage_Power * Percentage_of_best_power_mixture_power / 100.0;
370     if (Percentage_Power < 0.0)
371       Percentage_Power = 0.0;
372     else if (Percentage_Power > 100.0)
373       Percentage_Power = 100.0;
374     HP = Percentage_Power * MaxHP / 100.0;
375   } else {  
376     // Power output when the engine is not running
377     if (Cranking) {
378       if (RPM < 10) {
379         HP = 3.0;       // This is a hack to prevent overshooting the idle rpm in the first time step
380                     // It may possibly need to be changed if the prop model is changed.
381       } else if (RPM < 480) {
382         HP = 3.0 + ((480 - RPM) / 10.0);  
383         // This is a guess - would be nice to find a proper starter moter torque curve
384       } else {
385         HP = 3.0;
386       }
387     } else {
388       // Quick hack until we port the FMEP stuff
389       if (RPM > 0.0)
390         HP = -1.5;
391       else
392         HP = 0.0;
393     }
394   }
395 }
396
397 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 /**
399  * Calculate the exhaust gas temperature.
400  *
401  * Inputs: equivalence_ratio, m_dot_fuel, calorific_value_fuel, 
402  *   Cp_air, m_dot_air, Cp_fuel, m_dot_fuel, T_amb, Percentage_Power
403  *
404  * Outputs: combustion_efficiency, ExhaustGasTemp_degK
405  */
406
407 void FGPiston::doEGT(void)
408 {
409   double delta_T_exhaust;
410   double enthalpy_exhaust;
411   double heat_capacity_exhaust;
412   double dEGTdt;
413
414   if ((Running) && (m_dot_air > 0.0)) {  // do the energy balance
415     combustion_efficiency = Lookup_Combustion_Efficiency->GetValue(equivalence_ratio);
416     enthalpy_exhaust = m_dot_fuel * calorific_value_fuel * 
417                               combustion_efficiency * 0.33;
418     heat_capacity_exhaust = (Cp_air * m_dot_air) + (Cp_fuel * m_dot_fuel);
419     delta_T_exhaust = enthalpy_exhaust / heat_capacity_exhaust;
420     ExhaustGasTemp_degK = T_amb + delta_T_exhaust;
421     ExhaustGasTemp_degK *= 0.444 + ((0.544 - 0.444) * Percentage_Power / 100.0);
422   } else {  // Drop towards ambient - guess an appropriate time constant for now
423     dEGTdt = (298.0 - ExhaustGasTemp_degK) / 100.0;
424     delta_T_exhaust = dEGTdt * dt;
425     ExhaustGasTemp_degK += delta_T_exhaust;
426   }
427 }
428
429 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
430 /**
431  * Calculate the cylinder head temperature.
432  *
433  * Inputs: T_amb, IAS, rho_air, m_dot_fuel, calorific_value_fuel,
434  *   combustion_efficiency, RPM
435  *
436  * Outputs: CylinderHeadTemp_degK
437  */
438
439 void FGPiston::doCHT(void)
440 {
441   double h1 = -95.0;
442   double h2 = -3.95;
443   double h3 = -0.05;
444
445   double arbitary_area = 1.0;
446   double CpCylinderHead = 800.0;
447   double MassCylinderHead = 8.0;
448
449   double temperature_difference = CylinderHeadTemp_degK - T_amb;
450   double v_apparent = IAS * 0.5144444;
451   double v_dot_cooling_air = arbitary_area * v_apparent;
452   double m_dot_cooling_air = v_dot_cooling_air * rho_air;
453   double dqdt_from_combustion = 
454     m_dot_fuel * calorific_value_fuel * combustion_efficiency * 0.33;
455   double dqdt_forced = (h2 * m_dot_cooling_air * temperature_difference) + 
456     (h3 * RPM * temperature_difference);
457   double dqdt_free = h1 * temperature_difference;
458   double dqdt_cylinder_head = dqdt_from_combustion + dqdt_forced + dqdt_free;
459     
460   double HeatCapacityCylinderHead = CpCylinderHead * MassCylinderHead;
461     
462   CylinderHeadTemp_degK += dqdt_cylinder_head / HeatCapacityCylinderHead;
463 }
464
465 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466 /**
467  * Calculate the oil temperature.
468  *
469  * Inputs: Percentage_Power, running flag.
470  *
471  * Outputs: OilTemp_degK
472  */
473
474 void FGPiston::doOilTemperature(void)
475 {
476   double idle_percentage_power = 2.3;        // approximately
477   double target_oil_temp;        // Steady state oil temp at the current engine conditions
478   double time_constant;          // The time constant for the differential equation
479
480   if (Running) {
481     target_oil_temp = 363;
482     time_constant = 500;        // Time constant for engine-on idling.
483     if (Percentage_Power > idle_percentage_power) {
484       time_constant /= ((Percentage_Power / idle_percentage_power) / 10.0); // adjust for power 
485     }
486   } else {
487     target_oil_temp = 298;
488     time_constant = 1000;  // Time constant for engine-off; reflects the fact
489                            // that oil is no longer getting circulated
490   }
491
492   double dOilTempdt = (target_oil_temp - OilTemp_degK) / time_constant;
493
494   OilTemp_degK += (dOilTempdt * dt);
495 }
496
497 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
498 /**
499  * Calculate the oil pressure.
500  *
501  * Inputs: RPM
502  *
503  * Outputs: OilPressure_psi
504  */
505
506 void FGPiston::doOilPressure(void)
507 {
508   double Oil_Press_Relief_Valve = 60; // FIXME: may vary by engine
509   double Oil_Press_RPM_Max = 1800;    // FIXME: may vary by engine
510   double Design_Oil_Temp = 358;       // degK; FIXME: may vary by engine
511   double Oil_Viscosity_Index = 0.25;
512
513   OilPressure_psi = (Oil_Press_Relief_Valve / Oil_Press_RPM_Max) * RPM;
514
515   if (OilPressure_psi >= Oil_Press_Relief_Valve) {
516     OilPressure_psi = Oil_Press_Relief_Valve;
517   }
518
519   OilPressure_psi += (Design_Oil_Temp - OilTemp_degK) * Oil_Viscosity_Index;
520 }
521
522 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
523 //
524 //    The bitmasked value choices are as follows:
525 //    unset: In this case (the default) JSBSim would only print
526 //       out the normally expected messages, essentially echoing
527 //       the config files as they are read. If the environment
528 //       variable is not set, debug_lvl is set to 1 internally
529 //    0: This requests JSBSim not to output any messages
530 //       whatsoever.
531 //    1: This value explicity requests the normal JSBSim
532 //       startup messages
533 //    2: This value asks for a message to be printed out when
534 //       a class is instantiated
535 //    4: When this value is set, a message is displayed when a
536 //       FGModel object executes its Run() method
537 //    8: When this value is set, various runtime state variables
538 //       are printed out periodically
539 //    16: When set various parameters are sanity checked and
540 //       a message is printed out when they go out of bounds
541
542 void FGPiston::Debug(int from)
543 {
544   if (debug_lvl <= 0) return;
545
546   if (debug_lvl & 1) { // Standard console startup message output
547     if (from == 0) { // Constructor
548
549       cout << "\n    Engine Name: "         << Name << endl;
550       cout << "      MinManifoldPressure: " << MinManifoldPressure_inHg << endl;
551       cout << "      MaxManifoldPressure: " << MaxManifoldPressure_inHg << endl;
552       cout << "      Displacement: "        << Displacement             << endl;
553       cout << "      MaxHP: "               << MaxHP                    << endl;
554       cout << "      Cycles: "              << Cycles                   << endl;
555       cout << "      IdleRPM: "             << IdleRPM                  << endl;
556       cout << "      MaxThrottle: "         << MaxThrottle              << endl;
557       cout << "      MinThrottle: "         << MinThrottle              << endl;
558
559       cout << endl;
560       cout << "      Combustion Efficiency table:" << endl;
561       Lookup_Combustion_Efficiency->Print();
562       cout << endl;
563
564       cout << endl;
565       cout << "      Power Mixture Correlation table:" << endl;
566       Power_Mixture_Correlation->Print();
567       cout << endl;
568
569     }
570   }
571   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
572     if (from == 0) cout << "Instantiated: FGPiston" << endl;
573     if (from == 1) cout << "Destroyed:    FGPiston" << endl;
574   }
575   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
576   }
577   if (debug_lvl & 8 ) { // Runtime state variables
578   }
579   if (debug_lvl & 16) { // Sanity checking
580   }
581   if (debug_lvl & 64) {
582     if (from == 0) { // Constructor
583       cout << IdSrc << endl;
584       cout << IdHdr << endl;
585     }
586   }
587 }
588
589 double
590 FGPiston::CalcFuelNeed(void)
591 {
592   return FuelFlow_gph / 3600 * State->Getdt() * Propulsion->GetRate();
593 }