tankoh2 2.7.1__py3-none-any.whl
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/__about__.py +36 -0
- tankoh2/__init__.py +35 -0
- tankoh2/__main__.py +69 -0
- tankoh2/abq_cae/__init__.py +3 -0
- tankoh2/abq_cae/continueVesselCAE.py +1955 -0
- tankoh2/abq_cae/control_continueVesselCAE.py +238 -0
- tankoh2/arguments.py +696 -0
- tankoh2/control/__init__.py +81 -0
- tankoh2/control/control_cl.py +483 -0
- tankoh2/control/control_doe.py +375 -0
- tankoh2/control/control_metal.py +171 -0
- tankoh2/control/control_winding.py +405 -0
- tankoh2/control/genericcontrol.py +431 -0
- tankoh2/design/__init__.py +3 -0
- tankoh2/design/designutils.py +110 -0
- tankoh2/design/existingdesigns.py +895 -0
- tankoh2/design/loads.py +50 -0
- tankoh2/design/metal/__init__.py +5 -0
- tankoh2/design/metal/material.py +71 -0
- tankoh2/design/metal/mechanics.py +139 -0
- tankoh2/design/winding/__init__.py +5 -0
- tankoh2/design/winding/contour.py +325 -0
- tankoh2/design/winding/designopt.py +1057 -0
- tankoh2/design/winding/material.py +138 -0
- tankoh2/design/winding/optimize.py +433 -0
- tankoh2/design/winding/solver.py +487 -0
- tankoh2/design/winding/vessel_cl.py +377 -0
- tankoh2/design/winding/winding.py +249 -0
- tankoh2/design/winding/windingutils.py +411 -0
- tankoh2/geometry/__init__.py +3 -0
- tankoh2/geometry/dome.py +1562 -0
- tankoh2/geometry/geoutils.py +89 -0
- tankoh2/geometry/liner.py +102 -0
- tankoh2/masses/__init__.py +3 -0
- tankoh2/masses/massdata.py +23 -0
- tankoh2/masses/massestimation.py +211 -0
- tankoh2/mechanics/__init__.py +3 -0
- tankoh2/mechanics/fatigue.py +571 -0
- tankoh2/mechanics/fatiguefitting.py +371 -0
- tankoh2/mechanics/material.py +89 -0
- tankoh2/sensitivityAnalysis/__init__.py +0 -0
- tankoh2/sensitivityAnalysis/distributions.py +60 -0
- tankoh2/sensitivityAnalysis/parameterSets.py +171 -0
- tankoh2/sensitivityAnalysis/parameters.py +263 -0
- tankoh2/sensitivityAnalysis/sensitivityanalysis.py +308 -0
- tankoh2/service/__init__.py +3 -0
- tankoh2/service/cpacstank.py +241 -0
- tankoh2/service/exception.py +22 -0
- tankoh2/service/physicalprops.py +33 -0
- tankoh2/service/plot/__init__.py +3 -0
- tankoh2/service/plot/doeplot.py +134 -0
- tankoh2/service/plot/generic.py +141 -0
- tankoh2/service/plot/muwind.py +248 -0
- tankoh2/service/plot/tankcycles.py +10991 -0
- tankoh2/service/plot/vphplots.py +269 -0
- tankoh2/service/utilities.py +393 -0
- tankoh2/settings.py +199 -0
- tankoh2-2.7.1.dist-info/LICENSE.md +13 -0
- tankoh2-2.7.1.dist-info/LICENSES/MIT.txt +21 -0
- tankoh2-2.7.1.dist-info/METADATA +222 -0
- tankoh2-2.7.1.dist-info/RECORD +62 -0
- tankoh2-2.7.1.dist-info/WHEEL +4 -0
tankoh2/__about__.py
ADDED
|
@@ -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"
|
tankoh2/__init__.py
ADDED
|
@@ -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()
|
tankoh2/__main__.py
ADDED
|
@@ -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()
|