How to use the fluids.constants.g function in fluids

To help you get started, we’ve selected a few fluids examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

CalebBell / ht / ht / boiling_flow.py View on Github
.. [2] Bennett, Douglas L., M.W. Davies and B.L. Hertzler, The Suppression
of Saturated Nucleate Boiling by Forced Convective Flow, American
Institute of Chemical Engineers Symposium Series, vol. 76, no. 199.
91-103, 1980.
.. [3] Bertsch, Stefan S., Eckhard A. Groll, and Suresh V. Garimella.
"Review and Comparative Analysis of Studies on Saturated Flow Boiling in
Small Channels." Nanoscale and Microscale Thermophysical Engineering 12,
no. 3 (September 4, 2008): 187-227. doi:10.1080/15567260802317357.
'''
G = m/(pi/4*D**2)
Rel = D*G*(1-x)/mul
Prl = Prandtl(Cp=Cpl, mu=mul, k=kl)
hl = turbulent_Dittus_Boelter(Re=Rel, Pr=Prl)*kl/D
Xtt = Lockhart_Martinelli_Xtt(x=x, rhol=rhol, rhog=rhog, mul=mul, mug=mug)
F = ((Prl+1)/2.)**0.444*(1 + Xtt**-0.5)**1.78
X0 = 0.041*(sigma/(g*(rhol-rhog)))**0.5
S = (1 - exp(-F*hl*X0/kl))/(F*hl*X0/kl)

hnb = Forster_Zuber(Te=Te, dPsat=dPsat, Cpl=Cpl, kl=kl, mul=mul, sigma=sigma,
Hvap=Hvap, rhol=rhol, rhog=rhog)
return hnb*S + hl*F
CalebBell / fluids / fluids / open_flow.py View on Github
--------
Example compares terribly with the Ackers expression - probable error
in [2]_. DO NOT USE.

>>> Q_weir_rectangular_full_SIA(h1=0.3, h2=0.4, b=2)
1.1875825055400384

References
----------
.. [1] Normen für Wassermessungen: bei Durchführung von Abnahmeversuchen an
Wasserkraftmaschinen. SIA, 1924.
.. [2] Blevins, Robert D. Applied Fluid Dynamics Handbook. New York, N.Y.:
Van Nostrand Reinhold Co., 1984.
'''
Q = 2/3.*2**0.5*(0.615 + 0.000615/(h1 + 0.0016))*b*g**0.5*h1 \
+ 0.5*(h1/(h1+h2))**2*b*g**0.5*h1**1.5
return Q

CalebBell / fluids / fluids / packed_tower.py View on Github
def _Stichlmair_flood_f(inputs, Vl, rhog, rhol, mug, voidage, specific_area,
C1, C2, C3, H):
'''Internal function which calculates the errors of the two Stichlmair
objective functions, and their jacobian.
'''
Vg, dP_irr = float(inputs[0]), float(inputs[1])
dp = 6.0*(1.0 - voidage)/specific_area
Re = Vg*rhog*dp/mug
f0 = C1/Re + C2/Re**0.5 + C3
dP_dry = 0.75*f0*(1.0 - voidage)/voidage**4.65*rhog*H/dp*Vg*Vg
c = (-C1/Re - 0.5*C2*Re**-0.5)/f0
Frl = Vl*Vl*specific_area/(g*voidage**4.65)
h0 = 0.555*Frl**(1/3.)
hT = h0*(1.0 + 20.0*(dP_irr/H/rhol/g)**2)
err1 = dP_dry/H*((1.0 - voidage + hT)/(1.0 - voidage))**((2.0 + c)/3.)*(voidage/(voidage-hT))**4.65 - dP_irr/H
term = (dP_irr/(rhol*g*H))**2
err2 = (1./term - 40.0*((2.0+c)/3.)*h0/(1.0 - voidage + h0*(1.0 + 20.0*term))
- 186.0*h0/(voidage - h0*(1.0 + 20.0*term)))
return err1, err2
CalebBell / fluids / fluids / drag.py View on Github
while sill giving an answer. If at any point the tolerance is larger than
1%, an exception is also raised.

