Created
February 15, 2017 13:55
-
-
Save green3g/2b7d40f1cd0ca769e91b3409b2d50caa to your computer and use it in GitHub Desktop.
Fire Flow Test in Javascript
This file contains 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
function calculateRatedCapacity(staticPressure, residualPressure, outletDiameter, pitotReading) { | |
var outletCoefficient = 0.9; | |
var MULTIPLIER = 29.83; | |
var EXPONENT = 0.54; | |
if (outletDiameter > 2.5) { | |
outletCoefficient = 0.75; | |
} | |
var pressureToSubtract; | |
if (staticPressure >= 40) { | |
pressureToSubtract = 20; | |
} | |
if (staticPressure < 40) { | |
pressureToSubtract = staticPressure / 2; | |
} | |
var totalTestFlow = MULTIPLIER * outletCoefficient * Math.pow(outletDiameter, 2) * Math.sqrt(pitotReading); | |
var ratedCapacity = Math.pow( | |
(staticPressure - pressureToSubtract) / | |
(staticPressure - residualPressure), | |
EXPONENT) * totalTestFlow; | |
return ratedCapacity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment