Research:
speed density.
The engine has pressure and temperature sensors to figure out the
density of air in the manifold. Then tables in the DME are used to determine the volume of air (at
STP I suppose?) flowing through the engine at different operating points (engine speed, degrees of crankshaft rotation, manifold pressure and manifold temperature if correction is needed, cam phasing, and maybe others). Once the
density and volume are known the mass of the air can be determined. Then the mass flow rate is the mass of air over time.
density = absolute pressure / (absolute temperature * specific gas constant for air)
mass = density * volume
mass flow rate = mass / time
I am a little unsure about the correction of the volume. Maybe someone else can chime in. I think there are some chemical or mechanical engineers around that would probably know. There is also something called
corrected flow which uses different pressure and temperature values than STP. Seems like corrected flow is used when talking about mass flow, which is what we are talking about (grams/second or pounds/minute). Perhaps if using corrected flow the volume would not be corrected and an additional step of correcting the mass flow would occur at the end?
It is important to note the density calculation uses absolute values. I guess weird things happen at absolute zero temperature regarding density, but that's a conversation for another day. You could lose hours on Wikipedia reading about that.