MsxSolverOptions#

module wntr.msx.options

class MsxSolverOptions[source]#

Bases: _OptionsBase

Solver options

Parameters:
  • timestep (int >= 1) – Water quality timestep (seconds), by default 60 (one minute).

  • area_units (str, optional) – Units of area to use in surface concentration forms, by default M2. Valid values are FT2, M2, or CM2.

  • rate_units (str, optional) – Time units to use in all rate reactions, by default MIN. Valid values are SEC, MIN, HR, or DAY.

  • solver (str, optional) – Solver to use, by default RK5. Options are RK5 (5th order Runge-Kutta method), ROS2 (2nd order Rosenbrock method), or EUL (Euler method).

  • coupling (str, optional) – Use coupling method for solution, by default NONE. Valid options are FULL or NONE.

  • atol (float, optional) – Absolute concentration tolerance, by default 0.01 (regardless of species concentration units).

  • rtol (float, optional) – Relative concentration tolerance, by default 0.001 (±0.1%).

  • compiler (str, optional) – Whether to use a compiler, by default NONE. Valid options are VC, GC, or NONE

  • segments (int, optional) – Maximum number of segments per pipe (MSX 2.0 or newer only), by default 5000.

  • peclet (int, optional) – Peclet threshold for applying dispersion (MSX 2.0 or newer only), by default 1000.

  • report (MsxReportOptions or dict) – Options on how to report out results.


__init__(timestep=360, area_units='M2', rate_units='MIN', solver='RK5', coupling='NONE', atol=0.0001, rtol=0.0001, compiler='NONE', segments=5000, peclet=1000, report=None)[source]#
classmethod factory(val)#

Create an options object based on passing in an instance of the object, a dict, or a tuple

to_dict()[source]#

Dictionary representation of the options

area_units: str#

Units used to express pipe wall surface area where, by default FT2. Valid values are FT2, M2, and CM2.

atol: float#

Absolute tolerance used by the solvers, by default 0.01 for all species regardless of concentration units. Can be overridden on a per-species basis.

compiler: str#

Compiler to use if the equations should be compiled by EPANET-MSX, by default NONE. Valid options are VC, GC and NONE.

coupling: str#

Whether coupling should occur during solving, by default NONE. Valid values are NONE and FULL.

peclet: int#

Threshold for applying dispersion, by default 1000.

rate_units: str#

Units in which all reaction rate terms are expressed, by default HR. Valid values are HR, MIN, SEC, and DAY.

report: MsxReportOptions#

Reporting output options.

rtol: float#

Relative tolerance used during solvers ROS2 and RK5, by default 0.001 for all species. Can be overridden on a per-species basis.

segments: int#

Number of segments per-pipe to use, by default 5000.

solver: str#

Solver to use, by default EUL. Valid values are EUL, RK5, and ROS2.

timestep: int#

Timestep, in seconds, by default 360