]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/IO360.cxx
- catch exception from readProperties and exit
[flightgear.git] / src / FDM / IO360.cxx
index 4ca9ecccf1a921e28a7876d7639a9fbd9ee939f9..68687ef81b8a519edc167ed9abe157afa4074c68 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include <iostream>
-#include <fstream>
 #include <math.h>
 
+#include STL_FSTREAM
+#include STL_IOSTREAM
+
+#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+SG_USING_STD(cout);
+#endif
+
 #include "IO360.hxx"
 
-FG_USING_STD(cout);
 
 // Static utility functions
 
@@ -359,14 +363,15 @@ void FGNewEngine::update() {
     // Hack for testing - should output every 5 seconds
     static int count1 = 0;
     if(count1 == 0) {
-       cout << "P_atmos = " << p_amb << "  T_atmos = " << T_amb << '\n';
-       cout << "Manifold pressure = " << Manifold_Pressure << "  True_Manifold_Pressure = " << True_Manifold_Pressure << '\n';
-       cout << "p_amb_sea_level = " << p_amb_sea_level << '\n';
-       cout << "equivalence_ratio = " << equivalence_ratio << '\n';
-       cout << "combustion_efficiency = " << combustion_efficiency << '\n';
-       cout << "AFR = " << 14.7 / equivalence_ratio << '\n';
-       cout << "Mixture lever = " << Mixture_Lever_Pos << '\n';
-       cout << "n = " << RPM << " rpm\n";
+//     cout << "P_atmos = " << p_amb << "  T_atmos = " << T_amb << '\n';
+//     cout << "Manifold pressure = " << Manifold_Pressure << "  True_Manifold_Pressure = " << True_Manifold_Pressure << '\n';
+//     cout << "p_amb_sea_level = " << p_amb_sea_level << '\n';
+//     cout << "equivalence_ratio = " << equivalence_ratio << '\n';
+//     cout << "combustion_efficiency = " << combustion_efficiency << '\n';
+//     cout << "AFR = " << 14.7 / equivalence_ratio << '\n';
+//     cout << "Mixture lever = " << Mixture_Lever_Pos << '\n';
+//     cout << "n = " << RPM << " rpm\n";
+        cout << "T_amb = " << T_amb << '\n';
     }
     count1++;
     if(count1 == 600)
@@ -452,6 +457,14 @@ void FGNewEngine::update() {
     // on the actual manifold pressure, which takes air pressure into account.  However - this fails to
     // take the temperature into account - this is TODO.
 
+    // Adjust power for temperature - this is temporary until the power is done as a function of mass flow rate induced
+    // Adjust for Temperature - Temperature above Standard decrease
+    // power by 7/120 % per degree F increase, and incease power for
+    // temps below at the same ratio
+    float T_amb_degF = (T_amb * 1.8) - 459.67;
+    float T_amb_sea_lev_degF = (288 * 1.8) - 459.67; 
+    Percentage_Power = Percentage_Power + ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
+
     //DCL - now adjust power to compensate for mixture
     Percentage_of_best_power_mixture_power = Power_Mixture_Correlation(equivalence_ratio);
     Percentage_Power = Percentage_Power * Percentage_of_best_power_mixture_power / 100.0;