Hide keyboard shortcuts

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

# -*- coding: utf-8 -*- 

'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. 

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.''' 

 

from __future__ import division 

from scipy.interpolate import interp1d, UnivariateSpline 

from math import radians, cos 

 

__all__ = ['round_edge_screen', 'round_edge_open_mesh', 'square_edge_screen', 

'square_edge_grill', 'round_edge_grill'] 

 

round_Res = [20, 30, 40, 60, 80, 100, 200, 400] 

round_betas = [1.3, 1.1, 0.95, 0.83, 0.75, 0.7, 0.6, 0.52] 

#round_interp = interp1d(round_Res, round_betas, kind='linear') 

'''Quadratic interpolation with no smoothing, constant value extremities 

returned when outside table limits''' 

round_interp = UnivariateSpline(round_Res, round_betas, s=0, k=1) 

 

 

round_thetas = [0, 10, 20, 30, 40, 50, 60, 70, 80, 85] 

round_gammas = [1, 0.97, 0.88, 0.75, 0.59, 0.45, 0.3, 0.23, 0.15, 0.09] 

#inclined_round_interp = interp1d(round_thetas, round_gammas, kind='linear') 

'''Quadratic interpolation with no smoothing, constant value extremities 

returned when outside table limits''' 

inclined_round_interp = UnivariateSpline(round_thetas, round_gammas, s=0, k=1) 

 

#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.''' 

square_alphas = [0.0015625, 0.003125, 0.00625, 0.0125, 0.025, 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 = [1024000.,256000, 64000, 16000, 4000, 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 = UnivariateSpline(square_alphas, square_Ks, s=0, k=1) 

 

 

grills_rounded_alphas = [0.3, 0.4, 0.5, 0.6, 0.7] 

grills_rounded_Ks = [2, 1, 0.6, 0.4, 0.2] 

#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''' 

grills_rounded_interp = UnivariateSpline(grills_rounded_alphas, grills_rounded_Ks, s=0, k=2) 

 

def round_edge_screen(alpha, Re, angle=0): 

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. 

''' 

beta = float(round_interp(Re)) 

K = beta*(1 - alpha**2)/alpha**2 

if angle: 

if angle <= 45: 

K *= cos(radians(angle))**2 

else: 

K *= float(inclined_round_interp(angle)) 

return K 

 

 

def round_edge_open_mesh(alpha, subtype='diamond pattern wire', angle=0): 

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. 

''' 

if subtype == 'round bar screen': 

K = 0.95*(1-alpha) + 0.2*(1-alpha)**2 

elif subtype == 'diamond pattern wire': 

K = 0.67*(1-alpha) + 1.3*(1-alpha)**2 

elif subtype == 'knotted net': 

K = 0.70*(1-alpha) + 4.9*(1-alpha)**2 

elif subtype == 'knotless net': 

K = 0.72*(1-alpha) + 2.1*(1-alpha)**2 

else: 

raise Exception('Subtype not recognized') 

if angle: 

if angle < 45: 

K *= cos(radians(angle))**2 

else: 

K *= float(inclined_round_interp(angle)) 

return K 

 

 

def square_edge_screen(alpha): 

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. 

''' 

return float(square_interp(alpha)) 

 

 

def square_edge_grill(alpha=None, l=None, Dh=None, fd=None): 

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. 

''' 

if Dh and l and fd and l > 50*Dh: 

return (0.5*(1-alpha) + (1-alpha**2) + fd*l/Dh)/alpha**2 

else: 

return (0.5*(1-alpha) + (1-alpha**2))/alpha**2 

 

 

def round_edge_grill(alpha, l=None, Dh=None, fd=None): 

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. 

''' 

if Dh and l and fd and l > 50*Dh: 

return float(grills_rounded_interp(alpha)) + fd*l/Dh 

else: 

return float(grills_rounded_interp(alpha))