EPANET  3.0
EPANET Development Project
pipe.h
Go to the documentation of this file.
1 /* EPANET 3
2  *
3  * Copyright (c) 2016 Open Water Analytics
4  * Licensed under the terms of the MIT License (see the LICENSE file for details).
5  *
6  */
7 
10 
11 #ifndef PIPE_H_
12 #define PIPE_H_
13 
14 #include "Elements/link.h"
15 
16 #include <string>
17 
18 class Network;
19 
22 
23 class Pipe: public Link
24 {
25  public:
26 
27  // Constructor/Destructor
28 
29  Pipe(std::string name);
30  ~Pipe();
31 
32  // Methods
33 
34  int type() { return Link::PIPE; }
35  std::string typeStr() { return "Pipe"; }
36  void convertUnits(Network* nw);
37  bool isReactive();
38  void setInitFlow();
39  void setInitStatus(int status);
40  void setInitSetting(double setting);
41  void setResistance(Network* nw);
42 
43  double getRe(const double q, const double viscos);
44  double getResistance() {return resistance;}
45  double getVelocity();
46  double getUnitHeadLoss();
47  double getSetting(Network* nw) { return roughness; }
48  double getVolume() { return 0.785398 * length * diameter * diameter; }
49 
50  void findHeadLoss(Network* nw, double q);
51  bool canLeak() { return leakCoeff1 > 0.0; }
52  double findLeakage(Network* nw, double h, double& dqdh);
53  bool changeStatus(int s, bool makeChange,
54  const std::string reason,
55  std::stringstream& msgLog);
56  void validateStatus(Network* nw, double qTol);
57 
58  // Properties
59 
61  double length;
62  double roughness;
63  double resistance;
64  double lossFactor;
65  double leakCoeff1;
66  double leakCoeff2;
67  double bulkCoeff;
68  double wallCoeff;
69  double massTransCoeff;
70  };
71 
72 #endif
double length
pipe length (ft)
Definition: pipe.h:61
double lossFactor
minor loss factor (ft/cfs^2)
Definition: pipe.h:64
std::string name
element&#39;s ID name
Definition: element.h:28
double resistance
resistance factor (units depend head loss model)
Definition: pipe.h:63
double bulkCoeff
bulk reaction coefficient (mass^n/sec)
Definition: pipe.h:67
double roughness
roughness parameter (units depend on head loss model)
Definition: pipe.h:62
double wallCoeff
wall reaction coefficient (mass^n/sec)
Definition: pipe.h:68
A circular conduit Link through which water flows.
Definition: pipe.h:23
bool hasCheckValve
true if pipe has a check valve
Definition: pipe.h:60
double leakCoeff2
leakage coefficient (user units)
Definition: pipe.h:66
double massTransCoeff
mass transfer coefficient (mass^n/sec)
Definition: pipe.h:69
double leakCoeff1
leakage coefficient (user units)
Definition: pipe.h:65
Contains the data elements that describe a pipe network.
Definition: network.h:41