EPANET  3.0
EPANET Development Project
demandmodel.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 DEMANDMODEL_H_
12 #define DEMANDMODEL_H_
13 
14 #include <string>
15 
16 class Junction;
17 
24 
26 {
27  public:
28  DemandModel();
29  DemandModel(double expon_);
30  virtual ~DemandModel() = 0;
31  static DemandModel* factory(const std::string model, double expon_);
32 
34  virtual double findDemand(Junction* junc, double h, double& dqdh);
35 
37  virtual bool isPressureDeficient(Junction* junc) { return false; }
38 
39  protected:
40  double expon;
41 };
42 
43 
44 //-----------------------------------------------------------------------------
47 //-----------------------------------------------------------------------------
48 
50 {
51  public:
53 };
54 
55 
56 //-----------------------------------------------------------------------------
59 //-----------------------------------------------------------------------------
60 
62 {
63  public:
65  bool isPressureDeficient(Junction* junc);
66  double findDemand(Junction* junc, double p, double& dqdh);
67 };
68 
69 
70 //-----------------------------------------------------------------------------
73 //-----------------------------------------------------------------------------
74 
76 {
77  public:
78  PowerDemandModel(double expon_);
79  double findDemand(Junction* junc, double p, double& dqdh);
80 };
81 
82 
83 //-----------------------------------------------------------------------------
86 //-----------------------------------------------------------------------------
87 
89 {
90  public:
91  LogisticDemandModel(double expon_);
92  double findDemand(Junction* junc, double p, double& dqdh);
93 
94  private:
95  double a, b; // logistic function coefficients
96  void setCoeffs(double pMin, double pFull);
97 };
98 
99 #endif
A demand model where demand is a logistic function of pressure.
Definition: demandmodel.h:88
virtual bool isPressureDeficient(Junction *junc)
Changes fixed grade status depending on pressure deficit.
Definition: demandmodel.h:37
A demand model where demands are fixed independent of pressure.
Definition: demandmodel.h:49
The interface for a pressure-dependent demand model.
Definition: demandmodel.h:25
virtual double findDemand(Junction *junc, double h, double &dqdh)
Finds demand flow and its derivative as a function of head.
Definition: demandmodel.cpp:44
A variable head Node with no storage volume.
Definition: junction.h:26
A demand model where demands are reduced based on available pressure.
Definition: demandmodel.h:61
A demand model where demand varies as a power function of pressure.
Definition: demandmodel.h:75