write_inpfile#

module wntr.network.io

write_inpfile(wn, filename, units=None, version=2.2, force_coordinates=False)[source]#

Write the WaterNetworkModel to an EPANET INP file

Note

By default, WNTR now uses EPANET version 2.2 for the EPANET simulator engine. Thus, The WaterNetworkModel will also write an EPANET 2.2 formatted INP file by default as well. Because the PDD analysis options will break EPANET 2.0, the version option will allow the user to force EPANET 2.0 compatibility at the expense of pressured-dependent analysis options being turned off.

Parameters:
  • wn (wntr WaterNetworkModel) – Water network model

  • filename (string) – Name of the inp file.

  • units (str, int or FlowUnits) – Name of the units being written to the inp file.

  • version (float, {2.0, 2.2}) – Optionally specify forcing EPANET 2.0 compatibility.

  • force_coordinates (bool) – This only applies if self.options.graphics.map_filename is not None, and will force the COORDINATES section to be written even if a MAP file is provided. False by default, but coordinates are written by default since the MAP file is None by default.