From 374c0e04c6603a9ad55f6e4adb45795466942d10 Mon Sep 17 00:00:00 2001 From: Denis Freund Date: Sat, 28 Oct 2023 13:56:40 +0200 Subject: [PATCH] fix(fadec): correctur of fuel flow --- .../src/systems/fmgc/src/guidance/vnav/EngineModel.ts | 2 +- hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h | 2 +- hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hdw-a339x/src/systems/fmgc/src/guidance/vnav/EngineModel.ts b/hdw-a339x/src/systems/fmgc/src/guidance/vnav/EngineModel.ts index 1f79bda78..fe7c7a25a 100644 --- a/hdw-a339x/src/systems/fmgc/src/guidance/vnav/EngineModel.ts +++ b/hdw-a339x/src/systems/fmgc/src/guidance/vnav/EngineModel.ts @@ -238,7 +238,7 @@ export class EngineModel { + (coefficients[17] * mach ** 3) + (coefficients[18] * mach ** 2 * alt) + (coefficients[19] * mach * alt ** 2) + (coefficients[20] * alt ** 3); - return flow * 2.7; + return flow * 3.6; } // static getCN1fromUncorrectedThrust(thrust: number) diff --git a/hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h b/hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h index 530dd1ea4..7609b0554 100644 --- a/hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h +++ b/hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h @@ -206,7 +206,7 @@ class Polynomial { /// double correctedFuelFlow(double cn1, double mach, double alt) { double outCFF = 0; - double a330_f = 2.7; + double a330_f = 3.6; double c_Flow[21] = {-639.6602981, 0.00000e+00, 1.03705e+02, -2.23264e+03, 5.70316e-03, -2.29404e+00, 1.08230e+02, 2.77667e-04, -6.17180e+02, -7.20713e-02, 2.19013e-07, 2.49418e-02, -7.31662e-01, -1.00003e-05, diff --git a/hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h b/hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h index 64fc4cff2..6f386efce 100644 --- a/hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h +++ b/hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h @@ -205,10 +205,11 @@ class Polynomial { /// double correctedFuelFlow(double cn1, double mach, double alt) { double outCFF = 0; + double a330_f = 3.6; - double c_Flow[21] = {-1.7630e+02, -2.1542e-01, 4.7119e+01, 6.1519e+02, 1.8047e-03, -4.4554e-01, -4.3940e+01, - 4.0459e-05, -3.2912e+01, -6.2894e-03, -1.2544e-07, 1.0938e-02, 4.0936e-01, -5.5841e-06, - -2.3829e+01, 9.3269e-04, 2.0273e-11, -2.4100e+02, 1.4171e-02, -9.5581e-07, 1.2728e-11}; + double c_Flow[21] = {-639.6602981, 0.00000e+00, 1.03705e+02, -2.23264e+03, 5.70316e-03, -2.29404e+00, 1.08230e+02, + 2.77667e-04, -6.17180e+02, -7.20713e-02, 2.19013e-07, 2.49418e-02, -7.31662e-01, -1.00003e-05, + -3.79466e+01, 1.34552e-03, 5.72612e-09, -2.71950e+02, 8.58469e-02, -2.72912e-06, 2.02928e-11}; outCFF = c_Flow[0] + c_Flow[1] + (c_Flow[2] * cn1) + (c_Flow[3] * mach) + (c_Flow[4] * alt) + (c_Flow[5] * powFBW(cn1, 2)) + (c_Flow[6] * cn1 * mach) + (c_Flow[7] * cn1 * alt) + (c_Flow[8] * powFBW(mach, 2)) + (c_Flow[9] * mach * alt) + @@ -217,7 +218,7 @@ class Polynomial { (c_Flow[16] * cn1 * powFBW(alt, 2)) + (c_Flow[17] * powFBW(mach, 3)) + (c_Flow[18] * powFBW(mach, 2) * alt) + (c_Flow[19] * mach * powFBW(alt, 2)) + (c_Flow[20] * powFBW(alt, 3)); - return 2 * outCFF; + return outCFF * a330_f; } double oilTemperature(double energy, double preOilTemp, double maxOilTemp, double deltaTime) {