]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/propulsion/FGTurbine.cpp
Merge branch 'maint' into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGTurbine.cpp
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Module:       FGTurbine.cpp
4  Author:       David Culp
5  Date started: 03/11/2003
6  Purpose:      This module models a turbine engine.
7
8  ------------- Copyright (C) 2003  David Culp (davidculp2@comcast.net) ---------
9
10  This program is free software; you can redistribute it and/or modify it under
11  the terms of the GNU Lesser General Public License as published by the Free Software
12  Foundation; either version 2 of the License, or (at your option) any later
13  version.
14
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
18  details.
19
20  You should have received a copy of the GNU Lesser General Public License along with
21  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22  Place - Suite 330, Boston, MA  02111-1307, USA.
23
24  Further information about the GNU Lesser General Public License can also be found on
25  the world wide web at http://www.gnu.org.
26
27 FUNCTIONAL DESCRIPTION
28 --------------------------------------------------------------------------------
29
30 This class descends from the FGEngine class and models a turbine engine based
31 on parameters given in the engine config file for this class
32
33 HISTORY
34 --------------------------------------------------------------------------------
35 03/11/2003  DPC  Created
36 09/08/2003  DPC  Changed Calculate() and added engine phases
37
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 INCLUDES
40 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41
42 #include <vector>
43 #include <sstream>
44
45 #include "FGTurbine.h"
46
47 namespace JSBSim {
48
49 static const char *IdSrc = "$Id$";
50 static const char *IdHdr = ID_TURBINE;
51
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 CLASS IMPLEMENTATION
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55
56
57 FGTurbine::FGTurbine(FGFDMExec* exec, Element *el, int engine_number)
58   : FGEngine(exec, el, engine_number)
59 {
60   Type = etTurbine;
61
62   MilThrust = MaxThrust = 10000.0;
63   TSFC = 0.8;
64   ATSFC = 1.7;
65   IdleN1 = 30.0;
66   IdleN2 = 60.0;
67   MaxN1 = MaxN2 = 100.0;
68   Augmented = AugMethod = Injected = 0;
69   BypassRatio = BleedDemand = 0.0;
70   IdleThrustLookup = MilThrustLookup = MaxThrustLookup = InjectionLookup = 0;
71
72   ResetToIC();
73
74   Load(exec, el);
75   Debug(0);
76 }
77
78 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79
80 FGTurbine::~FGTurbine()
81 {
82   delete IdleThrustLookup;
83   delete MilThrustLookup;
84   delete MaxThrustLookup;
85   delete InjectionLookup;
86   Debug(1);
87 }
88
89 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90
91 void FGTurbine::ResetToIC(void)
92 {
93   N1 = N2 = 0.0;
94   correctedTSFC = TSFC;
95   ThrottlePos = AugmentCmd = 0.0;
96   InletPosition = NozzlePosition = 1.0;
97   Stalled = Seized = Overtemp = Fire = Augmentation = Injection = Reversed = false;
98   Cutoff = true;
99   phase = tpOff;
100   EGT_degC = 0.0;
101   OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
102 }
103
104 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 // The main purpose of Calculate() is to determine what phase the engine should
106 // be in, then call the corresponding function.
107
108 double FGTurbine::Calculate(void)
109 {
110   double thrust;
111
112   TAT = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556;
113   dt = State->Getdt() * Propulsion->GetRate();
114   ThrottlePos = FCS->GetThrottlePos(EngineNumber);
115   if (ThrottlePos > 1.0) {
116     AugmentCmd = ThrottlePos - 1.0;
117     ThrottlePos -= AugmentCmd;
118   } else {
119     AugmentCmd = 0.0;
120   }
121
122   // When trimming is finished check if user wants engine OFF or RUNNING
123   if ((phase == tpTrim) && (dt > 0)) {
124     if (Running && !Starved) {
125       phase = tpRun;
126       N2 = IdleN2 + ThrottlePos * N2_factor;
127       N1 = IdleN1 + ThrottlePos * N1_factor;
128       OilTemp_degK = 366.0;
129       Cutoff = false;
130       }
131     else {
132       phase = tpOff;
133       Cutoff = true;
134       EGT_degC = TAT;
135       }
136     }
137
138   if (!Running && Cutoff && Starter) {
139      if (phase == tpOff) phase = tpSpinUp;
140      }
141   if (!Running && !Cutoff && (N2 > 15.0)) phase = tpStart;
142   if (Cutoff && (phase != tpSpinUp)) phase = tpOff;
143   if (dt == 0) phase = tpTrim;
144   if (Starved) phase = tpOff;
145   if (Stalled) phase = tpStall;
146   if (Seized) phase = tpSeize;
147
148   switch (phase) {
149     case tpOff:    thrust = Off(); break;
150     case tpRun:    thrust = Run(); break;
151     case tpSpinUp: thrust = SpinUp(); break;
152     case tpStart:  thrust = Start(); break;
153     case tpStall:  thrust = Stall(); break;
154     case tpSeize:  thrust = Seize(); break;
155     case tpTrim:   thrust = Trim(); break;
156     default: thrust = Off();
157   }
158
159   thrust = Thruster->Calculate(thrust); // allow thruster to modify thrust (i.e. reversing)
160
161   return thrust;
162 }
163
164 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165
166 double FGTurbine::Off(void)
167 {
168   double qbar = Auxiliary->Getqbar();
169   Running = false;
170   FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
171   N1 = Seek(&N1, qbar/10.0, N1/2.0, N1/2.0);
172   N2 = Seek(&N2, qbar/15.0, N2/2.0, N2/2.0);
173   EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
174   OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
175   OilPressure_psi = N2 * 0.62;
176   NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
177   EPR = Seek(&EPR, 1.0, 0.2, 0.2);
178   Augmentation = false;
179   ConsumeFuel();  
180   return 0.0;
181 }
182
183 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184
185 double FGTurbine::Run()
186 {
187   double idlethrust, milthrust, thrust;
188   double N2norm;   // 0.0 = idle N2, 1.0 = maximum N2
189
190   idlethrust = MilThrust * IdleThrustLookup->GetValue();
191   milthrust = (MilThrust - idlethrust) * MilThrustLookup->GetValue();
192
193   Running = true;
194   Starter = false;
195
196   N2 = Seek(&N2, IdleN2 + ThrottlePos * N2_factor, delay, delay * 3.0);
197   N1 = Seek(&N1, IdleN1 + ThrottlePos * N1_factor, delay, delay * 2.4);
198   N2norm = (N2 - IdleN2) / N2_factor;
199   thrust = idlethrust + (milthrust * N2norm * N2norm);
200   EGT_degC = TAT + 363.1 + ThrottlePos * 357.1;
201   OilPressure_psi = N2 * 0.62;
202   OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
203
204   if (!Augmentation) {
205     correctedTSFC = TSFC * (0.84 + (1-N2norm)*(1-N2norm));
206     FuelFlow_pph = Seek(&FuelFlow_pph, thrust * correctedTSFC, 1000.0, 100000);
207     if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
208     NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
209     thrust = thrust * (1.0 - BleedDemand);
210     EPR = 1.0 + thrust/MilThrust;
211   }
212
213   if (AugMethod == 1) {
214     if ((ThrottlePos > 0.99) && (N2 > 97.0)) {Augmentation = true;}
215     else {Augmentation = false;}
216   }
217
218   if ((Augmented == 1) && Augmentation && (AugMethod < 2)) {
219     thrust = MaxThrustLookup->GetValue() * MaxThrust;
220     FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
221     NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
222   }
223
224   if (AugMethod == 2) {
225     if (AugmentCmd > 0.0) {
226       Augmentation = true;
227       double tdiff = (MaxThrust * MaxThrustLookup->GetValue()) - thrust;
228       thrust += (tdiff * AugmentCmd);
229       FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
230       NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
231     } else {
232       Augmentation = false;
233     }
234   }
235
236   if ((Injected == 1) && Injection) {
237     InjectionTimer += dt;
238     if (InjectionTimer < InjectionTime) {
239        thrust = thrust * InjectionLookup->GetValue();
240     } else {
241        Injection = false;
242     }
243   }
244
245   ConsumeFuel();
246   if (Cutoff) phase = tpOff;
247   if (Starved) phase = tpOff;
248
249   return thrust;
250 }
251
252 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253
254 double FGTurbine::SpinUp(void)
255 {
256   Running = false;
257   FuelFlow_pph = 0.0;
258   N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
259   N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
260   EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
261   OilPressure_psi = N2 * 0.62;
262   OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
263   EPR = 1.0;
264   NozzlePosition = 1.0;
265   return 0.0;
266 }
267
268 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269
270 double FGTurbine::Start(void)
271 {
272   if ((N2 > 15.0) && !Starved) {       // minimum 15% N2 needed for start
273     Cranking = true;                   // provided for sound effects signal
274     if (N2 < IdleN2) {
275       N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
276       N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
277       EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
278       FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
279       OilPressure_psi = N2 * 0.62;
280       ConsumeFuel();
281       }
282     else {
283       phase = tpRun;
284       Running = true;
285       Starter = false;
286       Cranking = false;
287       }
288     }
289   else {                 // no start if N2 < 15%
290     phase = tpOff;
291     Starter = false;
292     }
293
294   return 0.0;
295 }
296
297 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298
299 double FGTurbine::Stall(void)
300 {
301   double qbar = Auxiliary->Getqbar();
302   EGT_degC = TAT + 903.14;
303   FuelFlow_pph = IdleFF;
304   N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
305   N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
306   ConsumeFuel();
307   if (ThrottlePos < 0.01) phase = tpRun;        // clear the stall with throttle
308
309   return 0.0;
310 }
311
312 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
313
314 double FGTurbine::Seize(void)
315 {
316     double qbar = Auxiliary->Getqbar();
317     N2 = 0.0;
318     N1 = Seek(&N1, qbar/20.0, 0, N1/15.0);
319     FuelFlow_pph = IdleFF;
320     ConsumeFuel();
321     OilPressure_psi = 0.0;
322     OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0, 0.2);
323     Running = false;
324     return 0.0;
325 }
326
327 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328
329 double FGTurbine::Trim()
330 {
331     double idlethrust, milthrust, thrust, tdiff, N2norm;
332     idlethrust = MilThrust * IdleThrustLookup->GetValue();
333     milthrust = (MilThrust - idlethrust) * MilThrustLookup->GetValue();
334     N2 = IdleN2 + ThrottlePos * N2_factor;
335     N2norm = (N2 - IdleN2) / N2_factor;
336     thrust = (idlethrust + (milthrust * N2norm * N2norm))
337           * (1.0 - BleedDemand);
338
339     if (AugMethod == 1) {
340       if ((ThrottlePos > 0.99) && (N2 > 97.0)) {Augmentation = true;}
341       else {Augmentation = false;}
342     }
343
344     if ((Augmented == 1) && Augmentation && (AugMethod < 2)) {
345       thrust = MaxThrust * MaxThrustLookup->GetValue();
346     }
347
348     if (AugMethod == 2) {
349       if (AugmentCmd > 0.0) {
350         tdiff = (MaxThrust * MaxThrustLookup->GetValue()) - thrust;
351         thrust += (tdiff * AugmentCmd);
352       }
353     }
354
355     if ((Injected == 1) && Injection) {
356       thrust = thrust * InjectionLookup->GetValue();
357     }
358
359     return thrust;
360 }
361
362 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
363
364 double FGTurbine::CalcFuelNeed(void)
365 {
366   double dT = State->Getdt() * Propulsion->GetRate();
367   FuelFlowRate = FuelFlow_pph / 3600.0; // Calculates flow in lbs/sec from lbs/hr
368   FuelExpended = FuelFlowRate * dT;     // Calculates fuel expended in this time step
369   return FuelExpended;
370 }
371
372 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373
374 double FGTurbine::GetPowerAvailable(void) {
375   if( ThrottlePos <= 0.77 )
376     return 64.94*ThrottlePos;
377   else
378     return 217.38*ThrottlePos - 117.38;
379 }
380
381 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
382
383 double FGTurbine::Seek(double *var, double target, double accel, double decel) {
384   double v = *var;
385   if (v > target) {
386     v -= dt * decel;
387     if (v < target) v = target;
388   } else if (v < target) {
389     v += dt * accel;
390     if (v > target) v = target;
391   }
392   return v;
393 }
394
395 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396
397 bool FGTurbine::Load(FGFDMExec* exec, Element *el)
398 {
399   string property_name, property_prefix;
400   property_prefix = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
401
402   if (el->FindElement("milthrust"))
403     MilThrust = el->FindElementValueAsNumberConvertTo("milthrust","LBS");
404   if (el->FindElement("maxthrust"))
405     MaxThrust = el->FindElementValueAsNumberConvertTo("maxthrust","LBS");
406   if (el->FindElement("bypassratio"))
407     BypassRatio = el->FindElementValueAsNumber("bypassratio");
408   if (el->FindElement("bleed"))
409     BleedDemand = el->FindElementValueAsNumber("bleed");
410   if (el->FindElement("tsfc"))
411     TSFC = el->FindElementValueAsNumber("tsfc");
412   if (el->FindElement("atsfc"))
413     ATSFC = el->FindElementValueAsNumber("atsfc");
414   if (el->FindElement("idlen1"))
415     IdleN1 = el->FindElementValueAsNumber("idlen1");
416   if (el->FindElement("idlen2"))
417     IdleN2 = el->FindElementValueAsNumber("idlen2");
418   if (el->FindElement("maxn1"))
419     MaxN1 = el->FindElementValueAsNumber("maxn1");
420   if (el->FindElement("maxn2"))
421     MaxN2 = el->FindElementValueAsNumber("maxn2");
422   if (el->FindElement("augmented"))
423     Augmented = (int)el->FindElementValueAsNumber("augmented");
424   if (el->FindElement("augmethod"))
425     AugMethod = (int)el->FindElementValueAsNumber("augmethod");
426   if (el->FindElement("injected"))
427     Injected = (int)el->FindElementValueAsNumber("injected");
428   if (el->FindElement("injection-time"))
429     InjectionTime = el->FindElementValueAsNumber("injection-time");
430
431   Element *function_element;
432   string name;
433   FGPropertyManager* PropertyManager = exec->GetPropertyManager();
434
435   while (true) {
436     function_element = el->FindNextElement("function");
437     if (!function_element) break;
438     name = function_element->GetAttributeValue("name");
439     if (name == "IdleThrust") {
440       IdleThrustLookup = new FGFunction(PropertyManager, function_element, property_prefix);
441     } else if (name == "MilThrust") {
442       MilThrustLookup = new FGFunction(PropertyManager, function_element, property_prefix);
443     } else if (name == "AugThrust") {
444       MaxThrustLookup = new FGFunction(PropertyManager, function_element, property_prefix);
445     } else if (name == "Injection") {
446       InjectionLookup = new FGFunction(PropertyManager, function_element, property_prefix);
447     } else {
448       cerr << "Unknown function type: " << name << " in turbine definition." <<
449       endl;
450     }
451   }
452
453   // Pre-calculations and initializations
454
455   delay = 60.0 / (BypassRatio + 3.0);
456   N1_factor = MaxN1 - IdleN1;
457   N2_factor = MaxN2 - IdleN2;
458   OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
459   IdleFF = pow(MilThrust, 0.2) * 107.0;  // just an estimate
460
461   bindmodel();
462   return true;
463 }
464
465 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
466
467 string FGTurbine::GetEngineLabels(string delimeter)
468 {
469   std::ostringstream buf;
470
471   buf << Name << "_N1[" << EngineNumber << "]" << delimeter
472       << Name << "_N2[" << EngineNumber << "]" << delimeter
473       << Thruster->GetThrusterLabels(EngineNumber, delimeter);
474
475   return buf.str();
476 }
477
478 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
479
480 string FGTurbine::GetEngineValues(string delimeter)
481 {
482   std::ostringstream buf;
483
484   buf << N1 << delimeter
485       << N2 << delimeter
486       << Thruster->GetThrusterValues(EngineNumber, delimeter);
487
488   return buf.str();
489 }
490
491 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
492
493 void FGTurbine::bindmodel()
494 {
495   string property_name, base_property_name;
496   base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
497   property_name = base_property_name + "/n1";
498   PropertyManager->Tie( property_name.c_str(), &N1);
499   property_name = base_property_name + "/n2";
500   PropertyManager->Tie( property_name.c_str(), &N2);
501   property_name = base_property_name + "/injection_cmd";
502   PropertyManager->Tie( property_name.c_str(), (FGTurbine*)this, 
503                         &FGTurbine::GetInjection, &FGTurbine::SetInjection);
504 }
505
506 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
507
508 int FGTurbine::InitRunning(void) {
509   State->SuspendIntegration();
510   Cutoff=false;
511   Running=true;  
512   N2=16.0;
513   Calculate();
514   State->ResumeIntegration();
515   return phase==tpRun;
516 }
517
518 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
519 //    The bitmasked value choices are as follows:
520 //    unset: In this case (the default) JSBSim would only print
521 //       out the normally expected messages, essentially echoing
522 //       the config files as they are read. If the environment
523 //       variable is not set, debug_lvl is set to 1 internally
524 //    0: This requests JSBSim not to output any messages
525 //       whatsoever.
526 //    1: This value explicity requests the normal JSBSim
527 //       startup messages
528 //    2: This value asks for a message to be printed out when
529 //       a class is instantiated
530 //    4: When this value is set, a message is displayed when a
531 //       FGModel object executes its Run() method
532 //    8: When this value is set, various runtime state variables
533 //       are printed out periodically
534 //    16: When set various parameters are sanity checked and
535 //       a message is printed out when they go out of bounds
536
537 void FGTurbine::Debug(int from)
538 {
539   if (debug_lvl <= 0) return;
540
541   if (debug_lvl & 1) { // Standard console startup message output
542     if (from == 0) { // Constructor
543
544     }
545     if (from == 2) { // called from Load()
546       cout << "\n    Engine Name: "         << Name << endl;
547       cout << "      MilThrust:   "         << MilThrust << endl;
548       cout << "      MaxThrust:   "         << MaxThrust << endl;
549       cout << "      BypassRatio: "         << BypassRatio << endl;
550       cout << "      TSFC:        "         << TSFC << endl;
551       cout << "      ATSFC:       "         << ATSFC << endl;
552       cout << "      IdleN1:      "         << IdleN1 << endl;
553       cout << "      IdleN2:      "         << IdleN2 << endl;
554       cout << "      MaxN1:       "         << MaxN1 << endl;
555       cout << "      MaxN2:       "         << MaxN2 << endl;
556       cout << "      Augmented:   "         << Augmented << endl;
557       cout << "      AugMethod:   "         << AugMethod << endl;
558       cout << "      Injected:    "         << Injected << endl;
559       cout << "      MinThrottle: "         << MinThrottle << endl;
560
561       cout << endl;
562     }
563   }
564   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
565     if (from == 0) cout << "Instantiated: FGTurbine" << endl;
566     if (from == 1) cout << "Destroyed:    FGTurbine" << endl;
567   }
568   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
569   }
570   if (debug_lvl & 8 ) { // Runtime state variables
571   }
572   if (debug_lvl & 16) { // Sanity checking
573   }
574   if (debug_lvl & 64) {
575     if (from == 0) { // Constructor
576       cout << IdSrc << endl;
577       cout << IdHdr << endl;
578     }
579   }
580 }
581 }