var KinematikVizkosite = 0.000001004; function ReynoltSayisi(Hiz, Cap, KinVizkozite) { return (Hiz * Cap / KinVizkozite); } function SuDarbesiHesap(piccap, pK_katsayisi, ps, pHiz) { var DalgaHizi = 9900 / Math.sqrt(48.3 + pK_katsayisi * piccap / ps); return (DalgaHizi * pHiz / 9.81); } function colebrookeFonk(pLamda, pk, pD, pRe) { var a, b, c; a = pk / pD / 3.71; b = 2.51 / pRe / Math.sqrt(pLamda); c = 2 * Math.log(a + b) * 0.43429448190325182765; return (1 / Math.sqrt(pLamda) + c); } function colebrookeTurev(pLamda, pk, pD, pRe, pfnc) { var dh = 0.0000001; var a = colebrookeFonk(pLamda + dh, pk, pD, pRe); return ((a - pfnc) / dh); } function colebrookeLamda(pk, pD, pRe) { var x1, x2, fnc, trv; x1 = 0.001; while (true) { fnc = colebrookeFonk(x1, pk, pD, pRe); trv = colebrookeTurev(x1, pk, pD, pRe, fnc); x2 = x1 - fnc / trv; if (Math.abs(x2 - x1) < 0.000001) { break; } x1 = x2; } return x1; } function Lamda(pk, pD, pRe) { var a, b, lamda; a = colebrookeLamda(pk, pD, pRe); b = pRe * Math.sqrt(a) * pk / pD; //c = 30.0 * pD * Math.pow(pRe, -7 / 8); if (pRe < 2500) { lamda = 64.0 / pRe; } else if (b > 200) { lamda = tamTurbulansLamda(pk, pD); } else { lamda = a; } return lamda; } function tamTurbulansLamda(pk, pD) { return (Math.pow(1 / (2 * Math.log(3.71 / (pk / pD)) * 0.43429448190325182765), 2)); } function MoodyCapFonk(pCap, pDebi, pEgim, pDolOrani, pk, pKinVizk) { var xDebiOrani, xDoluAkistaDebi, xAlan, xHiz, D; xDebiOrani = KanalDebiOrani(pDolOrani); xDoluAkistaDebi = pDebi / xDebiOrani; xAlan = Math.PI * Math.pow(pCap, 2) / 4; xHiz = xDoluAkistaDebi / xAlan; D = pCap - Lamda(pk, pCap, ReynoltSayisi(xHiz, pCap, pKinVizk)) * Math.pow(xHiz, 2) / (2 * 9.81 * pEgim); return (D); } function MoodyCapTurev(pCap, pDebi, pEgim, pDolOrani, pk, pKinVizk, pmodycap) { var dh = 0.00001, A; A = MoodyCapFonk(pCap + dh, pDebi, pEgim, pDolOrani, pk, pKinVizk); return ((A - pmodycap) / dh); } function MoodyCap(pDebi, pEgim, pDolOrani, pk, pKinVizk) { // Debi m3/s // k m // Kin. vizk m2/s var x1, x2, fnc, trv; x1 = Math.sqrt(4 * pDebi / Math.PI / 1.5); while (true) { fnc = MoodyCapFonk(x1, pDebi, pEgim, pDolOrani, pk, pKinVizk); trv = MoodyCapTurev(x1, pDebi, pEgim, pDolOrani, pk, pKinVizk, fnc); x2 = x1 - fnc / trv; if (Math.abs(x2 - x1) < 0.000001) { break; } x1 = x2; } return (x1); } function MoodyEgim(pHiz, pk, pCap, pKinVizk) { var A, B; A = Lamda(pk, pCap, ReynoltSayisi(pHiz, pCap, pKinVizk)); B = Math.pow(pHiz, 2) / pCap / (2 * 9.81); return (A * B); } function MoodyCapBasincliFonk(pCap, pDebi, pEgim, pk, pKinVizk) { var xAlan, xHiz, D; xAlan = Math.PI * Math.pow(pCap, 2) / 4; xHiz = pDebi / xAlan; D = pCap - Lamda(pk, pCap, ReynoltSayisi(xHiz, pCap, pKinVizk)) * Math.pow(xHiz, 2) / (2 * 9.81 * pEgim); return (D); } function MoodyCapBasincliTurev(pCap, pDebi, pEgim, pk, pKinVizk, pmodycap) { var dh = 0.00001; var A; A = MoodyCapBasincliFonk(pCap + dh, pDebi, pEgim, pk, pKinVizk); return ((A - pmodycap) / dh); } function MoodyCapBasincli(pDebi, pEgim, pk, pKinVizk) { // Debi m3/s // k m // Kin. vizk m2/s var x1, x2, fnc, trv; x1 = Math.sqrt(4 * pDebi / Math.PI / 1.5); while (true) { fnc = MoodyCapBasincliFonk(x1, pDebi, pEgim, pk, pKinVizk); trv = MoodyCapBasincliTurev(x1, pDebi, pEgim, pk, pKinVizk, fnc); x2 = x1 - fnc / trv; if (Math.abs(x2 - x1) < 0.000001) { break; } x1 = x2; } return (x1); } function HazzenCapFonk(pCap, pDebi, pEgim, pHazzenKatsayisi) { var xAlan, xHiz; xAlan = Math.PI * Math.pow(pCap, 2) / 4.0; xHiz = pDebi / xAlan; return (pCap - 4 * Math.pow(xHiz / pHazzenKatsayisi / Math.pow(pEgim, 0.54), 1.0 / 0.63)); } function HazzenCapTurev(pCap, pDebi, pEgim, pHazzenKatsayisi, pfonk) { var dh = 0.00001; var A; A = HazzenCapFonk(pCap + dh, pDebi, pEgim, pHazzenKatsayisi); return ((A - pfonk) / dh); } function HazzenCap(pDebi, pEgim, pHazzenKatsayisi) { // Debi m3/s var x1, x2, fnc, trv; x1 = Math.sqrt(4 * pDebi / Math.PI / 1.5); while (true) { fnc = HazzenCapFonk(x1, pDebi, pEgim, pHazzenKatsayisi); trv = HazzenCapTurev(x1, pDebi, pEgim, pHazzenKatsayisi, fnc); x2 = x1 - fnc / trv; if (Math.abs(x2 - x1) < 0.000001) { break; } x1 = x2; } return (x1); } function HazzenEgim(pHiz, piccap, pHazzenKatsayisi) { return (Math.pow(pHiz / 0.849 / pHazzenKatsayisi / Math.pow(piccap / 4, 0.63), 1.0 / 0.54)); } function HazzenHiz(piccap, pegim, pHazzenKatsayisi) { return (0.849 * pHazzenKatsayisi * Math.pow(piccap / 4.0, 0.63) * Math.pow(pegim, 0.54)); } function fonk1(pX, pD, pH, pk, pkinvizk) { var a, b, c, f; a = 2.51 / ReynoltSayisi(pX, pD, pkinvizk); b = pk / (3.71 * pD); c = Math.sqrt(2 * 9.81 * pH * pD); f = pX / c + 2 * Math.log10(a * pX / c + b); return (f); } function turev1(pX, pD, pH, pk, pkinvizk) { var a, b, c, t; a = 2.51 / ReynoltSayisi(pX, pD, pkinvizk); b = pk / (3.71 * pD); c = Math.sqrt(2 * 9.81 * pH * pD); t = 1 / c + 2 * a / (Math.log(10) * (a * pX / c + b)); return (t); } function colebrookeHiz(pkayip, pD, pk, pkinvizk) { var x1, x2; x1 = 0.001; while (true) { x2 = x1 - fonk1(x1, pD, pkayip, pk, pkinvizk) / turev1(x1, pD, pkayip, pk, pkinvizk); if (Math.abs(x2 - x1) < 0.00000001) { break; } x1 = x2; } return x1; } function yuvarla(val, basamak) { return (Math.round(val * Math.pow(10, basamak)) / Math.pow(10, basamak)); } function asagi_yuvarla(val, basamak) { return (Math.floor(val * Math.pow(10, basamak)) / Math.pow(10, basamak)); } function yukari_yuvarla(val, basamak) { return (Math.ceil(val * Math.pow(10, basamak)) / Math.pow(10, basamak)); }