Skip to main content

Parallel Transient Simulation in Water Networks

Project description


Logo

Parallel Transient Simulation in Water Networks
Explore the docs »

View Demo · Report Bug · Request Feature

DOI Downloads

Getting Started

To get a local copy up and running follow these simple steps. PTSNET can be downloaded via pip

Installation

We highly encourage using a conda environment for the installation, so that dependencies such as OpenMPI don't have to be manually installed.

  • Install conda

    # Linux
    https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
    
    # Windows
    https://conda.io/projects/conda/en/latest/user-guide/install/windows.html
    
  • Install the conda environment with all the necessary dependencies, by opening a terminal and running the following commands

    1. Execute conda activate to start conda
    2. Execute conda config --add channels conda-forge to add the conda-forge channel
    3. Download the requirements.txt
    4. In the command line cd to the location where the requirements.txt file was downloaded
    5. Execute conda create -n ptsnet to create a new conda environment
    6. Activate the environment with conda activate ptsnet
    7. Install the requirements using conda install --file requirements.txt
    8. Install h5py
      • For Linux/Mac: conda install "h5py>=2.9=mpi*"
      • For Windows: conda install h5py
    9. Install PTSNET: pip install ptsnet

Usage

Create a file called named simulation.py with the following contents:

import matplotlib.pyplot as plt
from ptsnet.simulation.sim import PTSNETSimulation
from ptsnet.utils.io import get_example_path

sim = PTSNETSimulation(
  workspace_name = 'TNET3_VALVE',
  inpfile = get_example_path('TNET3'))
sim.define_valve_operation('VALVE-179', initial_setting=1, final_setting=0, start_time=1, end_time=2)
sim.run(); print(sim)

plt.plot(sim['time'], sim['node'].head['JUNCTION-73'])
plt.show()

After creating the file, you can execute the code from the command line.

To execute the parallel version of PTSNET it is necessary to have Linux/Mac.

If you have Linux/Mac execute the following command on the terminal:

mpiexec -n 4 python simulation.py

The number of processors is defined by the parameter -n in the command, in this case 4.

If you have Windows you can still run the simulation as shown below, but you will not have access to PTSNET's parallel capabilities:

python simulation.py

For more examples, please refer to the jupyter notebooks.

Cite Us

If PTSNET has been useful for your research and you are ready to publish your paper, please cite the paper below:

Distributed and Vectorized Method of Characteristics for Fast Transient Simulations in Water Distribution Systems

@article{riano2022distributed,
  title={Distributed and vectorized method of characteristics for fast transient simulations in water distribution systems},
  author={Ria{\~n}o-Brice{\~n}o, Gerardo and Sela, Lina and Hodges, Ben R},
  journal={Computer-Aided Civil and Infrastructure Engineering},
  year={2022},
  publisher={Wiley Online Library}
}

License

Distributed under the Unlicense License. See LICENSE for more information.

Contact

Gerardo Riano - griano@utexas.edu

Project Link: https://github.com/gandresr/PTSNET

Acknowledgements

This publication was developed under Cooperative Agreement No. 83595001 awarded by the U.S. Environmental Protection Agency to The University of Texas at Austin. It has not been formally reviewed by EPA. The views expressed in this document are solely those of the authors, and do not necessarily reflect those of the Agency. EPA does not endorse any products or commercial services mentioned in this publication. The authors acknowledge the Texas Advanced Computing Center (TACC) at The University of Texas at Austin for providing HPC resources that have contributed to the research results reported within this paper. URL: http://www.tacc.utexas.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ptsnet-0.1.7.tar.gz (573.0 kB view details)

Uploaded Source

Built Distribution

ptsnet-0.1.7-py3-none-any.whl (611.6 kB view details)

Uploaded Python 3

File details

Details for the file ptsnet-0.1.7.tar.gz.

File metadata

  • Download URL: ptsnet-0.1.7.tar.gz
  • Upload date:
  • Size: 573.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for ptsnet-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8c4886e9b878f0d7912047399b7a9622fbe37597917549b293b9ef7e49812c7a
MD5 6a62c93a4a15ec3233d61d54fc37a586
BLAKE2b-256 fa08974ee6e4a783b11e73485bb393f198c5effef90c1b1e9ac8f50e9443b183

See more details on using hashes here.

File details

Details for the file ptsnet-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ptsnet-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 611.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

File hashes

Hashes for ptsnet-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 66fcfc47e1fa05983752c4fe79fd02649b4475afb2243a99c87c780c0da70d11
MD5 c92df115f899ddc6b3bf57497a599457
BLAKE2b-256 eb063eae69881fca75368e6abbb9cb970c9dade8eb70f5b9f447d2f9b48b2fd9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page