Metadata-Version: 2.4
Name: tankoh2
Version: 2.9.1
Summary: Design and optimization of H2 tanks for high pressure applications and cryogenic hydrogen storage
License-Expression: MIT
License-File: LICENSE.md
License-File: LICENSES/MIT.txt
Keywords: lh2 tank,winding,hydrogen,storage
Author: Sebastian Freund
Author-email: sebastian.freund@dlr.de>
Maintainer: Sebastian Freund
Maintainer-email: sebastian.freund@dlr.de>
Requires-Python: ==3.10.*
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: CoolProp
Requires-Dist: bokeh
Requires-Dist: defusedxml
Requires-Dist: gmsh
Requires-Dist: matplotlib
Requires-Dist: numpy (<2.0)
Requires-Dist: openpyxl
Requires-Dist: openturns
Requires-Dist: pandas
Requires-Dist: patme
Requires-Dist: ruamel.yaml
Requires-Dist: scipy
Project-URL: Changelog, https://gitlab.dlr.de/sy-stm/software/tankoh2/-/blob/master/changelog.md
Project-URL: Documentation, https://sy-stm.pages.gitlab.dlr.de/software/tankoh2/
Project-URL: Homepage, https://gitlab.dlr.de/sy-stm/software//tankoh2
Project-URL: Repository, https://gitlab.com/DLR-SY/tank/tankoh2
Description-Content-Type: text/markdown

# tankoh2

