17/11/2016 – Darcy Friction Factor Checker – 达西摩擦系数查询器

(English version follows Chinese Part)

其实这个就是之前谈过的莫迪图查询器, 但是后来因为学习上比较忙,就没怎么研究。这两天看了一下,似乎并不需要做莫迪图查询器这么复杂,只需要根据输入参数代入逼近公式运算就可以得到所求摩擦系数。具体需要利用JavaScript来实现,通过输入的参数,在服务器端按照逼近公式计算,显示运算结果。

Actually, it is the moody chart checker I have mentioned before, but I was too busy for my courses to think about how to develop the checker. In these few days I found that there is no need to build a chart checker, a web calculator will work. Input necessary values and calculate with equation approximation, the display the result on the page. JavaScript will be used to develop the calculator.

按照Darcy friction factor formulae中提供了很多种逼近公式。

Darcy friction factor formulae shows many equation approximations.

首先尝试了一下Alashkar公式。

Try the Alashkar equation.

20161117-darcy-friction-factor

运算部分的JS中代码大概如下:

Calculation part of the JS code:

[code language=”javascript”]

function cal(form)
{
var a=Number(form.a.value);
var b=Number(form.b.value);
var c=Number(form.c.value);
var d=a/(b*3.7065);
var e=2.5226/c;
var f=1.665368035*e;
var g=Math.pow(f,0.8373492157);
var h=d+g;
var i=Math.log(h);
var j=e*i;
var k=0.8784893582*j;
var l=d-k;
var m=Math.log(l);
var n=e*m;
var o=0.8686068432*n;
var p=d-o;
var q=Math.pow(o,-2);
var r=Math.log(q);
form.s.value = 1.325474505*r;
}

[/code]

然而求出来的结果似乎并不对。还需要再研究研究。

It works but the result is strange, more research to do.

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注