Skip to content

Commit

Permalink
0.1.62 release
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebBell committed May 4, 2017
1 parent f42a06e commit b38fd87
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 24 deletions.
80 changes: 77 additions & 3 deletions docs/tutorial.rst
Expand Up @@ -856,7 +856,81 @@ V=3 m/s, Di=0.05, roughness 0.01 mm):
>>> dP_from_K(K, rho=1000, V=3)
37920.51140146369

There are five entrance loss coefficient methods:

>>> entrance_sharp() # sharp entrances
0.57
Electric motor sizing
---------------------
Motors are available in standard sizes, mostly as designated by the
National Electrical Manufacturers Association (NEMA). To easily determine what
the power of a motor will actually be once purchased, motor_round_size implements
rounding up of a motor power to the nearest size. NEMA standard motors are
specified in terms of horsepower.

>>> motor_round_size(1E5) # 100 kW motor
111854.98073734052 # 11.8% larger than desired
>>> from scipy.constants import hp
>>> motor_round_size(1E5)/hp # convert to hp
150.0

Motors are designed to generate a certain amount of power, but they themselves are
not 100% efficient at doing this and require more power due to efficiency losses.
Many minimum values for motor efficiency are standardized. The Canadian standard
for this is implemented in fluids as CSA_motor_efficiency.

>>> CSA_motor_efficiency(P=5*hp)
0.855

Most motors are not enclosed (the default assumption), but those that are closed
are more efficient.

>>> CSA_motor_efficiency(P=5*hp, closed=True)
0.875

The number of poles in a motor also affects its efficiency:

>>> CSA_motor_efficiency(P=5*hp, poles=6)
0.875

There is also a schedule of higher efficiency values standardized as well,
normally available at somewhat higher cost:

>>> CSA_motor_efficiency(P=5*hp, closed=True, poles=6, high_efficiency=True)
0.895

A motor will spin at more or less its design frequency, depending on its type.
However, if it does not meet sufficient resistance, it will not be using its
design power. This is good and bad - less power is used, but as a motor
drops under 50% of its design power, its efficiency becomes terrible. A function
has been written based on generic performance curves to estimate the underloaded
efficiency of a motor. Just how bad efficiency drops off depends on the design
power of a motor - higher power motors do better operating at low loads than
small motors.

>>> motor_efficiency_underloaded(P=1E3, load=.9)
1
>>> motor_efficiency_underloaded(P=1E3, load=.2)
0.6639347559654663

This needs to be applied on top of the normal motor efficiency; for example,
that 1 kW motor at 20% load would have a net efficiency of:

>>> motor_efficiency_underloaded(P=1E3, load=.2)*CSA_motor_efficiency(P=1E3)
0.5329404286134798


Many motors have Variable Frequency Drives (VFDs) which allow them to vary the
speed of their rotation. The VFD is another source of inefficiency, but by allowing
the pump or other piece of equipment to vary its speed, a system may be designed to
be less energy intensive. For example, rather than running a pump at a certain
high frequency and controlling the flow with a large control valve, the flow
rate can be controlled with the VFD directly.

The efficiency of a VFD depends on the maximum power it needs to be able to
generate, and the power it is actually generating at an instant (load).
A table of typical modern VFD efficiencies is implemented in fluids as
VFD_efficiency.

>>> VFD_efficiency(1E5) # 100 kW
0.97
>>> VFD_efficiency(5E3, load=.2) # 5 kW, 20% load
0.8562

2 changes: 1 addition & 1 deletion fluids/__init__.py
Expand Up @@ -93,4 +93,4 @@
__all__.extend(separator.__all__)


