Python interface for retrieving results of Pendulo water hammer simulation
Project description
PenWin32 (Pendulo) python API calling interface
What is it?
A python package enabling users to call a minimal set of PenWin32.dll API functions and subroutines within python scripts. For latest python version e.g. 3.10. 32 bits only.
Installation
Windows only
pip install pendulo
Requirements (32 bits)
python 3.10
numpy 1.21.3 (python 3.10)
Pendulo kernel library (penwin32.dll) 2022+
valid Pendulo_size and Pendulo_version license
This tool expects Picwin32.dll to be in the PATH or in one of the following folders:
%localappdata%/Programs/Safege/Pendulo or %localappdata%/Programs/Suez/Pendulo or [ C: or D: ] / 'Program Files (x86)/Safege/Pendulo_' + ['' or '_fr' or '_uk' or '_esp' or '_eng'] + ['' or '_ck']
With custom installations, PENDULO_DIR environment variable can be set to define the path.
Content
- The package provides:
pen_vers = init(debug=0) function
close() function
vdat, vval = ts(id_elem, typelt, attr) retrieves the result TS for element ‘id_elem’ of type ‘typelt’ and attribute ‘attr’.
- Example of ‘typelt’ and ‘attr’:
‘LINK’ or ‘ARC’: ‘Q’
‘NODE’ or ‘NOEUD’: ‘P’, ‘CH’ or ‘HH’
‘TANK’ or ‘RESERVOIR’: ‘NC’ or ‘NV’, ‘VO’
‘PUMP’ or ‘POMPE’: ‘PC’, ‘VR’, ‘Q’
‘VANNE’ or ‘ROBINET’ or ‘REGULATEUR’: ‘DO’, ‘PC’, ‘Q’
‘ANB’: ‘Q’, ‘VO’, ‘NC’ or ‘NV’
Example
# -*- coding: utf-8 -*- import os.path as OP import pendulo from ganessa.plot import pageplot from ganessa.util import winstr folder = OP.dirname(__file__) # init pendulo pendulo.init() model = OP.join(folder, 'VIROFL_1.PEN') print('===\nChargement de ', model) istat = pendulo.loadmodel(winstr(model)) if not istat: print(' * Erreur au chargement *') results = [] for node in ['PEN1', '36N646', '36N495', '36N488', '36N463', '36N35']: t, v = pendulo.ts(winstr(node), typelt='NODE', attr='CH') if len(t) and len(v): results.append((node, t, v)) fname = OP.join(folder, 'Simulation_1.png') pageplot(results, 'Simulation #1 - Charge aux noeuds', 2, 3, fname, inter=False, orient='h') pendulo.close()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pendulo-0.9.5-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4dbb4e590bbd6b2d475a1c446e2e4d33401ce8798b3049e8d3cc1f929a09077 |
|
MD5 | 9ad60153db8b9de66b17677e01934c9b |
|
BLAKE2b-256 | 15314852f04b74e600f9fed5e08c5cac38644cbf3675789d28214cc346ca69cc |
Hashes for pendulo-0.9.5-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea6b05009aed8b3e58b9be779e78483d1a189ae41e7fa441ba6ed298ca6d2ef1 |
|
MD5 | 64bf768d3b1b3b48c54c084988e3ef4f |
|
BLAKE2b-256 | c143e7484053e9e9dc3391cb250fd55ab54e9b81ec7adc8f4fe35228d5375cdf |