You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
I make some changes in wntr objects eg. remove valves, add new valves, adding simple controls. Then, I export as .inp file and open the file in EPANET. From EPANET, I could see the valves attributes are changed. However, the added controls do not appear in EPANET 'Simple Controls Editor'. Can anyone please help?
Example
Remove original valve, add new valve with desired attributes
Thanks for posting this example. WNTR can create controls that are not recognized by EPANET (and therefore not saved to the EPANET inp file), but in this case the ControlAction should change the valve "setting" attribute (which is flow for a FCV) instead of "flow" (which is a simulation result). We should add checks for valid attributes in the control classes.
Summary
I make some changes in wntr objects eg. remove valves, add new valves, adding simple controls. Then, I export as .inp file and open the file in EPANET. From EPANET, I could see the valves attributes are changed. However, the added controls do not appear in EPANET 'Simple Controls Editor'. Can anyone please help?
Example
Remove original valve, add new valve with desired attributes
valve1 = 'V_1'
f_v1 = wn.get_link(valve1)
wn.remove_link(V_1)
wn.add_valve(valve1, 'J_2','J_3', diameter=0.5, valve_type='FCV', minor_loss=0.0, initial_setting=0.0, initial_status='Active')
f_v1 = wn.get_link(valve1)
Add controls (set flow at time '00:00')
act = controls.ControlAction(f_v1 , 'flow', 100)
cond = controls.SimTimeCondition(wn, '=', '00:00')
ctrl = controls.Control(cond, act, name='c1')
wn.add_control('newc1', ctrl)
print (ctrl)
output: IF SYSTEM TIME IS 00:00:00 THEN VALVE V_1 FLOW IS 100.0 PRIORITY 3
The text was updated successfully, but these errors were encountered: