set_valve_setting
Change a valve's pressure, flow, or loss coefficient in an EPANET network. Validates the edit against the engine before applying; invalidates stale simulation results.
Instructions
Change the setting of a valve (PRV/PSV/PBV pressure, FCV flow, TCV loss coefficient) in a loaded network. The edit is validated against the EPANET engine before it is applied: the link must exist and be a valve, the value must be within realistic bounds for the valve type and the model's units, and the edited model must re-parse with the requested setting. GPV valves are rejected (their setting is a headloss curve id). Previous simulation results for the network are invalidated (they describe the old model) — re-run run_simulation afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| linkId | Yes | Id of the valve to change (use get_links to list valve ids and their current settings). | |
| setting | Yes | New valve setting in the valve type's units: PRV/PSV/PBV a pressure (m or psi), FCV a flow (e.g. LPS), TCV a dimensionless loss coefficient. Never negative. GPV valves are not supported (their setting is a headloss curve id). | |
| networkId | Yes | The network id returned by load_network. |