EPANET  3.0
EPANET Development Project
node.h
Go to the documentation of this file.
1 /* EPANET 3
2  *
3  * Copyright (c) 2016 Open Water Analytics
4  * Distributed under the MIT License (see the LICENSE file for details).
5  *
6  */
7 
10 
11 #ifndef NODE_H_
12 #define NODE_H_
13 
14 #include "Elements/element.h"
15 
16 #include <string>
17 
18 class Network;
19 class Emitter;
20 class QualSource;
21 class MemPool;
22 
29 
30 class Node: public Element
31 {
32  public:
33 
34  enum NodeType {JUNCTION, TANK, RESERVOIR};
35 
36  Node(std::string name_);
37  virtual ~Node();
38 
39  static Node* factory(int type_, std::string name_, MemPool* memPool);
40 
41  virtual int type() = 0;
42  virtual void convertUnits(Network* nw) = 0;
43  virtual void initialize(Network* nw);
44 
45  // Overridden for Junction nodes
46  virtual void findFullDemand(double multiplier, double patternFactor) { }
47  virtual double findActualDemand(Network* nw, double h, double& dqdh) { return 0; }
48  virtual double findEmitterFlow(double h, double& dqdh) { return 0; }
49  virtual void setFixedGrade() { fixedGrade = false; }
50  virtual bool isPressureDeficient(Network* nw) { return false; }
51  virtual bool hasEmitter() { return false; }
52 
53  // Overridden for Tank nodes
54  virtual void validate() { }
55  virtual bool isReactive() { return false; }
56  virtual bool isFull() { return false; }
57  virtual bool isEmpty() { return false; }
58  virtual bool isClosed(double flow) { return false; }
59  virtual double getVolume() { return 0.0; }
60 
61  // Input Parameters
62  bool rptFlag;
63  double elev;
64  double xCoord;
65  double yCoord;
66  double initQual;
68 
69  // Computed Variables
70  bool fixedGrade;
71  double head;
72  double qGrad;
73  double fullDemand;
74  double actualDemand;
75  double outflow;
76  double quality;
77 };
78 
79 #endif
bool fixedGrade
fixed grade status
Definition: node.h:70
Abstract parent class for all pipe network components.
Definition: element.h:19
Describes the Element class.
A connection point between links in a network.
Definition: node.h:30
double outflow
demand + emitter + leakage flow (cfs)
Definition: node.h:75
double initQual
initial water quality concen.
Definition: node.h:66
double elev
elevation (ft)
Definition: node.h:63
A simple pooled memory allocator.
Definition: mempool.h:21
double quality
water quality concen. (mass/ft3)
Definition: node.h:76
Externally applied water quality at a source node.
Definition: qualsource.h:20
double xCoord
X-coordinate.
Definition: node.h:64
double yCoord
Y-coordinate.
Definition: node.h:65
double qGrad
gradient of outflow w.r.t. head (cfs/ft)
Definition: node.h:72
QualSource * qualSource
water quality source information
Definition: node.h:67
double fullDemand
full demand required (cfs)
Definition: node.h:73
double actualDemand
actual demand delivered (cfs)
Definition: node.h:74
bool rptFlag
true if results are reported
Definition: node.h:62
Contains the data elements that describe a pipe network.
Definition: network.h:41
Models an unlimited pressure-dependent rate of water outflow at a Junction node.
Definition: emitter.h:23
double head
hydraulic head (ft)
Definition: node.h:71