Skip to content

Commit

Permalink
fix(fadec): correctur of fuel flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Revyn112 committed Oct 28, 2023
1 parent b934cee commit 374c0e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion hdw-a339x/src/wasm/fadec_a320/src/RegPolynomials.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class Polynomial {
/// </summary>
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,
Expand Down
9 changes: 5 additions & 4 deletions hdw-a339x/src/wasm/fadec_a330/src/RegPolynomials.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,11 @@ class Polynomial {
/// </summary>
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) +
Expand All @@ -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) {
Expand Down

0 comments on commit 374c0e0

Please sign in to comment.