EPANET  3.0
EPANET Development Project
pump.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 PUMP_H_
12 #define PUMP_H_
13 
14 #include "Elements/link.h"
15 #include "Elements/pumpcurve.h"
16 #include "Models/pumpenergy.h"
17 
18 #include <string>
19 
20 class Network;
21 class Pattern;
22 class Curve;
23 
26 
27 class Pump: public Link
28 {
29  public:
30 
31  // Constructor/Destructor
32 
33  Pump(std::string name_);
34  ~Pump();
35 
36  // Methods
37 
38  int type() { return Link::PUMP; }
39  std::string typeStr() { return "Pump"; }
40  void convertUnits(Network* nw);
41  void validate(Network* nw);
42 
43  void setInitFlow();
44  void setInitStatus(int s);
45  void setInitSetting(double s);
46  double getSetting(Network* nw) { return speed; }
47 
48  bool isHpPump() { return pumpCurve.isConstHP(); }
49 
50  void findHeadLoss(Network* nw, double q);
51  double updateEnergyUsage(Network* nw, int dt);
52 
53  bool changeStatus(int s, bool makeChange,
54  const std::string reason,
55  std::ostream& msgLog);
56  bool changeSetting(double s, bool makeChange,
57  const std::string reason,
58  std::ostream& msgLog);
59  void validateStatus(Network* nw, double qTol);
60  void applyControlPattern(std::ostream& msgLog);
61 
62  // Properties
63 
65  double speed;
70  double costPerKwh;
71  };
72 
73 #endif
PumpCurve pumpCurve
pump&#39;s head v. flow relation
Definition: pump.h:64
Describes the PumpCurve class.
A Link that raises the head of water flowing through it.
Definition: pump.h:27
PumpEnergy pumpEnergy
pump&#39;s energy usage
Definition: pump.h:67
Pattern * speedPattern
speed time pattern
Definition: pump.h:66
Describes the PumpEnergy class.
double costPerKwh
unit energy cost (cost/kwh)
Definition: pump.h:70
Describes how head varies with flow for a Pump link.
Definition: pumpcurve.h:20
double speed
relative pump speed
Definition: pump.h:65
Pattern * costPattern
energy cost pattern
Definition: pump.h:69
Accumulates energy usage metrics for a pump.
Definition: pumpenergy.h:20
Curve * efficCurve
efficiency. v. flow curve
Definition: pump.h:68
A set of multiplier factors associated with points in time.
Definition: pattern.h:29
Contains the data elements that describe a pipe network.
Definition: network.h:41
An ordered collection of x,y data pairs.
Definition: curve.h:30