Coverage for /home/caleb/Documents/University/CHE2703/fluids/fluids/filters.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- Copyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.'''
'square_edge_grill', 'round_edge_grill']
#round_interp = interp1d(round_Res, round_betas, kind='linear') '''Quadratic interpolation with no smoothing, constant value extremities returned when outside table limits'''
#inclined_round_interp = interp1d(round_thetas, round_gammas, kind='linear') '''Quadratic interpolation with no smoothing, constant value extremities returned when outside table limits'''
#square_alphas = [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 1.] #square_Ks = [100000., 1000., 250., 85., 52., 30., 17., 11., 7.7, 5.5, 3.8, 2.8, 2, 1.5, 1.1, 0.78, 0.53, 0.35, 0.08, 0.] #square_interp = interp1d(square_alphas, square_Ks, kind='linear') '''Quadratic interpolation with no smoothing, constant value extremities returned when outside table limits. Last actual value in the original table is K=1000 at alpha=0.05; the rest are extrapolated.'''
#grills_rounded_interp = interp1d(grills_rounded_alphas, grills_rounded_Ks, kind='linear') '''Cubic interpolation with no smoothing, constant value extremities returned when outside table limits'''
r'''Returns the loss coefficient for a round edged wire screen or bar screen, as shown in [1]_. Angle of inclination may be specified as well.
Parameters ---------- alpha : float Fraction of screen open to flow [-] Re : float Reynolds number of flow through screen with D = space between rods, [] angle : float, optional Angle of inclination, with 0 being straight and 90 being parallel to flow [degrees]
Returns ------- K : float Loss coefficient [-]
Notes ----- Linear interpolation between a table of values. Re table extends from 20 to 400, with constant values outside of the table. This behavior should be adequate. alpha should be between 0.05 and 0.8. If angle is over 85 degrees, the value at 85 degrees is used.
Examples -------- >>> round_edge_screen(0.5, 100) 2.0999999999999996 >>> round_edge_screen(0.5, 100, 45) 1.05
References ---------- .. [1] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.: Van Nostrand Reinhold Co., 1984. ''' else:
r'''Returns the loss coefficient for a round edged open net/screen made of one of the following patterns, according to [1]_:
'round bar screen':
.. math:: K = 0.95(1-\alpha) + 0.2(1-\alpha)^2
'diamond pattern wire':
.. math:: K = 0.67(1-\alpha) + 1.3(1-\alpha)^2
'knotted net':
.. math:: K = 0.70(1-\alpha) + 4.9(1-\alpha)^2
'knotless net':
.. math:: K = 0.72(1-\alpha) + 2.1(1-\alpha)^2
Parameters ---------- alpha : float Fraction of net/screen open to flow [-] subtype : str One of 'round bar screen', 'diamond pattern wire', 'knotted net' or 'knotless net'. angle : float, optional Angle of inclination, with 0 being straight and 90 being parallel to flow [degrees]
Returns ------- K : float Loss coefficient [-]
Notes ----- `alpha` should be between 0.85 and 1 for these correlations. Flow should be turbulent, with Re > 500.
Examples -------- >>> round_edge_open_mesh(0.96, angle=33.) 0.02031327712601458
References ---------- .. [1] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.: Van Nostrand Reinhold Co., 1984. ''' else: else:
r'''Returns the loss coefficient for a square wire screen or square bar screen or perforated plate with squared edges, as shown in [1]_.
Parameters ---------- alpha : float Fraction of screen open to flow [-]
Returns ------- K : float Loss coefficient [-]
Notes ----- Linear interpolation between a table of values.
Examples -------- >>> square_edge_screen(0.99) 0.008000000000000009
References ---------- .. [1] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.: Van Nostrand Reinhold Co., 1984. '''
r'''Returns the loss coefficient for a square grill or square bar screen or perforated plate with squared edges of thickness l, as shown in [1]_.
for Dh < l < 50D
.. math:: K = \frac{0.5(1-\alpha) + (1-\alpha^2)}{\alpha^2}
else:
.. math:: K = \frac{0.5(1-\alpha) + (1-\alpha^2) + f{l}/D}{\alpha^2}
Parameters ---------- alpha : float Fraction of grill open to flow [-] l : float Thickness of the grill or plate [m] Dh : float Hydraulic diameter of gap in grill, [m] fd : float Darcy friction factor [-]
Returns ------- K : float Loss coefficient [-]
Notes ----- If l, Dh, or fd is not provided, the first expression is used instead. The alteration of the expression to include friction factor is there if the grill is long enough to have considerable friction along the surface of the grill.
Examples -------- >>> square_edge_grill(.45) 5.296296296296296 >>> square_edge_grill(.45, l=.15, Dh=.002, fd=.0185) 12.148148148148147
References ---------- .. [1] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.: Van Nostrand Reinhold Co., 1984. ''' else:
r'''Returns the loss coefficient for a rounded square grill or square bar screen or perforated plate with rounded edges of thickness l, as shown in [1]_.
for Dh < l < 50D
.. math:: K = lookup(alpha)
else:
.. math:: K = lookup(alpha) + \frac{fl}{\alpha^2D}
Parameters ---------- alpha : float Fraction of grill open to flow [-] l : float, optional Thickness of the grill or plate [m] Dh : float, optional Hydraulic diameter of gap in grill, [m] fd : float, optional Darcy friction factor [-]
Returns ------- K : float Loss coefficient [-]
Notes ----- If l, Dh, or fd is not provided, the first expression is used instead. The alteration of the expression to include friction factor is there if the grill is long enough to have considerable friction along the surface of the grill. alpha must be between 0.3 and 0.7.
Examples -------- >>> round_edge_grill(.4) 1.0 >>> round_edge_grill(.4, l=.15, Dh=.002, fd=.0185) 2.3874999999999997
References ---------- .. [1] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.: Van Nostrand Reinhold Co., 1984. ''' else:
|