Package: ptsnet
Parallel Transient Simulation in Water NetworksExplore the docs »View Demo·Report Bug·Request FeatureGetting StartedTo get a local copy up and running follow these simple steps. PTSNET can be downloaded via pipInstallationWe highly encourage using a conda environment for the installation, so that dependencies such as OpenMPI don't have to be manually installed.Install conda# Linuxhttps://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html# Windowshttps://conda.io/projects/conda/en/latest/user-guide/install/windows.htmlInstall the conda environment with all the necessary dependencies, by opening a terminal and running the following commandsExecuteconda activateto start condaExecuteconda config --add channels conda-forgeto add theconda-forgechannelDownload therequirements.txtIn the command linecdto the location where the requirements.txt file was downloadedExecuteconda create -n ptsnetto create a new conda environmentActivate the environment withconda activate ptsnetInstall the requirements usingconda install --file requirements.txtInstall h5pyForLinux/Mac:conda install "h5py>=2.9=mpi*"ForWindows:conda install h5pyInstall PTSNET:pip install ptsnetUsageCreate a file called namedsimulation.pywith the following contents:importmatplotlib.pyplotaspltfromptsnet.simulation.simimportPTSNETSimulationfromptsnet.utils.ioimportget_example_pathsim=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 haveLinux/Mac.If you haveLinux/Macexecute the following command on the terminal:mpiexec-n4pythonsimulation.pyThe number of processors is defined by the parameter-nin the command, in this case 4.If you haveWindowsyou can still run the simulation as shown below, but you will not have access to PTSNET's parallel capabilities:pythonsimulation.pyFor more examples, please refer to thejupyter notebooks.Cite UsIf 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}
}LicenseDistributed under the Unlicense License. SeeLICENSEfor more information.ContactGerardo Riano -griano@utexas.eduProject Link:https://github.com/gandresr/PTSNETAcknowledgementsThis 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