How to export a mesh file as STL in ansys fluent?

CoolHarrison
CoolHarrison Member Posts: 17
10 Comments
**

This is the main section of code where I try to export a mesh file:

generate_volume_mesh = workflow.TaskObject["Generate the Volume Mesh"]
generate_volume_mesh.Arguments.update_dict({"VolumeFill": "poly-hexcore"})
generate_volume_mesh.Execute()

mesh_file = r"C:\Users\forha\OneDrive\Documents\GitHub\F1car-wAI\my_mesh.stl"
session.tui.file.export.stl("ANSYS Fluent", "2024R1", "meshing", mesh_file)

The error happens at the last line of code. When that code is ran, it tells me this:

Exception has occurred: RuntimeError
menu not found
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNKNOWN
    details = "menu not found"
    debug_error_string = "UNKNOWN:Error received from peer  {created_time:"2024-10-20T20:51:02.9016385+00:00", grpc_status:2, grpc_message:"menu not found"}"
>

During handling of the above exception, another exception occurred:

  File "C:\Users\forha\OneDrive\Documents\GitHub\F1car-wAI\fluentTest2.py", line 109, in <module>
    session.tui.file.export.stl("ANSYS Fluent", "2024R1", "meshing", mesh_file)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: menu not found

In the Pyfluent documentation, it says that the stl class has 4 inputs; service, version, mode and path. It's possible that these inputs are wrong, but I'm not really sure what they should be changed to. It's also possible that the function is wrong, but again i'm not sure.

Answers