cffview 0.2.0__tar.gz → 0.2.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.
- {cffview-0.2.0/src/cffview.egg-info → cffview-0.2.2}/PKG-INFO +18 -36
- {cffview-0.2.0 → cffview-0.2.2}/README.md +15 -33
- {cffview-0.2.0 → cffview-0.2.2}/pyproject.toml +4 -8
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview/main.py +115 -72
- {cffview-0.2.0 → cffview-0.2.2/src/cffview.egg-info}/PKG-INFO +18 -36
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview.egg-info/requires.txt +0 -1
- {cffview-0.2.0 → cffview-0.2.2}/LICENSE +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/setup.cfg +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview/boundary.py +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview/utils.py +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview.egg-info/SOURCES.txt +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview.egg-info/dependency_links.txt +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview.egg-info/entry_points.txt +0 -0
- {cffview-0.2.0 → cffview-0.2.2}/src/cffview.egg-info/top_level.txt +0 -0
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cffview
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python CLI tool to inspect Ansys Fluent .cas.h5/.msh.h5 files without opening Fluent
|
|
5
5
|
Author-email: preamer <1524477126@qq.com>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
7
7
|
Project-URL: Repository, https://github.com/preamer/cffview
|
|
8
8
|
Keywords: fluent,cfd,ansys,hdf5,mesh
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
14
15
|
Classifier: Topic :: Scientific/Engineering
|
|
15
16
|
Classifier: Environment :: Console
|
|
16
|
-
Requires-Python: >=3.
|
|
17
|
+
Requires-Python: >=3.10
|
|
17
18
|
Description-Content-Type: text/markdown
|
|
18
19
|
License-File: LICENSE
|
|
19
20
|
Requires-Dist: h5py>=3.16.0
|
|
20
21
|
Requires-Dist: pyvista>=0.48.4
|
|
21
22
|
Requires-Dist: sexpdata>=1.0.2
|
|
22
|
-
Requires-Dist: tqdm>=4.68.3
|
|
23
23
|
Dynamic: license-file
|
|
24
24
|
|
|
25
|
+
[](https://pypi.org/project/cffview/)
|
|
26
|
+
[](https://pypi.org/project/cffview)
|
|
27
|
+
[](https://github.com/preamer/cffview/actions/workflows/build_wheels.yml)
|
|
28
|
+
|
|
25
29
|
[中文](README.zh.md)
|
|
26
30
|
|
|
27
31
|
# cffview
|
|
@@ -35,11 +39,13 @@ A command-line tool for inspecting Ansys Fluent `.cas.h5` / `.msh.h5` files **wi
|
|
|
35
39
|
|
|
36
40
|
## Installation
|
|
37
41
|
|
|
42
|
+
### PyPI
|
|
43
|
+
|
|
38
44
|
```bash
|
|
39
45
|
pip install cffview
|
|
40
46
|
```
|
|
41
47
|
|
|
42
|
-
###
|
|
48
|
+
### From source
|
|
43
49
|
|
|
44
50
|
```bash
|
|
45
51
|
git clone https://github.com/preamer/cffview.git
|
|
@@ -59,7 +65,7 @@ cffview <file> [options]
|
|
|
59
65
|
|
|
60
66
|
| Option | Description |
|
|
61
67
|
|---|---|
|
|
62
|
-
|
|
|
68
|
+
| `--version` | Print the Fluent version of file |
|
|
63
69
|
| `--extract` | Dump raw Scheme settings to `general.scm` and `boundary.scm` |
|
|
64
70
|
| `--showmesh` | Visualise the mesh interactively with PyVista |
|
|
65
71
|
| `--solver` | Solver type, time, dimension, precision, turbulence model, energy, radiation, gravity |
|
|
@@ -71,6 +77,8 @@ cffview <file> [options]
|
|
|
71
77
|
| `--plotsets` | Plot sets |
|
|
72
78
|
| `--monitorsets` | Monitor sets |
|
|
73
79
|
| `--iter` | Iteration / time-step settings |
|
|
80
|
+
| `--contours` | Graphics contours settings |
|
|
81
|
+
| `--vectors` | Graphics vectors settings |
|
|
74
82
|
| `--save` | Save the output to `<file>.json` |
|
|
75
83
|
|
|
76
84
|
Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`, etc.) apply to `.cas.h5` files only.
|
|
@@ -78,17 +86,17 @@ Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`,
|
|
|
78
86
|
### Examples
|
|
79
87
|
|
|
80
88
|
```bash
|
|
89
|
+
# Show all settings and save to JSON
|
|
90
|
+
cffview case.cas.h5 --save
|
|
91
|
+
|
|
81
92
|
# Show solver configuration and boundary conditions
|
|
82
93
|
cffview case.cas.h5 --solver --bd
|
|
83
94
|
|
|
84
|
-
#
|
|
85
|
-
cffview case.cas.h5 --solver --mat --bd --ne --disc --rd --iter --save
|
|
86
|
-
|
|
87
|
-
# Visualise the mesh (.cas.h5 and .msh.h5 both supported)
|
|
95
|
+
# Visualise the mesh
|
|
88
96
|
cffview case.cas.h5 --showmesh
|
|
89
97
|
cffview mesh.msh.h5 --showmesh
|
|
90
98
|
|
|
91
|
-
# Check the Fluent version
|
|
99
|
+
# Check the Fluent version of file
|
|
92
100
|
cffview case.cas.h5 --version
|
|
93
101
|
|
|
94
102
|
# Extract raw Scheme strings for manual inspection
|
|
@@ -97,32 +105,6 @@ cffview case.cas.h5 --extract
|
|
|
97
105
|
|
|
98
106
|
---
|
|
99
107
|
|
|
100
|
-
## File Format Support
|
|
101
|
-
|
|
102
|
-
| Feature | `.cas.h5` | `.msh.h5` |
|
|
103
|
-
|---|---|---|
|
|
104
|
-
| Case settings (`--solver`, `--mat`, `--bd`, …) | ✅ | — |
|
|
105
|
-
| Mesh visualisation (3D) | ✅ | ✅ |
|
|
106
|
-
| Mesh visualisation (2D) | ✅ | ✅ |
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Supported Settings
|
|
111
|
-
|
|
112
|
-
| Flag | Contents |
|
|
113
|
-
|---|---|
|
|
114
|
-
| `--solver` | Algorithm (PBNS/DBNS), steady/transient, 2D/3D, single/double precision, turbulence model, energy, radiation, gravity |
|
|
115
|
-
| `--mat` | Fluid/solid materials with properties and evaluation methods |
|
|
116
|
-
| `--bd` | Velocity-inlet, pressure-outlet, mass-flow-inlet/outlet, wall (thermal & motion BC), porous-jump, interior, symmetry, … |
|
|
117
|
-
| `--ne` | Named expressions defined in the case |
|
|
118
|
-
| `--disc` | Per-equation scheme (Second Order Upwind, QUICK, …) and under-relaxation / pseudo-transient factors |
|
|
119
|
-
| `--rd` | Report definitions (volume, surface, flux) with field, zones, and per-zone flag |
|
|
120
|
-
| `--plotsets` | Plot set configurations |
|
|
121
|
-
| `--monitorsets` | Monitor set configurations |
|
|
122
|
-
| `--iter` | Iteration count (steady) or time-step size, number of steps, max inner iterations (transient) |
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
108
|
## License
|
|
127
109
|
|
|
128
110
|
[BSD-3-Clause](LICENSE)
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](https://pypi.org/project/cffview/)
|
|
2
|
+
[](https://pypi.org/project/cffview)
|
|
3
|
+
[](https://github.com/preamer/cffview/actions/workflows/build_wheels.yml)
|
|
4
|
+
|
|
1
5
|
[中文](README.zh.md)
|
|
2
6
|
|
|
3
7
|
# cffview
|
|
@@ -11,11 +15,13 @@ A command-line tool for inspecting Ansys Fluent `.cas.h5` / `.msh.h5` files **wi
|
|
|
11
15
|
|
|
12
16
|
## Installation
|
|
13
17
|
|
|
18
|
+
### PyPI
|
|
19
|
+
|
|
14
20
|
```bash
|
|
15
21
|
pip install cffview
|
|
16
22
|
```
|
|
17
23
|
|
|
18
|
-
###
|
|
24
|
+
### From source
|
|
19
25
|
|
|
20
26
|
```bash
|
|
21
27
|
git clone https://github.com/preamer/cffview.git
|
|
@@ -35,7 +41,7 @@ cffview <file> [options]
|
|
|
35
41
|
|
|
36
42
|
| Option | Description |
|
|
37
43
|
|---|---|
|
|
38
|
-
|
|
|
44
|
+
| `--version` | Print the Fluent version of file |
|
|
39
45
|
| `--extract` | Dump raw Scheme settings to `general.scm` and `boundary.scm` |
|
|
40
46
|
| `--showmesh` | Visualise the mesh interactively with PyVista |
|
|
41
47
|
| `--solver` | Solver type, time, dimension, precision, turbulence model, energy, radiation, gravity |
|
|
@@ -47,6 +53,8 @@ cffview <file> [options]
|
|
|
47
53
|
| `--plotsets` | Plot sets |
|
|
48
54
|
| `--monitorsets` | Monitor sets |
|
|
49
55
|
| `--iter` | Iteration / time-step settings |
|
|
56
|
+
| `--contours` | Graphics contours settings |
|
|
57
|
+
| `--vectors` | Graphics vectors settings |
|
|
50
58
|
| `--save` | Save the output to `<file>.json` |
|
|
51
59
|
|
|
52
60
|
Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`, etc.) apply to `.cas.h5` files only.
|
|
@@ -54,17 +62,17 @@ Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`,
|
|
|
54
62
|
### Examples
|
|
55
63
|
|
|
56
64
|
```bash
|
|
65
|
+
# Show all settings and save to JSON
|
|
66
|
+
cffview case.cas.h5 --save
|
|
67
|
+
|
|
57
68
|
# Show solver configuration and boundary conditions
|
|
58
69
|
cffview case.cas.h5 --solver --bd
|
|
59
70
|
|
|
60
|
-
#
|
|
61
|
-
cffview case.cas.h5 --solver --mat --bd --ne --disc --rd --iter --save
|
|
62
|
-
|
|
63
|
-
# Visualise the mesh (.cas.h5 and .msh.h5 both supported)
|
|
71
|
+
# Visualise the mesh
|
|
64
72
|
cffview case.cas.h5 --showmesh
|
|
65
73
|
cffview mesh.msh.h5 --showmesh
|
|
66
74
|
|
|
67
|
-
# Check the Fluent version
|
|
75
|
+
# Check the Fluent version of file
|
|
68
76
|
cffview case.cas.h5 --version
|
|
69
77
|
|
|
70
78
|
# Extract raw Scheme strings for manual inspection
|
|
@@ -73,32 +81,6 @@ cffview case.cas.h5 --extract
|
|
|
73
81
|
|
|
74
82
|
---
|
|
75
83
|
|
|
76
|
-
## File Format Support
|
|
77
|
-
|
|
78
|
-
| Feature | `.cas.h5` | `.msh.h5` |
|
|
79
|
-
|---|---|---|
|
|
80
|
-
| Case settings (`--solver`, `--mat`, `--bd`, …) | ✅ | — |
|
|
81
|
-
| Mesh visualisation (3D) | ✅ | ✅ |
|
|
82
|
-
| Mesh visualisation (2D) | ✅ | ✅ |
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Supported Settings
|
|
87
|
-
|
|
88
|
-
| Flag | Contents |
|
|
89
|
-
|---|---|
|
|
90
|
-
| `--solver` | Algorithm (PBNS/DBNS), steady/transient, 2D/3D, single/double precision, turbulence model, energy, radiation, gravity |
|
|
91
|
-
| `--mat` | Fluid/solid materials with properties and evaluation methods |
|
|
92
|
-
| `--bd` | Velocity-inlet, pressure-outlet, mass-flow-inlet/outlet, wall (thermal & motion BC), porous-jump, interior, symmetry, … |
|
|
93
|
-
| `--ne` | Named expressions defined in the case |
|
|
94
|
-
| `--disc` | Per-equation scheme (Second Order Upwind, QUICK, …) and under-relaxation / pseudo-transient factors |
|
|
95
|
-
| `--rd` | Report definitions (volume, surface, flux) with field, zones, and per-zone flag |
|
|
96
|
-
| `--plotsets` | Plot set configurations |
|
|
97
|
-
| `--monitorsets` | Monitor set configurations |
|
|
98
|
-
| `--iter` | Iteration count (steady) or time-step size, number of steps, max inner iterations (transient) |
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
84
|
## License
|
|
103
85
|
|
|
104
86
|
[BSD-3-Clause](LICENSE)
|
|
@@ -4,15 +4,16 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cffview"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "A Python CLI tool to inspect Ansys Fluent .cas.h5/.msh.h5 files without opening Fluent"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
11
|
authors = [{ name = "preamer", email = "1524477126@qq.com" }]
|
|
12
12
|
keywords = ["fluent", "cfd", "ansys", "hdf5", "mesh"]
|
|
13
13
|
license = "BSD-3-Clause"
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
16
17
|
"Programming Language :: Python :: 3.11",
|
|
17
18
|
"Programming Language :: Python :: 3.12",
|
|
18
19
|
"Programming Language :: Python :: 3.13",
|
|
@@ -20,12 +21,7 @@ classifiers = [
|
|
|
20
21
|
"Topic :: Scientific/Engineering",
|
|
21
22
|
"Environment :: Console",
|
|
22
23
|
]
|
|
23
|
-
dependencies = [
|
|
24
|
-
"h5py>=3.16.0",
|
|
25
|
-
"pyvista>=0.48.4",
|
|
26
|
-
"sexpdata>=1.0.2",
|
|
27
|
-
"tqdm>=4.68.3",
|
|
28
|
-
]
|
|
24
|
+
dependencies = ["h5py>=3.16.0", "pyvista>=0.48.4", "sexpdata>=1.0.2"]
|
|
29
25
|
|
|
30
26
|
[project.scripts]
|
|
31
27
|
cffview = "cffview.main:main"
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
def print_version(file_path: str) -> str:
|
|
2
5
|
"""Get the version of the .h5 file
|
|
3
6
|
|
|
@@ -17,7 +20,11 @@ def print_version(file_path: str) -> str:
|
|
|
17
20
|
print(f['/settings/Version'][0].decode())
|
|
18
21
|
|
|
19
22
|
|
|
20
|
-
def read_case(file_path: str, **kwargs) -> dict[
|
|
23
|
+
def read_case(file_path: str, **kwargs) -> dict[
|
|
24
|
+
Literal['solver', 'materials', 'boundary', 'named-expressions',
|
|
25
|
+
'disc-scheme', 'report-definitions', 'plotsets', 'monitorsets', 'iter'],
|
|
26
|
+
dict[str]
|
|
27
|
+
]:
|
|
21
28
|
"""Read the cas.h5 file
|
|
22
29
|
|
|
23
30
|
Parameters
|
|
@@ -27,7 +34,7 @@ def read_case(file_path: str, **kwargs) -> dict[str]:
|
|
|
27
34
|
|
|
28
35
|
Returns
|
|
29
36
|
-------
|
|
30
|
-
dict[str]
|
|
37
|
+
dict[Literal[...], dict[str]]
|
|
31
38
|
A dictionary containing the case settings
|
|
32
39
|
"""
|
|
33
40
|
import re
|
|
@@ -325,6 +332,76 @@ def read_case(file_path: str, **kwargs) -> dict[str]:
|
|
|
325
332
|
general_info
|
|
326
333
|
).group(1)
|
|
327
334
|
|
|
335
|
+
if kwargs['contours']:
|
|
336
|
+
import sexpdata
|
|
337
|
+
|
|
338
|
+
data['contours'] = {}
|
|
339
|
+
contours = re.search(
|
|
340
|
+
r'(\(graphics/contours.*)',
|
|
341
|
+
general_info,
|
|
342
|
+
re.M
|
|
343
|
+
).group(1)
|
|
344
|
+
contours: list = sexpdata.loads(contours, true=None)[1]
|
|
345
|
+
for contour in contours:
|
|
346
|
+
contour_dict = {
|
|
347
|
+
str(property_[0]): str(property_[2])
|
|
348
|
+
for property_ in contour
|
|
349
|
+
if str(property_[0]) not in [
|
|
350
|
+
'locations', 'location-ids', 'options',
|
|
351
|
+
'range-options', 'range-option', 'surfaces-list',
|
|
352
|
+
'color-map', 'colorings', 'annotations-list',
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
contour_dict['surface-list'] = contour[2][1]
|
|
356
|
+
contour_dict['range-options'] = {
|
|
357
|
+
str(range_option[0]): str(range_option[2])
|
|
358
|
+
for range_option in contour[6][1:]
|
|
359
|
+
}
|
|
360
|
+
contour_dict['color-map'] = {
|
|
361
|
+
str(color_map[0]): str(color_map[2])
|
|
362
|
+
for color_map in contour[-7][1:]
|
|
363
|
+
}
|
|
364
|
+
data['contours'][contour_dict['name']] = contour_dict
|
|
365
|
+
|
|
366
|
+
if kwargs['vectors']:
|
|
367
|
+
import sexpdata
|
|
368
|
+
|
|
369
|
+
data['vectors'] = {}
|
|
370
|
+
vectors = re.search(
|
|
371
|
+
r'(\(graphics/vectors\s.*)',
|
|
372
|
+
general_info,
|
|
373
|
+
re.M
|
|
374
|
+
).group(1)
|
|
375
|
+
vectors: list = sexpdata.loads(vectors, true=None)[1]
|
|
376
|
+
for vector in vectors:
|
|
377
|
+
vector_dict = {
|
|
378
|
+
str(property_[0]): str(property_[2])
|
|
379
|
+
for property_ in vector
|
|
380
|
+
if str(property_[0]) not in [
|
|
381
|
+
'locations', 'location-ids', 'options', 'scale',
|
|
382
|
+
'range-options', 'range-option', 'surfaces-list',
|
|
383
|
+
'color-map', 'vector-opt', 'annotations-list',
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
vector_dict['surface-list'] = vector[3][1]
|
|
387
|
+
vector_dict['range-options'] = {
|
|
388
|
+
str(range_option[0]): str(range_option[2])
|
|
389
|
+
for range_option in vector[7][1:]
|
|
390
|
+
}
|
|
391
|
+
vector_dict['scale'] = {
|
|
392
|
+
str(scale[0]): str(scale[2])
|
|
393
|
+
for scale in vector[9][1:]
|
|
394
|
+
}
|
|
395
|
+
vector_dict['vector-opt'] = {
|
|
396
|
+
str(vector_opt[0]): str(vector_opt[2])
|
|
397
|
+
for vector_opt in vector[-6][1:]
|
|
398
|
+
}
|
|
399
|
+
vector_dict['color-map'] = {
|
|
400
|
+
str(color_map[0]): str(color_map[2])
|
|
401
|
+
for color_map in vector[-5][1:]
|
|
402
|
+
}
|
|
403
|
+
data['vectors'][vector_dict['name']] = vector_dict
|
|
404
|
+
|
|
328
405
|
return data
|
|
329
406
|
|
|
330
407
|
|
|
@@ -358,7 +435,7 @@ def show_mesh(file_path: str) -> None:
|
|
|
358
435
|
import pyvista as pv
|
|
359
436
|
if file_path.endswith('cas.h5'):
|
|
360
437
|
pv.plot(
|
|
361
|
-
pv.read(file_path
|
|
438
|
+
pv.read(file_path),
|
|
362
439
|
show_edges=True,
|
|
363
440
|
show_axes=True,
|
|
364
441
|
smooth_shading=True,
|
|
@@ -404,9 +481,20 @@ def show_mesh(file_path: str) -> None:
|
|
|
404
481
|
offsets = np.cumsum(nnodes) - nnodes
|
|
405
482
|
pv_faces = np.insert(nodes, offsets, nnodes)
|
|
406
483
|
|
|
407
|
-
mesh = pv.PolyData(
|
|
484
|
+
mesh = pv.PolyData(
|
|
485
|
+
pv_points,
|
|
486
|
+
faces=pv_faces if dimension == 3 else None,
|
|
487
|
+
lines=pv_faces if dimension == 2 else None
|
|
488
|
+
)
|
|
408
489
|
plotter = pv.Plotter()
|
|
409
|
-
plotter.add_mesh(
|
|
490
|
+
plotter.add_mesh(
|
|
491
|
+
mesh,
|
|
492
|
+
show_edges=True,
|
|
493
|
+
color='lightblue',
|
|
494
|
+
line_width=2,
|
|
495
|
+
smooth_shading=True,
|
|
496
|
+
split_sharp_edges=True,
|
|
497
|
+
)
|
|
410
498
|
plotter.add_axes()
|
|
411
499
|
plotter.show()
|
|
412
500
|
|
|
@@ -423,73 +511,26 @@ def main() -> None:
|
|
|
423
511
|
help="path to the .h5 file"
|
|
424
512
|
)
|
|
425
513
|
|
|
426
|
-
|
|
427
|
-
"--extract",
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
"
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
"--
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
action="store_true",
|
|
446
|
-
help="show materials settings"
|
|
447
|
-
)
|
|
448
|
-
parser.add_argument(
|
|
449
|
-
"--bd", "--boundary",
|
|
450
|
-
action="store_true",
|
|
451
|
-
help="show boundary settings"
|
|
452
|
-
)
|
|
453
|
-
parser.add_argument(
|
|
454
|
-
"--ne", "--named-expressions",
|
|
455
|
-
action="store_true",
|
|
456
|
-
help="show named-expressions settings"
|
|
457
|
-
)
|
|
458
|
-
parser.add_argument(
|
|
459
|
-
"--disc",
|
|
460
|
-
action="store_true",
|
|
461
|
-
help="show disc-scheme and relax-factor settings"
|
|
462
|
-
)
|
|
463
|
-
parser.add_argument(
|
|
464
|
-
"--rd", "--report-definitions",
|
|
465
|
-
action="store_true",
|
|
466
|
-
help="show report-definitions settings"
|
|
467
|
-
)
|
|
468
|
-
parser.add_argument(
|
|
469
|
-
"--plotsets",
|
|
470
|
-
action="store_true",
|
|
471
|
-
help="show report-definitions plotsets settings"
|
|
472
|
-
)
|
|
473
|
-
parser.add_argument(
|
|
474
|
-
"--monitorsets",
|
|
475
|
-
action="store_true",
|
|
476
|
-
help="show report-definitions monitorsets settings"
|
|
477
|
-
)
|
|
478
|
-
parser.add_argument(
|
|
479
|
-
"--iter",
|
|
480
|
-
action="store_true",
|
|
481
|
-
help="show iteration settings"
|
|
482
|
-
)
|
|
483
|
-
parser.add_argument(
|
|
484
|
-
"--save",
|
|
485
|
-
action="store_true",
|
|
486
|
-
help="save output to file"
|
|
487
|
-
)
|
|
488
|
-
parser.add_argument(
|
|
489
|
-
"--showmesh",
|
|
490
|
-
action="store_true",
|
|
491
|
-
help="show mesh using pyvista"
|
|
492
|
-
)
|
|
514
|
+
ARGUMENTS = [
|
|
515
|
+
(("--extract",), "extract cas.h5 general and boundary string to files"),
|
|
516
|
+
(("--version",), "show the version of the .h5 file"),
|
|
517
|
+
(("--solver",), "show solver settings"),
|
|
518
|
+
(("--mat", "--materials"), "show materials settings"),
|
|
519
|
+
(("--bd", "--boundary"), "show boundary settings"),
|
|
520
|
+
(("--ne", "--named-expressions"), "show named-expressions settings"),
|
|
521
|
+
(("--disc",), "show disc-scheme and relax-factor settings"),
|
|
522
|
+
(("--rd", "--report-definitions"), "show report-definitions settings"),
|
|
523
|
+
(("--plotsets",), "show report-definitions plotsets settings"),
|
|
524
|
+
(("--monitorsets",), "show report-definitions monitorsets settings"),
|
|
525
|
+
(("--iter",), "show iteration settings"),
|
|
526
|
+
(("--contours",), "show graphics contours settings"),
|
|
527
|
+
(("--vectors",), "show graphics vectors settings"),
|
|
528
|
+
(("--save",), "save output to file"),
|
|
529
|
+
(("--showmesh",), "show mesh using pyvista"),
|
|
530
|
+
]
|
|
531
|
+
|
|
532
|
+
for flags, help_text in ARGUMENTS:
|
|
533
|
+
parser.add_argument(*flags, action="store_true", help=help_text)
|
|
493
534
|
|
|
494
535
|
args = parser.parse_args()
|
|
495
536
|
|
|
@@ -513,6 +554,8 @@ def main() -> None:
|
|
|
513
554
|
'rd': args.rd,
|
|
514
555
|
'plotsets': args.plotsets,
|
|
515
556
|
'monitorsets': args.monitorsets,
|
|
557
|
+
'contours': args.contours,
|
|
558
|
+
'vectors': args.vectors,
|
|
516
559
|
'iter': args.iter
|
|
517
560
|
}
|
|
518
561
|
output = read_case(args.file_path, **kwargs)
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cffview
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python CLI tool to inspect Ansys Fluent .cas.h5/.msh.h5 files without opening Fluent
|
|
5
5
|
Author-email: preamer <1524477126@qq.com>
|
|
6
6
|
License-Expression: BSD-3-Clause
|
|
7
7
|
Project-URL: Repository, https://github.com/preamer/cffview
|
|
8
8
|
Keywords: fluent,cfd,ansys,hdf5,mesh
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
14
15
|
Classifier: Topic :: Scientific/Engineering
|
|
15
16
|
Classifier: Environment :: Console
|
|
16
|
-
Requires-Python: >=3.
|
|
17
|
+
Requires-Python: >=3.10
|
|
17
18
|
Description-Content-Type: text/markdown
|
|
18
19
|
License-File: LICENSE
|
|
19
20
|
Requires-Dist: h5py>=3.16.0
|
|
20
21
|
Requires-Dist: pyvista>=0.48.4
|
|
21
22
|
Requires-Dist: sexpdata>=1.0.2
|
|
22
|
-
Requires-Dist: tqdm>=4.68.3
|
|
23
23
|
Dynamic: license-file
|
|
24
24
|
|
|
25
|
+
[](https://pypi.org/project/cffview/)
|
|
26
|
+
[](https://pypi.org/project/cffview)
|
|
27
|
+
[](https://github.com/preamer/cffview/actions/workflows/build_wheels.yml)
|
|
28
|
+
|
|
25
29
|
[中文](README.zh.md)
|
|
26
30
|
|
|
27
31
|
# cffview
|
|
@@ -35,11 +39,13 @@ A command-line tool for inspecting Ansys Fluent `.cas.h5` / `.msh.h5` files **wi
|
|
|
35
39
|
|
|
36
40
|
## Installation
|
|
37
41
|
|
|
42
|
+
### PyPI
|
|
43
|
+
|
|
38
44
|
```bash
|
|
39
45
|
pip install cffview
|
|
40
46
|
```
|
|
41
47
|
|
|
42
|
-
###
|
|
48
|
+
### From source
|
|
43
49
|
|
|
44
50
|
```bash
|
|
45
51
|
git clone https://github.com/preamer/cffview.git
|
|
@@ -59,7 +65,7 @@ cffview <file> [options]
|
|
|
59
65
|
|
|
60
66
|
| Option | Description |
|
|
61
67
|
|---|---|
|
|
62
|
-
|
|
|
68
|
+
| `--version` | Print the Fluent version of file |
|
|
63
69
|
| `--extract` | Dump raw Scheme settings to `general.scm` and `boundary.scm` |
|
|
64
70
|
| `--showmesh` | Visualise the mesh interactively with PyVista |
|
|
65
71
|
| `--solver` | Solver type, time, dimension, precision, turbulence model, energy, radiation, gravity |
|
|
@@ -71,6 +77,8 @@ cffview <file> [options]
|
|
|
71
77
|
| `--plotsets` | Plot sets |
|
|
72
78
|
| `--monitorsets` | Monitor sets |
|
|
73
79
|
| `--iter` | Iteration / time-step settings |
|
|
80
|
+
| `--contours` | Graphics contours settings |
|
|
81
|
+
| `--vectors` | Graphics vectors settings |
|
|
74
82
|
| `--save` | Save the output to `<file>.json` |
|
|
75
83
|
|
|
76
84
|
Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`, etc.) apply to `.cas.h5` files only.
|
|
@@ -78,17 +86,17 @@ Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`,
|
|
|
78
86
|
### Examples
|
|
79
87
|
|
|
80
88
|
```bash
|
|
89
|
+
# Show all settings and save to JSON
|
|
90
|
+
cffview case.cas.h5 --save
|
|
91
|
+
|
|
81
92
|
# Show solver configuration and boundary conditions
|
|
82
93
|
cffview case.cas.h5 --solver --bd
|
|
83
94
|
|
|
84
|
-
#
|
|
85
|
-
cffview case.cas.h5 --solver --mat --bd --ne --disc --rd --iter --save
|
|
86
|
-
|
|
87
|
-
# Visualise the mesh (.cas.h5 and .msh.h5 both supported)
|
|
95
|
+
# Visualise the mesh
|
|
88
96
|
cffview case.cas.h5 --showmesh
|
|
89
97
|
cffview mesh.msh.h5 --showmesh
|
|
90
98
|
|
|
91
|
-
# Check the Fluent version
|
|
99
|
+
# Check the Fluent version of file
|
|
92
100
|
cffview case.cas.h5 --version
|
|
93
101
|
|
|
94
102
|
# Extract raw Scheme strings for manual inspection
|
|
@@ -97,32 +105,6 @@ cffview case.cas.h5 --extract
|
|
|
97
105
|
|
|
98
106
|
---
|
|
99
107
|
|
|
100
|
-
## File Format Support
|
|
101
|
-
|
|
102
|
-
| Feature | `.cas.h5` | `.msh.h5` |
|
|
103
|
-
|---|---|---|
|
|
104
|
-
| Case settings (`--solver`, `--mat`, `--bd`, …) | ✅ | — |
|
|
105
|
-
| Mesh visualisation (3D) | ✅ | ✅ |
|
|
106
|
-
| Mesh visualisation (2D) | ✅ | ✅ |
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Supported Settings
|
|
111
|
-
|
|
112
|
-
| Flag | Contents |
|
|
113
|
-
|---|---|
|
|
114
|
-
| `--solver` | Algorithm (PBNS/DBNS), steady/transient, 2D/3D, single/double precision, turbulence model, energy, radiation, gravity |
|
|
115
|
-
| `--mat` | Fluid/solid materials with properties and evaluation methods |
|
|
116
|
-
| `--bd` | Velocity-inlet, pressure-outlet, mass-flow-inlet/outlet, wall (thermal & motion BC), porous-jump, interior, symmetry, … |
|
|
117
|
-
| `--ne` | Named expressions defined in the case |
|
|
118
|
-
| `--disc` | Per-equation scheme (Second Order Upwind, QUICK, …) and under-relaxation / pseudo-transient factors |
|
|
119
|
-
| `--rd` | Report definitions (volume, surface, flux) with field, zones, and per-zone flag |
|
|
120
|
-
| `--plotsets` | Plot set configurations |
|
|
121
|
-
| `--monitorsets` | Monitor set configurations |
|
|
122
|
-
| `--iter` | Iteration count (steady) or time-step size, number of steps, max inner iterations (transient) |
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
108
|
## License
|
|
127
109
|
|
|
128
110
|
[BSD-3-Clause](LICENSE)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|