Examples
--------
&gt;&gt;&gt; time_v_terminal_Stokes(D=1e-7, rhop=2200., rho=1.2, mu=1.78E-5, V0=1)
3.1880031137871528e-06
&gt;&gt;&gt; time_v_terminal_Stokes(D=1e-2, rhop=2200., rho=1.2, mu=1.78E-5, V0=1,
... tol=1e-30)
24800.636391801996
'''
if tol &lt; 1e-17:
tol = 2e-17
term = D*D*g*rho - D*D*g*rhop
denominator = term + 18.*mu*V0
v_term_base = g*D*D*(rhop-rho)/(18.*mu)

const = D*D*rhop/mu*-1.0/18.
for i in range(50):
try:
if v_term_base &lt; V0:
v_term = v_term_base*(1.0 + tol)
else:
v_term = v_term_base*(1.0 - tol)
numerator = term + 18.*mu*v_term
return log(numerator/denominator)*const
except:
tol = tol + tol
if tol &gt; 0.01:
raise ValueError('Could not find a solution')
raise ValueError('Could not find a solution')

CalebBell / ht / ht / boiling_plate.py View on Github
Evaporators." International Journal of Refrigeration 35, no. 2 (March
2012): 325-35. doi:10.1016/j.ijrefrig.2011.11.002.
.. [2] Huang, Jianchang. "Performance Analysis of Plate Heat Exchangers
Used as Refrigerant Evaporators," 2011. Thesis.
http://wiredspace.wits.ac.za/handle/10539/9779
.. [3] Amalfi, Raffaele L., Farzad Vakili-Farahani, and John R. Thome.
"Flow Boiling and Frictional Pressure Gradients in Plate Heat Exchangers.
Part 1: Review and Experimental Database." International Journal of
Refrigeration 61 (January 2016): 166-84.
doi:10.1016/j.ijrefrig.2015.07.010.
.. [4] Eldeeb, Radia, Vikrant Aute, and Reinhard Radermacher. "A Survey of
Correlations for Heat Transfer and Pressure Drop for Evaporation and
Condensation in Plate Heat Exchangers." International Journal of
Refrigeration 65 (May 2016): 12-26. doi:10.1016/j.ijrefrig.2015.11.013.
'''
do = 0.0146*angle*(2.*sigma/(g*(rhol - rhog)))**0.5
Prl = Prandtl(Cp=Cpl, mu=mul, k=kl)
alpha_l = thermal_diffusivity(k=kl, rho=rhol, Cp=Cpl)
h = 1.87E-3*(kl/do)*(q*do/(kl*Tsat))**0.56*(Hvap*do**2/alpha_l**2)**0.31*Prl**0.33
return h
CalebBell / ht / ht / boiling_nucleic.py View on Github
h for water at atmospheric pressure on oxidized aluminum.

>>> Rohsenow(rhol=957.854, rhog=0.595593, mul=2.79E-4, kl=0.680, Cpl=4217,
... Hvap=2.257E6, sigma=0.0589, Te=4.9, Csf=0.011, n=1.26)
3723.655267067467

