{"id":517,"date":"2016-11-17T17:59:53","date_gmt":"2016-11-17T09:59:53","guid":{"rendered":"http:\/\/goyuwei.com\/blog\/?p=517"},"modified":"2016-11-17T18:04:02","modified_gmt":"2016-11-17T10:04:02","slug":"17112016-darcy-friction-factor-checker-%e8%be%be%e8%a5%bf%e6%91%a9%e6%93%a6%e7%b3%bb%e6%95%b0%e6%9f%a5%e8%af%a2%e5%99%a8","status":"publish","type":"post","link":"https:\/\/goyuwei.com\/blog\/?p=517","title":{"rendered":"17\/11\/2016 \u2013 Darcy Friction Factor Checker \u2013 \u8fbe\u897f\u6469\u64e6\u7cfb\u6570\u67e5\u8be2\u5668"},"content":{"rendered":"<p>(English version follows Chinese Part)<\/p>\n<p>\u5176\u5b9e\u8fd9\u4e2a\u5c31\u662f\u4e4b\u524d\u8c08\u8fc7\u7684<a href=\"http:\/\/goyuwei.com\/blog\/?p=507\" target=\"_blank\">\u83ab\u8fea\u56fe\u67e5\u8be2\u5668<\/a>\uff0c \u4f46\u662f\u540e\u6765\u56e0\u4e3a\u5b66\u4e60\u4e0a\u6bd4\u8f83\u5fd9\uff0c\u5c31\u6ca1\u600e\u4e48\u7814\u7a76\u3002\u8fd9\u4e24\u5929\u770b\u4e86\u4e00\u4e0b\uff0c\u4f3c\u4e4e\u5e76\u4e0d\u9700\u8981\u505a\u83ab\u8fea\u56fe\u67e5\u8be2\u5668\u8fd9\u4e48\u590d\u6742\uff0c\u53ea\u9700\u8981\u6839\u636e\u8f93\u5165\u53c2\u6570\u4ee3\u5165\u903c\u8fd1\u516c\u5f0f\u8fd0\u7b97\u5c31\u53ef\u4ee5\u5f97\u5230\u6240\u6c42\u6469\u64e6\u7cfb\u6570\u3002\u5177\u4f53\u9700\u8981\u5229\u7528JavaScript\u6765\u5b9e\u73b0\uff0c\u901a\u8fc7\u8f93\u5165\u7684\u53c2\u6570\uff0c\u5728\u670d\u52a1\u5668\u7aef\u6309\u7167\u903c\u8fd1\u516c\u5f0f\u8ba1\u7b97\uff0c\u663e\u793a\u8fd0\u7b97\u7ed3\u679c\u3002<\/p>\n<p>Actually, it is the <a href=\"http:\/\/goyuwei.com\/blog\/?p=507\" target=\"_blank\">moody chart checker<\/a> 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\u00a0equation approximation, the display the result on the page. JavaScript will be used\u00a0to develop the calculator.<\/p>\n<p>\u6309\u7167<a href=\"https:\/\/en.wikipedia.org\/wiki\/Darcy_friction_factor_formulae\" target=\"_blank\">Darcy friction factor formulae<\/a>\u4e2d\u63d0\u4f9b\u4e86\u5f88\u591a\u79cd\u903c\u8fd1\u516c\u5f0f\u3002<\/p>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Darcy_friction_factor_formulae\" target=\"_blank\">Darcy friction factor formulae<\/a>\u00a0shows many\u00a0equation approximations.<\/p>\n<p>\u9996\u5148\u5c1d\u8bd5\u4e86\u4e00\u4e0bAlashkar\u516c\u5f0f\u3002<\/p>\n<p>Try the\u00a0Alashkar\u00a0equation.<\/p>\n<p><a href=\"http:\/\/goyuwei.com\/blog\/wp-content\/uploads\/2016\/11\/20161117-Darcy-Friction-Factor.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-518\" src=\"http:\/\/goyuwei.com\/blog\/wp-content\/uploads\/2016\/11\/20161117-Darcy-Friction-Factor.jpg\" alt=\"20161117-darcy-friction-factor\" width=\"838\" height=\"163\" srcset=\"https:\/\/goyuwei.com\/blog\/wp-content\/uploads\/2016\/11\/20161117-Darcy-Friction-Factor.jpg 838w, https:\/\/goyuwei.com\/blog\/wp-content\/uploads\/2016\/11\/20161117-Darcy-Friction-Factor-300x58.jpg 300w, https:\/\/goyuwei.com\/blog\/wp-content\/uploads\/2016\/11\/20161117-Darcy-Friction-Factor-768x149.jpg 768w\" sizes=\"auto, (max-width: 838px) 100vw, 838px\" \/><\/a><\/p>\n<p>\u8fd0\u7b97\u90e8\u5206\u7684JS\u4e2d\u4ee3\u7801\u5927\u6982\u5982\u4e0b\uff1a<\/p>\n<p>Calculation part of the JS code:<\/p>\n<p>[code language=&#8221;javascript&#8221;]<\/p>\n<p>function cal(form)<br \/>\n{<br \/>\nvar a=Number(form.a.value);<br \/>\nvar b=Number(form.b.value);<br \/>\nvar c=Number(form.c.value);<br \/>\nvar d=a\/(b*3.7065);<br \/>\nvar e=2.5226\/c;<br \/>\nvar f=1.665368035*e;<br \/>\nvar g=Math.pow(f,0.8373492157);<br \/>\nvar h=d+g;<br \/>\nvar i=Math.log(h);<br \/>\nvar j=e*i;<br \/>\nvar k=0.8784893582*j;<br \/>\nvar l=d-k;<br \/>\nvar m=Math.log(l);<br \/>\nvar n=e*m;<br \/>\nvar o=0.8686068432*n;<br \/>\nvar p=d-o;<br \/>\nvar q=Math.pow(o,-2);<br \/>\nvar r=Math.log(q);<br \/>\nform.s.value = 1.325474505*r;<br \/>\n}<\/p>\n<p>[\/code]<\/p>\n<p>\u7136\u800c\u6c42\u51fa\u6765\u7684\u7ed3\u679c\u4f3c\u4e4e\u5e76\u4e0d\u5bf9\u3002\u8fd8\u9700\u8981\u518d\u7814\u7a76\u7814\u7a76\u3002<\/p>\n<p>It works but the result is strange, more research to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(English version follows Chinese Part) \u5176\u5b9e\u8fd9\u4e2a\u5c31\u662f\u4e4b\u524d\u8c08\u8fc7\u7684\u83ab\u8fea\u56fe\u67e5\u8be2 &hellip; <a href=\"https:\/\/goyuwei.com\/blog\/?p=517\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">17\/11\/2016 \u2013 Darcy Friction Factor Checker \u2013 \u8fbe\u897f\u6469\u64e6\u7cfb\u6570\u67e5\u8be2\u5668<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[5,21,9],"tags":[],"class_list":["post-517","post","type-post","status-publish","format-aside","hentry","category-info-tech-","category-lab-log-","category-mechanical-engineering-","post_format-post-format-aside"],"_links":{"self":[{"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=517"}],"version-history":[{"count":0,"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/517\/revisions"}],"wp:attachment":[{"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goyuwei.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}