]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp
Merge branch 'next' of http://git.gitorious.org/fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGTurboProp.cpp
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Module:       FGTurboProp.cpp
4  Author:       Jiri "Javky" Javurek
5                based on SimTurbine and Turbine engine from David Culp
6  Date started: 05/14/2004
7  Purpose:      This module models a turbo propeller engine.
8
9  ------------- Copyright (C) 2004  (javky@email.cz) ---------
10
11  This program is free software; you can redistribute it and/or modify it under
12  the terms of the GNU Lesser 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 Lesser General Public License for more
19  details.
20
21  You should have received a copy of the GNU Lesser 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 Lesser 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 Turbo propeller engine
32 based on parameters given in the engine config file for this class
33
34 HISTORY
35 --------------------------------------------------------------------------------
36 05/14/2004  Created
37 02/08/2011  T. Kreitler, added rotor support
38
39 //JVK (mark)
40
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 INCLUDES
43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
44
45 #include <iostream>
46 #include <sstream>
47 #include "FGTurboProp.h"
48 #include "FGPropeller.h"
49 #include "FGRotor.h"
50 #include "models/FGPropulsion.h"
51 #include "models/FGAuxiliary.h"
52
53 using namespace std;
54
55 namespace JSBSim {
56
57 static const char *IdSrc = "$Id: FGTurboProp.cpp,v 1.19 2011/03/10 01:35:25 dpculp Exp $";
58 static const char *IdHdr = ID_TURBOPROP;
59
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 CLASS IMPLEMENTATION
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
63
64 FGTurboProp::FGTurboProp(FGFDMExec* exec, Element *el, int engine_number)
65   : FGEngine(exec, el, engine_number),
66     ITT_N1(NULL), EnginePowerRPM_N1(NULL), EnginePowerVC(NULL)
67 {
68   SetDefaults();
69   thrusterType = Thruster->GetType();
70
71   Load(exec, el);
72   bindmodel();
73   Debug(0);
74 }
75
76 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77
78 FGTurboProp::~FGTurboProp()
79 {
80   delete ITT_N1;
81   delete EnginePowerRPM_N1;
82   delete EnginePowerVC;
83   Debug(1);
84 }
85
86 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87
88 bool FGTurboProp::Load(FGFDMExec* exec, Element *el)
89 {
90   IdleFF=-1;
91   MaxStartingTime = 999999; //very big timeout -> infinite
92   Ielu_max_torque=-1;
93
94 // ToDo: Need to make sure units are properly accounted for below.
95
96   if (el->FindElement("milthrust"))
97     MilThrust = el->FindElementValueAsNumberConvertTo("milthrust","LBS");
98   if (el->FindElement("idlen1"))
99     IdleN1 = el->FindElementValueAsNumber("idlen1");
100   if (el->FindElement("idlen2"))
101     IdleN2 = el->FindElementValueAsNumber("idlen2");
102   if (el->FindElement("maxn1"))
103     MaxN1 = el->FindElementValueAsNumber("maxn1");
104   if (el->FindElement("maxn2"))
105     MaxN2 = el->FindElementValueAsNumber("maxn2");
106   if (el->FindElement("betarangeend"))
107     BetaRangeThrottleEnd = el->FindElementValueAsNumber("betarangeend")/100.0;
108   BetaRangeThrottleEnd = Constrain(0.0, BetaRangeThrottleEnd, 0.99999);
109   if (el->FindElement("reversemaxpower"))
110     ReverseMaxPower = el->FindElementValueAsNumber("reversemaxpower")/100.0;
111
112   if (el->FindElement("maxpower"))
113     MaxPower = el->FindElementValueAsNumber("maxpower");
114   if (el->FindElement("idlefuelflow"))
115     IdleFF = el->FindElementValueAsNumber("idlefuelflow");
116   if (el->FindElement("psfc"))
117     PSFC = el->FindElementValueAsNumber("psfc");
118   if (el->FindElement("n1idle_max_delay"))
119     Idle_Max_Delay = el->FindElementValueAsNumber("n1idle_max_delay");
120   if (el->FindElement("maxstartingtime"))
121     MaxStartingTime = el->FindElementValueAsNumber("maxstartingtime");
122   if (el->FindElement("startern1"))
123     StarterN1 = el->FindElementValueAsNumber("startern1");
124   if (el->FindElement("ielumaxtorque"))
125     Ielu_max_torque = el->FindElementValueAsNumber("ielumaxtorque");
126   if (el->FindElement("itt_delay"))
127     ITT_Delay = el->FindElementValueAsNumber("itt_delay");
128
129   Element *table_element;
130   string name;
131   FGPropertyManager* PropertyManager = exec->GetPropertyManager();
132
133   while (true) {
134     table_element = el->FindNextElement("table");
135     if (!table_element) break;
136     name = table_element->GetAttributeValue("name");
137     if (name == "EnginePowerVC") {
138       EnginePowerVC = new FGTable(PropertyManager, table_element);
139     } else if (name == "EnginePowerRPM_N1") {
140       EnginePowerRPM_N1 = new FGTable(PropertyManager, table_element);
141     } else if (name == "ITT_N1") {
142       ITT_N1 = new FGTable(PropertyManager, table_element);
143     } else {
144       cerr << "Unknown table type: " << name << " in turbine definition." <<
145       endl;
146     }
147   }
148
149   // Pre-calculations and initializations
150
151   delay=1;
152   N1_factor = MaxN1 - IdleN1;
153   N2_factor = MaxN2 - IdleN2;
154   OilTemp_degK = Auxiliary->GetTAT_C() + 273.0;
155   if (IdleFF==-1) IdleFF = pow(MilThrust, 0.2) * 107.0;  // just an estimate
156
157   // cout << "ENG POWER:" << EnginePowerRPM_N1->GetValue(1200,90) << endl;
158
159   return true;
160 }
161
162 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163 // The main purpose of Calculate() is to determine what phase the engine should
164 // be in, then call the corresponding function.
165
166 void FGTurboProp::Calculate(void)
167 {
168   RunPreFunctions();
169
170   TAT = Auxiliary->GetTAT_C();
171   dt = FDMExec->GetDeltaT() * Propulsion->GetRate();
172
173   Throttle = FCS->GetThrottlePos(EngineNumber);
174
175   RPM = Thruster->GetRPM() * Thruster->GetGearRatio();
176   if (thrusterType == FGThruster::ttPropeller) {
177     ((FGPropeller*)Thruster)->SetAdvance(FCS->GetPropAdvance(EngineNumber));
178     ((FGPropeller*)Thruster)->SetFeather(FCS->GetPropFeather(EngineNumber));
179     ((FGPropeller*)Thruster)->SetReverse(Reversed);
180     if (Reversed) {
181       ((FGPropeller*)Thruster)->SetReverseCoef(Throttle);
182     } else {
183       ((FGPropeller*)Thruster)->SetReverseCoef(0.0);
184     }
185
186     if (Reversed) {
187       if (Throttle < BetaRangeThrottleEnd) {
188           Throttle = 0.0;  // idle when in Beta-range
189       } else {
190         // when reversed:
191         Throttle = (Throttle-BetaRangeThrottleEnd)/(1-BetaRangeThrottleEnd) * ReverseMaxPower;
192       }
193     }
194   }
195
196   // When trimming is finished check if user wants engine OFF or RUNNING
197   if ((phase == tpTrim) && (dt > 0)) {
198     if (Running && !Starved) {
199       phase = tpRun;
200       N2 = IdleN2;
201       N1 = IdleN1;
202       OilTemp_degK = 366.0;
203       Cutoff = false;
204     } else {
205       phase = tpOff;
206       Cutoff = true;
207       Eng_ITT_degC = TAT;
208       Eng_Temperature = TAT;
209       OilTemp_degK = TAT+273.15;
210     }
211   }
212
213   if (!Running && Starter) {
214     if (phase == tpOff) {
215       phase = tpSpinUp;
216       if (StartTime < 0) StartTime=0;
217     }
218   }
219   if (!Running && !Cutoff && (N1 > 15.0)) {
220     phase = tpStart;
221     StartTime = -1;
222   }
223   if (Cutoff && (phase != tpSpinUp)) phase = tpOff;
224   if (dt == 0) phase = tpTrim;
225   if (Starved) phase = tpOff;
226   if (Condition >= 10) {
227     phase = tpOff;
228     StartTime=-1;
229   }
230
231   // limiter intervention wanted?
232   if (Ielu_max_torque > 0.0) {
233     double torque = 0.0;
234     
235     if (thrusterType == FGThruster::ttPropeller) {
236       torque = ((FGPropeller*)(Thruster))->GetTorque();
237     } else if (thrusterType == FGThruster::ttRotor) {
238       torque = ((FGRotor*)(Thruster))->GetTorque();
239     }
240
241     if (Condition < 1) {
242       if ( abs(torque) > Ielu_max_torque && Throttle >= OldThrottle ) {
243         Throttle = OldThrottle - 0.1 * dt; //IELU down
244         Ielu_intervent = true;
245       } else if ( Ielu_intervent && Throttle >= OldThrottle) {
246         Throttle = OldThrottle + 0.05 * dt; //IELU up
247         Ielu_intervent = true;
248       } else {
249         Ielu_intervent = false;
250       }
251     } else {
252       Ielu_intervent = false;
253     }
254     OldThrottle = Throttle;
255   }
256
257   switch (phase) {
258     case tpOff:    HP = Off(); break;
259     case tpRun:    HP = Run(); break;
260     case tpSpinUp: HP = SpinUp(); break;
261     case tpStart:  HP = Start(); break;
262     default: HP = 0;
263   }
264  
265   Thruster->Calculate(HP * hptoftlbssec);
266
267   RunPostFunctions();
268 }
269
270 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271
272 double FGTurboProp::Off(void)
273 {
274   double qbar = Auxiliary->Getqbar();
275   Running = false; EngStarting = false;
276
277   FuelFlow_pph = Seek(&FuelFlow_pph, 0, 800.0, 800.0);
278
279   //allow the air turn with generator
280   N1 = ExpSeek(&N1, qbar/15.0, Idle_Max_Delay*2.5, Idle_Max_Delay * 5);
281
282   OilTemp_degK = ExpSeek(&OilTemp_degK,273.15 + TAT, 400 , 400);
283
284   Eng_Temperature = ExpSeek(&Eng_Temperature,TAT,300,400);
285   double ITT_goal = ITT_N1->GetValue(N1,0.1) + ((N1>20) ? 0.0 : (20-N1)/20.0 * Eng_Temperature);
286   Eng_ITT_degC  = ExpSeek(&Eng_ITT_degC,ITT_goal,ITT_Delay,ITT_Delay*1.2);
287
288   OilPressure_psi = (N1/100.0*0.25+(0.1-(OilTemp_degK-273.15)*0.1/80.0)*N1/100.0) / 7692.0e-6; //from MPa to psi
289
290   ConsumeFuel(); // for possible setting Starved = false when fuel tank
291                  // is refilled (fuel crossfeed etc.)
292
293   if (RPM>5) return -0.012; // friction in engine when propeller spining (estimate)
294   return 0.0;
295 }
296
297 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298
299 double FGTurboProp::Run(void)
300 {
301   double thrust = 0.0, EngPower_HP, eff_coef;
302   Running = true; Starter = false; EngStarting = false;
303
304 //---
305   double old_N1 = N1;
306   N1 = ExpSeek(&N1, IdleN1 + Throttle * N1_factor, Idle_Max_Delay, Idle_Max_Delay * 2.4);
307
308   EngPower_HP = EnginePowerRPM_N1->GetValue(RPM,N1);
309   EngPower_HP *= EnginePowerVC->GetValue();
310   if (EngPower_HP > MaxPower) EngPower_HP = MaxPower;
311
312   eff_coef = 9.333 - (N1)/12; // 430%Fuel at 60%N1
313   FuelFlow_pph = PSFC * EngPower_HP * eff_coef;
314
315   Eng_Temperature = ExpSeek(&Eng_Temperature,Eng_ITT_degC,300,400);
316   double ITT_goal = ITT_N1->GetValue((N1-old_N1)*300+N1,1);
317   Eng_ITT_degC  = ExpSeek(&Eng_ITT_degC,ITT_goal,ITT_Delay,ITT_Delay*1.2);
318
319   OilPressure_psi = (N1/100.0*0.25+(0.1-(OilTemp_degK-273.15)*0.1/80.0)*N1/100.0) / 7692.0e-6; //from MPa to psi
320 //---
321   EPR = 1.0 + thrust/MilThrust;
322
323   OilTemp_degK = Seek(&OilTemp_degK, 353.15, 0.4-N1*0.001, 0.04);
324
325   ConsumeFuel();
326
327   if (Cutoff) phase = tpOff;
328   if (Starved) phase = tpOff;
329
330   return EngPower_HP;
331 }
332
333 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
334
335 double FGTurboProp::SpinUp(void)
336 {
337   double EngPower_HP;
338   Running = false; EngStarting = true;
339   FuelFlow_pph = 0.0;
340
341   if (!GeneratorPower) {
342     EngStarting=false;
343     phase=tpOff;
344     StartTime = -1;
345     return 0.0;
346   }
347
348   N1 = ExpSeek(&N1, StarterN1, Idle_Max_Delay * 6, Idle_Max_Delay * 2.4);
349
350   Eng_Temperature = ExpSeek(&Eng_Temperature,TAT,300,400);
351   double ITT_goal = ITT_N1->GetValue(N1,0.1) + ((N1>20) ? 0.0 : (20-N1)/20.0 * Eng_Temperature);
352   Eng_ITT_degC  = ExpSeek(&Eng_ITT_degC,ITT_goal,ITT_Delay,ITT_Delay*1.2);
353
354   OilTemp_degK = ExpSeek(&OilTemp_degK,273.15 + TAT, 400 , 400);
355
356   OilPressure_psi = (N1/100.0*0.25+(0.1-(OilTemp_degK-273.15)*0.1/80.0)*N1/100.0) / 7692.0e-6; //from MPa to psi
357   NozzlePosition = 1.0;
358
359   EngPower_HP = EnginePowerRPM_N1->GetValue(RPM,N1);
360   EngPower_HP *= EnginePowerVC->GetValue();
361   if (EngPower_HP > MaxPower) EngPower_HP = MaxPower;
362
363   if (StartTime>=0) StartTime+=dt;
364   if (StartTime > MaxStartingTime && MaxStartingTime > 0) { //start failed due timeout
365     phase = tpOff;
366     StartTime = -1;
367   }
368
369   ConsumeFuel(); // for possible setting Starved = false when fuel tank
370                  // is refilled (fuel crossfeed etc.)
371
372   return EngPower_HP;
373 }
374
375 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376
377 double FGTurboProp::Start(void)
378 {
379   double EngPower_HP = 0.0;
380   double eff_coef;
381
382   EngStarting = false;
383   if ((N1 > 15.0) && !Starved) {       // minimum 15% N2 needed for start
384     double old_N1 = N1;
385     Cranking = true;                   // provided for sound effects signal
386     if (N1 < IdleN1) {
387       EngPower_HP = EnginePowerRPM_N1->GetValue(RPM,N1);
388       EngPower_HP *= EnginePowerVC->GetValue();
389       if (EngPower_HP > MaxPower) EngPower_HP = MaxPower;
390       N1 = ExpSeek(&N1, IdleN1*1.1, Idle_Max_Delay*4, Idle_Max_Delay * 2.4);
391       eff_coef = 9.333 - (N1)/12; // 430%Fuel at 60%N1
392       FuelFlow_pph = PSFC * EngPower_HP * eff_coef;
393       Eng_Temperature = ExpSeek(&Eng_Temperature,Eng_ITT_degC,300,400);
394       double ITT_goal = ITT_N1->GetValue((N1-old_N1)*300+N1,1);
395       Eng_ITT_degC  = ExpSeek(&Eng_ITT_degC,ITT_goal,ITT_Delay,ITT_Delay*1.2);
396
397       OilPressure_psi = (N1/100.0*0.25+(0.1-(OilTemp_degK-273.15)*0.1/80.0)*N1/100.0) / 7692.0e-6; //from MPa to psi
398       OilTemp_degK = Seek(&OilTemp_degK, 353.15, 0.4-N1*0.001, 0.04);
399
400     } else {
401       phase = tpRun;
402       Running = true;
403       Starter = false;
404       Cranking = false;
405       FuelFlow_pph = 0;
406     }
407   } else {                 // no start if N2 < 15% or Starved
408     phase = tpOff;
409     Starter = false;
410   }
411
412   ConsumeFuel();
413
414   return EngPower_HP;
415 }
416
417
418 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
419
420 double FGTurboProp::CalcFuelNeed(void)
421 {
422   double dT = FDMExec->GetDeltaT() * Propulsion->GetRate();
423   FuelFlowRate = FuelFlow_pph / 3600.0;
424   FuelExpended = FuelFlowRate * dT;
425   return FuelExpended;
426 }
427
428 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429
430 double FGTurboProp::Seek(double *var, double target, double accel, double decel)
431 {
432   double v = *var;
433   if (v > target) {
434     v -= dt * decel;
435     if (v < target) v = target;
436   } else if (v < target) {
437     v += dt * accel;
438     if (v > target) v = target;
439   }
440   return v;
441 }
442
443 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
444
445 double FGTurboProp::ExpSeek(double *var, double target, double accel_tau, double decel_tau)
446 {
447 // exponential delay instead of the linear delay used in Seek
448   double v = *var;
449   if (v > target) {
450     v = (v - target) * exp ( -dt / decel_tau) + target;
451   } else if (v < target) {
452     v = (target - v) * (1 - exp ( -dt / accel_tau)) + v;
453   }
454   return v;
455 }
456
457 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
458
459 void FGTurboProp::SetDefaults(void)
460 {
461 //  Name = "Not defined";
462   N1 = N2 = 0.0;
463   HP = 0.0;
464   Type = etTurboprop;
465   MilThrust = 10000.0;
466   IdleN1 = 30.0;
467   IdleN2 = 60.0;
468   MaxN1 = 100.0;
469   MaxN2 = 100.0;
470   Throttle = 0.0;
471   InletPosition = 1.0;
472   NozzlePosition = 1.0;
473   Reversed = false;
474   Cutoff = true;
475   phase = tpOff;
476   Stalled = false;
477   Seized = false;
478   Overtemp = false;
479   Fire = false;
480   Eng_ITT_degC = 0.0;
481
482   GeneratorPower=true;
483   Condition = 0;
484   Ielu_intervent=false;
485
486   Idle_Max_Delay = 1.0;
487
488   Throttle = OldThrottle = 0.0;
489   ITT_Delay = 0.05;
490   ReverseMaxPower = 0.0;
491   BetaRangeThrottleEnd = 0.0;
492 }
493
494 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495
496
497 string FGTurboProp::GetEngineLabels(const string& delimiter)
498 {
499   std::ostringstream buf;
500
501   buf << Name << "_N1[" << EngineNumber << "]" << delimiter
502       << Name << "_N2[" << EngineNumber << "]" << delimiter
503       << Name << "_PwrAvail[" << EngineNumber << "]" << delimiter
504       << Thruster->GetThrusterLabels(EngineNumber, delimiter);
505
506   return buf.str();
507 }
508
509 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
510
511 string FGTurboProp::GetEngineValues(const string& delimiter)
512 {
513   std::ostringstream buf;
514
515   buf << N1 << delimiter
516       << N2 << delimiter
517       << HP << delimiter
518       << Thruster->GetThrusterValues(EngineNumber,delimiter);
519
520   return buf.str();
521 }
522
523 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
524
525 int FGTurboProp::InitRunning(void)
526 {
527   FDMExec->SuspendIntegration();
528   Cutoff=false;
529   Running=true;  
530   N2=16.0;
531   Calculate();
532   FDMExec->ResumeIntegration();
533   return phase==tpRun;
534 }
535
536 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
537
538 void FGTurboProp::bindmodel()
539 {
540   string property_name, base_property_name;
541   base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
542   property_name = base_property_name + "/n1";
543   PropertyManager->Tie( property_name.c_str(), &N1);
544   // property_name = base_property_name + "/n2";
545   // PropertyManager->Tie( property_name.c_str(), &N2);
546   property_name = base_property_name + "/reverser";
547   PropertyManager->Tie( property_name.c_str(), &Reversed);
548   property_name = base_property_name + "/power-hp";
549   PropertyManager->Tie( property_name.c_str(), &HP);
550   property_name = base_property_name + "/itt-c";
551   PropertyManager->Tie( property_name.c_str(), &Eng_ITT_degC);
552   property_name = base_property_name + "/engtemp-c";
553   PropertyManager->Tie( property_name.c_str(), &Eng_Temperature);
554   property_name = base_property_name + "/ielu_intervent";
555   PropertyManager->Tie( property_name.c_str(), &Ielu_intervent);
556 }
557
558 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
559 //    The bitmasked value choices are as follows:
560 //    unset: In this case (the default) JSBSim would only print
561 //       out the normally expected messages, essentially echoing
562 //       the config files as they are read. If the environment
563 //       variable is not set, debug_lvl is set to 1 internally
564 //    0: This requests JSBSim not to output any messages
565 //       whatsoever.
566 //    1: This value explicity requests the normal JSBSim
567 //       startup messages
568 //    2: This value asks for a message to be printed out when
569 //       a class is instantiated
570 //    4: When this value is set, a message is displayed when a
571 //       FGModel object executes its Run() method
572 //    8: When this value is set, various runtime state variables
573 //       are printed out periodically
574 //    16: When set various parameters are sanity checked and
575 //       a message is printed out when they go out of bounds
576
577 void FGTurboProp::Debug(int from)
578 {
579   if (debug_lvl <= 0) return;
580
581   if (debug_lvl & 1) { // Standard console startup message output
582     if (from == 0) { // Constructor
583
584     }
585     if (from == 2) { // called from Load()
586       cout << "\n ****MUJ MOTOR TURBOPROP****\n";
587       cout << "\n    Engine Name: "         << Name << endl;
588       cout << "      MilThrust:   "         << MilThrust << endl;
589       cout << "      IdleN1:      "         << IdleN1 << endl;
590       cout << "      MaxN1:       "         << MaxN1 << endl;
591
592       cout << endl;
593     }
594   }
595   if (debug_lvl & 2 ) { // Instantiation/Destruction notification
596     if (from == 0) cout << "Instantiated: FGTurboProp" << endl;
597     if (from == 1) cout << "Destroyed:    FGTurboProp" << endl;
598   }
599   if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
600   }
601   if (debug_lvl & 8 ) { // Runtime state variables
602   }
603   if (debug_lvl & 16) { // Sanity checking
604   }
605   if (debug_lvl & 64) {
606     if (from == 0) { // Constructor
607       cout << IdSrc << endl;
608       cout << IdHdr << endl;
609     }
610   }
611 }
612 }