tankoh2 2.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tankoh2-2.7.1/LICENSE.md +13 -0
- tankoh2-2.7.1/LICENSES/MIT.txt +21 -0
- tankoh2-2.7.1/PKG-INFO +222 -0
- tankoh2-2.7.1/README.md +191 -0
- tankoh2-2.7.1/pyproject.toml +86 -0
- tankoh2-2.7.1/src/tankoh2/__about__.py +36 -0
- tankoh2-2.7.1/src/tankoh2/__init__.py +35 -0
- tankoh2-2.7.1/src/tankoh2/__main__.py +69 -0
- tankoh2-2.7.1/src/tankoh2/abq_cae/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/abq_cae/continueVesselCAE.py +1955 -0
- tankoh2-2.7.1/src/tankoh2/abq_cae/control_continueVesselCAE.py +238 -0
- tankoh2-2.7.1/src/tankoh2/arguments.py +696 -0
- tankoh2-2.7.1/src/tankoh2/control/__init__.py +81 -0
- tankoh2-2.7.1/src/tankoh2/control/control_cl.py +483 -0
- tankoh2-2.7.1/src/tankoh2/control/control_doe.py +375 -0
- tankoh2-2.7.1/src/tankoh2/control/control_metal.py +171 -0
- tankoh2-2.7.1/src/tankoh2/control/control_winding.py +405 -0
- tankoh2-2.7.1/src/tankoh2/control/genericcontrol.py +431 -0
- tankoh2-2.7.1/src/tankoh2/design/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/design/designutils.py +110 -0
- tankoh2-2.7.1/src/tankoh2/design/existingdesigns.py +895 -0
- tankoh2-2.7.1/src/tankoh2/design/loads.py +50 -0
- tankoh2-2.7.1/src/tankoh2/design/metal/__init__.py +5 -0
- tankoh2-2.7.1/src/tankoh2/design/metal/material.py +71 -0
- tankoh2-2.7.1/src/tankoh2/design/metal/mechanics.py +139 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/__init__.py +5 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/contour.py +325 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/designopt.py +1057 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/material.py +138 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/optimize.py +433 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/solver.py +487 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/vessel_cl.py +377 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/winding.py +249 -0
- tankoh2-2.7.1/src/tankoh2/design/winding/windingutils.py +411 -0
- tankoh2-2.7.1/src/tankoh2/geometry/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/geometry/dome.py +1562 -0
- tankoh2-2.7.1/src/tankoh2/geometry/geoutils.py +89 -0
- tankoh2-2.7.1/src/tankoh2/geometry/liner.py +102 -0
- tankoh2-2.7.1/src/tankoh2/masses/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/masses/massdata.py +23 -0
- tankoh2-2.7.1/src/tankoh2/masses/massestimation.py +211 -0
- tankoh2-2.7.1/src/tankoh2/mechanics/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/mechanics/fatigue.py +571 -0
- tankoh2-2.7.1/src/tankoh2/mechanics/fatiguefitting.py +371 -0
- tankoh2-2.7.1/src/tankoh2/mechanics/material.py +89 -0
- tankoh2-2.7.1/src/tankoh2/sensitivityAnalysis/__init__.py +0 -0
- tankoh2-2.7.1/src/tankoh2/sensitivityAnalysis/distributions.py +60 -0
- tankoh2-2.7.1/src/tankoh2/sensitivityAnalysis/parameterSets.py +171 -0
- tankoh2-2.7.1/src/tankoh2/sensitivityAnalysis/parameters.py +263 -0
- tankoh2-2.7.1/src/tankoh2/sensitivityAnalysis/sensitivityanalysis.py +308 -0
- tankoh2-2.7.1/src/tankoh2/service/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/service/cpacstank.py +241 -0
- tankoh2-2.7.1/src/tankoh2/service/exception.py +22 -0
- tankoh2-2.7.1/src/tankoh2/service/physicalprops.py +33 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/__init__.py +3 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/doeplot.py +134 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/generic.py +141 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/muwind.py +248 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/tankcycles.py +10991 -0
- tankoh2-2.7.1/src/tankoh2/service/plot/vphplots.py +269 -0
- tankoh2-2.7.1/src/tankoh2/service/utilities.py +393 -0
- tankoh2-2.7.1/src/tankoh2/settings.py +199 -0
tankoh2-2.7.1/LICENSE.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
SPDX-FileCopyrightText: 2020 German Aerospace Center (DLR)
|
|
3
|
+
SPDX-License-Identifier: MIT
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## License
|
|
8
|
+
|
|
9
|
+
Copyright © 2020 German Aerospace Center (DLR)
|
|
10
|
+
|
|
11
|
+
This work is licensed under the [MIT](LICENSES/MIT.txt) license.
|
|
12
|
+
|
|
13
|
+
> **Hint:** We provided the copyright and license information in accordance to the [REUSE Specification 3.0](https://reuse.software/spec/).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 sfreund-DLR
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tankoh2-2.7.1/PKG-INFO
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: tankoh2
|
|
3
|
+
Version: 2.7.1
|
|
4
|
+
Summary: Design and optimization of H2 tanks for high pressure applications and cryogenic hydrogen storage
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: lh2 tank,winding,hydrogen,storage
|
|
7
|
+
Author: Sebastian Freund
|
|
8
|
+
Author-email: sebastian.freund@dlr.de>
|
|
9
|
+
Requires-Python: >=3.9,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Dist: CoolProp
|
|
18
|
+
Requires-Dist: defusedxml
|
|
19
|
+
Requires-Dist: matplotlib
|
|
20
|
+
Requires-Dist: numpy (<2)
|
|
21
|
+
Requires-Dist: openturns
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: ruamel.yaml
|
|
24
|
+
Requires-Dist: scipy
|
|
25
|
+
Project-URL: Changelog, https://gitlab.dlr.de/sy-stm/software/tankoh2/-/blob/master/changelog.md
|
|
26
|
+
Project-URL: Documentation, https://sy-stm.pages.gitlab.dlr.de/software/tankoh2/
|
|
27
|
+
Project-URL: Homepage, https://gitlab.dlr.de/sy-stm/software//tankoh2
|
|
28
|
+
Project-URL: Repository, https://gitlab.com/DLR-SY/tank/tankoh2
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# tankoh2
|
|
32
|
+
|
|
33
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
|
|
34
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
|
|
35
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/releases)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Design and optimization of H2 tanks.
|
|
39
|
+
|
|
40
|
+
For metal structures, tankoh2 is a standalone pre-design tool.
|
|
41
|
+
For CFRP structures, a detailed winding optimization is performed.
|
|
42
|
+
The winding simulation is carried out by [µChain](https://www.mefex.de/software/)
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- Material/layup read/write
|
|
47
|
+
- Define requirements for cryogenic or high-pressure hydrogen storage
|
|
48
|
+
- Create dome (spherical, isotensoid, torisspherical or conical) and liner from cylindrical length and radius or using a dome contour
|
|
49
|
+
- Setup of a vessel model
|
|
50
|
+
- Optimization of each layer with respect to minimizing puck fibre failure, bending loads, and maintaining a good contour
|
|
51
|
+
- Create and run DOE with support of DLR tools (delismm, fa_pyutils)
|
|
52
|
+
- Routines for the improvement of the FEM model generatred by Abaqus CAE
|
|
53
|
+
- Planned features:
|
|
54
|
+
- Global optimization of
|
|
55
|
+
- All angles of helical layers
|
|
56
|
+
- All hoop layer shifts
|
|
57
|
+
- Target: mass minimization
|
|
58
|
+
- Constraint: puck fibre failure
|
|
59
|
+
- Improved DOE: Liner and fitting adjustment w.r.t. vessel geometry
|
|
60
|
+
- Abaqus: introduction of the abaqus solver at the end of the optimization process
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
Here is the full [Documentation](https://dlr-sy.gitlab.io/tank/tankoh2/)
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
### Installation for users
|
|
68
|
+
Coming soon: installation via pypi using `pip install tankoh2`
|
|
69
|
+
|
|
70
|
+
When tankoh2 is installed, please follow the steps in [Settings File](#settings-file).
|
|
71
|
+
|
|
72
|
+
### Installation from source
|
|
73
|
+
- Get tankoh2 from
|
|
74
|
+
> https://gitlab.com/DLR-SY/tank/tankoh2.git
|
|
75
|
+
- Install python 3.10 (On the Windows Installer, check the advanced option to add Python to your path and to install pip)
|
|
76
|
+
- Install poetry
|
|
77
|
+
> pip install poetry
|
|
78
|
+
- Install requirements for the project
|
|
79
|
+
> cd <path_to_tankoh2>
|
|
80
|
+
> poetry install
|
|
81
|
+
- When tankoh2 is installed, please follow the steps in [Settings File](#settings-file).
|
|
82
|
+
|
|
83
|
+
### For winding: Path to µChain
|
|
84
|
+
|
|
85
|
+
Add an environment variable named MYCROPYCHAINPATH
|
|
86
|
+
and set its value to the path of your [µChain](https://www.mefex.de/software/) installation.
|
|
87
|
+
|
|
88
|
+
Old Method, will be deprecated soon: Alternatively, in the folder `/src/tankoh2/`, create a file `settings.json`
|
|
89
|
+
and include the path here.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
{
|
|
93
|
+
"mycropychainPath": "<path_to_muChain>"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Activate the environment
|
|
98
|
+
|
|
99
|
+
This needs to be done whenever you want to use tankoh2.
|
|
100
|
+
First, navigate into tankoh2's source directory.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
cd <path_to_tankoh2>/src
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Then, before running tankoh2, you need to activate the python environment created by poetry during the installation. Alternatively replace 'python' in the commands with 'poetry run'.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
poetry shell
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Test the installation
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
python -m tankoh2 --help
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
You can perform a standalone test for metal tanks
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
python -m tankoh2 --materialName alu2219 --windingOrMetal metal --domeType circle
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Developers
|
|
125
|
+
- Follow the steps [Installation from source](#installation-from-source) above
|
|
126
|
+
- Install all dev dependencies and test dependencies listed in ``pyproject.toml``
|
|
127
|
+
|
|
128
|
+
#### Pre-Commit Hooks
|
|
129
|
+
|
|
130
|
+
Developers may also install the pre-commit hook.
|
|
131
|
+
|
|
132
|
+
**Precommit**
|
|
133
|
+
1. If not installed: install the pre-commit
|
|
134
|
+
> pip install pre-commit
|
|
135
|
+
2. In the tankoh2 folder
|
|
136
|
+
> pre-commit install
|
|
137
|
+
|
|
138
|
+
This enables the pre-commit hooks defined in _.pre-commit-config.yaml_
|
|
139
|
+
and eases your commits and successful pipline runs. You can test pre-commit by running
|
|
140
|
+
> pre-commit run
|
|
141
|
+
|
|
142
|
+
### Requirements
|
|
143
|
+
|
|
144
|
+
see **tool.poetry.dependencies** section in [pyproject.toml](pyproject.toml)
|
|
145
|
+
|
|
146
|
+
FreeCAD is required for conical domes
|
|
147
|
+
|
|
148
|
+
## Usage
|
|
149
|
+
A full list the available parameters is created with
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
python -m tankoh2 --help
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Winding
|
|
156
|
+
|
|
157
|
+
For winding mode, a valid µWind license is required!
|
|
158
|
+
Run the following, to start a winding optimization.
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
python -m tankoh2
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Metal
|
|
165
|
+
|
|
166
|
+
A design run for metal structures can be run by
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
python -m tankoh2 --materialName alu2219 --windingOrMetal metal --domeType circle
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Config Files:
|
|
173
|
+
It's easiest to write design config files in .yaml format to define any parameters for the winding or metal simulation. Using config files, it's possible to reproduce and modify runs.
|
|
174
|
+
Config files need to be put in the folder tankoh2/designs and are used via the option --configFile [nameOfFile.yaml]. For example:
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
python -m tankoh2 --configFile 700bar_example.yaml
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Any non-default parameters can be defined in parameter:value pairs. All possible parameters with descriptions can be seen in defaults.yaml and in the documentation. Config files can also recursively include other configFiles as parameters, whose parameters can be overwritten.
|
|
181
|
+
The parameters which were used in each run are also saved in .yaml format in the run directory. These directories are located under tankoh2/tmp by default.
|
|
182
|
+
|
|
183
|
+
Parameters given in config files are overwritten by parameters supplied explicitly via options.
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
python -m tankoh2 --configFile 700bar_example.yaml --safetyFactor 2.0
|
|
187
|
+
```
|
|
188
|
+
The option --windingOrMetal can currently not be defined in a config file and must be given explicitly for metal simulation (default is winding).
|
|
189
|
+
|
|
190
|
+
## Contributing to _tankoh2_
|
|
191
|
+
|
|
192
|
+
We welcome your contribution!
|
|
193
|
+
|
|
194
|
+
If you want to provide a code change, please:
|
|
195
|
+
|
|
196
|
+
* Create a fork of the project.
|
|
197
|
+
* Develop the feature/patch
|
|
198
|
+
* Provide a merge request.
|
|
199
|
+
|
|
200
|
+
> If it is the first time that you contribute, please add yourself to the list
|
|
201
|
+
> of contributors below.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
## Citing
|
|
205
|
+
|
|
206
|
+
Please cite name and web address of the project
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
see [license](LICENSE.md)
|
|
211
|
+
|
|
212
|
+
## Change Log
|
|
213
|
+
|
|
214
|
+
see [changelog](changelog.md)
|
|
215
|
+
|
|
216
|
+
## Authors
|
|
217
|
+
|
|
218
|
+
[Sebastian Freund](mailto:sebastian.freund@dlr.de)
|
|
219
|
+
[Caroline Lüders](mailto:caroline.lueders@dlr.de)
|
|
220
|
+
[Linus Jacobsen](mailto:linus.jacobsen@dlr.de)
|
|
221
|
+
[Felipe Franzoni](mailto:felipe.franzoni@dlr.de)
|
|
222
|
+
|
tankoh2-2.7.1/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# tankoh2
|
|
2
|
+
|
|
3
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
|
|
4
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
|
|
5
|
+
[](https://gitlab.com/DLR-SY/tank/tankoh2/-/releases)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Design and optimization of H2 tanks.
|
|
9
|
+
|
|
10
|
+
For metal structures, tankoh2 is a standalone pre-design tool.
|
|
11
|
+
For CFRP structures, a detailed winding optimization is performed.
|
|
12
|
+
The winding simulation is carried out by [µChain](https://www.mefex.de/software/)
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- Material/layup read/write
|
|
17
|
+
- Define requirements for cryogenic or high-pressure hydrogen storage
|
|
18
|
+
- Create dome (spherical, isotensoid, torisspherical or conical) and liner from cylindrical length and radius or using a dome contour
|
|
19
|
+
- Setup of a vessel model
|
|
20
|
+
- Optimization of each layer with respect to minimizing puck fibre failure, bending loads, and maintaining a good contour
|
|
21
|
+
- Create and run DOE with support of DLR tools (delismm, fa_pyutils)
|
|
22
|
+
- Routines for the improvement of the FEM model generatred by Abaqus CAE
|
|
23
|
+
- Planned features:
|
|
24
|
+
- Global optimization of
|
|
25
|
+
- All angles of helical layers
|
|
26
|
+
- All hoop layer shifts
|
|
27
|
+
- Target: mass minimization
|
|
28
|
+
- Constraint: puck fibre failure
|
|
29
|
+
- Improved DOE: Liner and fitting adjustment w.r.t. vessel geometry
|
|
30
|
+
- Abaqus: introduction of the abaqus solver at the end of the optimization process
|
|
31
|
+
|
|
32
|
+
## Documentation
|
|
33
|
+
Here is the full [Documentation](https://dlr-sy.gitlab.io/tank/tankoh2/)
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
### Installation for users
|
|
38
|
+
Coming soon: installation via pypi using `pip install tankoh2`
|
|
39
|
+
|
|
40
|
+
When tankoh2 is installed, please follow the steps in [Settings File](#settings-file).
|
|
41
|
+
|
|
42
|
+
### Installation from source
|
|
43
|
+
- Get tankoh2 from
|
|
44
|
+
> https://gitlab.com/DLR-SY/tank/tankoh2.git
|
|
45
|
+
- Install python 3.10 (On the Windows Installer, check the advanced option to add Python to your path and to install pip)
|
|
46
|
+
- Install poetry
|
|
47
|
+
> pip install poetry
|
|
48
|
+
- Install requirements for the project
|
|
49
|
+
> cd <path_to_tankoh2>
|
|
50
|
+
> poetry install
|
|
51
|
+
- When tankoh2 is installed, please follow the steps in [Settings File](#settings-file).
|
|
52
|
+
|
|
53
|
+
### For winding: Path to µChain
|
|
54
|
+
|
|
55
|
+
Add an environment variable named MYCROPYCHAINPATH
|
|
56
|
+
and set its value to the path of your [µChain](https://www.mefex.de/software/) installation.
|
|
57
|
+
|
|
58
|
+
Old Method, will be deprecated soon: Alternatively, in the folder `/src/tankoh2/`, create a file `settings.json`
|
|
59
|
+
and include the path here.
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
{
|
|
63
|
+
"mycropychainPath": "<path_to_muChain>"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Activate the environment
|
|
68
|
+
|
|
69
|
+
This needs to be done whenever you want to use tankoh2.
|
|
70
|
+
First, navigate into tankoh2's source directory.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
cd <path_to_tankoh2>/src
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then, before running tankoh2, you need to activate the python environment created by poetry during the installation. Alternatively replace 'python' in the commands with 'poetry run'.
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
poetry shell
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Test the installation
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
python -m tankoh2 --help
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
You can perform a standalone test for metal tanks
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
python -m tankoh2 --materialName alu2219 --windingOrMetal metal --domeType circle
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Developers
|
|
95
|
+
- Follow the steps [Installation from source](#installation-from-source) above
|
|
96
|
+
- Install all dev dependencies and test dependencies listed in ``pyproject.toml``
|
|
97
|
+
|
|
98
|
+
#### Pre-Commit Hooks
|
|
99
|
+
|
|
100
|
+
Developers may also install the pre-commit hook.
|
|
101
|
+
|
|
102
|
+
**Precommit**
|
|
103
|
+
1. If not installed: install the pre-commit
|
|
104
|
+
> pip install pre-commit
|
|
105
|
+
2. In the tankoh2 folder
|
|
106
|
+
> pre-commit install
|
|
107
|
+
|
|
108
|
+
This enables the pre-commit hooks defined in _.pre-commit-config.yaml_
|
|
109
|
+
and eases your commits and successful pipline runs. You can test pre-commit by running
|
|
110
|
+
> pre-commit run
|
|
111
|
+
|
|
112
|
+
### Requirements
|
|
113
|
+
|
|
114
|
+
see **tool.poetry.dependencies** section in [pyproject.toml](pyproject.toml)
|
|
115
|
+
|
|
116
|
+
FreeCAD is required for conical domes
|
|
117
|
+
|
|
118
|
+
## Usage
|
|
119
|
+
A full list the available parameters is created with
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
python -m tankoh2 --help
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Winding
|
|
126
|
+
|
|
127
|
+
For winding mode, a valid µWind license is required!
|
|
128
|
+
Run the following, to start a winding optimization.
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
python -m tankoh2
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Metal
|
|
135
|
+
|
|
136
|
+
A design run for metal structures can be run by
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
python -m tankoh2 --materialName alu2219 --windingOrMetal metal --domeType circle
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Config Files:
|
|
143
|
+
It's easiest to write design config files in .yaml format to define any parameters for the winding or metal simulation. Using config files, it's possible to reproduce and modify runs.
|
|
144
|
+
Config files need to be put in the folder tankoh2/designs and are used via the option --configFile [nameOfFile.yaml]. For example:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
python -m tankoh2 --configFile 700bar_example.yaml
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Any non-default parameters can be defined in parameter:value pairs. All possible parameters with descriptions can be seen in defaults.yaml and in the documentation. Config files can also recursively include other configFiles as parameters, whose parameters can be overwritten.
|
|
151
|
+
The parameters which were used in each run are also saved in .yaml format in the run directory. These directories are located under tankoh2/tmp by default.
|
|
152
|
+
|
|
153
|
+
Parameters given in config files are overwritten by parameters supplied explicitly via options.
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
python -m tankoh2 --configFile 700bar_example.yaml --safetyFactor 2.0
|
|
157
|
+
```
|
|
158
|
+
The option --windingOrMetal can currently not be defined in a config file and must be given explicitly for metal simulation (default is winding).
|
|
159
|
+
|
|
160
|
+
## Contributing to _tankoh2_
|
|
161
|
+
|
|
162
|
+
We welcome your contribution!
|
|
163
|
+
|
|
164
|
+
If you want to provide a code change, please:
|
|
165
|
+
|
|
166
|
+
* Create a fork of the project.
|
|
167
|
+
* Develop the feature/patch
|
|
168
|
+
* Provide a merge request.
|
|
169
|
+
|
|
170
|
+
> If it is the first time that you contribute, please add yourself to the list
|
|
171
|
+
> of contributors below.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Citing
|
|
175
|
+
|
|
176
|
+
Please cite name and web address of the project
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
see [license](LICENSE.md)
|
|
181
|
+
|
|
182
|
+
## Change Log
|
|
183
|
+
|
|
184
|
+
see [changelog](changelog.md)
|
|
185
|
+
|
|
186
|
+
## Authors
|
|
187
|
+
|
|
188
|
+
[Sebastian Freund](mailto:sebastian.freund@dlr.de)
|
|
189
|
+
[Caroline Lüders](mailto:caroline.lueders@dlr.de)
|
|
190
|
+
[Linus Jacobsen](mailto:linus.jacobsen@dlr.de)
|
|
191
|
+
[Felipe Franzoni](mailto:felipe.franzoni@dlr.de)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2022 German Aerospace Center (DLR)
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tankoh2"
|
|
7
|
+
version = "2.7.1"
|
|
8
|
+
description = "Design and optimization of H2 tanks for high pressure applications and cryogenic hydrogen storage"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
authors = [{name = "Sebastian Freund", email = "sebastian.freund@dlr.de>"},
|
|
11
|
+
{name = "Caroline Lüders", email = "caroline.lueders@dlr.de>"},
|
|
12
|
+
{name = "Linus Jacobsen", email = "linus.jacobsen@dlr.de>"},
|
|
13
|
+
{name = "Felipe Franzoni", email = "felipe.franzoni@dlr.de>"},
|
|
14
|
+
{name = "Christopher Rickert", email = "christopher.rickert@dlr.de"}]
|
|
15
|
+
readme = "README.md"
|
|
16
|
+
include = ["changelog.md", "LICENSES/MIT.txt"]
|
|
17
|
+
keywords = ["lh2 tank", "winding", "hydrogen", "storage"]
|
|
18
|
+
requires-python = ">=3.9,<4.0"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"numpy<2",
|
|
21
|
+
"scipy",
|
|
22
|
+
"pandas",
|
|
23
|
+
"matplotlib",
|
|
24
|
+
"CoolProp",
|
|
25
|
+
"ruamel.yaml",
|
|
26
|
+
"defusedxml",
|
|
27
|
+
"openturns",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://gitlab.dlr.de/sy-stm/software//tankoh2"
|
|
32
|
+
Changelog = "https://gitlab.dlr.de/sy-stm/software/tankoh2/-/blob/master/changelog.md"
|
|
33
|
+
Documentation = "https://sy-stm.pages.gitlab.dlr.de/software/tankoh2/"
|
|
34
|
+
Repository = "https://gitlab.com/DLR-SY/tank/tankoh2"
|
|
35
|
+
|
|
36
|
+
[[tool.poetry.source]]
|
|
37
|
+
name = "PyPI"
|
|
38
|
+
priority = "primary"
|
|
39
|
+
|
|
40
|
+
[[tool.poetry.source]]
|
|
41
|
+
name = "dlr-sy-stm"
|
|
42
|
+
url = "https://gitlab.dlr.de/api/v4/groups/38226/-/packages/pypi/simple"
|
|
43
|
+
priority = "supplemental"
|
|
44
|
+
|
|
45
|
+
[tool.poetry]
|
|
46
|
+
include = [{ path = "src"}]
|
|
47
|
+
|
|
48
|
+
[tool.poetry.scripts]
|
|
49
|
+
#sample-calculator = "sample_calculator.main:cmd_main"
|
|
50
|
+
|
|
51
|
+
[tool.poetry.group.dev.dependencies]
|
|
52
|
+
flake8 = "*"
|
|
53
|
+
black = "*"
|
|
54
|
+
isort = "*"
|
|
55
|
+
reuse = "*"
|
|
56
|
+
bandit = "*"
|
|
57
|
+
setuptools = "*"
|
|
58
|
+
Sphinx = "*"
|
|
59
|
+
sphinx_rtd_theme = "*"
|
|
60
|
+
sphinxcontrib-bibtex = "*"
|
|
61
|
+
sphinxcontrib-mermaid = "*"
|
|
62
|
+
pre-commit = "*"
|
|
63
|
+
|
|
64
|
+
[tool.poetry.group.test.dependencies]
|
|
65
|
+
pytest = "*"
|
|
66
|
+
pytest-cov = "*"
|
|
67
|
+
|
|
68
|
+
[tool.coverage.run]
|
|
69
|
+
branch = true
|
|
70
|
+
|
|
71
|
+
[tool.coverage.html]
|
|
72
|
+
directory = "build/htmlcov"
|
|
73
|
+
|
|
74
|
+
[tool.black]
|
|
75
|
+
line-length = 120
|
|
76
|
+
exclude = "docs"
|
|
77
|
+
|
|
78
|
+
[tool.isort]
|
|
79
|
+
line_length = 120
|
|
80
|
+
skip = "docs"
|
|
81
|
+
profile = "black"
|
|
82
|
+
|
|
83
|
+
[tool.pytest.ini_options]
|
|
84
|
+
pythonpath = [
|
|
85
|
+
".", "src",
|
|
86
|
+
]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR)
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Central information about the software package
|
|
7
|
+
|
|
8
|
+
It is a single location for this information.
|
|
9
|
+
See https://packaging.python.org/en/latest/single_source_version.html
|
|
10
|
+
variant 3.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import datetime
|
|
14
|
+
from os.path import abspath, basename, dirname
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
__programDir__ = dirname(abspath(__file__))
|
|
18
|
+
if not "site-packages" in __programDir__:
|
|
19
|
+
# not installed
|
|
20
|
+
__programDir__ = dirname(dirname(__programDir__))
|
|
21
|
+
|
|
22
|
+
__title__ = basename(dirname(__file__))
|
|
23
|
+
except NameError:
|
|
24
|
+
# in case the file is analyzed via exec(), there is no __file__ variable.
|
|
25
|
+
# In this case __programDir__ and __title__ must be defined elsewhere
|
|
26
|
+
__programDir__ = None
|
|
27
|
+
__title__ = None
|
|
28
|
+
|
|
29
|
+
__description__ = "Design and optimization of H2 tanks using muChain"
|
|
30
|
+
__version__ = "2.4.2"
|
|
31
|
+
__author__ = "Sebastian Freund, Caroline Lueders"
|
|
32
|
+
__email__ = "sebastian.freund@dlr.de"
|
|
33
|
+
__license__ = "MIT"
|
|
34
|
+
__copyright__ = "Copyright (C) 2023 Deutsches Zentrum fuer Luft- und Raumfahrt(DLR, German Aerospace Center)"
|
|
35
|
+
__url__ = "https://github.com/sfreund-DLR/tankoh2"
|
|
36
|
+
__keywords__ = "tank h2 optimization design fem model"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR)
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
h2 tank optimization
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
import sys
|
|
11
|
+
|
|
12
|
+
from tankoh2.__about__ import __author__, __description__, __programDir__, __title__, __version__
|
|
13
|
+
from tankoh2.settings import PychainWrapper
|
|
14
|
+
|
|
15
|
+
# main program information
|
|
16
|
+
name = __title__
|
|
17
|
+
programDir = __programDir__
|
|
18
|
+
version = __version__
|
|
19
|
+
description = __description__
|
|
20
|
+
author = __author__
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# create logger
|
|
24
|
+
level = logging.INFO
|
|
25
|
+
formatter = logging.Formatter("%(levelname)s\t%(asctime)s: %(message)s")
|
|
26
|
+
handler = logging.StreamHandler(sys.stdout)
|
|
27
|
+
handler.setLevel(level)
|
|
28
|
+
handler.formatter = formatter
|
|
29
|
+
log = logging.getLogger(f"{name}_logger")
|
|
30
|
+
log.handlers.append(handler)
|
|
31
|
+
log.setLevel(level)
|
|
32
|
+
|
|
33
|
+
# make mycropychain available
|
|
34
|
+
pychainIsLoaded = False
|
|
35
|
+
pychain = PychainWrapper()
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2023 German Aerospace Center (DLR)
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
|
|
7
|
+
|
|
8
|
+
from tankoh2 import description, name
|
|
9
|
+
from tankoh2.arguments import allArgs
|
|
10
|
+
from tankoh2.control.control_metal import createDesign as createDesignMetal
|
|
11
|
+
from tankoh2.control.control_winding import createDesign as createDesignWinding
|
|
12
|
+
from tankoh2.control.genericcontrol import parseConfigFile
|
|
13
|
+
from tankoh2.service.exception import Tankoh2Error
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def main():
|
|
17
|
+
parserDesc = f"""{description}.
|
|
18
|
+
Use the following optional arguments to customize the tank design.
|
|
19
|
+
Any argument not given, will be extended by the ones defined in
|
|
20
|
+
tankoh2.design.existingdesigns.defaultDesign."""
|
|
21
|
+
parser = ArgumentParser(
|
|
22
|
+
prog=name, description=parserDesc, add_help=False, formatter_class=ArgumentDefaultsHelpFormatter
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
grouped = allArgs.groupby("group")
|
|
26
|
+
groupNames = allArgs["group"].unique()
|
|
27
|
+
|
|
28
|
+
# if the help is requested, all defaults should be listed. If not, it is important to know which params are set explicitly
|
|
29
|
+
includeDefaults = True if "--help" in sys.argv else False
|
|
30
|
+
|
|
31
|
+
for groupName in groupNames:
|
|
32
|
+
argsGroup = allArgs[allArgs["group"] == groupName]
|
|
33
|
+
parserGroup = parser.add_argument_group(groupName)
|
|
34
|
+
for argName, group, metavar, default, dataType, helpStr, action in argsGroup.iloc:
|
|
35
|
+
kwargs = {}
|
|
36
|
+
kwargs.update({"metavar": metavar} if metavar else {})
|
|
37
|
+
if includeDefaults:
|
|
38
|
+
kwargs.update({"default": default})
|
|
39
|
+
kwargs.update({"action": action} if action else {})
|
|
40
|
+
kwargs.update({"type": dataType} if dataType else {})
|
|
41
|
+
parserGroup.add_argument(f"--{argName}", help=helpStr, **kwargs)
|
|
42
|
+
|
|
43
|
+
options = parser.parse_args()
|
|
44
|
+
params = {key: val for key, val in vars(options).items() if val is not None}
|
|
45
|
+
windingOrMetal = params.pop("windingOrMetal").lower() if "windingOrMetal" in params else None
|
|
46
|
+
if "configFile" in params and params["configFile"] is not None:
|
|
47
|
+
configArgs = parseConfigFile(params["configFile"])
|
|
48
|
+
if "windingOrMetal" in configArgs:
|
|
49
|
+
windingOrMetal = configArgs["windingOrMetal"].lower()
|
|
50
|
+
if windingOrMetal is None:
|
|
51
|
+
windingOrMetal = "winding"
|
|
52
|
+
params = {key: value for key, value in params.items() if value != parser.get_default(key)}
|
|
53
|
+
# don't pass default values
|
|
54
|
+
try:
|
|
55
|
+
if windingOrMetal == "winding":
|
|
56
|
+
createDesignWinding(**params)
|
|
57
|
+
elif windingOrMetal == "metal":
|
|
58
|
+
createDesignMetal(**params)
|
|
59
|
+
else:
|
|
60
|
+
raise Tankoh2Error(
|
|
61
|
+
f'Parameter "windingOrMetal" can only be one of [winding, metal] but got ' f"{windingOrMetal}"
|
|
62
|
+
)
|
|
63
|
+
except:
|
|
64
|
+
sys.stdout.flush()
|
|
65
|
+
raise
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
if __name__ == "__main__":
|
|
69
|
+
main()
|