Skip to content

Commit f7bc19a

Browse files
committed
Add the function getLinkVolumes / close #213
1 parent 8c1af57 commit f7bc19a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ The `EPANET-Matlab Toolkit` is based/inspired on the [EPANET-Matlab Toolkit](htt
212212
|getLinkVelocity|Current computed flow velocity (read only)|
213213
|getLinkVertices|Retrieves the coordinate's of a vertex point assigned to a link.|
214214
|getLinkVerticesCount|Retrieves the number of internal vertex points assigned to a link|
215+
|getLinkVolumes|Get link volumes|
215216
|getLinkWallReactionCoeff|Pipe wall chemical reaction coefficient|
216217
|getNodeActualDemand|Retrieves the computed value of all actual demands|
217218
|getNodeActualDemandSensingNodes|Retrieves the computed demand values at some sensing nodes|

epanet_matlab_toolkit/epanet.m

+12
Original file line numberDiff line numberDiff line change
@@ -8613,6 +8613,18 @@ function setCurveValue(obj, index, curvePnt, value)
86138613
end
86148614
end
86158615
end
8616+
function V = getLinkVolumes(obj)
8617+
% Get link volumes
8618+
% Link volume = pi * (diameter/2).^2 * length
8619+
L = obg.getLinkLength;
8620+
D = obj.getLinkDiameter;
8621+
if obj.Units_SI_Metric
8622+
unt = 100;
8623+
else
8624+
unt = 328.08399;
8625+
end
8626+
V = pi*((D/unt).^2/4).*L;
8627+
end
86168628
function valueIndex = addCurve(obj, varargin)
86178629
% Adds a new curve appended to the end of the existing curves. (EPANET Version 2.1)
86188630
% Returns the new curve's index.

0 commit comments

Comments
 (0)