-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
618 lines (552 loc) · 24.5 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<!DOCTYPE html>
<html>
<head>
<title>README.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<style>
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
body {
font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
font-size: var(--vscode-markdown-font-size, 14px);
padding: 0 26px;
line-height: var(--vscode-markdown-line-height, 22px);
word-wrap: break-word;
}
#code-csp-warning {
position: fixed;
top: 0;
right: 0;
color: white;
margin: 16px;
text-align: center;
font-size: 12px;
font-family: sans-serif;
background-color:#444444;
cursor: pointer;
padding: 6px;
box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}
#code-csp-warning:hover {
text-decoration: none;
background-color:#007acc;
box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}
body.scrollBeyondLastLine {
margin-bottom: calc(100vh - 22px);
}
body.showEditorSelection .code-line {
position: relative;
}
body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
content: "";
display: block;
position: absolute;
top: 0;
left: -12px;
height: 100%;
}
body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
left: -30px;
}
.vscode-light.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(0, 0, 0, 0.15);
}
.vscode-light.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(0, 0, 0, 0.40);
}
.vscode-light.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-dark.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 255, 255, 0.4);
}
.vscode-dark.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 255, 255, 0.60);
}
.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
.vscode-high-contrast.showEditorSelection .code-active-line:before {
border-left: 3px solid rgba(255, 160, 0, 0.7);
}
.vscode-high-contrast.showEditorSelection .code-line:hover:before {
border-left: 3px solid rgba(255, 160, 0, 1);
}
.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
border-left: none;
}
img {
max-width: 100%;
max-height: 100%;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:focus,
input:focus,
select:focus,
textarea:focus {
outline: 1px solid -webkit-focus-ring-color;
outline-offset: -1px;
}
hr {
border: 0;
height: 2px;
border-bottom: 2px solid;
}
h1 {
padding-bottom: 0.3em;
line-height: 1.2;
border-bottom-width: 1px;
border-bottom-style: solid;
}
h1, h2, h3 {
font-weight: normal;
}
table {
border-collapse: collapse;
}
table > thead > tr > th {
text-align: left;
border-bottom: 1px solid;
}
table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
padding: 5px 10px;
}
table > tbody > tr + tr > td {
border-top: 1px solid;
}
blockquote {
margin: 0 7px 0 5px;
padding: 0 16px 0 10px;
border-left-width: 5px;
border-left-style: solid;
}
code {
font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
font-size: 1em;
line-height: 1.357em;
}
body.wordWrap pre {
white-space: pre-wrap;
}
pre:not(.hljs),
pre.hljs code > div {
padding: 16px;
border-radius: 3px;
overflow: auto;
}
pre code {
color: var(--vscode-editor-foreground);
tab-size: 4;
}
/** Theming */
.vscode-light pre {
background-color: rgba(220, 220, 220, 0.4);
}
.vscode-dark pre {
background-color: rgba(10, 10, 10, 0.4);
}
.vscode-high-contrast pre {
background-color: rgb(0, 0, 0);
}
.vscode-high-contrast h1 {
border-color: rgb(0, 0, 0);
}
.vscode-light table > thead > tr > th {
border-color: rgba(0, 0, 0, 0.69);
}
.vscode-dark table > thead > tr > th {
border-color: rgba(255, 255, 255, 0.69);
}
.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
border-color: rgba(0, 0, 0, 0.18);
}
.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
border-color: rgba(255, 255, 255, 0.18);
}
</style>
<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
color: #8e908c;
}
/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #c82829;
}
/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5871f;
}
/* Tomorrow Yellow */
.hljs-attribute {
color: #eab700;
}
/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #718c00;
}
/* Tomorrow Blue */
.hljs-title,
.hljs-section {
color: #4271ae;
}
/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
color: #8959a8;
}
.hljs {
display: block;
overflow-x: auto;
color: #4d4d4c;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
</style>
<style>
/*
* Markdown PDF CSS
*/
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
padding: 0 12px;
}
pre {
background-color: #f8f8f8;
border: 1px solid #cccccc;
border-radius: 3px;
overflow-x: auto;
white-space: pre-wrap;
overflow-wrap: break-word;
}
pre:not(.hljs) {
padding: 23px;
line-height: 19px;
}
blockquote {
background: rgba(127, 127, 127, 0.1);
border-color: rgba(0, 122, 204, 0.5);
}
.emoji {
height: 1.4em;
}
code {
font-size: 14px;
line-height: 19px;
}
/* for inline code */
:not(pre):not(.hljs) > code {
color: #C9AE75; /* Change the old color so it seems less like an error */
font-size: inherit;
}
/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
page-break-after: always;
}
</style>
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
<script>
mermaid.initialize({
startOnLoad: true,
theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
? 'dark'
: 'default'
});
</script>
<h1 id="internal-fluid-flow"><code>internal-fluid-flow</code></h1>
<p><a href="https://zenodo.org/badge/latestdoi/509430202"><img src="https://zenodo.org/badge/509430202.svg" alt="DOI"></a>
<a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPLv3-blue.svg" alt="License: GPL v3"></a>
<img src="https://img.shields.io/github/v/release/aumpierre-unb/Internal-Fluid-Flow-for-Scilab" alt="GitHub release (latest by date)"></p>
<h2 id="install-and-load-internal-fluid-flow-toolbox-for-scilab">Install and load <code>internal-fluid-flow</code> Toolbox for Scilab</h2>
<p>1. Download <code>v0.2.2.zip</code> file from <a href="https://github.com/aumpierre-unb/Internal-Fluid-Flow-for-Scilab/releases">Releases</a>.</p>
<p>2. Set Scilab current directory to the download folder.</p>
<p>3. To install and load the toolbox, type:</p>
<pre class="hljs"><code><div>atomsInstall('v0.2.2.zip'),..
atomsLoad('inflowlib')
</div></code></pre>
<h2 id="citation-of-internal-fluid-flow-toolbox-for-scilab">Citation of <code>internal-fluid-flow</code> Toolbox for Scilab</h2>
<p>You can cite all versions (both released and pre-released), by using
<a href="https://doi.org/10.5281/zenodo.6927994">DOI 105281/zenodo.6927994</a>.</p>
<p>This DOI represents all versions, and will always resolve to the latest one.</p>
<p>To cite the last released version, please check
https://zenodo.org/account/settings/github/repository/aumpierre-unb/Internal-Fluid-Flow-for-Scilab.</p>
<hr>
<p>The following is a very short introduction to the steady internal flow of an incompressible and inviscid fluid and to the <code>internal-fluid-flow</code> Toolbox for Scilab.</p>
<p>Internal flow is a pretty extensive topic in fluid mechanics and there are a lot of important and interesting observations related to it that are not taken into account in this text, because they have no direct impact the computation performed by the functions in this toolbox. Our focus here is a small set of equations that described the phenomenon and are required to solve problems on internal fluid flow.</p>
<p>This text is divided in two main sections: <strong>The Theory</strong> and <strong>The <code>internal-fluid-flow</code> Toolbox for Scilab</strong>.</p>
<h2 id="the-theory">The Theory</h2>
<h3 id="the-bernoulli-equation">The Bernoulli Equation</h3>
<p>The Bernoulli equation is an expression of the mechanical energy balance for a very particular situation:</p>
<ul>
<li>internal steady flow of an</li>
<li>incompressible inviscid fluid, where</li>
<li>friction effects and tube fittings can be neglected.</li>
</ul>
<p>For such a case, the mechanical energy is conserved, and for any two points 1 and 2 we have</p>
<p>$$
{\rho v_2^2 \over 2} + \rho g z_2 + p_2 =
{\rho v_1^2 \over 2} + \rho g z_1 + p_1
$$</p>
<p>or</p>
<p>$$
{v_2^2 \over 2g}+z_2+{p_2 \over \rho g}=
{v_1^2 \over 2g}+z_1+{p_1 \over \rho g}
$$</p>
<p>where</p>
<ul>
<li><em>ρ</em> is the fluid's density,</li>
<li><em>v</em> is the flow speed,</li>
<li><em>g</em> is the gravitational acceleration,</li>
<li><em>z</em> is the elevation, and</li>
<li><em>p</em> is the static pressure.</li>
</ul>
<h3 id="head-loss">Head Loss</h3>
<p>The flow of viscous fluids is accompanied of energy dispersion, which can be measured as pressure drop or, equivalently, as head loss <em>h</em>, by the Darcy-Weisbach equation,</p>
<p>$$
h=f{v^2 \over 2g} {L \over D}
$$</p>
<p>where <em>f</em> is the Darcy friction factor, <em>L</em> is the pipe's length and <em>D</em> is the pipe's hydraulic diameter,</p>
<p>$$
D={4A \over P}
$$</p>
<p>where <em>A</em> is the cross-sectional area of the flow and <em>P</em> is the wet perimeter of the cross-section. <em>f</em> is described as a function of the Reynolds number,</p>
<p>$$
Re={\rho vg \over \mu}
$$</p>
<p>and the pipe's relative roughness,</p>
<p>$$
\varepsilon={k \over D}
$$</p>
<p>where</p>
<ul>
<li><em>μ</em> is the fluid's dynamic viscosity and</li>
<li><em>k</em> is the pipe's[ internal surface] roughness.</li>
</ul>
<p>The Reynolds number <em>Re</em>, the Darcy friction factor <em>f</em>, and the relative roughness <em>ε</em> completely describe the internal flow of incompressible viscous fluids, for both laminar and turbulent regimes. Usually, <em>f</em> is given as a function of <em>Re</em> and <em>ε</em>.</p>
<p>The simplest problems on internal fluid flow consist on computing one of them given the two other. More complex situations arise when only one or none of those variables is known. Instead, dimensional variables involved are given. However not always, in most cases iterative computation is required.</p>
<h3 id="laminar-flow-and-turbulent-flow">Laminar Flow and Turbulent Flow</h3>
<p>For laminar flow, <em>Re</em> < 2,300 (typically), the Darcy friction factor is given by the Poiseuille condition,</p>
<p>$$
f={64 \over Re}
$$</p>
<p>For turbulent flow, <em>Re</em> > 2,300 (typically), the Darcy friction factor is given implicitly by the Colebrook-White equation,</p>
<p>$$
{1 \over \sqrt{f}}=2\ \mathrm{log} {1 \over\displaystyle {\varepsilon \over 3.7} + {2.51 \over {Re \sqrt{f}}}}
$$</p>
<h2 id="the-internal-fluid-flow-toolbox-for-scilab">The <code>internal-fluid-flow</code> Toolbox for Scilab</h2>
<p><code>internal-fluid-flow</code> provides the following functions:</p>
<ul>
<li><code>epsRe2fD</code></li>
<li><code>epsfD2Re</code></li>
<li><code>hDeps2fDRe</code></li>
<li><code>hveps2fDRe</code></li>
<li><code>hQeps2fDRe</code></li>
<li><code>hvthk2fDRe</code></li>
<li><code>hQthk2fDRe</code></li>
</ul>
<h3 id="epsre2fd"><code>epsRe2fD</code></h3>
<p><code>epsRe2fD</code> computes the Darcy friction factor <em>f</em> given the relative roughness <em>ε</em> and the Reynolds number <em>Re</em>. If given <em>Re</em> < 2,500, then flow is assumed to be laminar and <em>f</em> is computed using of the Poiseuille condition. Otherwise, flow is assumed to be turbulent and <em>f</em> is computed using the Colebrook-White equation.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[f]=epsRe2fD(Re,[eps[,s]])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Darcy friction factor <em>f</em> given the Reynolds number <em>Re</em>=25,000 and the relative roughness <em>ε</em> = 0.0044:</p>
<pre class="hljs"><code><div>f=epsRe2fD(2.5e4,4.4e-3,%f)
</div></code></pre>
<p>or</p>
<pre class="hljs"><code><div>Re=2.5e4,eps=4.4e-3,f=epsRe2fD(Re,eps)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Darcy friction factor <em>f</em> given the Reynolds number <em>Re</em>=25,000 and the relative roughness <em>ε</em> = 0.0044 and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>f=epsRe2fD(2.5e4,4.4e-3,%t)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Darcy friction factor <em>f</em> given the Reynolds number <em>Re</em>=25,000:</p>
<pre class="hljs"><code><div>f=epsRe2fD(2.5e4)
</div></code></pre>
<h3 id="epsfd2re"><code>epsfD2Re</code></h3>
<p><code>espfD2Re</code> computes the Reynolds number <em>Re</em> given the relative roughness <em>ε</em> and the Darcy friction factor <em>f</em>. Depending on the inputs, solution may be laminar or turbulent flow, or either for smooth pipes with higher friction, or none for lower friction and rough pipes. If the Poiseuille condition produces <em>Re</em> < 2,500, laminar solution is accepted. If given <em>f</em> is possible for turbulent flow,</p>
<p>$$
{1 \over \sqrt{f}}<2\ \mathrm{log} {1 \over\displaystyle {\varepsilon \over 3.7}}
$$</p>
<p>(which is Colebrook-White equation for for elevated <em>Re</em>) the turbulent solution is accepted. If both solutions are accepted, espfD2Re returns both answers. If neither laminar or turbulent solutions are accepted, espfD2Re returns an empty matrix. If given <em>ε</em> > 0.05, execution is aborted.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re]=epsfD2Re(f[,eps[,s]])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds <em>Re</em> number given the Darcy friction factor <em>f</em> = 0.033 and the relative roughness <em>ε</em> = 0.0044:</p>
<pre class="hljs"><code><div>Re=epsfD2Re(3.3e-2,4.4e-3,%f)
</div></code></pre>
<p>or</p>
<pre class="hljs"><code><div>f=3.3e-2,eps=4.4e-3,Re=epsfD2Re(f,eps)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds <em>Re</em> number given the Darcy friction factor <em>f</em> = 0.033 and the relative roughness <em>ε</em> = 0.0044 and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>Re=epsfD2Re(3.3e-2,4.4e-3,%t)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number factor <em>f</em> given the Darcy friction <em>f</em> = 0.033:</p>
<pre class="hljs"><code><div>Re=epsfD2Re(3.3e-2)
</div></code></pre>
<h3 id="hdeps2fdre"><code>hDeps2fDRe</code></h3>
<p><code>hDeps2fDRe</code> computes both the Darcy friction factor <em>f</em> and the Reynolds number <em>Re</em> given the head loss <em>h</em>, the pipe's length <em>L</em>, relative roughness <em>ε</em> and hydraulic diameter <em>D</em>, the gravitational acceleration <em>g</em>, and the fluid's density <em>ρ</em> and dynamic viscosity <em>μ</em>. Replacing flow speed <em>v</em> in the Darcy-Weisbach equation by the Reynolds number <em>Re</em>,</p>
<p>$$
Re^2 f={2gh\rho^2D^3 \over {\mu^2 L}}
$$</p>
<p>Along with the Colebrook-White equation, this version of the Darcy-Weisbach equation produces a system of two equations with two variables. Solution is computed iteratively, however an analytic solution is possible in this case.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re,f]=hDeps2fDRe(h,g,mu,rho,D,L,eps[,s])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given</p>
<p>the head loss <em>h</em> = 0.40 m,</p>
<p>the gravitational acceleration <em>g</em> = 9.81 m/s/s,</p>
<p>the fluid's the dynamic viscosity <em>μ</em> = 0.89 cP and density <em>ρ</em> = 0.98 kg/L, and</p>
<p>the pipe's hydraulic diameter <em>D</em>=10 (cm), length <em>L</em> = 25 m and relative roughness <em>ε</em> = 0.0025:</p>
<pre class="hljs"><code><div>[Re,fD]=hDeps2fDRe(40,981,8.9e-3,0.98,10,2.5e3,2.5e-3,%f)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given the same inputs and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>[Re,f]=hDeps2fDRe(40,981,8.9e-3,0.98,10,2.5e3,2.5e-3,%t)
</div></code></pre>
<h3 id="hveps2fdre"><code>hveps2fDRe</code></h3>
<p><code>hveps2fDRe</code> computes both the Darcy friction factor <em>f</em> and the Reynolds number <em>Re</em> given the head loss <em>h</em>, the pipe's length <em>L</em> and relative roughness <em>ε</em>, the flow speed <em>v</em>, the gravitational acceleration <em>g</em>, and the fluid's density <em>ρ</em> and dynamic viscosity <em>μ</em>. Replacing hydraulic diameter <em>D</em> in the Darcy-Weisbach equation by the Reynolds number <em>Re</em>,</p>
<p>$$
{f \over Re}={2gh\mu \over {v^3\rho L}}
$$</p>
<p>Along with the Colebrook-White equation, this version of the Darcy-Weisbach equation produces a system of two equations with two variables. Solution is computed iteratively.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re,f]=hveps2fDRe(h,g,mu,rho,v,L,eps[,s])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given</p>
<p>the head loss <em>h</em> = 0.40 m,</p>
<p>the gravitational acceleration <em>g</em> = 9.81 m/s/s,</p>
<p>the fluid's the dynamic viscosity <em>μ</em> = 0.89 cP and density <em>ρ</em> = 0.98 kg/L,</p>
<p>the flow speed <em>v</em> = 1.1 m/s, and</p>
<p>the pipe's length <em>L</em> = 25 m and relative roughness <em>ε</em> = 0.0025:</p>
<pre class="hljs"><code><div>[Re,f]=hveps2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-3,%f)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given the same inputs and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>[Re,f]=hveps2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-3,%t)
</div></code></pre>
<h3 id="hqeps2fdre"><code>hQeps2fDRe</code></h3>
<p><code>hQeps2fDRe</code> computes both the Darcy friction factor <em>f</em> and the Reynolds number <em>Re</em> given the head loss <em>h</em>, the pipe's length <em>L</em> and relative roughness <em>ε</em>, the volumetric flow rate <em>Q</em>, the gravitational acceleration <em>g</em>, and the fluid's density <em>ρ</em> and dynamic viscosity <em>μ</em>. Replacing hydraulic diameter <em>D</em> in the Darcy-Weisbach equation by the Reynolds number <em>Re</em>,</p>
<p>$$
{Re^5 f}={2ghQ^3 \over\displaystyle {\left( {\pi \over 4} \right)^3 {\left( {\mu \over \rho} \right) }^5 L }}
$$</p>
<p>Along with the Colebrook-White equation, this version of the Darcy-Weisbach equation produces a system of two equations with two variables. Solution is computed iteratively.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re,f]=hQeps2fDRe(h,g,mu,rho,Q,L,eps[,s])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given</p>
<p>the head loss <em>h</em> = 0.40 m,</p>
<p>the gravitational acceleration <em>g</em> = 9.81 m/s/s,</p>
<p>the fluid's the dynamic viscosity <em>μ</em> = 0.89 cP and density <em>ρ</em> = 0.98 kg/L,</p>
<p>the volumetric flow rate <em>Q</em> = 8.6 L/s, and</p>
<p>the pipe's length <em>L</em> = 25 m and relative roughness <em>ε</em> = 0.0025:</p>
<pre class="hljs"><code><div>[Re,f]=hQeps2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-3,%f)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given the same inputs and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>[Re,f]=hQeps2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-3,%t)
</div></code></pre>
<h3 id="hvthk2fdre"><code>hvthk2fDRe</code></h3>
<p><code>hvthk2fDRe</code> computes both the Darcy friction factor <em>f</em> and the Reynolds number <em>Re</em> given the head loss <em>h</em>, the pipe's length <em>L</em> and roughness <em>k</em>, the flow speed <em>v</em>, the gravitational acceleration <em>g</em>, and the fluid's density <em>ρ</em> and dynamic viscosity <em>μ</em>. Replacing hydraulic diameter <em>D</em> in the Darcy-Weisbach equation by the Reynolds number <em>Re</em>,</p>
<p>$$
{f \over Re}={2gh\mu \over {v^3\rho L}}
$$</p>
<p>Along with the Colebrook-White equation, this version of the Darcy-Weisbach equation produces a system of two equations with two variables. Solution is computed iteratively.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re,f]=hvthk2fDRe(h,g,mu,rho,v,L,thk[,s])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given</p>
<p>the head loss <em>h</em> = 0.40 m,</p>
<p>the gravitational acceleration <em>g</em> = 9.81 m/s/s,</p>
<p>the fluid's the dynamic viscosity <em>μ</em> = 0.89 cP and density <em>ρ</em> = 0.98 kg/L,</p>
<p>the flow speed <em>v</em> = 1.1 m/s, and</p>
<p>the pipe's length <em>L</em> = 25 m and roughness <em>k</em> = 0.25 mm:</p>
<pre class="hljs"><code><div>[Re,f]=hvthk2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-2,%f)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given the same inputs and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>[Re,f]=hvthk2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-2,%t)
</div></code></pre>
<h3 id="hqthk2fdre"><code>hQthk2fDRe</code></h3>
<p><code>hQthk2fDRe</code> computes both the Darcy friction factor <em>f</em> and the Reynolds number <em>Re</em> given the head loss <em>h</em>, the pipe's length <em>L</em> and roughness <em>k</em>, the volumetric flow rate <em>Q</em>, the gravitational acceleration <em>g</em>, and the fluid's density <em>ρ</em> and dynamic viscosity <em>μ</em>. Replacing hydraulic diameter <em>D</em> in the Darcy-Weisbach equation by the Reynolds number <em>Re</em>,</p>
<p>$$
{Re^5 f}={2ghQ^3 \over\displaystyle {\left( {\pi \over 4} \right)^3 {\left( {\mu \over \rho} \right) }^5 L }}
$$</p>
<p>Along with the Colebrook-White equation, this version of the Darcy-Weisbach equation produces a system of two equations with two variables. Solution is computed iteratively.</p>
<p><strong>Syntax:</strong></p>
<pre class="hljs"><code><div>[Re,f]=hQthk2fDRe(h,g,mu,rho,Q,L,thk[,s])
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given</p>
<p>the head loss <em>h</em> = 0.40 m,</p>
<p>the gravitational acceleration <em>g</em> = 9.81 m/s/s,</p>
<p>the fluid's the dynamic viscosity <em>μ</em> = 0.89 cP and density <em>ρ</em> = 0.98 kg/L,</p>
<p>the volumetric flow rate <em>Q</em> = 8.6 L/s, and</p>
<p>the pipe's length <em>L</em> = 25 m and roughness <em>k</em> = 0.25 mm:</p>
<pre class="hljs"><code><div>[Re,f]=hQthk2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-2,%f)
</div></code></pre>
<p><strong>Example:</strong></p>
<p>Compute the Reynolds number <em>Re</em> and the Darcy friction factor <em>f</em> given the same inputs and plot a representation of the solution on a schematic Moody diagram:</p>
<pre class="hljs"><code><div>[Re,f]=hQthk2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-2,%t)
</div></code></pre>
<h3 id="see-also">See Also</h3>
<p><a href="https://github.com/aumpierre-unb/Psychrometrics-for-Scilab">Psychrometrics-for-Scilab</a>.</p>
<p>Copyright © 2022 2023 2024 Alexandre Umpierre</p>
<p>email: aumpierre@gmail.com</p>
</body>
</html>