References
----------
.. [1] Cao, Eduardo. Heat Transfer in Process Engineering.
McGraw Hill Professional, 2009.
.. [2] Rohsenow, Warren M. "A Method of Correlating Heat Transfer Data for
Surface Boiling of Liquids." Technical Report. Cambridge, Mass. : M.I.T.
Division of Industrial Cooporation, 1951
'''
if Te is not None:
return mul*Hvap*(g*(rhol-rhog)/sigma)**0.5*(Cpl*Te**(2/3.)/Csf/Hvap/(Cpl*mul/kl)**n)**3
elif q is not None:
A = mul*Hvap*(g*(rhol-rhog)/sigma)**0.5*(Cpl/Csf/Hvap/(Cpl*mul/kl)**n)**3
return A**(1/3.)*q**(2/3.)
else:
raise ValueError('Either q or Te is needed for this correlation')
CalebBell / fluids / fluids / two_phase.py View on Github
return Lombardi_Pedrocchi(m=m, x=x, rhol=rhol, rhog=rhog, sigma=sigma, D=D, L=L)
elif Method2 == "Chisholm rough":
return Chisholm(m=m, x=x, rhol=rhol, rhog=rhog, mul=mul, mug=mug, D=D,
L=L, roughness=roughness, rough_correction=True)
elif Method2 == "Zhang_Hibiki_Mishima adiabatic gas":
return Zhang_Hibiki_Mishima(m=m, x=x, rhol=rhol, rhog=rhog, mul=mul, mug=mug,
sigma=sigma, D=D, L=L, roughness=roughness,
elif Method2 == "Zhang_Hibiki_Mishima flow boiling":
return Zhang_Hibiki_Mishima(m=m, x=x, rhol=rhol, rhog=rhog, mul=mul, mug=mug,
sigma=sigma, D=D, L=L, roughness=roughness,
flowtype='flow boiling')
elif Method2 == "Beggs-Brill":
return Beggs_Brill(m=m, x=x, rhol=rhol, rhog=rhog, mul=mul, mug=mug,
sigma=sigma, P=P, D=D, angle=angle, L=L,
roughness=roughness, acceleration=False, g=g)
else:
raise ValueError(_unknown_msg_two_phase)
CalebBell / ht / ht / conv_jacket.py View on Github
Engineering Chemistry Process Design and Development 9, no. 4
(October 1, 1970): 553-58. doi:10.1021/i260036a010.
.. [2] Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition.
Berlin; New York:: Springer, 2010.
'''
delta = (Djacket-Dtank)/2.
Q = m/rho
Pr = Cp*mu/k
vs = Q/H/delta
vo = Q/(pi/4*Dinlet**2)
if dT is not None and isobaric_expansion is not None and inlettype == 'radial' and inletlocation is not None:
if dT > 0: # Heating jacket fluid
if inletlocation == 'auto' or inletlocation == 'bottom':
va = 0.5*(2*g*H*isobaric_expansion*abs(dT))**0.5
else:
va = -0.5*(2*g*H*isobaric_expansion*abs(dT))**0.5
else: # cooling fluid
if inletlocation == 'auto' or inletlocation == 'top':
va = 0.5*(2*g*H*isobaric_expansion*abs(dT))**0.5
else:
va = -0.5*(2*g*H*isobaric_expansion*abs(dT))**0.5
else:
va = 0
vh = (vs*vo)**0.5 + va
dg = (8/3.)**0.5*delta
Res = vh*dg*rho/mu
if muw is not None:
NuSL = (0.03*Res**0.75*Pr)/(1 + 1.74*(Pr-1)/Res**0.125)*(mu/muw)**0.14
else:
NuSL = (0.03*Res**0.75*Pr)/(1 + 1.74*(Pr-1)/Res**0.125)
return NuSL*k/dg

CalebBell / ht / ht / condensation.py View on Github
2\sqrt{2}/3

Examples
--------
p. 578 in [1]_, matches exactly.

>>> Nusselt_laminar(Tsat=370, Tw=350, rhog=7.0, rhol=585., kl=0.091,
... mul=158.9E-6, Hvap=776900, L=0.1)
1482.206403453679

References
----------
.. [1] Hewitt, G. L. Shires T. Reg Bott G. F., George L. Shires, and
T. R. Bott. Process Heat Transfer. 1E. Boca Raton: CRC Press, 1994.
'''
return 2.*2.**0.5/3.*(kl**3*rhol*(rhol - rhog)*g*sin(angle/180.*pi)
*Hvap/(mul*(Tsat - Tw)*L))**0.25

CalebBell / fluids / fluids / core.py View on Github
Returns
-------
Bo : float
Bond number []

Examples
--------
>>> Bond(1000., 1.2, .0589, 2)
665187.2339558573

References
----------
.. [1] Green, Don, and Robert Perry. Perry's Chemical Engineers' Handbook,
Eighth Edition. McGraw-Hill Professional, 2007.
'''
return (g*(rhol-rhog)*L*L/sigma)


fluids

Fluid dynamics component of Chemical Engineering Design Library (ChEDL)

MIT

69 / 100