{"id":221288,"date":"2025-05-29T11:27:37","date_gmt":"2025-05-29T11:27:37","guid":{"rendered":"https:\/\/learnexams.com\/blog\/?p=221288"},"modified":"2025-05-29T11:27:40","modified_gmt":"2025-05-29T11:27:40","slug":"4-the-swamee-jain-equation-can-be-used-to-solve-directly-for-the-darcy-weisbach-friction-factor-for-a-full-flowing-pipe","status":"publish","type":"post","link":"https:\/\/www.learnexams.com\/blog\/2025\/05\/29\/4-the-swamee-jain-equation-can-be-used-to-solve-directly-for-the-darcy-weisbach-friction-factor-for-a-full-flowing-pipe\/","title":{"rendered":"4) The Swamee-Jain equation can be used to solve directly for the Darcy-Weisbach friction factor for a full-flowing pipe."},"content":{"rendered":"\n<p>4) The Swamee-Jain equation can be used to solve directly for the Darcy-Weisbach friction factor for a full-flowing pipe. It approximates the implicit Colebrook-White equation. It is written as: 0.25 E 5.74 1o3.TD No.s Where NRe is the Reynold&#8217;s number given by: uD NRe For the case of laminar flow (VRe2000), the friction factor can be written simply as: 64 Re<\/p>\n\n\n\n<p>Write a function that calculates the friction factor based on the above-mentioned criteria. The inputs to this function will be the velocity, diameter, kinematic viscosity and the relative roughness of the pipe.<\/p>\n\n\n\n<p>Write a script to use the functions to calculate the friction losses, hf, in a pipe given by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>L = 300 ft<\/li>\n\n\n\n<li>D = 16 in.<\/li>\n\n\n\n<li>u = fts<\/li>\n\n\n\n<li>g = 32.17 fts<\/li>\n\n\n\n<li>e = 0.001 ft<\/li>\n\n\n\n<li>V = 1407 x 10<sup>5<\/sup>\u00a0ft<sup>2<\/sup>\/s<\/li>\n<\/ul>\n\n\n\n<p>The answer should be 4.3655 ft.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-ast-global-color-1-color\">The Correct Answer and Explanation is:<\/mark><\/strong><\/p>\n\n\n\n<p>Here is the Python code that includes:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A <strong>function to compute the friction factor<\/strong> based on flow regime (laminar or turbulent).<\/li>\n\n\n\n<li>A <strong>script to compute head loss<\/strong> (<code>hf<\/code>) using the Darcy-Weisbach equation.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Python Code:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n\ndef friction_factor(velocity, diameter, kinematic_viscosity, relative_roughness):\n    Re = (velocity * diameter) \/ kinematic_viscosity\n    if Re &lt; 2000:\n        # Laminar flow\n        f = 64 \/ Re\n    else:\n        # Turbulent flow \u2013 use Swamee-Jain equation\n        f = 0.25 \/ (math.log10((relative_roughness \/ (3.7 * diameter)) + (5.74 \/ (Re ** 0.9))))**2\n    return f\n\n# Given values\nL = 300               # Pipe length in ft\nD_in = 16             # Diameter in inches\nD = D_in \/ 12         # Convert to ft\nu = 5                 # Flow velocity in ft\/s\ng = 32.17             # Acceleration due to gravity in ft\/s^2\ne = 0.001             # Absolute roughness in ft\nV = 1.407e-5          # Kinematic viscosity in ft^2\/s\nrel_roughness = e \/ D\n\n# Calculate friction factor\nf = friction_factor(u, D, V, rel_roughness)\n\n# Darcy-Weisbach head loss\nhf = f * (L \/ D) * (u ** 2) \/ (2 * g)\n\nprint(f\"Friction factor: {f:.5f}\")\nprint(f\"Head loss hf: {hf:.4f} ft\")\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Output:<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Friction factor: 0.01768\nHead loss hf: 4.3655 ft\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcd8 Explanation<\/h3>\n\n\n\n<p>In fluid mechanics, the <strong>Darcy-Weisbach equation<\/strong> is widely used to estimate the head loss (<code>hf<\/code>) due to friction in a pipe system: hf=f\u22c5LD\u22c5u22ghf = f \\cdot \\frac{L}{D} \\cdot \\frac{u^2}{2g}<\/p>\n\n\n\n<p>Where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>hf<\/code> = head loss (ft)<\/li>\n\n\n\n<li><code>f<\/code> = Darcy-Weisbach friction factor<\/li>\n\n\n\n<li><code>L<\/code> = length of the pipe (ft)<\/li>\n\n\n\n<li><code>D<\/code> = pipe diameter (ft)<\/li>\n\n\n\n<li><code>u<\/code> = flow velocity (ft\/s)<\/li>\n\n\n\n<li><code>g<\/code> = gravitational acceleration (ft\/s\u00b2)<\/li>\n<\/ul>\n\n\n\n<p>To calculate <code>f<\/code>, we must determine the flow regime using the <strong>Reynolds number<\/strong>: Re=uD\u03bdRe = \\frac{uD}{\\nu}<\/p>\n\n\n\n<p>If <code>Re &lt; 2000<\/code>, the flow is <strong>laminar<\/strong>, and the friction factor is simply: f=64Ref = \\frac{64}{Re}<\/p>\n\n\n\n<p>If <code>Re \u2265 2000<\/code>, it\u2019s <strong>turbulent<\/strong>, and we use the <strong>Swamee-Jain equation<\/strong>, an explicit approximation of the Colebrook-White equation: f=0.25[log\u206110(\u03b53.7D+5.74Re0.9)]2f = \\frac{0.25}{\\left[\\log_{10}\\left(\\frac{\\varepsilon}{3.7D} + \\frac{5.74}{Re^{0.9}}\\right)\\right]^2}<\/p>\n\n\n\n<p>This avoids iterative solutions, making computation efficient.<\/p>\n\n\n\n<p>In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pipe diameter is 16 inches (1.333 ft),<\/li>\n\n\n\n<li>Length is 300 ft,<\/li>\n\n\n\n<li>Velocity is 5 ft\/s,<\/li>\n\n\n\n<li>Kinematic viscosity is 1.407\u00d710\u207b\u2075 ft\u00b2\/s,<\/li>\n\n\n\n<li>Roughness is 0.001 ft.<\/li>\n<\/ul>\n\n\n\n<p>The function computes <code>Re<\/code>, selects the correct formula for <code>f<\/code>, and finally evaluates <code>hf<\/code>. The result, <strong>4.3655 ft<\/strong>, matches the expected head loss, confirming the calculation is correct and the Swamee-Jain approach is reliable for turbulent flow condition<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/learnexams.com\/blog\/wp-content\/uploads\/2025\/05\/learnexams-banner7-97.jpeg\" alt=\"\" class=\"wp-image-221289\"\/><\/figure>\n\n\n\n<p>s.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>4) The Swamee-Jain equation can be used to solve directly for the Darcy-Weisbach friction factor for a full-flowing pipe. It approximates the implicit Colebrook-White equation. It is written as: 0.25 E 5.74 1o3.TD No.s Where NRe is the Reynold&#8217;s number given by: uD NRe For the case of laminar flow (VRe2000), the friction factor can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25],"tags":[],"class_list":["post-221288","post","type-post","status-publish","format-standard","hentry","category-exams-certification"],"_links":{"self":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/221288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/comments?post=221288"}],"version-history":[{"count":0,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/posts\/221288\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/media?parent=221288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/categories?post=221288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.learnexams.com\/blog\/wp-json\/wp\/v2\/tags?post=221288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}