ansys / ansys/pyprimemesh

Fluent can't read 2D mesh created by PyPrimeMesh

Open
#1,140 1 comment 0 reactions 0 assignees View on GitHub
aps enhancement
Dominant language
Python
Stars
35
Forks
14
Avg merge
3d 5h
Merged PRs (30d)
11

Description

### 🔍 Before submitting the issue

- [x] I have searched among the existing issues
- [x] I am using a Python virtual environment

### 🐞 Description of the bug

Hi.

I wanted to conduct a 2D parametric study using PyPrimeMesh and PyFluent. However, the mesh exported by PyPrimeMesh is giving an erro when imported by fluent (both manually and using PyFluent).

The following code is a simple example where i try to mesh a simple rectangle (`test.scdocx`) and export the mesh to a file. If i try to open the `test.msh` file with fluent, i get the error `This appears to be a surface mesh. surface meshes cannot be read under the /file/read-case functionality.`

I'm not sure if I'm doing something wrong or its a bug in PyPrimeMesh. I have spent the past few days readying the documentation without much success.

### 📝 Steps to reproduce

Run the following code with the `test.scdocx` file in the same directory.

[test.scdocx.zip](https://github.com/user-attachments/files/22211828/test.scdocx.zip)

```python
import os
from ansys.meshing import prime

prime_client = prime.launch_prime()
model = prime_client.model
mesh_util = prime.lucid.Mesh(model=model)

filename= "test.scdocx"

file_io = prime.FileIO(model)
file_io.import_cad(
file_name=filename,
params=prime.ImportCadParams(
model=model,
length_unit=prime.LengthUnit.MM,
part_creation_type=prime.PartCreationType.MODEL,
),
)

part = model.parts[0]
surfer_params = prime.SurferParams(
model=model,
size_field_type=prime.SizeFieldType.CONSTANT,
constant_size=5,
generate_quads=False,
)

surfer_result = prime.Surfer(model).mesh_topo_faces(
part.id, topo_faces=part.get_topo_faces(), params=surfer_params
)

save_path = "test.msh"
export_params = prime.ExportFluentMeshingMeshParams(
model,
)

file_io.export_fluent_meshing_mesh(save_path, export_fluent_mesh_params=export_params)
assert os.path.exists(save_path)
print(f"Fluent mesh exported at {save_path}")

print(prime.SurfaceQualitySummaryResults(model=model))

prime_client.exit()

```

### 💻 Which operating system are you using?

Windows

### 📀 Which ANSYS version are you using?

2025 R1

### 🐍 Which Python version are you using?

3.12

### 📦 Installed packages

```shell
aiohappyeyeballs==2.6.1
aiohttp==3.12.15
aiosignal==1.4.0
ansys-api-meshing-prime==0.1.4
ansys-meshing-prime==0.8.1
ansys-tools-visualization-interface==0.11.0
appdirs==1.4.4
attrs==25.3.0
certifi==2025.8.3
charset-normalizer==3.4.3
contourpy==1.3.3
cycler==0.12.1
fonttools==4.59.2
frozenlist==1.7.0
grpcio==1.74.0
idna==3.10
kiwisolver==1.4.9
matplotlib==3.10.6
more-itertools==10.8.0
msgpack==1.1.1
multidict==6.6.4
numpy==2.2.6
packaging==25.0
pillow==11.3.0
platformdirs==4.4.0
pooch==1.8.2
propcache==0.3.2
protobuf==4.25.8
pyparsing==3.2.3
python-dateutil==2.9.0.post0
pyvista==0.46.3
pyyaml==6.0.2
requests==2.32.5
scooby==0.10.1
six==1.17.0
trame==3.12.0
trame-client==3.10.1
trame-common==1.0.1
trame-server==3.6.0
trame-vtk==2.9.1
trame-vuetify==3.0.2
typing-extensions==4.15.0
urllib3==2.5.0
vtk==9.5.1
websockets==15.0.1
wslink==2.4.0
yarl==1.20.1
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with test.scdocx, the supplied Python example, and the listed PyPrimeMesh and Fluent versions. Start at FileIO.export_fluent_meshing_mesh and ExportFluentMeshingMeshParams, then verify whether the generated test.msh is a valid Fluent-readable volume mesh or an expected surface export; done means the behavior is corrected or clearly documented with a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.