HydDown
HydDown: A Python package for calculation of hydrogen (or other gas) pressure vessel filling and discharge - Published in JOSS (2021)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Scientific Fields
Repository
Hydrogen (or other pure gas phase species) depressurization calculations
Basic Info
Statistics
- Stars: 35
- Watchers: 2
- Forks: 6
- Open Issues: 4
- Releases: 10
Topics
Metadata Files
README.md
HydDown
Hydrogen (or other pure gas phase species as well as mixtures) depressurization/pressurisation calculations incorporating heat transfer effetcs. It also models vessel response (pressure/temperature) to external heat loads e.g. external fire (pool/jet) incorporating the Stefan-Boltzmann approach.
This code is published under an MIT license.
Install as simple as:
pip install hyddown
In the case of an error in installing relation to python2, for example:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement hyddown (from versions: none)
ERROR: No matching distribution found for hyddown
please instead install with
python3 -m pip install hyddown
or try
pip3 install hyddown
Run the code as simple as:
python main.py input.yml
where main.py is the main script and input.yml is the input file in Yaml syntax.
Consult the manual for a more rigorous explanation of the software, the implemented methods, and its usage. Further, the manual also contains a few validation studies.
Citing HydDown
Please cite the following reference:
Andreasen, A., (2021). HydDown: A Python package for calculation of hydrogen (or other gas) pressure vessel filling and discharge. Journal of Open Source Software, 6(66), 3695, https://doi.org/10.21105/joss.03695
@article{Andreasen2021,
doi = {10.21105/joss.03695},
url = {https://doi.org/10.21105/joss.03695},
year = {2021},
publisher = {The Open Journal},
volume = {6},
number = {66},
pages = {3695},
author = {Anders Andreasen},
title = {HydDown: A Python package for calculation of hydrogen (or other gas) pressure vessel filling and discharge},
journal = {Journal of Open Source Software}
}
Demonstration
The easiest way to explore the capability of HydDown is the streamlit app. This version allows calculation of:
- filling of vessel with gas (pressurisation)
- discharge of gas (depressurisation)
- various gases (H2, N2, CH4, He, Air)
- variable size pressure cylinder/vessel
- heat transfer between gas and vessel wall can be turned on/off
Background
This is a small spare time project for calculation of vessel filling/depressurisation behaviour. This is mainly to demonstrate, that although perceived as a very tedious/difficult/complex problem to solve, actually a fairly limited amount of code is necessary if you have a good thermodynamic backend.
A few choices is made to keep things simple to begin with:
- Coolprop is used as thermodynamic backend
- Mainly pure substances are considered (mixtures can be handled - but calculations can be slow)
- Gas phase only
- No temperture stratification in the gas phase
- Default option of no temperture gradient through vessel wall (now extended with a 1-D transient heat conduction model to allow modelling of vessels with low thermal conductivety e.g. type III/IV vessels).
The code is as simple as possible. The above choices makes the problem a lot more simple to solve, First of all the pure substance Helmholtz energy based equation of state (HEOS) in coolprop offers a lot of convenience in terms of the property pairs/state variables that can be set independently. Using only a single gas phase species also means that component balances is redundant and 2 or 3-phase flash calculations are not required. That being said the principle used for a single component is more or less the same, even for multicomponent mixtures with potentially more than one phase.
Description
The following methods are implemented:
- Isothermal i.e. constant temperature of the fluid during depressurisation (for a very slow process with a large heat reservoir)
- Isenthalpic/Adiabatic (no heat transfer with surroundings, no work performed by the expanding fluid)
- Isentropic (no heat transfer with surroundings, PV work performed by the expanding fluid)
- Constant internal energy
- Energy balance. This is the most general case and includes the ability to transfer heat with surroundings
Various mass flow equations are enabled:
- Orifice
- Control valve
- Relief valve (discharge only)
- Constant mass flow
A simple (naive) explicit Euler scheme is implemented to integrate the mass balance over time, with the mass rate being calculated from an orifice/valve equation. For each step, the mass relief/ left in the vessel is known. Since the volume is fixed the mass density is directly given. For the simple methods (isentropic,isenthalpic,isenergetic etc), Coolprop allows specifying density and either H,S or U directly - this is very handy and normally only TP, PH, TS property pairs are implemented, and you would need to code a second loop to make it into am UV, VH or SV calculation. Coolprop is very convenient for this, however for a cubic EOS and for multicomponent Helmholtz energy EOS coolprop only supports a subset of state variables to be specified directly (T,P,quality). For this reason single component HEOS is the main target of this small project. In case the "Energy balance" method is applied, the heat added from convection and work is accounted for.
Basic usage
The Yaml input file is edited to reflect the system of interest. For isothermal/isenthalpic/isentropic/isenergetic calculations the minimal input required are:
- Initial conditions (pressure, temperature)
- vessel dimensions (ID/length)
- valve parameters (Cd, diameter, backpressure)
- Calculation setup (time step, end time)
- Type of gas
If heat transfer is to be considered the calculation type "energybalance" is required. A few options are possible:
- Fixed U (U-value required, and ambient temperature)
- Fixed Q (Q to be applied to the fluid is requried)
- Specified h, the external heat transfer coefficient is provided and either the internal is provided or calculated from assumption of natural convection from a vertical cylinder at high Gr number. Ambient temperature is required.
- Detailed
- Fire with heat load calculated from the Stefan-Boltzmann equation
Owner
- Name: Anders Andreasen
- Login: andr1976
- Kind: user
- Location: Esbjerg, Denmark
- Company: Ramboll Energy
- Repositories: 3
- Profile: https://github.com/andr1976
Chemical Engineer, working within process and energy technology
JOSS Publication
HydDown: A Python package for calculation of hydrogen (or other gas) pressure vessel filling and discharge
Tags
Gas storage Depressurisation Blow-down Pressure cylinder Energy storage HydrogenGitHub Events
Total
- Create event: 6
- Release event: 2
- Issues event: 16
- Watch event: 6
- Delete event: 2
- Issue comment event: 5
- Push event: 109
- Pull request event: 14
- Fork event: 1
Last Year
- Create event: 6
- Release event: 2
- Issues event: 16
- Watch event: 6
- Delete event: 2
- Issue comment event: 5
- Push event: 109
- Pull request event: 14
- Fork event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Anders Andreasen | 5****6 | 538 |
| github-actions | g****s@g****m | 58 |
| Mark E. Fuller | m****r@g****e | 4 |
| GitHub Action test | t****t@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 17
- Total pull requests: 84
- Average time to close issues: 4 months
- Average time to close pull requests: about 4 hours
- Total issue authors: 5
- Total pull request authors: 2
- Average comments per issue: 1.65
- Average comments per pull request: 0.43
- Merged pull requests: 79
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 9
- Pull requests: 11
- Average time to close issues: 22 days
- Average time to close pull requests: 8 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.44
- Average comments per pull request: 0.18
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- andr1976 (8)
- bocklund (3)
- mefuller (3)
- defencedog (1)
- rei148 (1)
Pull Request Authors
- andr1976 (84)
- mefuller (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 45 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 8
- Total maintainers: 1
pypi.org: hyddown
Hydrogen (or other pure gas phase species) pressure vessel filling and discharge calculations
- Homepage: https://github.com/andr1976/HydDown/
- Documentation: https://hyddown.readthedocs.io/
- License: MIT License
-
Latest release: 0.23.0
published 12 months ago
Rankings
Maintainers (1)
Dependencies
- Cerberus >=1.3.3
- CoolProp >=6.4.1
- PyYAML >=5.4.1
- matplotlib >=3.3.3
- numpy >=1.19.5
- pandas >=1.1.4
- pytest >=6.2.3
- scipy >=1.6.0
- streamlit >=0.89
- tqdm *
- Cerberus >=1.3.3
- CoolProp >=6.4.1
- PyYAML >=5.4.1
- matplotlib >=3.3.3
- numpy >=1.19.5
- pandas >=1.1.4
- pytest >=6.2.3
- scipy >=1.6.0
- streamlit >=0.89
- tqdm *
- actions/checkout v2 composite
- actions/upload-artifact master composite
- ad-m/github-push-action master composite
- docker://rstropek/pandoc-latex * composite
- actions/checkout v2 composite
- github/codeql-action/analyze v1 composite
- github/codeql-action/autobuild v1 composite
- github/codeql-action/init v1 composite
- actions/checkout v2 composite
- actions/upload-artifact v1 composite
- openjournals/openjournals-draft-action master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- codecov/codecov-action v1 composite
