OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
280 stars 205 forks source link

Modulating float valve for tank inlets #726

Open lbutler opened 1 year ago

lbutler commented 1 year ago

In the UK it is very common for tanks to be controlled by a modulating float valve.

These valves will maintain a relatively constant level in storage tanks by admitting flow into the tank in direct proportion to the flow out of the tank. As the tank level changes, the float control proportionally opens or closes the main valve, keeping the liquid level nearly constant.

Commercial modelling software popular in the UK, such as InfoWorks WS Pro, includes the ability to model these valves but there currently isn’t a simple way to do this in EPANET.

An example of this type of valve can be found on the Cla-Val website

Below are graphs showing observed data from SCADA and calibrated model results. The float valve was set with a control depth of 2.175m with a regulating range of 0.4m with a 150mm valve. The opening/loss Coeff. curve can also be supplied if it is of interest.

image

image

image

While the almost flat tank level has minimal change on downstream pressures, the matching of upstream flows is important in UK networks as they generally run with smaller diameter pipes with higher headloss than what is seen in North America.

The use of the EPANET engine is very low in the UK and the inclusion of modulating float valves could help users switch between commercial modelling packages and EPANET.

The two approaches that may work in getting modulating float valves into EPANET are:

Any other additional thoughts or potential ways to solve this issue would be appreciated!

lbutler commented 1 year ago

A very quick demo showing how this can be calculated using the EPANET toolkit can be found here: https://modelcreate.github.io/epanet-js-float-valve-example/

With the source code in Typescript here: https://github.com/modelcreate/epanet-js-float-valve-example/tree/master/src/utils

LRossman commented 1 year ago

A simple way to add a modulating float valve to EPANET is to enhance the existing Flow Control Valve (FCV) element. An additional optional property, EN_FCV_LINK, is the index of the link whose current flow rate establishes the current setting of the FCV. A new function, resetfcvs() is called from the existing controls() function in hydraul.c at each time step to reset each FCV's flow setting if it has been assigned an EN_FCV_LINK.

I have implemented this idea and tested it on a slightly modified version of @lbutler 's example as shown below. The modulated FCV is used to maintain a constant water level in a tank with both inflow and outflow.

FloatValveNetwork

The results from running the model produce the required behavior as seen by the following plot:

FloatValveResults

lbutler commented 1 year ago

I'm going to extract 2-3 example models that include the upstream monitored pressure points and then we can compare any approach with calibrated results. This way it also would be clear the effect that the inlet flow can have on the upstream network in UK networks and we can see tanks where the dip in tank level is more pronounced.

@LRossman in your approach above, do you think we could apply the same logic through more advanced control rules as described in #725?

While I believe named variables and expressions in SWMM are limited to checking conditions (though I may be wrong on this) could we also use them in the assigned setting?

For example:

VARIABLE OutflowTarget = Pipe TANK_OUTLET FLOW

RULE 1
IF TANK_OUTLET < 5
THEN VALVE Flow_Control SETTING = OutflowTarget

As described in my section option, we could use the same logic to set a Positional Control Valve (PCV) to act as a continuously regulating floating valve

VARIABLE T1_DEPTH = Tank T1 PRESSURE
EXPRESSION FLV_PERCENT = ( 4 - T1_DEPTH ) / 2 ; (controlDepth - currentLevel) / range

RULE 1
IF TANK_OUTLET < 2
THEN VALVE T1_Inlet_Valve SETTING = FLV_PERCENT

Alternatively, it becomes a native valve type, most likely a derivative of the PCV which paraments to set the control depth, range and valve curve.

LRossman commented 1 year ago

@lbutler I also thought that the extended rule vocabulary could handle a modulating float valve while providing more versatility than the modified FCV approach. The downside is that it is more complicated to implement and there is the possibility that an unnecessary amount of time is spent recomputing network hydraulics when rules keep firing at each rule evaluation time step (whose default is 5 minutes). Such would be the case with your PCV example since T1_depth keeps changing at every rule time step.

Also I'm a little confused about whether the goal is to maintain a target tank depth (as in the second example you gave) or maintain an inflow that equals the tank's outflow (as in your first example). Both of these have a lot in common with the variable speed pump control feature that adjusts a pump's speed setting to maintain a fixed pressure at some downstream node. Like the modulating float valve, this feature appears in some commercial software but not yet in EPANET. Please see issue #530 for how it could be implemented (without the use of rules). Something similar might be applicable to the modulating float valve.