Hiya
I wrote an html based javascript to do the maths for my floating depression flow bench I attach the code here, to use it you need to adjust variable C if you do not agree with the 0.596 CD I use. If you copy and paste it in a text editor such as Notepad and save it as a .html or .htm extension it should fire up in a web browser, sometimes you have to tell the browser to run scripts. The script is not well written but I am self taught and it does work. It takes into account temp/pressure/humidity and assumes isentropic flow conditions. I am not going to enter into the ins and outs of the maths, suffice it to say it has been used by at least three students as part of their theses to gain Engineering degrees. If you use the code elsewhere please be polite enough to say it is written by Peter Burgess'. I hope you get as much enjoyment from flow benching as I have for the last 28 years!
Peter
<html>
<head>
<title>Flowbench JavaScript</title>
<meta
http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
<!--
var A = prompt("Enter valve diameter in millimetres","Valve diameter");
var X = prompt("Enter the reading on manometer X in millimetres", "Reading on Manometer X in millimetres");
var Y = prompt("Enter the reading on manometer Y in millimetres", "Reading on Manometer Y in millimetres");
var T = prompt("Enter the temperature reading in degrees centigrade", "Temperature in degrees C");
var P = prompt("Enter the atmospheric pressure reading in millibars", "Atmospheric pressure in millibars");
var V = prompt("Enter the vapour pressure of water at test temperature T centigrade", "Vapour pressure in N/m2");
var H = prompt("Enter the relative humidity as a decimal pointage", "Relative Humidity");
var O = prompt ("Enter the orifice diameter in millimetres","Orifice diameter in millimetres");
var O = eval(O);
var O = O/2000;
var O = eval(O);
var O = Math.pow(O,2);
var O = eval(O);
var O = 3.1415927 * O;
var O = eval(O);
var A = eval(A);
var X = eval(X);
var Y = eval(Y);
var T = eval(T);
var P = eval(P);
var V = eval(V);
var H = eval(H);
var X = X * 9.81;
var Y = Y * 9.81;
var Pr = P * 100;
var Pr = eval(Pr);
var dP = Pr-Y-X;
var dP = eval(dP);
var ndP = (dP * 1.404);
var ndP = eval(ndP);
var ndP = (X / ndP);
var ndP = eval(ndP);
var S = 1-(0.410072 * ndP);
var S = eval(S);
var Q = Pr-Y;
var Q = eval(Q);
var T = (T + 273);
var T = eval(T);
var K = (.378 * V * H);
var K = eval(K);
var Zz = (Q - K);
var Zz = eval(Zz);
var R = (Zz / T);
var R = eval(R);
var d = (R * 0.003482);
var d = eval(d);
var A = (A/2);
var A = eval(A);
var A = (A/1000);
var A = eval(A);
var A = Math.pow(A,2);
var A = eval(A);
var A =(A * 3.1415927);
var A = eval(A);
var C = 0.596;
var C = eval(C);
var B = (2 * d * X);
var B = eval(B);
var B = Math.pow(B,0.5);
var B = eval(B);
var M = (O * C * S * B);
var M = eval(M);
var V = (M / 1.225);
var V = eval(V);
var Z = ( 6229.35 / Y);
var Z = eval(Z);
var Z = Math.pow(Z,0.5);
var Z = eval(Z);
var F = (V * Z * 2118.8802);
var F = eval(F);
var F = F * 100;
var F = eval(F);
var F = Math.round(F) / 100;
var F = eval(F);
var E = (0.000789 / A);
var E = eval(E);
var E = (E * 0.62);
var E = eval(E);
var J = ( X / Y);
var J = eval(J);
var J = Math.pow(J,0.5);
var J = eval(J);
var Cd = (J * E);
var Cd = Cd * 100;
var Cd = eval(Cd);
var Cd = Math.round(Cd) / 100;
var Cd = eval(Cd);
var F = F * 100;
var F = eval(F);
var F = Math.round(F) / 100;
var F = eval(F);
var Cot = F * 0.632;
var Cot = eval(Cot);
var Cot = Cot * 100;
var Cot = eval(Cot);
var Cot = Math.round(Cot)/100;
var Coe = F * 0.775;
var Coe = eval(Coe);
var Coe = Coe * 100;
var Coe = eval(Coe);
var Coe = Math.round(Coe)/100;
var Cof = F * 1.058;
var Cof = eval(Cof);
var Cof = Cof * 100;
var Cof = eval(Cof);
var Cof = Math.round(Cof)/100;
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
</head>
<body bgcolor="#000066" text="#CCCCCC" link="#99FFFF" oncontextmenu="return false">
<div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:4; left: 18px; top: 286px"><img src="img0.gif" width="468" height="114"></div>
<script>
document.write("The airflow is "+ F + " c.f.m. at 25 inches H2O.");
document.write("<BR>The airflow is "+ Cot + " c.f.m. at 10 inches H2O.");
document.write("<BR>The airflow is "+ Coe +" c.f.m. at 15 inches H2O.");
document.write("<BR>The airflow is "+ Cof + " c.f.m. at 28 inches H2O.");
document.write("<BR>The coefficient of discharge is " + Cd );
</script>
<div id="Layer1" style="position:absolute; width:200px; height:45px; z-index:3; left: 13px; top: 176px">
<form name="form1" >
<input type="button" name="Button2" value="Click here to evaluate more flow figures" onClick="MM_goToURL('parent','flowmaths.html');return document.MM_returnValue">
</form>
</div>
<div id="Layer4" style="position:absolute; width:475px; height:35px; z-index:5; left: 23px; top: 411px">
</div>
</body>
</html>