]> git.mxchange.org Git - flightgear.git/commitdiff
David Luff: I've put Phil's temperature correction back in since I'm not
authorcurt <curt>
Thu, 22 Mar 2001 23:42:16 +0000 (23:42 +0000)
committercurt <curt>
Thu, 22 Mar 2001 23:42:16 +0000 (23:42 +0000)
implicitly correcting for that yet.  The plane now makes it to 11000ft on
autopilot *slowly*.  I think I'll have to look at the prop parameters
next - altering the diameter and blade angle just slightly can have
quite an effect.  If you want to play then try changing the values
prop_diameter and blade_angle in FGNewEngine::init.  Keep blade
angle between 20 and 25 (since those are the only values for which
I've entered data and I interpolate between them) and ignore
FGProp1_Blade_Angle since that's an old variable that isn't used.  I
really ought to read all the engine and prop parameters from file to
avoid recompilation when tweaking !

src/FDM/IO360.cxx

index 4ca9ecccf1a921e28a7876d7639a9fbd9ee939f9..f0188a75d2e02c530be7a3ee7e94acd0e9dbc767 100644 (file)
@@ -359,14 +359,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 +453,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;