flowstate 0.6.1__tar.gz → 0.6.2__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.
- {flowstate-0.6.1 → flowstate-0.6.2}/.github/workflows/docs.yml +2 -4
- flowstate-0.6.2/.github/workflows/package.yml +41 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/.github/workflows/publish.yml +2 -2
- {flowstate-0.6.1 → flowstate-0.6.2}/CITATION.cff +0 -1
- {flowstate-0.6.1 → flowstate-0.6.2}/PKG-INFO +6 -5
- {flowstate-0.6.1 → flowstate-0.6.2}/README.md +2 -1
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/installation.md +1 -1
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/atmosphere-models.md +12 -5
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/transport.md +33 -9
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/cli.md +16 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/mkdocs.yml +0 -2
- {flowstate-0.6.1 → flowstate-0.6.2}/pyproject.toml +4 -4
- flowstate-0.6.2/src/flow_state/cli/__init__.py +8 -0
- flowstate-0.6.2/src/flow_state/cli/app.py +51 -0
- flowstate-0.6.2/src/flow_state/cli/callbacks.py +24 -0
- flowstate-0.6.2/src/flow_state/cli/cmd_init.py +32 -0
- flowstate-0.6.2/src/flow_state/cli/cmd_recover.py +44 -0
- flowstate-0.6.2/src/flow_state/cli/cmd_solve.py +158 -0
- flowstate-0.6.2/src/flow_state/cli/constants.py +4 -0
- flowstate-0.6.2/src/flow_state/cli/templates.py +51 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/__init__.py +2 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/examples.py +2 -2
- flowstate-0.6.2/src/flow_state/io/hdf5.py +35 -0
- flowstate-0.6.2/src/flow_state/recover.py +220 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/solvers.py +10 -10
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/PKG-INFO +6 -5
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/SOURCES.txt +13 -2
- flowstate-0.6.2/src/flowstate.egg-info/entry_points.txt +2 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/requires.txt +2 -2
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/scm_file_list.json +13 -2
- flowstate-0.6.2/src/flowstate.egg-info/scm_version.json +8 -0
- flowstate-0.6.2/tests/test_cli.py +134 -0
- flowstate-0.6.2/tests/test_recover.py +116 -0
- flowstate-0.6.1/docs/refs.bib +0 -83
- flowstate-0.6.1/src/flow_state/cli.py +0 -562
- flowstate-0.6.1/src/flowstate.egg-info/entry_points.txt +0 -2
- flowstate-0.6.1/src/flowstate.egg-info/scm_version.json +0 -8
- {flowstate-0.6.1 → flowstate-0.6.2}/.github/workflows/test.yml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/.gitignore +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/.vscode/extensions.json +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/.vscode/settings.json +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/LICENSE +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/apps/webapp/.streamlit/config.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/apps/webapp/app.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/apps/webapp/requirements.txt +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/architecture.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/atmosphere.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/core.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/solvers.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/api/transport.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/architecture.svg +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/atmosphere_dens_comparison.png +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/atmosphere_temp_comparison.png +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/cira86_latitude_grid.png +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/re1_hifire1.png +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/assets/re1_stort.png +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/cli-reference.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/configs/aedc_t9.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/configs/bam6qt.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/configs/hifire1.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/configs/stort_cira.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/examples.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/javascripts/mathjax.js +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/nomenclature.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/atmosphere-comparison.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/definitions.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/gas-models.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/gas-properties.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/theory/isentropic.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/basic-usage.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/config-files.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/configuration.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/output.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/user-guide/workflow.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/vnv/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/vnv/validation/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/docs/vnv/verification/index.md +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/examples/bam6qt_conditions.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/examples/flight_conditions_cira86.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/examples/flight_conditions_ussa76.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/examples/flow_config_cira86.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/examples/mach8_re1_conditions.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/atmosphere_density_plotter.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/generate_atmosphere_plots.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/generate_latitude_grid.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/stort_trajectory_reynolds_number_comparison.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/temp_graph_atmosphere_models.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/scripts/test_trajectory_1_calculation.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/setup.cfg +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/atmosphere/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/atmosphere/cira86.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/atmosphere/core.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/atmosphere/registry.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/atmosphere/ussa76.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/core.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/examples/aedc_t9.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/examples/bam6qt.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/examples/sandia.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/examples/stort.toml +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/gas/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/gas/equilibrium.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/gas/park.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/gas/perfect.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/gas/registry.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/legacy_dat.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/print_summary.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/read_config.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/read_data.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/io/write_data.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/isentropic.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/math_utils/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/math_utils/bisection.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/core.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/keyes.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/power_law.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/registry.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/transport/sutherland.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/turbulence.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flow_state/units.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/dependency_links.txt +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/src/flowstate.egg-info/top_level.txt +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/stort_trajectory_reynolds_number_comparison.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/__init__.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_atmosphere.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_builders.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_equilibrium.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_gas.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_io.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_isentropic.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_park.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_solvers.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_transport.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_turbulence.py +0 -0
- {flowstate-0.6.1 → flowstate-0.6.2}/tests/test_units.py +0 -0
|
@@ -29,12 +29,10 @@ jobs:
|
|
|
29
29
|
python-version: "3.11"
|
|
30
30
|
|
|
31
31
|
- name: Install dependencies
|
|
32
|
-
run:
|
|
33
|
-
pip install mkdocs-material mkdocstrings[python] mkdocs-bibtex
|
|
34
|
-
pip install -e .
|
|
32
|
+
run: pip install -e ".[dev]"
|
|
35
33
|
|
|
36
34
|
- name: Build documentation
|
|
37
|
-
run:
|
|
35
|
+
run: zensical build --strict
|
|
38
36
|
|
|
39
37
|
- name: Upload artifact
|
|
40
38
|
uses: actions/upload-pages-artifact@v5
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GPL-3.0-or-later - see LICENSE
|
|
2
|
+
name: Package
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- uses: actions/setup-python@v6
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.11"
|
|
22
|
+
|
|
23
|
+
- name: Build distributions
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install build twine
|
|
26
|
+
python -m build
|
|
27
|
+
python -m twine check dist/*
|
|
28
|
+
|
|
29
|
+
- name: Smoke-test wheel
|
|
30
|
+
run: |
|
|
31
|
+
python -m venv "${RUNNER_TEMP}/wheel-test"
|
|
32
|
+
"${RUNNER_TEMP}/wheel-test/bin/python" -m pip install dist/*.whl
|
|
33
|
+
cd "${RUNNER_TEMP}"
|
|
34
|
+
"${RUNNER_TEMP}/wheel-test/bin/python" -c "import flow_state"
|
|
35
|
+
"${RUNNER_TEMP}/wheel-test/bin/flow-state" --help
|
|
36
|
+
|
|
37
|
+
- name: Upload distributions
|
|
38
|
+
uses: actions/upload-artifact@v7
|
|
39
|
+
with:
|
|
40
|
+
name: distributions
|
|
41
|
+
path: dist/
|
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
run: python -m build
|
|
47
47
|
|
|
48
48
|
- name: Upload dist artifacts
|
|
49
|
-
uses: actions/upload-artifact@
|
|
49
|
+
uses: actions/upload-artifact@v7
|
|
50
50
|
with:
|
|
51
51
|
name: dist
|
|
52
52
|
path: dist/
|
|
@@ -60,7 +60,7 @@ jobs:
|
|
|
60
60
|
|
|
61
61
|
steps:
|
|
62
62
|
- name: Download dist artifacts
|
|
63
|
-
uses: actions/download-artifact@
|
|
63
|
+
uses: actions/download-artifact@v8
|
|
64
64
|
with:
|
|
65
65
|
name: dist
|
|
66
66
|
path: dist/
|
|
@@ -6,7 +6,6 @@ type: software
|
|
|
6
6
|
authors:
|
|
7
7
|
- family-names: "Hader"
|
|
8
8
|
given-names: "Christoph"
|
|
9
|
-
affiliation: "University of Arizona"
|
|
10
9
|
orcid: "https://orcid.org/0000-0002-0956-000X"
|
|
11
10
|
repository-code: "https://github.com/uahypersonics/flow-state"
|
|
12
11
|
url: "https://uahypersonics.github.io/flow-state"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flowstate
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Summary: Lightweight utility for computing flow states
|
|
5
|
-
Author-email: Christoph Hader <
|
|
5
|
+
Author-email: Christoph Hader <christoph.hader@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://github.com/uahypersonics/flow-state
|
|
8
8
|
Project-URL: Repository, https://github.com/uahypersonics/flow-state
|
|
@@ -17,15 +17,15 @@ Classifier: Topic :: Scientific/Engineering :: Physics
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: h5py>=3.10.0
|
|
20
21
|
Requires-Dist: typer>=0.9.0
|
|
21
22
|
Requires-Dist: tomli-w>=1.0.0
|
|
22
23
|
Provides-Extra: dev
|
|
23
24
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
24
25
|
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
25
26
|
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
26
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: zensical; extra == "dev"
|
|
27
28
|
Requires-Dist: mkdocstrings[python]>=0.24; extra == "dev"
|
|
28
|
-
Requires-Dist: mkdocs-bibtex>=2.0; extra == "dev"
|
|
29
29
|
Dynamic: license-file
|
|
30
30
|
|
|
31
31
|
# flow_state
|
|
@@ -36,7 +36,7 @@ Compressible flow state calculations for Python.
|
|
|
36
36
|
[](https://codecov.io/gh/uahypersonics/flow-state)
|
|
37
37
|
[](https://doi.org/10.5281/zenodo.18926470)
|
|
38
38
|
[](https://pypi.org/project/flowstate/)
|
|
39
|
-
[](https://uahypersonics.github.io/flow-state/)
|
|
40
40
|
[](https://flow-state-calculator.streamlit.app/)
|
|
41
41
|
[](LICENSE)
|
|
42
42
|
[](https://www.python.org/downloads/)
|
|
@@ -73,6 +73,7 @@ print(state.pres, state.temp, state.re1)
|
|
|
73
73
|
```bash
|
|
74
74
|
flow-state init # Create a config template
|
|
75
75
|
flow-state solve # Solve from flow_config.toml
|
|
76
|
+
flow-state recover base_flow.hdf5 # Recover flow_conditions.json from HDF5 metadata
|
|
76
77
|
```
|
|
77
78
|
|
|
78
79
|
- API Usage: https://uahypersonics.github.io/flow-state/user_guide/api_usage/
|
|
@@ -6,7 +6,7 @@ Compressible flow state calculations for Python.
|
|
|
6
6
|
[](https://codecov.io/gh/uahypersonics/flow-state)
|
|
7
7
|
[](https://doi.org/10.5281/zenodo.18926470)
|
|
8
8
|
[](https://pypi.org/project/flowstate/)
|
|
9
|
-
[](https://uahypersonics.github.io/flow-state/)
|
|
10
10
|
[](https://flow-state-calculator.streamlit.app/)
|
|
11
11
|
[](LICENSE)
|
|
12
12
|
[](https://www.python.org/downloads/)
|
|
@@ -43,6 +43,7 @@ print(state.pres, state.temp, state.re1)
|
|
|
43
43
|
```bash
|
|
44
44
|
flow-state init # Create a config template
|
|
45
45
|
flow-state solve # Solve from flow_config.toml
|
|
46
|
+
flow-state recover base_flow.hdf5 # Recover flow_conditions.json from HDF5 metadata
|
|
46
47
|
```
|
|
47
48
|
|
|
48
49
|
- API Usage: https://uahypersonics.github.io/flow-state/user_guide/api_usage/
|
|
@@ -32,7 +32,7 @@ This includes:
|
|
|
32
32
|
|
|
33
33
|
- [pytest](https://docs.pytest.org/) and [pytest-cov](https://pytest-cov.readthedocs.io/) for testing
|
|
34
34
|
- [ruff](https://docs.astral.sh/ruff/) for linting
|
|
35
|
-
- [
|
|
35
|
+
- [Zensical](https://zensical.org/) for documentation
|
|
36
36
|
|
|
37
37
|
## Verify Installation
|
|
38
38
|
|
|
@@ -8,12 +8,12 @@ For usage examples, see [Examples](../examples.md#flight-conditions) and [Config
|
|
|
8
8
|
|
|
9
9
|
| Model | Function/Class | Altitude Range | Lat/Season | Reference |
|
|
10
10
|
|-------|----------------|----------------|------------|----------|
|
|
11
|
-
| [USSA76](#ussa76) | `ussa76()` | 0–86 km | No | [
|
|
12
|
-
| [CIRA86](#cira86) | `CIRA86()` | 0–120 km | Yes | [
|
|
11
|
+
| [USSA76](#ussa76) | `ussa76()` | 0–86 km | No | [^ussa1976] |
|
|
12
|
+
| [CIRA86](#cira86) | `CIRA86()` | 0–120 km | Yes | [^cira1986] |
|
|
13
13
|
|
|
14
14
|
## US Standard Atmosphere 1976 (USSA76) {#ussa76}
|
|
15
15
|
|
|
16
|
-
The default model [
|
|
16
|
+
The default model [^ussa1976]. Defines a single reference atmosphere independent of latitude and season.
|
|
17
17
|
|
|
18
18
|
- Valid from 0 to 86 km (geometric altitude)
|
|
19
19
|
- Piecewise linear temperature profile with defined lapse rates
|
|
@@ -53,7 +53,7 @@ where \(g_0 = 9.80665\) m/s² is standard gravity and \(R = 287.05\) J/(kg·K).
|
|
|
53
53
|
|
|
54
54
|
## COSPAR International Reference Atmosphere (CIRA86) {#cira86}
|
|
55
55
|
|
|
56
|
-
Latitude and season-dependent model [
|
|
56
|
+
Latitude and season-dependent model [^cira1986].
|
|
57
57
|
|
|
58
58
|
- Valid from 0 to 120 km altitude
|
|
59
59
|
- Tabulated data interpolated for latitude (0–80°N, 10° increments) and month (1–12)
|
|
@@ -82,4 +82,11 @@ Parameters:
|
|
|
82
82
|
|
|
83
83
|
## References
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
[^ussa1976]: NOAA, NASA, and USAF. *U.S. Standard Atmosphere, 1976*.
|
|
86
|
+
NOAA-S/T 76-1562, 1976.
|
|
87
|
+
[View report](https://www.ngdc.noaa.gov/stp/space-weather/online-publications/miscellaneous/us-standard-atmosphere-1976/us-standard-atmosphere_st76-1562_noaa.pdf).
|
|
88
|
+
|
|
89
|
+
[^cira1986]: Rees, D., Barnett, J. J., and Labitzke, K. *COSPAR International
|
|
90
|
+
Reference Atmosphere: 1986. Part II: Middle Atmosphere Models*. Advances in
|
|
91
|
+
Space Research 10(12), 1990.
|
|
92
|
+
[doi:10.1016/0273-1177(90)90386-E](https://doi.org/10.1016/0273-1177(90)90386-E).
|
|
@@ -6,15 +6,15 @@ Viscosity models available in `flow_state`. All models compute [dynamic viscosit
|
|
|
6
6
|
|
|
7
7
|
| Model | Class | Gases | Reference |
|
|
8
8
|
|-------|-------|-------|-----------|
|
|
9
|
-
| [Sutherland's Law](#sutherland) | `Sutherland` | Air, N2, Custom | [
|
|
10
|
-
| [Sutherland's Law with LTC](#sutherland_ltc) | `SutherlandLowTemp` | Air | [
|
|
9
|
+
| [Sutherland's Law](#sutherland) | `Sutherland` | Air, N2, Custom | [^sutherland1893] |
|
|
10
|
+
| [Sutherland's Law with LTC](#sutherland_ltc) | `SutherlandLowTemp` | Air | [^mack1969] |
|
|
11
11
|
| [Sutherland's Law with LTC (Blended)](#sutherland_blended) | `SutherlandBlended` | Air | - |
|
|
12
|
-
| [Keyes](#keyes) | `Keyes` | Air, N2 | [
|
|
13
|
-
| [Power Law](#power-law) | `PowerLaw` | Air | [
|
|
12
|
+
| [Keyes](#keyes) | `Keyes` | Air, N2 | [^keyes1951] |
|
|
13
|
+
| [Power Law](#power-law) | `PowerLaw` | Air | [^white2006] |
|
|
14
14
|
|
|
15
15
|
## Sutherland's Law {#sutherland}
|
|
16
16
|
|
|
17
|
-
The standard Sutherland formula [
|
|
17
|
+
The standard Sutherland formula [^sutherland1893]:
|
|
18
18
|
|
|
19
19
|
\[
|
|
20
20
|
\mu(T) = \mu_{\text{ref}} \left( \frac{T}{T_{\text{ref}}} \right)^{3/2} \frac{T_{\text{ref}} + S}{T + S}
|
|
@@ -35,7 +35,7 @@ Valid for moderate temperatures (~100 K to ~1900 K for air).
|
|
|
35
35
|
|
|
36
36
|
## Sutherland's Law with Low-Temperature Correction (LTC) {#sutherland_ltc}
|
|
37
37
|
|
|
38
|
-
Prevents unphysical viscosity at very low temperatures where Sutherland's law breaks down [
|
|
38
|
+
Prevents unphysical viscosity at very low temperatures where Sutherland's law breaks down [^mack1969]:
|
|
39
39
|
|
|
40
40
|
\[
|
|
41
41
|
\mu(T) = \begin{cases}
|
|
@@ -106,7 +106,7 @@ The temperature derivative in the polynomial region (\(T_1 \leq T \leq T_2\)) is
|
|
|
106
106
|
|
|
107
107
|
## Keyes Model {#keyes}
|
|
108
108
|
|
|
109
|
-
High-temperature viscosity law [
|
|
109
|
+
High-temperature viscosity law [^keyes1951] [^priebe2012] [^roy2006]:
|
|
110
110
|
|
|
111
111
|
\[
|
|
112
112
|
\mu(T) = \frac{a_0 \sqrt{T}}{1 + a_1 \cdot 10^{-a_2/T} / T}
|
|
@@ -129,7 +129,7 @@ where \(D = 1 + a_1 \cdot 10^{-a_2/T} / T\) and \(D' = a_1 \cdot 10^{-a_2/T} (a_
|
|
|
129
129
|
|
|
130
130
|
## Power Law {#power-law}
|
|
131
131
|
|
|
132
|
-
Simple power-law model [
|
|
132
|
+
Simple power-law model [^white2006]:
|
|
133
133
|
|
|
134
134
|
\[
|
|
135
135
|
\mu(T) = \mu_{\text{ref}} \left( \frac{T}{T_{\text{ref}}} \right)^m
|
|
@@ -145,4 +145,28 @@ Useful for simplified analyses or specific temperature ranges. Typical exponent
|
|
|
145
145
|
|
|
146
146
|
## References
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
[^sutherland1893]: Sutherland, William. "The viscosity of gases and molecular
|
|
149
|
+
force." *The London, Edinburgh, and Dublin Philosophical Magazine and
|
|
150
|
+
Journal of Science* 36(223), 507-531, 1893.
|
|
151
|
+
[doi:10.1080/14786449308620508](https://doi.org/10.1080/14786449308620508).
|
|
152
|
+
|
|
153
|
+
[^mack1969]: Mack, Leslie M. *Boundary-Layer Stability Theory*. Jet Propulsion
|
|
154
|
+
Laboratory, Document ID 19900029782, 1969.
|
|
155
|
+
[View report](https://ntrs.nasa.gov/citations/19900029782).
|
|
156
|
+
|
|
157
|
+
[^keyes1951]: Keyes, Frederick G. "A Summary of Viscosity and Heat Conduction
|
|
158
|
+
Data for He, A, H2, O2, N2, CO, CO2, H2O and Air." *Transactions of the
|
|
159
|
+
American Society of Mechanical Engineers* 73, 589-596, 1951.
|
|
160
|
+
[doi:10.1115/1.4016335](https://doi.org/10.1115/1.4016335).
|
|
161
|
+
|
|
162
|
+
[^priebe2012]: Priebe, Stephan and Martin, M. Pino. "Low-frequency unsteadiness
|
|
163
|
+
in shock wave-turbulent boundary layer interaction." *Journal of Fluid
|
|
164
|
+
Mechanics* 699, 1-49, 2012.
|
|
165
|
+
[doi:10.1017/jfm.2011.560](https://doi.org/10.1017/jfm.2011.560).
|
|
166
|
+
|
|
167
|
+
[^roy2006]: Roy, Christopher J. and Blottner, Frederick G. "Review and
|
|
168
|
+
assessment of turbulence models for hypersonic flows." *Progress in
|
|
169
|
+
Aerospace Sciences* 42(7-8), 469-530, 2006.
|
|
170
|
+
[doi:10.1016/j.paerosci.2006.12.002](https://doi.org/10.1016/j.paerosci.2006.12.002).
|
|
171
|
+
|
|
172
|
+
[^white2006]: White, Frank M. *Viscous Fluid Flow*. 3rd ed., McGraw-Hill, 2006.
|
|
@@ -18,6 +18,22 @@ flow-state init --force # overwrite existing
|
|
|
18
18
|
|
|
19
19
|
Compute flow state from direct options or a config file.
|
|
20
20
|
|
|
21
|
+
### `flow-state recover`
|
|
22
|
+
|
|
23
|
+
Reconstruct `flow_conditions.json` from root attributes stored in an HDF5
|
|
24
|
+
base-flow file:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
flow-state recover base_flow.hdf5
|
|
28
|
+
flow-state recover base_flow.hdf5 --output recovered_conditions.json --quiet
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The command recognizes current attribute names such as `mach`, `re1`,
|
|
32
|
+
`temp_inf`, `pres_inf`, `temp_stag`, and `pres_stag`, as well as legacy
|
|
33
|
+
short names embedded in descriptive attributes such as `m`, `p_inf`, `t_inf`,
|
|
34
|
+
`p0`, and `t0`. It reports an error listing the recognized metadata when the
|
|
35
|
+
file does not contain a complete solver input combination.
|
|
36
|
+
|
|
21
37
|
## Direct Options
|
|
22
38
|
|
|
23
39
|
For quick one-off calculations:
|
|
@@ -12,7 +12,7 @@ license = "GPL-3.0-or-later"
|
|
|
12
12
|
license-files = ["LICENSE"]
|
|
13
13
|
requires-python = ">=3.11"
|
|
14
14
|
authors = [
|
|
15
|
-
{name = "Christoph Hader", email = "
|
|
15
|
+
{name = "Christoph Hader", email = "christoph.hader@gmail.com"},
|
|
16
16
|
]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Development Status :: 3 - Alpha",
|
|
@@ -25,6 +25,7 @@ classifiers = [
|
|
|
25
25
|
keywords = ["compressible-flow", "aerodynamics", "gas-dynamics", "cfd"]
|
|
26
26
|
|
|
27
27
|
dependencies = [
|
|
28
|
+
"h5py>=3.10.0",
|
|
28
29
|
"typer>=0.9.0",
|
|
29
30
|
"tomli-w>=1.0.0",
|
|
30
31
|
]
|
|
@@ -34,13 +35,12 @@ dev = [
|
|
|
34
35
|
"pytest>=7.0",
|
|
35
36
|
"pytest-cov>=4.0",
|
|
36
37
|
"ruff>=0.1.0",
|
|
37
|
-
"
|
|
38
|
+
"zensical",
|
|
38
39
|
"mkdocstrings[python]>=0.24",
|
|
39
|
-
"mkdocs-bibtex>=2.0",
|
|
40
40
|
]
|
|
41
41
|
|
|
42
42
|
[project.scripts]
|
|
43
|
-
flow-state = "flow_state.cli:
|
|
43
|
+
flow-state = "flow_state.cli.app:app"
|
|
44
44
|
|
|
45
45
|
[project.urls]
|
|
46
46
|
Homepage = "https://github.com/uahypersonics/flow-state"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Typer application for the flow-state command-line interface."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Annotated
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from flow_state.cli.callbacks import configure_logging, version_callback
|
|
10
|
+
from flow_state.cli.cmd_init import cmd_init
|
|
11
|
+
from flow_state.cli.cmd_recover import cmd_recover
|
|
12
|
+
from flow_state.cli.cmd_solve import cmd_solve
|
|
13
|
+
|
|
14
|
+
app = typer.Typer(
|
|
15
|
+
name="flow-state",
|
|
16
|
+
help="Compute flow states.",
|
|
17
|
+
add_completion=False,
|
|
18
|
+
no_args_is_help=True,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@app.callback()
|
|
23
|
+
def main(
|
|
24
|
+
version: Annotated[
|
|
25
|
+
bool | None,
|
|
26
|
+
typer.Option(
|
|
27
|
+
"--version",
|
|
28
|
+
"-V",
|
|
29
|
+
help="Show version and exit.",
|
|
30
|
+
callback=version_callback,
|
|
31
|
+
is_eager=True,
|
|
32
|
+
),
|
|
33
|
+
] = None,
|
|
34
|
+
debug: Annotated[
|
|
35
|
+
bool,
|
|
36
|
+
typer.Option("--debug", "-v", help="Enable verbose/debug output."),
|
|
37
|
+
] = False,
|
|
38
|
+
) -> None:
|
|
39
|
+
"""Compute flow states from freestream, stagnation, or atmospheric inputs."""
|
|
40
|
+
|
|
41
|
+
del version
|
|
42
|
+
configure_logging(debug)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
app.command(name="init", rich_help_panel="Workflow")(cmd_init)
|
|
46
|
+
app.command(name="recover", rich_help_panel="Workflow")(cmd_recover)
|
|
47
|
+
app.command(name="solve", rich_help_panel="Calculators")(cmd_solve)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if __name__ == "__main__":
|
|
51
|
+
app()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""Shared callbacks for the flow-state command-line interface."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from flow_state import __version__
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def configure_logging(debug: bool) -> None:
|
|
13
|
+
"""Configure console logging for CLI commands."""
|
|
14
|
+
|
|
15
|
+
level = logging.DEBUG if debug else logging.INFO
|
|
16
|
+
logging.basicConfig(level=level, format="%(levelname)-8s %(message)s")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def version_callback(value: bool) -> None:
|
|
20
|
+
"""Print the installed package version and exit."""
|
|
21
|
+
|
|
22
|
+
if value:
|
|
23
|
+
typer.echo(f"flow-state version {__version__}")
|
|
24
|
+
raise typer.Exit()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Generate a starter flow-state configuration."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Annotated
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
|
|
10
|
+
from flow_state.cli.constants import DEFAULT_CONFIG
|
|
11
|
+
from flow_state.cli.templates import CONFIG_TEMPLATE
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def cmd_init(
|
|
15
|
+
output: Annotated[
|
|
16
|
+
Path,
|
|
17
|
+
typer.Option("--output", "-o", help="Output config file path"),
|
|
18
|
+
] = Path(DEFAULT_CONFIG),
|
|
19
|
+
force: Annotated[
|
|
20
|
+
bool,
|
|
21
|
+
typer.Option("--force", "-f", help="Overwrite existing file"),
|
|
22
|
+
] = False,
|
|
23
|
+
) -> None:
|
|
24
|
+
"""Generate a documented template configuration file."""
|
|
25
|
+
|
|
26
|
+
if output.exists() and not force:
|
|
27
|
+
typer.echo(f"Error: {output} already exists. Use --force to overwrite", err=True)
|
|
28
|
+
raise typer.Exit(1)
|
|
29
|
+
|
|
30
|
+
output.write_text(CONFIG_TEMPLATE)
|
|
31
|
+
typer.echo(f"Created {output}")
|
|
32
|
+
typer.echo("Edit the file, then run: flow-state solve")
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Recover and write flow conditions from HDF5 metadata."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Annotated
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
|
|
10
|
+
from flow_state.cli.constants import DEFAULT_OUTPUT
|
|
11
|
+
from flow_state.io import write_json
|
|
12
|
+
from flow_state.recover import recover_from_hdf5
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def cmd_recover(
|
|
16
|
+
input_file: Annotated[
|
|
17
|
+
Path,
|
|
18
|
+
typer.Argument(help="HDF5 base-flow file containing flow-condition attributes."),
|
|
19
|
+
],
|
|
20
|
+
output: Annotated[
|
|
21
|
+
Path,
|
|
22
|
+
typer.Option(
|
|
23
|
+
"--output",
|
|
24
|
+
"-o",
|
|
25
|
+
help="Output JSON file.",
|
|
26
|
+
),
|
|
27
|
+
] = Path(DEFAULT_OUTPUT),
|
|
28
|
+
quiet: Annotated[
|
|
29
|
+
bool,
|
|
30
|
+
typer.Option("--quiet", "-q", help="Suppress summary output."),
|
|
31
|
+
] = False,
|
|
32
|
+
) -> None:
|
|
33
|
+
"""Recover flow_conditions.json from HDF5 root attributes."""
|
|
34
|
+
try:
|
|
35
|
+
state = recover_from_hdf5(input_file)
|
|
36
|
+
except (FileNotFoundError, OSError, TypeError, ValueError) as error:
|
|
37
|
+
typer.echo(f"Error recovering flow state: {error}", err=True)
|
|
38
|
+
raise typer.Exit(1) from error
|
|
39
|
+
|
|
40
|
+
write_json(state, output)
|
|
41
|
+
typer.echo(f"Wrote {output}")
|
|
42
|
+
if not quiet:
|
|
43
|
+
typer.echo("")
|
|
44
|
+
typer.echo(str(state))
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"""Compute and write a flow state from CLI or TOML inputs."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Annotated
|
|
8
|
+
|
|
9
|
+
import typer
|
|
10
|
+
|
|
11
|
+
from flow_state.cli.constants import DEFAULT_CONFIG, DEFAULT_OUTPUT
|
|
12
|
+
from flow_state.io import read_config, write_flow_conditions_dat, write_json
|
|
13
|
+
from flow_state.solvers import solve
|
|
14
|
+
|
|
15
|
+
logger = logging.getLogger(__name__)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def cmd_solve(
|
|
19
|
+
mach: Annotated[float | None, typer.Option("--mach", "-m", help="Mach number")] = None,
|
|
20
|
+
pres_stag: Annotated[
|
|
21
|
+
float | None,
|
|
22
|
+
typer.Option("--pres-stag", help="Stagnation pressure (default: Pa)"),
|
|
23
|
+
] = None,
|
|
24
|
+
pres_stag_unit: Annotated[
|
|
25
|
+
str | None,
|
|
26
|
+
typer.Option("--pres-stag-unit", help="Stagnation pressure unit (Pa, psi, atm, bar)"),
|
|
27
|
+
] = None,
|
|
28
|
+
temp_stag: Annotated[
|
|
29
|
+
float | None,
|
|
30
|
+
typer.Option("--temp-stag", help="Stagnation temperature (K)"),
|
|
31
|
+
] = None,
|
|
32
|
+
altitude: Annotated[
|
|
33
|
+
float | None,
|
|
34
|
+
typer.Option("--altitude", "-a", help="Altitude (default: m)"),
|
|
35
|
+
] = None,
|
|
36
|
+
altitude_unit: Annotated[
|
|
37
|
+
str | None,
|
|
38
|
+
typer.Option("--altitude-unit", help="Altitude unit (m, ft, km)"),
|
|
39
|
+
] = None,
|
|
40
|
+
pres: Annotated[
|
|
41
|
+
float | None,
|
|
42
|
+
typer.Option("--pres", help="Static pressure (default: Pa)"),
|
|
43
|
+
] = None,
|
|
44
|
+
pres_unit: Annotated[
|
|
45
|
+
str | None,
|
|
46
|
+
typer.Option("--pres-unit", help="Static pressure unit (Pa, psi, atm, bar)"),
|
|
47
|
+
] = None,
|
|
48
|
+
temp: Annotated[
|
|
49
|
+
float | None,
|
|
50
|
+
typer.Option("--temp", help="Static temperature (default: K)"),
|
|
51
|
+
] = None,
|
|
52
|
+
temp_unit: Annotated[
|
|
53
|
+
str | None,
|
|
54
|
+
typer.Option("--temp-unit", help="Static temperature unit (K, C, F, R)"),
|
|
55
|
+
] = None,
|
|
56
|
+
re1: Annotated[
|
|
57
|
+
float | None,
|
|
58
|
+
typer.Option("--re1", help="Unit Reynolds number [1/m]"),
|
|
59
|
+
] = None,
|
|
60
|
+
gas: Annotated[str | None, typer.Option("--gas", help="Gas type (air, n2)")] = None,
|
|
61
|
+
atm: Annotated[
|
|
62
|
+
str | None,
|
|
63
|
+
typer.Option("--atm", help="Atmosphere model (ussa76, cira86)"),
|
|
64
|
+
] = None,
|
|
65
|
+
lref: Annotated[
|
|
66
|
+
float | None,
|
|
67
|
+
typer.Option("--lref", help="Reference length (m)"),
|
|
68
|
+
] = None,
|
|
69
|
+
config: Annotated[
|
|
70
|
+
Path | None,
|
|
71
|
+
typer.Option(
|
|
72
|
+
"--config",
|
|
73
|
+
"-c",
|
|
74
|
+
help="Input config file (TOML). Ignored if direct options provided.",
|
|
75
|
+
),
|
|
76
|
+
] = None,
|
|
77
|
+
output: Annotated[
|
|
78
|
+
Path,
|
|
79
|
+
typer.Option(
|
|
80
|
+
"--output",
|
|
81
|
+
"-o",
|
|
82
|
+
help="Output file (JSON). Defaults to flow_conditions.json in the current directory.",
|
|
83
|
+
),
|
|
84
|
+
] = Path(DEFAULT_OUTPUT),
|
|
85
|
+
dat: Annotated[
|
|
86
|
+
bool,
|
|
87
|
+
typer.Option("--dat", help="Write legacy .dat file (flow_conditions.dat)."),
|
|
88
|
+
] = False,
|
|
89
|
+
quiet: Annotated[
|
|
90
|
+
bool,
|
|
91
|
+
typer.Option("--quiet", "-q", help="Suppress summary output."),
|
|
92
|
+
] = False,
|
|
93
|
+
) -> None:
|
|
94
|
+
"""Compute a flow state from direct options or a configuration file."""
|
|
95
|
+
|
|
96
|
+
has_direct_options = any([mach, pres_stag, temp_stag, altitude, pres, temp, re1])
|
|
97
|
+
|
|
98
|
+
if has_direct_options:
|
|
99
|
+
solve_kwargs: dict[str, object] = {}
|
|
100
|
+
if mach is not None:
|
|
101
|
+
solve_kwargs["mach"] = mach
|
|
102
|
+
if pres_stag is not None:
|
|
103
|
+
solve_kwargs["pres_stag"] = (pres_stag, pres_stag_unit) if pres_stag_unit else pres_stag
|
|
104
|
+
if temp_stag is not None:
|
|
105
|
+
solve_kwargs["temp_stag"] = temp_stag
|
|
106
|
+
if altitude is not None:
|
|
107
|
+
solve_kwargs["altitude"] = (altitude, altitude_unit) if altitude_unit else altitude
|
|
108
|
+
if pres is not None:
|
|
109
|
+
solve_kwargs["pres"] = (pres, pres_unit) if pres_unit else pres
|
|
110
|
+
if temp is not None:
|
|
111
|
+
solve_kwargs["temp"] = (temp, temp_unit) if temp_unit else temp
|
|
112
|
+
if re1 is not None:
|
|
113
|
+
solve_kwargs["re1"] = re1
|
|
114
|
+
if gas is not None:
|
|
115
|
+
solve_kwargs["gas"] = gas
|
|
116
|
+
if atm is not None:
|
|
117
|
+
solve_kwargs["atm"] = atm
|
|
118
|
+
if lref is not None:
|
|
119
|
+
solve_kwargs["lref"] = lref
|
|
120
|
+
else:
|
|
121
|
+
config_path = config if config else Path(DEFAULT_CONFIG)
|
|
122
|
+
if not config_path.exists():
|
|
123
|
+
typer.echo(f"Error: {config_path} not found.", err=True)
|
|
124
|
+
typer.echo(
|
|
125
|
+
"Provide direct options (--mach, etc.) or run 'flow-state init' to create a config.",
|
|
126
|
+
err=True,
|
|
127
|
+
)
|
|
128
|
+
raise typer.Exit(1)
|
|
129
|
+
|
|
130
|
+
try:
|
|
131
|
+
solve_kwargs = read_config(config_path)
|
|
132
|
+
except Exception as error:
|
|
133
|
+
typer.echo(f"Error parsing {config_path}: {error}", err=True)
|
|
134
|
+
raise typer.Exit(1) from error
|
|
135
|
+
|
|
136
|
+
try:
|
|
137
|
+
state = solve(**solve_kwargs)
|
|
138
|
+
except (ValueError, TypeError) as error:
|
|
139
|
+
typer.echo(f"Error computing flow state: {error}", err=True)
|
|
140
|
+
raise typer.Exit(1) from error
|
|
141
|
+
|
|
142
|
+
if state.provenance:
|
|
143
|
+
for key, value in state.provenance.items():
|
|
144
|
+
logger.debug("%s: %s", key, value)
|
|
145
|
+
logger.debug("gas_model: %s", state.gas_model)
|
|
146
|
+
logger.debug("transport_model: %s", state.transport_model)
|
|
147
|
+
|
|
148
|
+
write_json(state, output)
|
|
149
|
+
typer.echo(f"Wrote {output}")
|
|
150
|
+
|
|
151
|
+
if dat:
|
|
152
|
+
dat_path = Path("flow_conditions.dat")
|
|
153
|
+
write_flow_conditions_dat(state, dat_path)
|
|
154
|
+
typer.echo(f"Wrote {dat_path}")
|
|
155
|
+
|
|
156
|
+
if not quiet:
|
|
157
|
+
typer.echo("")
|
|
158
|
+
typer.echo(str(state))
|