[![pipeline
status](https://gitlab.com/DLR-SY/tank/tankoh2/badges/master/pipeline.svg)](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
[![coverage
report](https://gitlab.com/DLR-SY/tank/tankoh2/badges/master/coverage.svg)](https://gitlab.com/DLR-SY/tank/tankoh2/-/commits/master)
[![Latest
Release](https://gitlab.com/DLR-SY/tank/tankoh2/-/badges/release.svg)](https://gitlab.com/DLR-SY/tank/tankoh2/-/releases)


Design and optimization of H2 tanks.

For metal structures, tankoh2 is a standalone pre-design tool.
For CFRP structures, a detailed winding optimization is performed.
The winding simulation is carried out by [µChain](https://www.mefex.de/software/)

For Automated Fiber Placement (AFP) structures, an end-to-end process is
carried out: it automates Finite Element model generation using Abaqus in
the background and post-processes the results, from an Excel stacking
definition all the way through to the tank's mechanical response.

## Features

- Material/layup read/write
- Define requirements for cryogenic or high-pressure hydrogen storage
- Create dome (spherical, isotensoid, torisspherical or conical) and liner from cylindrical length
and radius or using a dome contour
- Setup of a vessel model
- Optimization of each layer with respect to minimizing puck fibre failure, bending loads, and
maintaining a good contour
- Generate Solid-Axisymmetric Abaqus FEM Models and use them within Optimization
- Create and run DOE with support of DLR tools (delismm, fa_pyutils)
- Planned features:
  - Global optimization of
    - All angles of helical layers
    - All hoop layer shifts
    - Target: mass minimization
    - Constraint: puck fibre failure
  - Improved DOE: Liner and fitting adjustment w.r.t. vessel geometry
  - Abaqus: introduction of the abaqus solver at the end of the optimization process

## Documentation
Here is the full [Documentation](https://dlr-sy.gitlab.io/tank/tankoh2/)

## Installation

### Installation for users

On the command line run

`pip install tankoh2`

to install tankoh2 and its dependencies.

### Installation from source (for developers)

- clone tankoh2 and cd into the directory
  > git clone https://gitlab.com/DLR-SY/tank/tankoh2.git
  >
  > cd tankoh2
- Install python 3.10
- Install poetry
  > pip install poetry
- Install requirements for the project
  > poetry install
- To run the project, navigate into the tankoh2 directory and use
  >poetry run python -m tankoh [--further Options]

### For winding: Path to µChain

Add an environment variable named `MYCROPYCHAINPATH`
and set its value to the path of your [µChain](https://www.mefex.de/software/) installation.

Old Method, will be deprecated soon: Alternatively, in the folder `/src/tankoh2/`, create a file
`settings.json`
and include the path here.

```
{
  "mycropychainPath": "<path_to_muChain>"
}
```

### Test the installation

```
python -m tankoh2 --help
```

You can perform a standalone test for metal tanks

```
python -m tankoh2 --materialName alu2219 --manufacturingType metal --domeType circle
```

#### Pre-Commit Hooks

Developers may also install the pre-commit hook.

**Precommit**
1. If not installed: install the pre-commit
   > pip install pre-commit
2. In the tankoh2 folder
   > pre-commit install

This enables the pre-commit hooks defined in _.pre-commit-config.yaml_
and eases your commits and successful pipline runs. You can test pre-commit by running
> pre-commit run

## Usage
A full list the available parameters is created with

```
python -m tankoh2 --help
```

### Winding

For winding mode, a valid µWind license is required!
Run the following, to start a winding optimization.

```
python -m tankoh2
```

### Metal

A design run for metal structures can be run by

```
python -m tankoh2 --materialName alu2219 --manufacturingType metal --domeType circle
```

### AFP (Automated Fiber Placement)

The AFP mode lives mainly in `mainAFP.py` and can still be called from there directly:

```
cd <path_to_tankoh2>/src/tankoh2/design/afp
python mainAFP.py --inputFile inputFiles/DemoStackingDefinition.xlsx --tankname demo
```

It is also dispatched through the main entry point with `--afp true`:

```
python -m tankoh2 --afp true --inputFile <path_to_afp>/inputFiles/DemoStackingDefinition.xlsx --tankname demo
```

If Abaqus isn't on your PATH, point it to the executable explicitly (or use
`--abaqusExe <path>` in the direct `mainAFP.py` call). The AFP program was developed against
**Abaqus 2024**
(e.g. `abq2024hf4`, `abq2024`, `abq2024le`); using a version **below 2024 will produce errors**,
while versions
**above 2024 may work**:

```
python -m tankoh2 --afp true \
    --inputFile <path_to_afp>/inputFiles/DemoStackingDefinition.xlsx \
    --tankname demo \
    --abaqusExe <path-to-abaqus.exe>
```

A few example input files ship in the `inputFiles/` folder. **Most simulation settings are
configured inside the Excel
input file itself** using the settings tool built into the file — `--inputFile` and `--tankname`
only select which file
to read and what to name the run. The Abaqus executable is picked up from PATH by default; override
it with
`--abaqusExe <path-or-name>` if needed.

### Config Files:
It's easiest to write design config files in .yaml format to define any parameters.
Using config files, it's possible to reproduce and modify runs. All possible parameters with
descriptions can be seen in defaults.yaml. Config files can also
recursively include other configFiles as parameters, whose parameters can be overwritten.
Config files  are used via the option --configFile <nameOfConfig.yaml>.
For example:

```
python -m tankoh2 --configFile <nameOfConfig.yaml>
```

Parameters given in config files are overwritten by parameters supplied explicitly via options.

```
python -m tankoh2 --configFile <nameOfConfig.yaml> --safetyFactor 2.0
```


## Contributing to _tankoh2_

We welcome your contribution!

If you want to provide a code change, please:

* Create a fork of the project.
* Develop the feature/patch
* Provide a merge request.

> If it is the first time that you contribute, please add yourself to the list
> of contributors below.


## Citing

Please cite name and web address of the project

## License

see [license](LICENSE.md)

## Change Log

see [changelog](changelog.md)

## Authors

[Sebastian Freund](mailto:sebastian.freund@dlr.de)
[Caroline Lüders](mailto:caroline.lueders@dlr.de)
[Linus Jacobsen](mailto:linus.jacobsen@dlr.de)
[Felipe Franzoni](mailto:felipe.franzoni@dlr.de)
[Christopher Rickert](mailto:christopher.rickert@dlr.de)

