Skip to content

PyFluent Meshing Issue with Watertight meshing workflow while generating volume mesh #4272

Open
@MohammedAnsys

Description

@MohammedAnsys

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

In the Watertight Meshing workflow using PyFluent, while generating the volume mesh, parameters such as buffer layer, peel layer, and minimum size appear in the volume meshing object as static information. However, attempting to update these parameters through function arguments does not work as expected.

Specifically, when trying to pass these parameters via arguments to the volume meshing command, the following error is encountered: Illegitimate input at /GenerateTheVolumeMeshWTM;

📝 Steps to reproduce

transient_compressible.zip

import os
import ansys.fluent.core as pyfluent
from ansys.fluent.core import UIMode
session = pyfluent.launch_fluent(
    mode="meshing",       
    ui_mode=UIMode.GUI,)

meshing = session.workflow

input_file = os.path.join(os.getcwd(), 'nozzle.dsco')

meshing.InitializeWorkflow(WorkflowType="Watertight Geometry")
    
meshing.TaskObject["Import Geometry"].Arguments = {"FileName": input_file}
meshing.TaskObject["Import Geometry"].Execute()

meshing.TaskObject["Add Local Sizing"].Execute()

surface_mesh = {
        "CFDSurfaceMeshControls": {
            "MaxSize": 30,
            "MinSize": 2,
            "SizeFunctions": "Curvature",
        }
    }
meshing.TaskObject["Generate the Surface Mesh"].Arguments.set_state(surface_mesh)
meshing.TaskObject["Generate the Surface Mesh"].Execute()

geometry_describe = {
        "SetupType": "The geometry consists of only fluid regions with no voids",
        "WallToInternal": "No",
        "InvokeShareTopology": "No",
        "Multizone": "No",
    }
meshing.TaskObject["Describe Geometry"].Arguments.set_state(geometry_describe)
meshing.TaskObject["Describe Geometry"].Execute()

boundary_condition = {
        "BoundaryLabelList": ["inlet"],
        "BoundaryLabelTypeList": ["pressure-inlet"]
    }
meshing.TaskObject["Update Boundaries"].Arguments.set_state(boundary_condition)
meshing.TaskObject["Update Boundaries"].Execute()

# Update regions
meshing.TaskObject["Update Regions"].Execute()

boundary_layer = {
        "NumberOfLayers": 8,
        "TransitionRatio": 0.35,
    }
meshing.TaskObject["Add Boundary Layers"].Arguments.update_dict(boundary_layer)
meshing.TaskObject["Add Boundary Layers"].Execute()

volume_mesh = {"VolumeFill": "poly-hexcore", "HexMaxSize": "20",}
mesh_preference={"Avoid1_8Transition": "yes"}
meshing.TaskObject["Generate the Volume Mesh"].Arguments.set_state(volume_mesh)
meshing.TaskObject["Generate the Volume Mesh"].Arguments.set_state(mesh_preference)
meshing.TaskObject["Generate the Volume Mesh"].Execute()

💻 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

Using Python 3.12.10 
Package                               Version
------------------------------------- -----------
ansys-api-fluent                      0.3.36
ansys-api-platform-instancemanagement 1.1.3
ansys-api-tools-filetransfer          0.1.1
ansys-fluent-core                     0.33.0
ansys-platform-instancemanagement     1.1.2
ansys-tools-filetransfer              0.1.1
ansys-units                           0.6.0
asttokens                             3.0.0
certifi                               2025.6.15
charset-normalizer                    3.4.2
click                                 8.2.1
colorama                              0.4.6
comm                                  0.2.2
debugpy                               1.8.14
decorator                             5.2.1
defusedxml                            0.7.1
deprecated                            1.2.18
docker                                7.1.0
executing                             2.2.0
googleapis-common-protos              1.70.0
grpcio                                1.73.1
grpcio-health-checking                1.62.3
grpcio-status                         1.62.3
idna                                  3.10
importlib-metadata                    8.7.0
ipykernel                             6.29.5
ipython                               9.4.0
ipython-pygments-lexers               1.1.1
jedi                                  0.19.2
joblib                                1.5.1
jupyter-client                        8.6.3
jupyter-core                          5.8.1
matplotlib-inline                     0.1.7
nest-asyncio                          1.6.0
nltk                                  3.9.1
numpy                                 2.3.1
packaging                             25.0
pandas                                2.2.3
parso                                 0.8.4
pip                                   25.1.1
platformdirs                          4.3.8
prompt-toolkit                        3.0.51
protobuf                              4.25.8
psutil                                7.0.0
pure-eval                             0.2.3
pyansys-tools-report                  0.8.2
pygments                              2.19.2
python-dateutil                       2.9.0.post0
pytz                                  2025.2
pywin32                               310
pyyaml                                6.0.2
pyzmq                                 27.0.0
regex                                 2024.11.6
requests                              2.32.4
scooby                                0.10.1
setuptools                            80.9.0
six                                   1.17.0
stack-data                            0.6.3
tornado                               6.5.1
tqdm                                  4.67.1
traitlets                             5.14.3
tzdata                                2025.2
urllib3                               2.5.0
uv                                    0.7.19
wcwidth                               0.2.13
wrapt                                 1.17.2
zipp                                  3.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue, problem or error in PyFluent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions