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

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

459

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

477

478

479

480

481

482

483

484

485

486

487

488

489

490

491

492

493

494

495

496

497

498

499

500

501

502

503

504

505

506

507

508

509

510

511

512

513

514

515

516

517

518

519

520

521

522

523

524

525

526

527

528

529

530

531

532

533

534

535

536

537

538

539

540

541

542

543

544

545

546

547

548

549

550

551

552

553

554

555

556

557

558

559

560

561

562

563

564

565

566

567

568

569

570

571

572

573

574

575

576

577

578

579

580

581

582

583

584

585

586

587

588

589

590

591

592

593

594

595

596

597

598

599

600

601

602

603

604

605

606

607

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622

623

624

625

626

627

628

629

630

631

632

633

634

635

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

653

654

655

656

657

658

659

660

661

662

663

664

665

666

667

668

669

670

671

672

673

674

675

676

677

678

679

680

681

682

683

684

685

686

687

688

689

690

691

692

693

694

695

696

697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

737

738

739

740

741

742

743

744

745

746

747

748

749

750

751

752

753

754

755

756

757

758

759

760

761

762

763

764

765

766

767

768

769

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

788

789

790

791

792

793

794

795

796

797

798

799

800

801

802

803

804

805

806

807

808

809

810

811

812

813

814

815

816

817

818

819

820

821

822

823

824

825

826

827

828

829

830

831

832

833

834

835

836

837

838

839

840

841

842

843

844

845

846

847

848

849

850

851

852

853

854

855

856

857

858

859

860

861

862

863

864

865

866

867

868

869

870

871

872

873

874

875

876

877

878

879

880

881

882

883

884

885

886

887

888

889

890

891

892

893

894

895

896

897

898

899

900

901

902

903

904

905

906

907

908

909

910

911

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

939

940

941

942

943

944

945

946

947

948

949

950

951

952

953

954

955

956

957

958

959

960

961

962

963

964

965

966

967

968

969

970

971

972

973

974

975

976

977

978

979

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994

995

996

997

998

999

1000

1001

1002

1003

1004

1005

1006

1007

1008

1009

1010

1011

1012

1013

1014

1015

1016

1017

1018

1019

1020

1021

1022

1023

1024

1025

1026

1027

1028

1029

1030

1031

1032

1033

1034

1035

1036

1037

1038

1039

1040

1041

1042

1043

1044

1045

1046

1047

1048

1049

1050

1051

1052

1053

1054

1055

1056

1057

1058

1059

1060

1061

1062

1063

1064

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089

1090

1091

1092

1093

1094

1095

1096

1097

1098

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1131

1132

1133

1134

1135

1136

1137

1138

1139

1140

1141

1142

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1167

1168

1169

1170

1171

1172

1173

1174

1175

1176

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1201

1202

1203

1204

1205

1206

1207

1208

1209

1210

1211

1212

1213

1214

1215

1216

1217

1218

1219

1220

1221

1222

1223

1224

1225

1226

1227

1228

1229

1230

1231

1232

1233

1234

1235

1236

1237

1238

1239

1240

1241

1242

1243

1244

1245

1246

1247

1248

1249

1250

1251

1252

1253

1254

1255

1256

1257

1258

1259

1260

1261

1262

1263

1264

1265

1266

1267

# -*- 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 math import cos, sin, tan, atan, pi 

 

__all__ = ['contraction_sharp', 'contraction_round', 

'contraction_conical', 'contraction_beveled', 'diffuser_sharp', 

'diffuser_conical', 'diffuser_conical_staged', 'diffuser_curved', 

'diffuser_pipe_reducer', 

'entrance_sharp', 'entrance_distance', 'entrance_angled', 

'entrance_rounded', 'entrance_beveled', 'exit_normal', 'bend_rounded', 

'bend_miter', 'helix', 'spiral','Darby3K', 'Hooper2K', 'Kv_to_Cv', 'Cv_to_Kv', 

'Kv_to_K', 'K_to_Kv', 'Darby', 'Hooper'] 

 

### Entrances 

 

def entrance_sharp(): 

r'''Returns loss coefficient for a sharp entrance to a pipe 

as shown in [1]_. 

 

.. math:: 

K = 0.57 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Other values used have been 0.5. 

 

Examples 

-------- 

>>> entrance_sharp() 

0.57 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

return 0.57 

 

 

def entrance_distance(d=None, t=None, l=None): 

r'''Returns loss coefficient for a sharp entrance to a pipe at a distance 

from the wall of a reservoir, as shown in [1]_. 

 

.. math:: 

K = 1.12 - 22\frac{t}{d} + 216\left(\frac{t}{d}\right)^2 + 

80\left(\frac{t}{d}\right)^3 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

t : float 

Thickness of pipe wall, [m] 

l : float, optional 

Length of pipe extending from the wall, [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Requires that l/d be >= 0.5. 

Requires that t/d <= 0.05. 

Will raise an exception if these are not the case. 

 

Examples 

-------- 

>>> entrance_distance(d=0.1, t=0.0005) 

1.0154100000000004 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

if l: 

if l/d < 0.5: 

raise Exception('l/d is under 0.5') 

if t/d > 0.05: 

raise Exception('t/d > 0.05') 

return 1.12 - 22*t/d + 216*(t/d)**2 + 80*(t/d)**3 

 

 

def entrance_angled(angle): 

r'''Returns loss coefficient for a sharp, angled entrance to a pipe 

flush with the wall of a reservoir, as shown in [1]_. 

 

.. math:: 

K = 0.57 + 0.30\cos(\theta) + 0.20\cos(\theta)^2 

 

Parameters 

---------- 

angle : float 

Angle of inclination, [degrees] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Not reliable for angles under 20 degrees. 

Loss coefficient is the same for a upward or downward angle. 

 

Examples 

-------- 

>>> entrance_angled(30) 

0.9798076211353316 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

angle = angle/(180/pi) 

return 0.57 + 0.30*cos(angle) + 0.20*cos(angle)**2 

 

 

def entrance_rounded(Di, rc): 

r'''Returns loss coefficient for a rounded entrance to a pipe 

flush with the wall of a reservoir, as shown in [1]_. 

 

.. math:: 

K = 0.0696\left(1 - 0.569\frac{r}{d}\right)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622\left(1 - 0.30\sqrt{\frac{r}{d}} 

- 0.70\frac{r}{d}\right)^4 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

rd : float 

Radius of curvatuce of the entrance, [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Applies for r/D < 1. 

For generously rounded entrances (r/D ~= 1): K = 0.03 

 

Examples 

-------- 

>>> entrance_rounded(Di=0.1, rc=0.0235) 

0.09839534618360923 

 

References 

---------- 

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

 

 

def entrance_beveled(Di, l, angle): 

r'''Returns loss coefficient for a beveled entrance to a pipe 

flush with the wall of a reservoir, as shown in [1]_. 

 

.. math:: 

K = 0.0696\left(1 - C_b\frac{l}{d}\right)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622\left[1-1.5C_b\left(\frac{l}{d} 

\right)^{\frac{1-(l/d)^{1/4}}{2}}\right] 

 

C_b = \left(1 - \frac{\theta}{90}\right)\left(\frac{\theta}{90} 

\right)^{\frac{1}{l+l/d}} 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

l : float 

Length of bevel, [m] 

angle : float 

Angle of bevel, [degrees] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

A cheap way of getting a lower pressure drop. 

Little credible data is available. 

 

Examples 

-------- 

>>> entrance_beveled(Di=0.1, l=0.003, angle=45) 

0.45086864221916984 

 

References 

---------- 

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

 

 

### Exits 

 

def exit_normal(): 

r'''Returns loss coefficient for any exit to a pipe 

as shown in [1]_ and in other sources. 

 

.. math:: 

K = 1 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

It has been found on occasion that K = 2.0 for laminar flow, and ranges 

from about 1.04 to 1.10 for turbulent flow. 

 

Examples 

-------- 

>>> exit_normal() 

1.0 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

return 1.0 

 

### Bends 

 

def bend_rounded(Di=None, rc=None, angle=None, fd=None, bend_diameters=5): 

r'''Returns loss coefficient for any rounded bend in a pipe 

as shown in [1]_. 

 

.. math:: 

K = f\alpha\frac{r}{d} + (0.10 + 2.4f)\sin(\alpha/2) 

+ \frac{6.6f(\sqrt{\sin(\alpha/2)}+\sin(\alpha/2))} 

{(r/d)^{\frac{4\alpha}{\pi}}} 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

rc : float 

Radius of curvatuce of the entrance, optional [m] 

angle : float 

Angle of bend, [degrees] 

fd : float 

Darcy friction factor [-] 

bend_diameters : float 

Number of diameters of pipe making up the bend radius [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

When inputting bend diameters, note that manufacturers often specify 

this as a multiplier of nominal diameter, which is different than actual 

diameter. Those require that rc be specified. 

 

First term represents surface friction loss; the second, secondary flows; 

and the third, flow separation. 

Encompasses the entire range of elbow and pipe bend configurations. 

 

Examples 

-------- 

>>> bend_rounded(Di=4.020, rc=4.0*5, angle=30, fd=0.0163) 

0.10680196344492195 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

angle = angle/(180/pi) 

if not rc: 

rc = Di*bend_diameters 

return (fd*angle*rc/Di + (0.10 + 2.4*fd)*sin(angle/2.) 

+ 6.6*fd*(sin(angle/2.)**0.5 + sin(angle/2.))/(rc/Di)**(4.*angle/pi)) 

 

 

def bend_miter(angle): 

r'''Returns loss coefficient for any single-joint miter bend in a pipe 

as shown in [1]_. 

 

.. math:: 

K = 0.42\sin(\alpha/2) + 2.56\sin^3(\alpha/2) 

 

Parameters 

---------- 

angle : float 

Angle of bend, [degrees] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Applies for bends from 0 to 150 degrees. One joint only. 

 

Examples 

-------- 

>>> bend_miter(150) 

2.7128147734758103 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

angle = angle/(180/pi) 

return 0.42*sin(angle*0.5) + 2.56*sin(angle*0.5)**3 

 

 

def helix(Di=None, rs=None, pitch=None, N=None, fd=None): 

r'''Returns loss coefficient for any size constant-pitch helix 

as shown in [1]_. Has applications in immersed coils in tanks. 

 

.. math:: 

K = N \left[f\frac{\sqrt{(2\pi r)^2 + p^2}}{d} + 0.20 + 4.8 f\right] 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

rs : float 

Radius of spiral, [m] 

pitch : float 

Distance between two subsequent coil centers, [m] 

N : float 

Number of coils in the helix [-] 

fd : float 

Darcy friction factor [-] 

 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Formulation based on peak secondary flow as in two 180 degree bends per 

coil. Flow separation ignored. No f, Re, geometry limitations. 

Source not compared against others. 

 

Examples 

-------- 

>>> helix(Di=0.01, rs=0.1, pitch=.03, N=10, fd=.0185) 

14.525134924495514 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

return N*(fd*((2*pi*rs)**2 + pitch**2)**0.5/Di + 0.20 + 4.8*fd) 

 

 

def spiral(Di=None, rmax=None, rmin=None, pitch=None, fd=None): 

r'''Returns loss coefficient for any size constant-pitch spiral 

as shown in [1]_. Has applications in immersed coils in tanks. 

 

.. math:: 

K = \frac{r_{max} - r_{min}}{p} \left[ f\pi\left(\frac{r_{max} 

+r_{min}}{d}\right) + 0.20 + 4.8f\right] 

+ \frac{13.2f}{(r_{min}/d)^2} 

 

Parameters 

---------- 

Di : float 

Inside diameter of pipe, [m] 

rmax : float 

Radius of spiral at extremity, [m] 

rmax : float 

Radius of spiral at end near center, [m] 

pitch : float 

Distance between two subsequent coil centers, [m] 

fd : float 

Darcy friction factor [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Source not compared against others. 

 

Examples 

-------- 

>>> spiral(Di=0.01, rmax=.1, rmin=.02, pitch=.01, fd=0.0185) 

7.950918552775473 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

return (rmax-rmin)/pitch*(fd*pi*(rmax+rmin)/Di + 0.20 + 4.8*fd) + 13.2*fd/(rmin/Di)**2 

 

### Contractions 

 

def contraction_sharp(Di1, Di2): 

r'''Returns loss coefficient for any sharp edged pipe contraction 

as shown in [1]_. 

 

.. math:: 

K = 0.0696(1-\beta^5)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622(1-0.215\beta^2 - 0.785\beta^5) 

 

\beta = d_2/d_1 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe, [m] 

Di2 : float 

Inside diameter of following pipe, [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

A value of 0.506 or simply 0.5 is often used. 

 

Examples 

-------- 

>>> contraction_sharp(Di1=1, Di2=0.4) 

0.5301269161591805 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di2/Di1 

lbd = 1 + 0.622*(1-0.215*beta**2 - 0.785*beta**5) 

return 0.0696*(1-beta**5)*lbd**2 + (lbd-1)**2 

 

 

def contraction_round(Di1, Di2, rc): 

r'''Returns loss coefficient for any round edged pipe contraction 

as shown in [1]_. 

 

.. math:: 

K = 0.0696\left(1 - 0.569\frac{r}{d_2}\right)\left(1-\sqrt{\frac{r} 

{d_2}}\beta\right)(1-\beta^5)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622\left(1 - 0.30\sqrt{\frac{r}{d_2}} 

- 0.70\frac{r}{d_2}\right)^4 (1-0.215\beta^2-0.785\beta^5) 

 

\beta = d_2/d_1 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe, [m] 

Di2 : float 

Inside diameter of following pipe, [m] 

rc : float 

Radius of curvatuce of the contraction, [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Rounding radius larger than 0.14Di2 prevents flow separation from the wall. 

Further increase in rounding radius continues to reduce loss coefficient. 

 

Examples 

-------- 

>>> contraction_round(Di1=1, Di2=0.4, rc=0.04) 

0.1783332490866574 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di2/Di1 

lbd = 1 + 0.622*(1 - 0.30*(rc/Di2)**0.5 - 0.70*rc/Di2)**4*(1-0.215*beta**2 - 0.785*beta**5) 

return 0.0696*(1-0.569*rc/Di2)*(1-(rc/Di2)**0.5*beta)*(1-beta**5)*lbd**2 + (lbd-1)**2 

 

 

def contraction_conical(Di1, Di2, l=None, angle=None, fd=None): 

r'''Returns loss coefficient for any conical pipe contraction 

as shown in [1]_. 

 

.. math:: 

K = 0.0696[1+C_B(\sin(\alpha/2)-1)](1-\beta^5)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622(\alpha/180)^{0.8}(1-0.215\beta^2-0.785\beta^5) 

 

\beta = d_2/d_1 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe, [m] 

Di2 : float 

Inside diameter of following pipe, [m] 

l : float 

Length of the contraction, optional [m] 

angle : float 

Angle of contraction, optional [degrees] 

fd : float 

Darcy friction factor [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Cheap and has substantial impact on pressure drop. 

 

Examples 

-------- 

>>> contraction_conical(Di1=0.1, Di2=0.04, l=0.04, fd=0.0185) 

0.15779041548350314 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di2/Di1 

if angle: 

angle = angle/(180/pi) 

l = (Di1 - Di2)/(2*tan(angle/2)) 

elif l: 

angle = 2*atan((Di1-Di2)/2/l) 

else: 

raise Exception('Either l or angle is required') 

 

lbd = 1 + 0.622*(angle/pi)**0.8*(1-0.215*beta**2 - 0.785*beta**5) 

return fd*(1-beta**4)/(8*sin(angle/2)) + 0.0696*sin(angle/2)*(1-beta**5)*lbd**2 + (lbd-1)**2 

 

 

def contraction_beveled(Di1, Di2, l=None, angle=None): 

r'''Returns loss coefficient for any sharp beveled pipe contraction 

as shown in [1]_. 

 

.. math:: 

K = 0.0696[1+C_B(\sin(\alpha/2)-1)](1-\beta^5)\lambda^2 + (\lambda-1)^2 

 

\lambda = 1 + 0.622\left[1+C_B\left(\left(\frac{\alpha}{180} 

\right)^{0.8}-1\right)\right](1-0.215\beta^2-0.785\beta^5) 

 

C_B = \frac{l}{d_2}\frac{2\beta\tan(\alpha/2)}{1-\beta} 

 

\beta = d_2/d_1 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe, [m] 

Di2 : float 

Inside diameter of following pipe, [m] 

l : float 

Length of the bevel along the pipe axis ,[m] 

angle : float 

Angle of bevel, [degrees] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

 

Examples 

-------- 

>>> contraction_beveled(Di1=0.5, Di2=0.1, l=.7*.1, angle=120) 

0.40946469413070485 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

angle = angle/(180/pi) 

beta = Di2/Di1 

CB = l/Di2*2*beta*tan(angle/2)/(1-beta) 

lbd = 1 + 0.622*(1 + CB*((angle/pi)**0.8-1))*(1-0.215*beta**2-0.785*beta**5) 

return 0.0696*(1 + CB*(sin(angle/2)-1))*(1-beta**5)*lbd**2 + (lbd-1)**2 

 

### Expansions (diffusers) 

 

def diffuser_sharp(Di1, Di2): 

r'''Returns loss coefficient for any sudded pipe diameter expansion 

as shown in [1]_ and in other sources. 

 

.. math:: 

K_1 = (1-\beta^2)^2 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe (smaller), [m] 

Di2 : float 

Inside diameter of following pipe (larger), [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Highly accurate. 

 

Examples 

-------- 

>>> diffuser_sharp(Di1=.5, Di2=1) 

0.5625 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di1/Di2 

return (1-beta**2)**2 

 

 

def diffuser_conical(Di1, Di2, l=None, angle=None, fd=None): 

r'''Returns loss coefficient for any conical pipe expansion 

as shown in [1]_. Five different formulas are used, depending on 

the angle and the ratio of diameters. 

 

For 0 to 20 degrees, all aspect ratios: 

 

.. math:: 

K_1 = 8.30[\tan(\alpha/2)]^{1.75}(1-\beta^2)^2 + \frac{f(1-\beta^4)}{8\sin(\alpha/2)} 

 

For 20 to 60 degrees, beta < 0.5: 

 

.. math:: 

K_1 = \left\{1.366\sin\left[\frac{2\pi(\alpha-15^\circ)}{180}\right]^{0.5} 

- 0.170 - 3.28(0.0625-\beta^4)\sqrt{\frac{\alpha-20^\circ}{40^\circ}}\right\} 

(1-\beta^2)^2 + \frac{f(1-\beta^4)}{8\sin(\alpha/2)} 

 

For 20 to 60 degrees, beta >= 0.5: 

 

.. math:: 

K_1 = \left\{1.366\sin\left[\frac{2\pi(\alpha-15^\circ)}{180}\right]^{0.5} 

- 0.170 \right\}(1-\beta^2)^2 + \frac{f(1-\beta^4)}{8\sin(\alpha/2)} 

 

For 60 to 180 degrees, beta < 0.5: 

 

.. math:: 

K_1 = \left[1.205 - 3.28(0.0625-\beta^4)-12.8\beta^6\sqrt{\frac 

{\alpha-60^\circ}{120^\circ}}\right](1-\beta^2)^2 

 

For 60 to 180 degrees, beta >= 0.5: 

 

.. math:: 

K_1 = \left[1.205 - 0.20\sqrt{\frac{\alpha-60^\circ}{120^\circ}} 

\right](1-\beta^2)^2 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe (smaller), [m] 

Di2 : float 

Inside diameter of following pipe (larger), [m] 

l : float 

Length of the contraction along the pipe axis, optional[m] 

angle : float 

Angle of contraction, [degrees] 

fd : float 

Darcy friction factor [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

For angles above 60 degrees, friction factor is not used. 

 

Examples 

-------- 

>>> diffuser_conical(Di1=.1**0.5, Di2=1, angle=10., fd=0.020) 

0.12301652230915454 

>>> diffuser_conical(Di1=1/3., Di2=1, angle=50, fd=0.03) # 2 

0.8081340270019336 

>>> diffuser_conical(Di1=2/3., Di2=1, angle=40, fd=0.03) # 3 

0.32533470783539786 

>>> diffuser_conical(Di1=1/3., Di2=1, angle=120, fd=0.0185) # #4 

0.812308728765127 

>>> diffuser_conical(Di1=2/3., Di2=1, angle=120, fd=0.0185) # Last 

0.3282650135070033 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di1/Di2 

 

if angle: 

angle_rad = angle/(180/pi) 

l = (Di2 - Di1)/(2*tan(angle_rad/2)) 

elif l: 

angle_rad = 2*atan((Di2-Di1)/2/l) 

angle = angle_rad*(180/pi) 

 

if 0 < angle <= 20: 

K = 8.30*tan(angle_rad/2)**1.75*(1-beta**2)**2 + fd*(1-beta**4)/8./sin(angle_rad/2) 

elif 20 < angle <= 60 and 0 <= beta < 0.5: 

K = (1.366*sin(2*pi*(angle-15)/180.)**0.5-0.170 

- 3.28*(0.0625-beta**4)*((angle-20)/40.)**0.5)*(1-beta**2)**2 + fd*(1-beta**4)/8./sin(angle_rad/2) 

elif 20 < angle <= 60 and beta >= 0.5: 

K = (1.366*sin(2*pi*(angle-15)/180.)**0.5-0.170)*(1-beta**2)**2 + fd*(1-beta**4)/8./sin(angle_rad/2) 

elif 60 < angle <= 180 and 0 <= beta < 0.5: 

K = (1.205 - 3.28*(0.0625-beta**4) - 12.8*beta**6*((angle-60)/120.)**0.5)*(1-beta**2)**2 

elif 60 < angle <= 180 and beta >= 0.5: 

K = (1.205 - 0.20*((angle-60)/120.)**0.5)*(1-beta**2)**2 

else: 

raise Exception('Conical diffuser inputs incorrect') 

return K 

 

 

def diffuser_conical_staged(Di1, Di2, DEs, ls, fd=None): 

r'''Returns loss coefficient for any series of staged conical pipe expansions 

as shown in [1]_. Five different formulas are used, depending on 

the angle and the ratio of diameters. This function calls diffuser_conical. 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe (smaller), [m] 

Di2 : float 

Inside diameter of following pipe (larger), [m] 

DEs : array 

Diameters of intermediate sections, [m] 

ls : array 

Lengths of the various sections, [m] 

fd : float 

Darcy friction factor [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Only lengths of sections currently allowed. This could be changed 

to understand angles also. 

 

Formula doesn't make much sense, as observed by the example comparing 

a series of conical sections. Use only for small numbers of segments of 

highly differing angles. 

 

Examples 

-------- 

>>> diffuser_conical(Di1=1., Di2=10.,l=9, fd=0.01) 

0.973137914861591 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

K = 0 

DEs.insert(0, Di1) 

DEs.append(Di2) 

for i in range(len(ls)): 

K += diffuser_conical(Di1=float(DEs[i]), Di2=float(DEs[i+1]), l=float(ls[i]), fd=fd) 

return K 

 

 

def diffuser_curved(Di1, Di2, l): 

r'''Returns loss coefficient for any curved wall pipe expansion 

as shown in [1]_. 

 

.. math:: 

K_1 = \phi(1.43-1.3\beta^2)(1-\beta^2)^2 

 

\phi = 1.01 - 0.624\frac{l}{d_1} + 0.30\left(\frac{l}{d_1}\right)^2 

- 0.074\left(\frac{l}{d_1}\right)^3 + 0.0070\left(\frac{l}{d_1}\right)^4 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe (smaller), [m] 

Di2 : float 

Inside diameter of following pipe (larger), [m] 

l : float 

Length of the curve along the pipe axis, [m] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Beta^2 should be between 0.1 and 0.9. 

A small mismatch between tabulated values of this function in table 11.3 

is observed with the equation presented. 

 

Examples 

-------- 

>>> diffuser_curved(Di1=.25**0.5, Di2=1., l=2.) 

0.2299781250000002 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

beta = Di1/Di2 

phi = 1.01 - 0.624*l/Di1 + 0.30*(l/Di1)**2 - 0.074*(l/Di1)**3 + 0.0070*(l/Di1)**4 

return phi*(1.43 - 1.3*beta**2)*(1 - beta**2)**2 

 

 

def diffuser_pipe_reducer(Di1, Di2, l, fd1, fd2=None): 

r'''Returns loss coefficient for any pipe reducer pipe expansion 

as shown in [1]. This is an approximate formula. 

 

.. math:: 

K_f = f_1\frac{0.20l}{d_1} + \frac{f_1(1-\beta)}{8\sin(\alpha/2)} 

+ f_2\frac{0.20l}{d_2}\beta^4 

 

\alpha = 2\tan^{-1}\left(\frac{d_1-d_2}{1.20l}\right) 

 

Parameters 

---------- 

Di1 : float 

Inside diameter of original pipe (smaller), [m] 

Di2 : float 

Inside diameter of following pipe (larger), [m] 

l : float 

Length of the pipe reducer along the pipe axis, [m] 

fd1 : float 

Darcy friction factor at inlet diameter [-] 

fd2 : float 

Darcy friction factor at outlet diameter, optional [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Industry lack of standardization prevents better formulas from being 

developed. Add 15% if the reducer is eccentric. 

Friction factor at outlet will be assumed the same as at inlet if not specified. 

 

Doubt about the validity of this equation is raised. 

 

Examples 

-------- 

>>> diffuser_pipe_reducer(Di1=.5, Di2=.75, l=1.5, fd1=0.07) 

0.06873244301714816 

 

References 

---------- 

.. [1] Rennels, Donald C., and Hobart M. Hudson. Pipe Flow: A Practical 

and Comprehensive Guide. 1st edition. Hoboken, N.J: Wiley, 2012. 

''' 

if not fd2: 

fd2 = fd1 

beta = Di1/Di2 

angle = -2*atan((Di1-Di2)/1.20/l) 

K = fd1*0.20*l/Di1 + fd1*(1-beta)/8./sin(angle/2) + fd2*0.20*l/Di2*beta**4 

return K 

 

### TODO: Tees 

 

### 3 Darby 3K Method (with valves) 

Darby = {} 

Darby['Elbow, 90°, threaded, standard, (r/D = 1)'] = {'K1': 800, 'Ki': 0.14, 'Kd': 4} 

Darby['Elbow, 90°, threaded, long radius, (r/D = 1.5)'] = {'K1': 800, 'Ki': 0.071, 'Kd': 4.2} 

Darby['Elbow, 90°, flanged, welded, bends, (r/D = 1)'] = {'K1': 800, 'Ki': 0.091, 'Kd': 4} 

Darby['Elbow, 90°, (r/D = 2)'] = {'K1': 800, 'Ki': 0.056, 'Kd': 3.9} 

Darby['Elbow, 90°, (r/D = 4)'] = {'K1': 800, 'Ki': 0.066, 'Kd': 3.9} 

Darby['Elbow, 90°, (r/D = 6)'] = {'K1': 800, 'Ki': 0.075, 'Kd': 4.2} 

Darby['Elbow, 90°, mitered, 1 weld, (90°)'] = {'K1': 1000, 'Ki': 0.27, 'Kd': 4} 

Darby['Elbow, 90°, 2 welds, (45°)'] = {'K1': 800, 'Ki': 0.068, 'Kd': 4.1} 

Darby['Elbow, 90°, 3 welds, (30°)'] = {'K1': 800, 'Ki': 0.035, 'Kd': 4.2} 

Darby['Elbow, 45°, threaded standard, (r/D = 1)'] = {'K1': 500, 'Ki': 0.071, 'Kd': 4.2} 

Darby['Elbow, 45°, long radius, (r/D = 1.5)'] = {'K1': 500, 'Ki': 0.052, 'Kd': 4} 

Darby['Elbow, 45°, mitered, 1 weld, (45°)'] = {'K1': 500, 'Ki': 0.086, 'Kd': 4} 

Darby['Elbow, 45°, mitered, 2 welds, (22.5°)'] = {'K1': 500, 'Ki': 0.052, 'Kd': 4} 

Darby['Elbow, 180°, threaded, close-return bend, (r/D = 1)'] = {'K1': 1000, 'Ki': 0.23, 'Kd': 4} 

Darby['Elbow, 180°, flanged, (r/D = 1)'] = {'K1': 1000, 'Ki': 0.12, 'Kd': 4} 

Darby['Elbow, 180°, all, (r/D = 1.5)'] = {'K1': 1000, 'Ki': 0.1, 'Kd': 4} 

Darby['Tee, Through-branch, (as elbow), threaded, (r/D = 1)'] = {'K1': 500, 'Ki': 0.274, 'Kd': 4} 

Darby['Tee, Through-branch,(as elbow), (r/D = 1.5)'] = {'K1': 800, 'Ki': 0.14, 'Kd': 4} 

Darby['Tee, Through-branch, (as elbow), flanged, (r/D = 1)'] = {'K1': 800, 'Ki': 0.28, 'Kd': 4} 

Darby['Tee, Through-branch, (as elbow), stub-in branch'] = {'K1': 1000, 'Ki': 0.34, 'Kd': 4} 

Darby['Tee, Run-through, threaded, (r/D = 1)'] = {'K1': 200, 'Ki': 0.091, 'Kd': 4} 

Darby['Tee, Run-through, flanged, (r/D = 1)'] = {'K1': 150, 'Ki': 0.05, 'Kd': 4} 

Darby['Tee, Run-through, stub-in branch'] = {'K1': 100, 'Ki': 0, 'Kd': 0} 

Darby['Valve, Angle valve, 45°, full line size, β = 1'] = {'K1': 950, 'Ki': 0.25, 'Kd': 4} 

Darby['Valve, Angle valve, 90°, full line size, β = 1'] = {'K1': 1000, 'Ki': 0.69, 'Kd': 4} 

Darby['Valve, Globe valve, standard, β = 1'] = {'K1': 1500, 'Ki': 1.7, 'Kd': 3.6} 

Darby['Valve, Plug valve, branch flow'] = {'K1': 500, 'Ki': 0.41, 'Kd': 4} 

Darby['Valve, Plug valve, straight through'] = {'K1': 300, 'Ki': 0.084, 'Kd': 3.9} 

Darby['Valve, Plug valve, three-way (flow through)'] = {'K1': 300, 'Ki': 0.14, 'Kd': 4} 

Darby['Valve, Gate valve, standard, β = 1'] = {'K1': 300, 'Ki': 0.037, 'Kd': 3.9} 

Darby['Valve, Ball valve, standard, β = 1'] = {'K1': 300, 'Ki': 0.017, 'Kd': 3.5} 

Darby['Valve, Diaphragm, dam type'] = {'K1': 1000, 'Ki': 0.69, 'Kd': 4.9} 

Darby['Valve, Swing check'] = {'K1': 1500, 'Ki': 0.46, 'Kd': 4} 

Darby['Valve, Lift check'] = {'K1': 2000, 'Ki': 2.85, 'Kd': 3.8} 

 

 

def Darby3K(NPS=None, Re=None, name=None, K1=None, Ki=None, Kd=None): 

r'''Returns loss coefficient for any various fittings, depending 

on the name input. Alternatively, the Darby constants K1, Ki and Kd 

may be provided and used instead. Source of data is [1]_. 

Reviews of this model are favorable. 

 

.. math:: 

K_f = \frac{K_1}{Re} + K_i\left(1 + \frac{K_d}{D_{\text{NPS}}^{0.3}}\right) 

 

Parameters 

---------- 

NPS : float 

Nominal diameter of the pipe, [in] 

Re : float 

Reynolds number, [-] 

name : str 

String from Darby dict representing a fitting 

K1 : float 

K1 parameter of Darby model, optional [-] 

Ki : float 

Ki parameter of Darby model, optional [-] 

Kd : float 

Kd parameter of Darby model, optional [in] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Also described in Albright's Handbook and Ludwig's Applied Process Design. 

Relatively uncommon to see it used. 

 

The possibility of combining these methods with those above are attractive. 

 

Examples 

-------- 

>>> Darby3K(NPS=2., Re=10000., name='Valve, Angle valve, 45°, full line size, β = 1') 

1.1572523963562353 

>>> Darby3K(NPS=12., Re=10000., K1=950, Ki=0.25, Kd=4) 

0.819510280626355 

 

References 

---------- 

.. [1] Silverberg, Peter, and Ron Darby. "Correlate Pressure Drops through 

Fittings: Three Constants Accurately Calculate Flow through Elbows, 

Valves and Tees." Chemical Engineering 106, no. 7 (July 1999): 101. 

.. [2] Silverberg, Peter. "Correlate Pressure Drops Through Fittings." 

Chemical Engineering 108, no. 4 (April 2001): 127,129-130. 

''' 

if name: 

if name in Darby: 

d = Darby[name] 

K1, Ki, Kd = d['K1'], d['Ki'], d['Kd'] 

else: 

raise Exception('Name of fitting not in list') 

elif K1 and Ki and Kd: 

pass 

else: 

raise Exception('Name of fitting or constants are required') 

return K1/Re + Ki*(1. + Kd/NPS**0.3) 

 

 

### 2K Hooper Method 

 

Hooper = {} 

Hooper['Elbow, 90°, Standard (R/D = 1), Screwed'] = {'K1': 800, 'Kinfty': 0.4} 

Hooper['Elbow, 90°, Standard (R/D = 1), Flanged/welded'] = {'K1': 800, 'Kinfty': 0.25} 

Hooper['Elbow, 90°, Long-radius (R/D = 1.5), All types'] = {'K1': 800, 'Kinfty': 0.2} 

Hooper['Elbow, 90°, Mitered (R/D = 1.5), 1 weld (90° angle)'] = {'K1': 1000, 'Kinfty': 1.15} 

Hooper['Elbow, 90°, Mitered (R/D = 1.5), 2 weld (45° angle)'] = {'K1': 800, 'Kinfty': 0.35} 

Hooper['Elbow, 90°, Mitered (R/D = 1.5), 3 weld (30° angle)'] = {'K1': 800, 'Kinfty': 0.3} 

Hooper['Elbow, 90°, Mitered (R/D = 1.5), 4 weld (22.5° angle)'] = {'K1': 800, 'Kinfty': 0.27} 

Hooper['Elbow, 90°, Mitered (R/D = 1.5), 5 weld (18° angle)'] = {'K1': 800, 'Kinfty': 0.25} 

Hooper['Elbow, 45°, Standard (R/D = 1), All types'] = {'K1': 500, 'Kinfty': 0.2} 

Hooper['Elbow, 45°, Long-radius (R/D 1.5), All types'] = {'K1': 500, 'Kinfty': 0.15} 

Hooper['Elbow, 45°, Mitered (R/D=1.5), 1 weld (45° angle)'] = {'K1': 500, 'Kinfty': 0.25} 

Hooper['Elbow, 45°, Mitered (R/D=1.5), 2 weld (22.5° angle)'] = {'K1': 500, 'Kinfty': 0.15} 

Hooper['Elbow, 45°, Standard (R/D = 1), Screwed'] = {'K1': 1000, 'Kinfty': 0.7} 

Hooper['Elbow, 180°, Standard (R/D = 1), Flanged/welded'] = {'K1': 1000, 'Kinfty': 0.35} 

Hooper['Elbow, 180°, Long-radius (R/D = 1.5), All types'] = {'K1': 1000, 'Kinfty': 0.3} 

Hooper['Elbow, Used as, Standard, Screwed'] = {'K1': 500, 'Kinfty': 0.7} 

Hooper['Elbow, Elbow, Long-radius, Screwed'] = {'K1': 800, 'Kinfty': 0.4} 

Hooper['Elbow, Elbow, Standard, Flanged/welded'] = {'K1': 800, 'Kinfty': 0.8} 

Hooper['Elbow, Elbow, Stub-in type branch'] = {'K1': 1000, 'Kinfty': 1} 

Hooper['Tee, Run, Screwed'] = {'K1': 200, 'Kinfty': 0.1} 

Hooper['Tee, Through, Flanged or welded'] = {'K1': 150, 'Kinfty': 0.05} 

Hooper['Tee, Tee, Stub-in type branch'] = {'K1': 100, 'Kinfty': 0} 

Hooper['Valve, Gate, Full line size, Beta = 1'] = {'K1': 300, 'Kinfty': 0.1} 

Hooper['Valve, Ball, Reduced trim, Beta = 0.9'] = {'K1': 500, 'Kinfty': 0.15} 

Hooper['Valve, Plug, Reduced trim, Beta = 0.8'] = {'K1': 1000, 'Kinfty': 0.25} 

Hooper['Valve, Globe, Standard'] = {'K1': 1500, 'Kinfty': 4} 

Hooper['Valve, Globe, Angle or Y-type'] = {'K1': 1000, 'Kinfty': 2} 

Hooper['Valve, Diaphragm, Dam type'] = {'K1': 1000, 'Kinfty': 2} 

Hooper['Valve, Butterfly,'] = {'K1': 800, 'Kinfty': 0.25} 

Hooper['Valve, Check, Lift'] = {'K1': 2000, 'Kinfty': 10} 

Hooper['Valve, Check, Swing'] = {'K1': 1500, 'Kinfty': 1.5} 

Hooper['Valve, Check, Tilting-disc'] = {'K1': 1000, 'Kinfty': 0.5} 

 

 

def Hooper2K(Di=None, Re=None, name=None, K1=None, Kinfty=None): 

r'''Returns loss coefficient for any various fittings, depending 

on the name input. Alternatively, the Hooper constants K1, Kinfty 

may be provided and used instead. Source of data is [1]_. 

Reviews of this model are favorable less favorable than the Darby method 

but superior to the constant-K method. 

 

.. math:: 

K = \frac{K_1}{Re} + K_\infty\left(1 + \frac{1}{ID_{in}}\right) 

 

Parameters 

---------- 

Di : float 

Actual inside diameter of the pipe, [in] 

Re : float 

Reynolds number, [-] 

name : str 

String from Hooper dict representing a fitting 

K1 : float 

K1 parameter of Hooper model, optional [-] 

Kinfty : float 

Kinfty parameter of Hooper model, optional [-] 

 

Returns 

------- 

K : float 

Loss coefficient [-] 

 

Notes 

----- 

Also described in Ludwig's Applied Process Design. 

Relatively uncommon to see it used. 

No actual example found. 

 

Examples 

-------- 

>>> Hooper2K(Di=2., Re=10000., name='Valve, Globe, Standard') 

6.15 

>>> Hooper2K(Di=2., Re=10000., K1=900, Kinfty=4) 

6.09 

 

References 

---------- 

.. [1] Hooper, W. B., "The 2-K Method Predicts Head Losses in Pipe 

Fittings," Chem. Eng., p. 97, Aug. 24 (1981). 

.. [2] Hooper, William B. "Calculate Head Loss Caused by Change in Pipe 

Size." Chemical Engineering 95, no. 16 (November 7, 1988): 89. 

.. [3] Kayode Coker. Ludwig's Applied Process Design for Chemical and 

Petrochemical Plants. 4E. Amsterdam ; Boston: Gulf Professional 

Publishing, 2007. 

''' 

if name: 

if name in Hooper: 

d = Hooper[name] 

K1, Kinfty = d['K1'], d['Kinfty'] 

else: 

raise Exception('Name of fitting not in list') 

elif K1 and Kinfty: 

pass 

else: 

raise Exception('Name of fitting or constants are required') 

return K1/Re + Kinfty*(1. + 1./Di) 

 

 

### Valves 

 

 

 

def Kv_to_Cv(Kv): 

r'''Convert valve flow coefficient from imperial to common metric units. 

 

.. math:: 

C_v = 1.1560992283540599 K_v 

 

Parameters 

---------- 

Kv : float 

Valve flow coefficient, [1 m^3 cold water/hour at dP = 1 bar] 

 

Returns 

------- 

Cv : float 

Valve flow coefficient, [1 gpm water at 1.0 psi dP] 

 

Notes 

----- 

Kv = 0.865 Cv is in the IEC standard 60534-2-1. 

It has also been said that Cv = 1.17Kv; this is wrong by current standards. 

 

Examples 

-------- 

>>> Kv_to_Cv(2) 

2.3121984567081197 

 

References 

---------- 

.. [1] ISA-75.01.01-2007 (60534-2-1 Mod) Draft 

''' 

return 1.1560992283540599*Kv 

 

 

def Cv_to_Kv(Cv): 

r'''Convert valve flow coefficient from imperial to common metric units. 

 

.. math:: 

K_v = C_v/1.156 

 

Parameters 

---------- 

Cv : float 

Valve flow coefficient, [1 gpm water at 1.0 psi dP] 

 

Returns 

------- 

Kv : float 

Valve flow coefficient, [1 m^3 cold water/hour at dP = 1 bar] 

 

Notes 

----- 

Kv = 0.865 Cv is in the IEC standard 60534-2-1. 

It has also been said that Cv = 1.17Kv; this is wrong by current standards. 

 

Examples 

-------- 

>>> Cv_to_Kv(2.312) 

1.9998283393819036 

 

References 

---------- 

.. [1] ISA-75.01.01-2007 (60534-2-1 Mod) Draft 

''' 

return Cv/1.1560992283540599 

 

 

def Kv_to_K(Kv, D): 

r'''Convert valve flow coefficient from common metric units to regular 

loss coefficients. 

 

.. math:: 

K = 0.001604 \frac{D^4}{K_v^2} 

 

Parameters 

---------- 

Kv : float 

Valve flow coefficient, [1 m^3 cold water/hour at dP = 1 bar] 

 

Returns 

------- 

K : float 

Loss coefficient, [-] 

 

Notes 

----- 

 

 

Examples 

-------- 

>>> Kv_to_K(2.312, .015) 

15.1912580369009 

 

References 

---------- 

.. [1] ISA-75.01.01-2007 (60534-2-1 Mod) Draft 

''' 

return 0.001604E12*D**4/Kv**2 

 

 

def K_to_Kv(K, D): 

r'''Convert regular loss coefficient to valve flow coefficient. 

 

.. math:: 

K_v = \sqrt{0.001604 \frac{D^4}{K}} 

 

Parameters 

---------- 

K : float 

Loss coefficient, [-] 

 

Returns 

------- 

Kv : float 

Valve flow coefficient, [1 m^3 cold water/hour at dP = 1 bar] 

 

Notes 

----- 

 

 

Examples 

-------- 

>>> K_to_Kv(15.1912580369009, .015) 

2.312 

 

References 

---------- 

.. [1] ISA-75.01.01-2007 (60534-2-1 Mod) Draft 

''' 

return (0.001604E12*D**4/K)**0.5