__version__ = '0.1.61'
__version__ = '0.1.62'
28 changes: 15 additions & 13 deletions fluids/fittings.py
Expand Up @@ -120,7 +120,7 @@ def entrance_angled(angle):
Parameters
----------
angle : float
Angle of inclination, [degrees]
Angle of inclination (90=straight, 0=parallel to pipe wall) [degrees]
Returns
-------
Expand All @@ -130,7 +130,7 @@ def entrance_angled(angle):
Notes
-----
Not reliable for angles under 20 degrees.
Loss coefficient is the same for a upward or downward angle.
Loss coefficient is the same for an upward or downward angled inlet.
Examples
--------
Expand All @@ -155,7 +155,7 @@ def entrance_rounded(Di, rc):
\lambda = 1 + 0.622\left(1 - 0.30\sqrt{\frac{r}{d}}
- 0.70\frac{r}{d}\right)^4
Parameters
----------
Di : float
Expand All @@ -170,8 +170,8 @@ def entrance_rounded(Di, rc):
Notes
-----
Applies for r/D < 1.
For generously rounded entrances (r/D ~= 1): K = 0.03
For generously rounded entrance (rc/Di >= 1), the loss coefficient converges
to 0.03.
Examples
--------
Expand All @@ -183,12 +183,14 @@ def entrance_rounded(Di, rc):
.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical
and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012.
'''
lbd = 1 + 0.622*(1 - 0.30*(rc/Di)**0.5 - 0.70*(rc/Di))**4
return 0.0696*(1 - 0.569*rc/Di)*lbd**2 + (lbd-1)**2
if rc/Di > 1:
return 0.03
lbd = 1. + 0.622*(1. - 0.30*(rc/Di)**0.5 - 0.70*(rc/Di))**4
return 0.0696*(1. - 0.569*rc/Di)*lbd**2 + (lbd - 1.)**2


def entrance_beveled(Di, l, angle):
r'''Returns loss coefficient for a beveled entrance to a pipe
r'''Returns loss coefficient for a beveled or chamfered entrance to a pipe
flush with the wall of a reservoir, as shown in [1]_.
.. math::
Expand All @@ -205,9 +207,9 @@ def entrance_beveled(Di, l, angle):
Di : float
Inside diameter of pipe, [m]
l : float
Length of bevel, [m]
Length of bevel measured parallel to the pipe length, [m]
angle : float
Angle of bevel, [degrees]
Angle of bevel with respect to the pipe length, [degrees]
Returns
-------
Expand All @@ -229,9 +231,9 @@ def entrance_beveled(Di, l, angle):
.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical
and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012.
'''
Cb = (1-angle/90.)*(angle/90.)**(1./(1 +l/Di ))
lbd = 1 + 0.622*(1 - 1.5*Cb*(l/Di)**((1-(l/Di)**0.25)/2.))
return 0.0696*(1-Cb*l/Di)*lbd**2 + (lbd-1)**2
Cb = (1-angle/90.)*(angle/90.)**(1./(1 + l/Di ))
lbd = 1 + 0.622*(1 - 1.5*Cb*(l/Di)**((1 - (l/Di)**0.25)/2.))
return 0.0696*(1 - Cb*l/Di)*lbd**2 + (lbd - 1.)**2


### Exits
Expand Down
4 changes: 2 additions & 2 deletions fluids/packed_tower.py
Expand Up @@ -248,7 +248,7 @@ def separation_demister_ElDessouky(vs, voidage, d_wire, d_drop):
was used in the conversion.
In [1]_, V ranged from 0.98-7.5 m/s, rho from 80.317-208.16 kg/m^3, depth
from 100 to 200 mm, wire diameter of 0.2mm to 0.32 mm, and particle
from 100 to 200 mm, wire diameter of 0.2 mm to 0.32 mm, and particle
diameter from 1 to 5 mm.
Examples
Expand Down Expand Up @@ -614,7 +614,7 @@ def to_zero(inputs):



def Robbins(Fpd=24, L=None, G=None, rhol=None, rhog=None, mul=None, H=1, A=None):
def Robbins(L, G, rhol, rhog, mul, H=1, A=None, Fpd=24):
r'''Calculates pressure drop across a packed column, using the Robbins
equation.
Expand Down
7 changes: 4 additions & 3 deletions fluids/pump.py
Expand Up @@ -168,13 +168,15 @@ def VFD_efficiency(P, load=1):
Table extends down to 3 hp and up to 400 hp; values outside these limits
are rounded to the nearest known value. Values between standardized sizes
are interpolated linearly. Load values extend down to 0.016.
The table used is for Pulse Width Modulation (PWM) VFDs.
Examples
--------
>>> VFD_efficiency(10*hp)
0.96
>>> VFD_efficiency(100*hp, load=0.5)
0.96
>>> VFD_efficiency(100*hp, load=0.2)
0.92
References
----------
Expand Down Expand Up @@ -271,7 +273,6 @@ def motor_round_size(P):
nema_min_full_closed_6p_i = interp1d(nema_min_P, nema_min_full_closed_6p)
nema_min_full_closed_8p_i = interp1d(nema_min_P, nema_min_full_closed_8p)

#print nema_min_full_closed_8p_i(345)

def CSA_motor_efficiency(P, closed=False, poles=2, high_efficiency=False):
r'''Returns the efficiency of a NEMA motor according to [1]_.
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -57,8 +57,8 @@
name = 'fluids',
packages = ['fluids'],
license='MIT',
version = '0.1.61',
download_url = 'https://github.com/CalebBell/fluids/tarball/0.1.61',
version = '0.1.62',
download_url = 'https://github.com/CalebBell/fluids/tarball/0.1.62',
description = 'Fluid dynamics component of Chemical Engineering Design Library (ChEDL)',
long_description=open('README.rst').read(),
extras_require = {
Expand Down
1 change: 1 addition & 0 deletions tests/test_fittings.py
Expand Up @@ -32,6 +32,7 @@ def test_fittings():

K = entrance_rounded(Di=0.1, rc=0.0235)
assert_allclose(K, 0.09839534618360923)
assert_allclose(entrance_rounded(Di=0.1, rc=0.2), 0.03)

K = entrance_beveled(Di=0.1, l=0.003, angle=45)
assert_allclose(K, 0.45086864221916984)
Expand Down

0 comments on commit b38fd87

Please sign in to comment.