1. Download v0.2.2.zip
file from Releases.
2. Set Scilab current directory to the download folder.
3. To install and load the toolbox, type:
atomsInstall('v0.2.2.zip'),..
atomsLoad('inflowlib')
You can cite all versions (both released and pre-released), by using DOI 105281/zenodo.6927994.
This DOI represents all versions, and will always resolve to the latest one.
To cite the last released version, please check https://zenodo.org/account/settings/github/repository/aumpierre-unb/Internal-Fluid-Flow-for-Scilab.
The following is a very short introduction to the steady internal flow of an incompressible and inviscid fluid and to the internal-fluid-flow
Toolbox for Scilab.
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.
This text is divided in two main sections: The Theory and The internal-fluid-flow
Toolbox for Scilab.
The Bernoulli equation is an expression of the mechanical energy balance for a very particular situation:
- internal steady flow of an
- incompressible inviscid fluid, where
- friction effects and tube fittings can be neglected.
For such a case, the mechanical energy is conserved, and for any two points 1 and 2 we have
or
where
- ρ is the fluid's density,
- v is the flow speed,
- g is the gravitational acceleration,
- z is the elevation, and
- p is the static pressure.
The flow of viscous fluids is accompanied of energy dispersion, which can be measured as pressure drop or, equivalently, as head loss h, by the Darcy-Weisbach equation,
where f is the Darcy friction factor, L is the pipe's length and D is the pipe's hydraulic diameter,
where A is the cross-sectional area of the flow and P is the wet perimeter of the cross-section. f is described as a function of the Reynolds number,
and the pipe's relative roughness,
where
- μ is the fluid's dynamic viscosity and
- k is the pipe's[ internal surface] roughness.
The Reynolds number Re, the Darcy friction factor f, and the relative roughness ε completely describe the internal flow of incompressible viscous fluids, for both laminar and turbulent regimes. Usually, f is given as a function of Re and ε.
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.
For laminar flow, Re < 2,300 (typically), the Darcy friction factor is given by the Poiseuille condition,
For turbulent flow, Re > 2,300 (typically), the Darcy friction factor is given implicitly by the Colebrook-White equation,
internal-fluid-flow
provides the following functions:
epsRe2fD
epsfD2Re
hDeps2fDRe
hveps2fDRe
hQeps2fDRe
hvthk2fDRe
hQthk2fDRe
epsRe2fD
computes the Darcy friction factor f given the relative roughness ε and the Reynolds number Re. If given Re < 2,500, then flow is assumed to be laminar and f is computed using of the Poiseuille condition. Otherwise, flow is assumed to be turbulent and f is computed using the Colebrook-White equation.
Syntax:
[f]=epsRe2fD(Re,[eps[,s]])
Example:
Compute the Darcy friction factor f given the Reynolds number Re=25,000 and the relative roughness ε = 0.0044:
f=epsRe2fD(2.5e4,4.4e-3,%f)
or
Re=2.5e4,eps=4.4e-3,f=epsRe2fD(Re,eps)
Example:
Compute the Darcy friction factor f given the Reynolds number Re=25,000 and the relative roughness ε = 0.0044 and plot a representation of the solution on a schematic Moody diagram:
f=epsRe2fD(2.5e4,4.4e-3,%t)
Example:
Compute the Darcy friction factor f given the Reynolds number Re=25,000:
f=epsRe2fD(2.5e4)
espfD2Re
computes the Reynolds number Re given the relative roughness ε and the Darcy friction factor f. 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 Re < 2,500, laminar solution is accepted. If given f is possible for turbulent flow,
(which is Colebrook-White equation for for elevated Re) 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 ε > 0.05, execution is aborted.
Syntax:
[Re]=epsfD2Re(f[,eps[,s]])
Example:
Compute the Reynolds Re number given the Darcy friction factor f = 0.033 and the relative roughness ε = 0.0044:
Re=epsfD2Re(3.3e-2,4.4e-3,%f)
or
f=3.3e-2,eps=4.4e-3,Re=epsfD2Re(f,eps)
Example:
Compute the Reynolds Re number given the Darcy friction factor f = 0.033 and the relative roughness ε = 0.0044 and plot a representation of the solution on a schematic Moody diagram:
Re=epsfD2Re(3.3e-2,4.4e-3,%t)
Example:
Compute the Reynolds number factor f given the Darcy friction f = 0.033:
Re=epsfD2Re(3.3e-2)
hDeps2fDRe
computes both the Darcy friction factor f and the Reynolds number Re given the head loss h, the pipe's length L, relative roughness ε and hydraulic diameter D, the gravitational acceleration g, and the fluid's density ρ and dynamic viscosity μ. Replacing flow speed v in the Darcy-Weisbach equation by the Reynolds number Re,
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.
Syntax:
[Re,f]=hDeps2fDRe(h,g,mu,rho,D,L,eps[,s])
Example:
Compute the Reynolds number Re and the Darcy friction factor f given
the head loss h = 0.40 m,
the gravitational acceleration g = 9.81 m/s/s,
the fluid's the dynamic viscosity μ = 0.89 cP and density ρ = 0.98 kg/L, and
the pipe's hydraulic diameter D=10 (cm), length L = 25 m and relative roughness ε = 0.0025:
[Re,fD]=hDeps2fDRe(40,981,8.9e-3,0.98,10,2.5e3,2.5e-3,%f)
Example:
Compute the Reynolds number Re and the Darcy friction factor f given the same inputs and plot a representation of the solution on a schematic Moody diagram:
[Re,f]=hDeps2fDRe(40,981,8.9e-3,0.98,10,2.5e3,2.5e-3,%t)
hveps2fDRe
computes both the Darcy friction factor f and the Reynolds number Re given the head loss h, the pipe's length L and relative roughness ε, the flow speed v, the gravitational acceleration g, and the fluid's density ρ and dynamic viscosity μ. Replacing hydraulic diameter D in the Darcy-Weisbach equation by the Reynolds number Re,
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.
Syntax:
[Re,f]=hveps2fDRe(h,g,mu,rho,v,L,eps[,s])
Example:
Compute the Reynolds number Re and the Darcy friction factor f given
the head loss h = 0.40 m,
the gravitational acceleration g = 9.81 m/s/s,
the fluid's the dynamic viscosity μ = 0.89 cP and density ρ = 0.98 kg/L,
the flow speed v = 1.1 m/s, and
the pipe's length L = 25 m and relative roughness ε = 0.0025:
[Re,f]=hveps2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-3,%f)
Example:
Compute the Reynolds number Re and the Darcy friction factor f given the same inputs and plot a representation of the solution on a schematic Moody diagram:
[Re,f]=hveps2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-3,%t)
hQeps2fDRe
computes both the Darcy friction factor f and the Reynolds number Re given the head loss h, the pipe's length L and relative roughness ε, the volumetric flow rate Q, the gravitational acceleration g, and the fluid's density ρ and dynamic viscosity μ. Replacing hydraulic diameter D in the Darcy-Weisbach equation by the Reynolds number Re,
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.
Syntax:
[Re,f]=hQeps2fDRe(h,g,mu,rho,Q,L,eps[,s])
Example:
Compute the Reynolds number Re and the Darcy friction factor f given
the head loss h = 0.40 m,
the gravitational acceleration g = 9.81 m/s/s,
the fluid's the dynamic viscosity μ = 0.89 cP and density ρ = 0.98 kg/L,
the volumetric flow rate Q = 8.6 L/s, and
the pipe's length L = 25 m and relative roughness ε = 0.0025:
[Re,f]=hQeps2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-3,%f)
Example:
Compute the Reynolds number Re and the Darcy friction factor f given the same inputs and plot a representation of the solution on a schematic Moody diagram:
[Re,f]=hQeps2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-3,%t)
hvthk2fDRe
computes both the Darcy friction factor f and the Reynolds number Re given the head loss h, the pipe's length L and roughness k, the flow speed v, the gravitational acceleration g, and the fluid's density ρ and dynamic viscosity μ. Replacing hydraulic diameter D in the Darcy-Weisbach equation by the Reynolds number Re,
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.
Syntax:
[Re,f]=hvthk2fDRe(h,g,mu,rho,v,L,thk[,s])
Example:
Compute the Reynolds number Re and the Darcy friction factor f given
the head loss h = 0.40 m,
the gravitational acceleration g = 9.81 m/s/s,
the fluid's the dynamic viscosity μ = 0.89 cP and density ρ = 0.98 kg/L,
the flow speed v = 1.1 m/s, and
the pipe's length L = 25 m and roughness k = 0.25 mm:
[Re,f]=hvthk2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-2,%f)
Example:
Compute the Reynolds number Re and the Darcy friction factor f given the same inputs and plot a representation of the solution on a schematic Moody diagram:
[Re,f]=hvthk2fDRe(40,981,8.9e-3,0.98,1.1e2,2.5e3,2.5e-2,%t)
hQthk2fDRe
computes both the Darcy friction factor f and the Reynolds number Re given the head loss h, the pipe's length L and roughness k, the volumetric flow rate Q, the gravitational acceleration g, and the fluid's density ρ and dynamic viscosity μ. Replacing hydraulic diameter D in the Darcy-Weisbach equation by the Reynolds number Re,
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.
Syntax:
[Re,f]=hQthk2fDRe(h,g,mu,rho,Q,L,thk[,s])
Example:
Compute the Reynolds number Re and the Darcy friction factor f given
the head loss h = 0.40 m,
the gravitational acceleration g = 9.81 m/s/s,
the fluid's the dynamic viscosity μ = 0.89 cP and density ρ = 0.98 kg/L,
the volumetric flow rate Q = 8.6 L/s, and
the pipe's length L = 25 m and roughness k = 0.25 mm:
[Re,f]=hQthk2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-2,%f)
Example:
Compute the Reynolds number Re and the Darcy friction factor f given the same inputs and plot a representation of the solution on a schematic Moody diagram:
[Re,f]=hQthk2fDRe(40,981,8.9e-3,0.98,8.6e3,2.5e3,2.5e-2,%t)
Copyright © 2022 2023 2024 Alexandre Umpierre
email: [email protected]