Transport configuration and availability#

solver.transport exposes the configured ARD transport options. Dispersion coefficients use project length squared per second (ft²/s or m²/s), and target_dx uses project length. Set both mode and coefficient for a uniform coefficient:

from openswmm.engine import Solver, TransportDispersionMode

solver = Solver("model.inp")
try:
    solver.open()
    solver.options["QUALITY_SOLVER"] = "EULERIAN_ARD"
    component = "org.hydrocouple.openswmm.transport.ard"
    if component not in solver.process_components:
        solver.process_components.register(component, "model.ard")
    solver.transport.dispersion_mode = TransportDispersionMode.VALUE
    solver.transport.dispersion_value = 0.5
    solver.transport.target_dx = 10.0
    solver.initialize()
    solver.start()
    for elapsed in solver.steps():
        pass
    solver.end()
finally:
    solver.close()
    solver.destroy()

For persistence, the model must register org.hydrocouple.openswmm.transport.ard with a configuration-file path. solver.write() then renders the live configuration to that component file. Setting values alone does not add a process-component registration.

Configure transport before initialization. Setters mark the configuration as present; this does not establish that a particular backend carries every species in every domain. Inspect solver.transport_matrix after opening or editing options. It maps TransportDomain to TransportClass to immutable TransportCell(state, count, reason) records. Disabled or unavailable cells explain why the process is absent.

transport.boundaries, transport.sources and transport.conduit_dispersion are tuples of snapshot records. Boundary/source rows are read-only in this native API revision; author them in the component file before opening. For a VALUE row, a boundary value is concentration in species units, and a source value is a mass rate in species mass units per second. For a TIMESERIES row, use the timeseries name instead of the numeric value.

solver.thread_info reports process-wide CPU and OpenMP limits. solver.effective_threads(requested=0) reports the team sizes the engine would select for the current model; zero requests automatic selection. This query does not start a run or change the THREADS option.

class ConduitDispersion(link_index, value)#

Bases: NamedTuple

Create new instance of ConduitDispersion(link_index, value)

Parameters:

Alias for field number 0

value: float#

Alias for field number 1

class EffectiveThreads(global_threads, dynamic_wave, surface2d)#

Bases: NamedTuple

Create new instance of EffectiveThreads(global_threads, dynamic_wave, surface2d)

Parameters:
  • global_threads (int)

  • dynamic_wave (int)

  • surface2d (int)

dynamic_wave: int#

Alias for field number 1

global_threads: int#

Alias for field number 0

surface2d: int#

Alias for field number 2

class ThreadInfo(logical_cpus, omp_max_threads, omp_available, perf_cores, kokkos_omp_threads)#

Bases: NamedTuple

Create new instance of ThreadInfo(logical_cpus, omp_max_threads, omp_available, perf_cores, kokkos_omp_threads)

Parameters:
  • logical_cpus (int)

  • omp_max_threads (int)

  • omp_available (bool)

  • perf_cores (int)

  • kokkos_omp_threads (int)

kokkos_omp_threads: int#

Alias for field number 4

logical_cpus: int#

Alias for field number 0

omp_available: bool#

Alias for field number 2

omp_max_threads: int#

Alias for field number 1

perf_cores: int#

Alias for field number 3

class Transport(owner)#

Bases: object

Parameters:

owner (Solver | ModelBuilder)

property boundaries: tuple[TransportRow, ...]#
property conduit_dispersion: tuple[ConduitDispersion, ...]#
property configured: bool#
property sources: tuple[TransportRow, ...]#
dispersion_mode: TransportDispersionMode#
dispersion_value: float#
target_dx: float#
class TransportCell(state: 'TransportState', count: 'int', reason: 'str')#

Bases: object

Parameters:
  • state (TransportState)

  • count (int)

  • reason (str)

state: TransportState#
count: int#
reason: str#
class TransportRow(element, species, is_timeseries, value, timeseries)#

Bases: NamedTuple

Create new instance of TransportRow(element, species, is_timeseries, value, timeseries)

Parameters:
element: str#

Alias for field number 0

is_timeseries: bool#

Alias for field number 2

species: str#

Alias for field number 1

timeseries: str#

Alias for field number 4

value: float#

Alias for field number 3

effective_threads(owner, requested=Ellipsis)#
Parameters:
Return type:

EffectiveThreads

thread_info()#
Return type:

ThreadInfo

transport_class_name(species_class)#
Parameters:

species_class (TransportClass)

Return type:

str

transport_domain_name(domain)#
Parameters:

domain (TransportDomain)

Return type:

str

transport_matrix(owner)#
Parameters:

owner (Solver)

Return type:

dict[TransportDomain, dict[TransportClass, TransportCell]]