From 5c40815758cc7d4d52dd2d9cf389e2caaa636aaf Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 28 Jan 2019 00:00:19 -0500 Subject: [PATCH] no comment --- firmware/controllers/math/speed_density.cpp | 9 +++++---- firmware/controllers/math/speed_density.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/math/speed_density.cpp b/firmware/controllers/math/speed_density.cpp index 94e0f2f3e0..939a701573 100644 --- a/firmware/controllers/math/speed_density.cpp +++ b/firmware/controllers/math/speed_density.cpp @@ -82,14 +82,15 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_EN /** * @return air mass in grams */ -static float getCycleAirMass(float VE, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX) { +static float getCycleAirMass(float volumetricEfficiency, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX) { // todo: pre-calculate cylinder displacement to save one division float cylinderDisplacement = CONFIG(specs.displacement); - return (cylinderDisplacement * VE * MAP) / (GAS_R * tempK); + return (cylinderDisplacement * volumetricEfficiency * MAP) / (GAS_R * tempK); } -float getCylinderAirMass(float VE, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX) { - return getCycleAirMass(VE, MAP, tempK PASS_ENGINE_PARAMETER_SUFFIX) / CONFIG(specs.cylindersCount); +float getCylinderAirMass(float volumetricEfficiency, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX) { + return getCycleAirMass(volumetricEfficiency, MAP, tempK PASS_ENGINE_PARAMETER_SUFFIX) + / CONFIG(specs.cylindersCount); } /** diff --git a/firmware/controllers/math/speed_density.h b/firmware/controllers/math/speed_density.h index 62418358e9..074bd8f8d0 100644 --- a/firmware/controllers/math/speed_density.h +++ b/firmware/controllers/math/speed_density.h @@ -12,8 +12,8 @@ #define gramm_second_to_cc_minute(gs) ((gs) / 0.0119997981) #define cc_minute_to_gramm_second(ccm) ((ccm) * 0.0119997981) -float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_ENGINE_PARAMETER_SUFFIX); -float getCylinderAirMass(float VE, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX); +float getTCharge(int rpm, float tps, float coolantTemperature, float airTemperature DECLARE_ENGINE_PARAMETER_SUFFIX); +float getCylinderAirMass(float volumetricEfficiency, float MAP, float tempK DECLARE_ENGINE_PARAMETER_SUFFIX); float sdMath(float airMass, float AFR DECLARE_ENGINE_PARAMETER_SUFFIX); void setDefaultVETable(DECLARE_ENGINE_PARAMETER_SIGNATURE);