Last active
August 3, 2020 02:53
-
-
Save brandonros/172b33f92bac2af840dd4ae14e4b026a to your computer and use it in GitHub Desktop.
VE (volumetric efficiency) calculator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://atgtraining.com/atg-volumetric-efficiency-calculator/ | |
const calculateVe = ({engineSize, rpm, maf, iat, cylinder, pressuure, mafSelection, iatSelection, pressureSelection}) => { | |
let val = 0, cid = 0, lb = 0, degc = 0, degf = 0, tempK = 0, v = 0, molorMass = 0.28705, gb_air_vol = 0, gsec = 0; | |
let gb_theo_air_vol = 0, lMin = 0, estv = 0, load = 0, cylAir = 0, refCylAir = 0, estGross = 0, estRWHP = 0; | |
cid = engineSize / 0.0163871; | |
if (mafSelection == 0) { // g/sec | |
lb = maf * 0.00220462 * 60; | |
} else { // lb/min | |
gsec = maf / (0.00220462 * 60); | |
maf = gsec; | |
lb = gsec * 0.00220462 * 60; | |
} | |
if (iatSelection == 0) { // fahrenheit | |
degc = (iat - 32) * 5 / 9; | |
} else { // celsius | |
degf = iat * 9 / 5 + 32; | |
degc = (degf - 32) * 5 / 9; | |
} | |
tempK = degc + 273.15; | |
degc = (degc).toFixed(2); | |
tempK = (tempK).toFixed(2); | |
if (pressureSelection == 0) { // kPa | |
} else { // in/hg | |
pressuure = pressuure / 0.2953; | |
} | |
v = (maf * tempK * 0.28705) / pressuure; | |
gb_air_vol = v * 60; | |
gb_theo_air_vol = engineSize * rpm / 2; | |
estv = (gb_air_vol / gb_theo_air_vol) * 100; | |
cylAir = maf * 120 / (rpm * cylinder); | |
refCylAir = engineSize * 1.168 / cylinder; | |
estGross = lb * 10; | |
estRWHP = estGross * 0.85; | |
load = (cylAir / refCylAir) * 100; | |
return { | |
cylAir, | |
refCylAir, | |
estGross, | |
estRWHP, | |
estv, | |
load | |
} | |
} | |
console.log(calculateVe({ | |
// constant | |
engineSize: parseFloat('4.0'), // liters | |
cylinder: parseInt('8'), | |
// unit selections | |
mafSelection: 0, | |
iatSelection: 0, | |
pressureSelection: 0, | |
// variables | |
rpm: parseInt('6500'), // rpm | |
maf: parseFloat('145.00'), // g/sec | |
iat: parseInt('100'), // fahrenheit | |
pressuure: parseFloat('101.325'), // kaPa | |
})) |
In terms of air/fuel ratio, pump gas is usually around 12.5:1 for maximum power and you add fuel with boost for safety. 10.5 or 11 isn't uncommon on boosted engines.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AFR below 10: too rich; can seriously foul spark plugs and eventually wash the oil off cylinder walls
AFR above 13: too lean; run too hot