refactoring: better method name
This commit is contained in:
parent
ce29b1ea17
commit
276df6e481
|
@ -511,7 +511,7 @@ static void showFuelInfo2(float rpm, float engineLoad) {
|
|||
|
||||
float baseFuelMs = getBaseTableFuel((int) rpm, engineLoad);
|
||||
|
||||
float magicAir = getAirMass(engineConfiguration, 1, 100, convertCelsiusToKelvin(20));
|
||||
float magicAir = getCylinderAirMass(engineConfiguration, 1, 100, convertCelsiusToKelvin(20));
|
||||
|
||||
scheduleMsg(&logger, "SD magic fuel %f", sdMath(engineConfiguration, magicAir, 14.7));
|
||||
scheduleMsg(&logger, "inj flow %fcc/min displacement %fL", engineConfiguration->injector.flow,
|
||||
|
|
|
@ -51,12 +51,16 @@ float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_EN
|
|||
*/
|
||||
#define GAS_R 0.28705
|
||||
|
||||
float getAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK) {
|
||||
float getCycleAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK) {
|
||||
// todo: pre-calculate cylinder displacement to save one division
|
||||
float cylinderDisplacement = engineConfiguration->specs.displacement / engineConfiguration->specs.cylindersCount;
|
||||
float cylinderDisplacement = engineConfiguration->specs.displacement;
|
||||
return (cylinderDisplacement * VE * MAP) / (GAS_R * tempK);
|
||||
}
|
||||
|
||||
float getCylinderAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK) {
|
||||
return getCycleAirMass(engineConfiguration, VE, MAP, tempK) / engineConfiguration->specs.cylindersCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return per cylinder injection time, in seconds
|
||||
*/
|
||||
|
@ -96,7 +100,7 @@ floatms_t getSpeedDensityFuel(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
float adjustedMap = map + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
efiAssert(!cisnan(adjustedMap), "NaN adjustedMap", 0);
|
||||
|
||||
float airMass = getAirMass(engineConfiguration, ENGINE(engineState.currentVE), adjustedMap, tChargeK);
|
||||
float airMass = getCylinderAirMass(engineConfiguration, ENGINE(engineState.currentVE), adjustedMap, tChargeK);
|
||||
efiAssert(!cisnan(airMass), "NaN airMass", 0);
|
||||
#if EFI_PRINTF_FUEL_DETAILS || defined(__DOXYGEN__)
|
||||
printf("map=%f adjustedMap=%f airMass=%f\t\n",
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
float getTCharge(int rpm, float tps, float coolantTemp, float airTemp DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void setDetaultVETable(persistent_config_s *config);
|
||||
float getAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK);
|
||||
float getCylinderAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK);
|
||||
float getCycleAirMass(engine_configuration_s *engineConfiguration, float VE, float MAP, float tempK);
|
||||
float sdMath(engine_configuration_s *engineConfiguration, float airMass, float AFR);
|
||||
|
||||
#define gramm_second_to_cc_minute(gs) ((gs) / 0.0119997981)
|
||||
|
|
|
@ -31,7 +31,7 @@ void testSpeedDensity(void) {
|
|||
|
||||
eth.ec->injector.flow = gramm_second_to_cc_minute(5.303);
|
||||
|
||||
float airMass = getAirMass(eth.ec, 0.92, 98, 293.16);
|
||||
float airMass = getCylinderAirMass(eth.ec, 0.92, 98, 293.16);
|
||||
|
||||
assertEquals(0.9371, airMass);
|
||||
|
||||
|
|
Loading…
Reference in New Issue