add_tank
Add a storage tank with a connector pipe to an existing junction or reservoir to boost pressure, then validate the edited EPANET model for hydraulic solvability and data integrity.
Instructions
Add a storage tank at a strategic location: a new tank node plus a connector pipe attaching it to an existing node — a junction (e.g. a low-pressure junction that needs pressure support) or, optionally, a reservoir. The edit is validated against the EPANET engine before it is applied — unique ids, realistic geometry, the edited model must re-parse with the tank and pipe present, node/link counts must increase by exactly one each, and the edited model must still solve hydraulically if the base model did. Previous simulation results are invalidated; re-run run_simulation to see the effect.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pipeId | Yes | New unique pipe id connecting the junction to the tank (1-31 characters, no spaces and none of: + - . ;). | |
| tankId | Yes | New unique tank id (1-31 characters, no spaces and none of: + - . ;). | |
| diameter | Yes | Tank diameter (model's length units). | |
| maxLevel | Yes | Maximum water level above the tank bottom (model's units); must exceed minLevel. | |
| minLevel | Yes | Minimum water level above the tank bottom (model's units). | |
| elevation | Yes | Tank bottom elevation in the model's units (m for SI, ft for US). | |
| minVolume | No | Minimum volume; defaults to 0. | |
| networkId | Yes | The network id returned by load_network. | |
| junctionId | No | Id of an existing junction to attach the tank to (use get_nodes to list junction ids; a low-pressure junction is a good candidate). Provide exactly one of junctionId or reservoirId. | |
| pipeLength | Yes | Length of the connector pipe (model's length units). | |
| reservoirId | No | Id of an existing reservoir to attach the tank to instead of a junction (use get_nodes to list reservoir ids). Provide exactly one of junctionId or reservoirId. | |
| initialLevel | Yes | Initial water level above the tank bottom (model's units). | |
| pipeDiameter | Yes | Diameter of the connector pipe (mm for SI models, inches for US-unit models). | |
| pipeRoughness | No | Roughness of the connector pipe (default 100 for H-W/C-M models, 0.25 for D-W models). |