cffview 0.2.1__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.1/src/cffview.egg-info → cffview-0.2.2}/PKG-INFO +16 -35
- {cffview-0.2.1 → cffview-0.2.2}/README.md +15 -33
- {cffview-0.2.1 → cffview-0.2.2}/pyproject.toml +2 -7
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview/main.py +102 -70
- {cffview-0.2.1 → cffview-0.2.2/src/cffview.egg-info}/PKG-INFO +16 -35
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview.egg-info/requires.txt +0 -1
- {cffview-0.2.1 → cffview-0.2.2}/LICENSE +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/setup.cfg +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview/boundary.py +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview/utils.py +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview.egg-info/SOURCES.txt +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview.egg-info/dependency_links.txt +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview.egg-info/entry_points.txt +0 -0
- {cffview-0.2.1 → cffview-0.2.2}/src/cffview.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
@@ -20,9 +20,12 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: h5py>=3.16.0
|
|
21
21
|
Requires-Dist: pyvista>=0.48.4
|
|
22
22
|
Requires-Dist: sexpdata>=1.0.2
|
|
23
|
-
Requires-Dist: tqdm>=4.68.3
|
|
24
23
|
Dynamic: license-file
|
|
25
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
|
+
|
|
26
29
|
[中文](README.zh.md)
|
|
27
30
|
|
|
28
31
|
# cffview
|
|
@@ -36,11 +39,13 @@ A command-line tool for inspecting Ansys Fluent `.cas.h5` / `.msh.h5` files **wi
|
|
|
36
39
|
|
|
37
40
|
## Installation
|
|
38
41
|
|
|
42
|
+
### PyPI
|
|
43
|
+
|
|
39
44
|
```bash
|
|
40
45
|
pip install cffview
|
|
41
46
|
```
|
|
42
47
|
|
|
43
|
-
###
|
|
48
|
+
### From source
|
|
44
49
|
|
|
45
50
|
```bash
|
|
46
51
|
git clone https://github.com/preamer/cffview.git
|
|
@@ -60,7 +65,7 @@ cffview <file> [options]
|
|
|
60
65
|
|
|
61
66
|
| Option | Description |
|
|
62
67
|
|---|---|
|
|
63
|
-
|
|
|
68
|
+
| `--version` | Print the Fluent version of file |
|
|
64
69
|
| `--extract` | Dump raw Scheme settings to `general.scm` and `boundary.scm` |
|
|
65
70
|
| `--showmesh` | Visualise the mesh interactively with PyVista |
|
|
66
71
|
| `--solver` | Solver type, time, dimension, precision, turbulence model, energy, radiation, gravity |
|
|
@@ -72,6 +77,8 @@ cffview <file> [options]
|
|
|
72
77
|
| `--plotsets` | Plot sets |
|
|
73
78
|
| `--monitorsets` | Monitor sets |
|
|
74
79
|
| `--iter` | Iteration / time-step settings |
|
|
80
|
+
| `--contours` | Graphics contours settings |
|
|
81
|
+
| `--vectors` | Graphics vectors settings |
|
|
75
82
|
| `--save` | Save the output to `<file>.json` |
|
|
76
83
|
|
|
77
84
|
Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`, etc.) apply to `.cas.h5` files only.
|
|
@@ -79,17 +86,17 @@ Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`,
|
|
|
79
86
|
### Examples
|
|
80
87
|
|
|
81
88
|
```bash
|
|
89
|
+
# Show all settings and save to JSON
|
|
90
|
+
cffview case.cas.h5 --save
|
|
91
|
+
|
|
82
92
|
# Show solver configuration and boundary conditions
|
|
83
93
|
cffview case.cas.h5 --solver --bd
|
|
84
94
|
|
|
85
|
-
#
|
|
86
|
-
cffview case.cas.h5 --solver --mat --bd --ne --disc --rd --iter --save
|
|
87
|
-
|
|
88
|
-
# Visualise the mesh (.cas.h5 and .msh.h5 both supported)
|
|
95
|
+
# Visualise the mesh
|
|
89
96
|
cffview case.cas.h5 --showmesh
|
|
90
97
|
cffview mesh.msh.h5 --showmesh
|
|
91
98
|
|
|
92
|
-
# Check the Fluent version
|
|
99
|
+
# Check the Fluent version of file
|
|
93
100
|
cffview case.cas.h5 --version
|
|
94
101
|
|
|
95
102
|
# Extract raw Scheme strings for manual inspection
|
|
@@ -98,32 +105,6 @@ cffview case.cas.h5 --extract
|
|
|
98
105
|
|
|
99
106
|
---
|
|
100
107
|
|
|
101
|
-
## File Format Support
|
|
102
|
-
|
|
103
|
-
| Feature | `.cas.h5` | `.msh.h5` |
|
|
104
|
-
|---|---|---|
|
|
105
|
-
| Case settings (`--solver`, `--mat`, `--bd`, …) | ✅ | — |
|
|
106
|
-
| Mesh visualisation (3D) | ✅ | ✅ |
|
|
107
|
-
| Mesh visualisation (2D) | ✅ | ✅ |
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Supported Settings
|
|
112
|
-
|
|
113
|
-
| Flag | Contents |
|
|
114
|
-
|---|---|
|
|
115
|
-
| `--solver` | Algorithm (PBNS/DBNS), steady/transient, 2D/3D, single/double precision, turbulence model, energy, radiation, gravity |
|
|
116
|
-
| `--mat` | Fluid/solid materials with properties and evaluation methods |
|
|
117
|
-
| `--bd` | Velocity-inlet, pressure-outlet, mass-flow-inlet/outlet, wall (thermal & motion BC), porous-jump, interior, symmetry, … |
|
|
118
|
-
| `--ne` | Named expressions defined in the case |
|
|
119
|
-
| `--disc` | Per-equation scheme (Second Order Upwind, QUICK, …) and under-relaxation / pseudo-transient factors |
|
|
120
|
-
| `--rd` | Report definitions (volume, surface, flux) with field, zones, and per-zone flag |
|
|
121
|
-
| `--plotsets` | Plot set configurations |
|
|
122
|
-
| `--monitorsets` | Monitor set configurations |
|
|
123
|
-
| `--iter` | Iteration count (steady) or time-step size, number of steps, max inner iterations (transient) |
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
108
|
## License
|
|
128
109
|
|
|
129
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,7 +4,7 @@ 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
10
|
requires-python = ">=3.10"
|
|
@@ -21,12 +21,7 @@ classifiers = [
|
|
|
21
21
|
"Topic :: Scientific/Engineering",
|
|
22
22
|
"Environment :: Console",
|
|
23
23
|
]
|
|
24
|
-
dependencies = [
|
|
25
|
-
"h5py>=3.16.0",
|
|
26
|
-
"pyvista>=0.48.4",
|
|
27
|
-
"sexpdata>=1.0.2",
|
|
28
|
-
"tqdm>=4.68.3",
|
|
29
|
-
]
|
|
24
|
+
dependencies = ["h5py>=3.16.0", "pyvista>=0.48.4", "sexpdata>=1.0.2"]
|
|
30
25
|
|
|
31
26
|
[project.scripts]
|
|
32
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,
|
|
@@ -434,73 +511,26 @@ def main() -> None:
|
|
|
434
511
|
help="path to the .h5 file"
|
|
435
512
|
)
|
|
436
513
|
|
|
437
|
-
|
|
438
|
-
"--extract",
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
"
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
"--
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
action="store_true",
|
|
457
|
-
help="show materials settings"
|
|
458
|
-
)
|
|
459
|
-
parser.add_argument(
|
|
460
|
-
"--bd", "--boundary",
|
|
461
|
-
action="store_true",
|
|
462
|
-
help="show boundary settings"
|
|
463
|
-
)
|
|
464
|
-
parser.add_argument(
|
|
465
|
-
"--ne", "--named-expressions",
|
|
466
|
-
action="store_true",
|
|
467
|
-
help="show named-expressions settings"
|
|
468
|
-
)
|
|
469
|
-
parser.add_argument(
|
|
470
|
-
"--disc",
|
|
471
|
-
action="store_true",
|
|
472
|
-
help="show disc-scheme and relax-factor settings"
|
|
473
|
-
)
|
|
474
|
-
parser.add_argument(
|
|
475
|
-
"--rd", "--report-definitions",
|
|
476
|
-
action="store_true",
|
|
477
|
-
help="show report-definitions settings"
|
|
478
|
-
)
|
|
479
|
-
parser.add_argument(
|
|
480
|
-
"--plotsets",
|
|
481
|
-
action="store_true",
|
|
482
|
-
help="show report-definitions plotsets settings"
|
|
483
|
-
)
|
|
484
|
-
parser.add_argument(
|
|
485
|
-
"--monitorsets",
|
|
486
|
-
action="store_true",
|
|
487
|
-
help="show report-definitions monitorsets settings"
|
|
488
|
-
)
|
|
489
|
-
parser.add_argument(
|
|
490
|
-
"--iter",
|
|
491
|
-
action="store_true",
|
|
492
|
-
help="show iteration settings"
|
|
493
|
-
)
|
|
494
|
-
parser.add_argument(
|
|
495
|
-
"--save",
|
|
496
|
-
action="store_true",
|
|
497
|
-
help="save output to file"
|
|
498
|
-
)
|
|
499
|
-
parser.add_argument(
|
|
500
|
-
"--showmesh",
|
|
501
|
-
action="store_true",
|
|
502
|
-
help="show mesh using pyvista"
|
|
503
|
-
)
|
|
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)
|
|
504
534
|
|
|
505
535
|
args = parser.parse_args()
|
|
506
536
|
|
|
@@ -524,6 +554,8 @@ def main() -> None:
|
|
|
524
554
|
'rd': args.rd,
|
|
525
555
|
'plotsets': args.plotsets,
|
|
526
556
|
'monitorsets': args.monitorsets,
|
|
557
|
+
'contours': args.contours,
|
|
558
|
+
'vectors': args.vectors,
|
|
527
559
|
'iter': args.iter
|
|
528
560
|
}
|
|
529
561
|
output = read_case(args.file_path, **kwargs)
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
@@ -20,9 +20,12 @@ License-File: LICENSE
|
|
|
20
20
|
Requires-Dist: h5py>=3.16.0
|
|
21
21
|
Requires-Dist: pyvista>=0.48.4
|
|
22
22
|
Requires-Dist: sexpdata>=1.0.2
|
|
23
|
-
Requires-Dist: tqdm>=4.68.3
|
|
24
23
|
Dynamic: license-file
|
|
25
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
|
+
|
|
26
29
|
[中文](README.zh.md)
|
|
27
30
|
|
|
28
31
|
# cffview
|
|
@@ -36,11 +39,13 @@ A command-line tool for inspecting Ansys Fluent `.cas.h5` / `.msh.h5` files **wi
|
|
|
36
39
|
|
|
37
40
|
## Installation
|
|
38
41
|
|
|
42
|
+
### PyPI
|
|
43
|
+
|
|
39
44
|
```bash
|
|
40
45
|
pip install cffview
|
|
41
46
|
```
|
|
42
47
|
|
|
43
|
-
###
|
|
48
|
+
### From source
|
|
44
49
|
|
|
45
50
|
```bash
|
|
46
51
|
git clone https://github.com/preamer/cffview.git
|
|
@@ -60,7 +65,7 @@ cffview <file> [options]
|
|
|
60
65
|
|
|
61
66
|
| Option | Description |
|
|
62
67
|
|---|---|
|
|
63
|
-
|
|
|
68
|
+
| `--version` | Print the Fluent version of file |
|
|
64
69
|
| `--extract` | Dump raw Scheme settings to `general.scm` and `boundary.scm` |
|
|
65
70
|
| `--showmesh` | Visualise the mesh interactively with PyVista |
|
|
66
71
|
| `--solver` | Solver type, time, dimension, precision, turbulence model, energy, radiation, gravity |
|
|
@@ -72,6 +77,8 @@ cffview <file> [options]
|
|
|
72
77
|
| `--plotsets` | Plot sets |
|
|
73
78
|
| `--monitorsets` | Monitor sets |
|
|
74
79
|
| `--iter` | Iteration / time-step settings |
|
|
80
|
+
| `--contours` | Graphics contours settings |
|
|
81
|
+
| `--vectors` | Graphics vectors settings |
|
|
75
82
|
| `--save` | Save the output to `<file>.json` |
|
|
76
83
|
|
|
77
84
|
Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`, etc.) apply to `.cas.h5` files only.
|
|
@@ -79,17 +86,17 @@ Multiple flags can be combined freely. Case settings flags (`--solver`, `--mat`,
|
|
|
79
86
|
### Examples
|
|
80
87
|
|
|
81
88
|
```bash
|
|
89
|
+
# Show all settings and save to JSON
|
|
90
|
+
cffview case.cas.h5 --save
|
|
91
|
+
|
|
82
92
|
# Show solver configuration and boundary conditions
|
|
83
93
|
cffview case.cas.h5 --solver --bd
|
|
84
94
|
|
|
85
|
-
#
|
|
86
|
-
cffview case.cas.h5 --solver --mat --bd --ne --disc --rd --iter --save
|
|
87
|
-
|
|
88
|
-
# Visualise the mesh (.cas.h5 and .msh.h5 both supported)
|
|
95
|
+
# Visualise the mesh
|
|
89
96
|
cffview case.cas.h5 --showmesh
|
|
90
97
|
cffview mesh.msh.h5 --showmesh
|
|
91
98
|
|
|
92
|
-
# Check the Fluent version
|
|
99
|
+
# Check the Fluent version of file
|
|
93
100
|
cffview case.cas.h5 --version
|
|
94
101
|
|
|
95
102
|
# Extract raw Scheme strings for manual inspection
|
|
@@ -98,32 +105,6 @@ cffview case.cas.h5 --extract
|
|
|
98
105
|
|
|
99
106
|
---
|
|
100
107
|
|
|
101
|
-
## File Format Support
|
|
102
|
-
|
|
103
|
-
| Feature | `.cas.h5` | `.msh.h5` |
|
|
104
|
-
|---|---|---|
|
|
105
|
-
| Case settings (`--solver`, `--mat`, `--bd`, …) | ✅ | — |
|
|
106
|
-
| Mesh visualisation (3D) | ✅ | ✅ |
|
|
107
|
-
| Mesh visualisation (2D) | ✅ | ✅ |
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Supported Settings
|
|
112
|
-
|
|
113
|
-
| Flag | Contents |
|
|
114
|
-
|---|---|
|
|
115
|
-
| `--solver` | Algorithm (PBNS/DBNS), steady/transient, 2D/3D, single/double precision, turbulence model, energy, radiation, gravity |
|
|
116
|
-
| `--mat` | Fluid/solid materials with properties and evaluation methods |
|
|
117
|
-
| `--bd` | Velocity-inlet, pressure-outlet, mass-flow-inlet/outlet, wall (thermal & motion BC), porous-jump, interior, symmetry, … |
|
|
118
|
-
| `--ne` | Named expressions defined in the case |
|
|
119
|
-
| `--disc` | Per-equation scheme (Second Order Upwind, QUICK, …) and under-relaxation / pseudo-transient factors |
|
|
120
|
-
| `--rd` | Report definitions (volume, surface, flux) with field, zones, and per-zone flag |
|
|
121
|
-
| `--plotsets` | Plot set configurations |
|
|
122
|
-
| `--monitorsets` | Monitor set configurations |
|
|
123
|
-
| `--iter` | Iteration count (steady) or time-step size, number of steps, max inner iterations (transient) |
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
108
|
## License
|
|
128
109
|
|
|
129
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
|