ansys / ansys/pyworkbench-examples

Bug located in ansys-fluent-workflow

Open
#108 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
No language data
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

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

Attempting to run example ansys-fluent-workflow line 53:

`sys_name = wb.run_script_file(str((assets / "project.wbjn").absolute()))`

Fails with not very informative error, consider improvement:
`ERROR:root:Error when running the script: CommandFailedException: Generic Command`

Seems the error is prompted by the execution of line 40 of the project.wbjn:

`setup1.SendCommand(Command="(%py-exec \"workflow.TaskObject['Import Geometry'].Execute()\")")
`
With Fluent reporting the following:

```
Error: Workbench Busy: Could not process command :ActivateCADEditor
Error Object #94
Error: Exception encountered in S_ExecuteTask: Workbench Busy: Could not process command :ActivateCadEditor
Error Object: ("workflow.TaskObject['Import Geometry'].Execute()")
```
Attaching screen shot of Fluent error output:

![Image](https://github.com/user-attachments/assets/35d341ee-2118-4722-9b6b-adc60b8e7640)

This error is **not reproduced** if you run the journal file manually from the workbench app "File > Scripting > Run Script File". This failure only happens as is if using pyworkbench.

However workbench and fluent hang before completion at line 51, where they eternally wait for its execution:
`setup1.SendCommand(Command="(%py-exec \"workflow.TaskObject['Generate the Volume Mesh'].Execute()\")")`

May be separate issue

### 📝 Steps to reproduce

1. Clone pyworkbench-examples.
2. Create virtual environment using provided cpython in ansys installation: "$ANSYS_PATH"+"v251"+"\commonfiles\CPython\3_10\winx64\Release\python\python.exe"
3. Install required packages:
python -m pip ansys-workbench-core
5. Execute $[..]/pyworkbench-examples/examples/ansys-fluent-workflow/main.py

### 💻 Which operating system are you using?

Windows

### 📀 Which ANSYS version are you using?

Unified Package Name: R251RC1P00

WB
11/12/2024 15:10:24
ADO Build Number=Workbench-Windows-Daily_release-25.1_20241112_.1
BUILD_VCS_NUMBER_TfsAnsmeshingGit=9d8153d9bd5195575a5ae8bddee362e1e0727b1a
BUILD_VCS_NUMBER_TfsBulkdataintfaceGit=6517d4cd3e331121b0f532fc9a054326dfbaa3b3
BUILD_VCS_NUMBER_TfsCodedvGit=0b31cf96a0833418ee9134856e287df1b969182e
BUILD_VCS_NUMBER_TfsFieldmesherGit=0b2f0c84851e41f6808813d48c5b116ba3f88676
BUILD_VCS_NUMBER_TfsMultiGit=84ab1854377bb280553f74b5848679f7c28967ee
BUILD_VCS_NUMBER_TfsAddinsGit=542c6191ae8a51ce46be6089a1297da715ad055d
BUILD_VCS_NUMBER_TfsFrameworkGit=952b5e9dbd76c84b4d0b4f2dd46a145d3f87c1b8
BUILD_VCS_NUMBER_TfsDataintfaceGit=95fde1a1ed7e3699245efeb4e78b4578b48e9bee
BUILD_VCS_NUMBER_TfsCommonDVGit=704cfa5d49dc9c1d32cee70f9fc36b17e886e264
BUILD_VCS_NUMBER_TfsProtocolsGit=2f39bdfe9eb58583662d9a27cf42838108d68208
BUILD_VCS_NUMBER_TfsPrimemeshingGit=fe2764426a32ee00a02a211980fb58ce966e82dc
BUILD_VCS_NUMBER_TfsDPFGit=d2684b756507a6e3c7f6123c7f43e07d7af2561e
BUILD_VCS_NUMBER_Tfsmechext-virtualmotionGit=9801bbf2d41b3970fa8daecd0089ffd1492c5af3
This version of corewb is the same as the previously certified

fluent
3d Build Time: Nov 10 2024 10:55:45 EST Build Id: 10209
fluent GIT Revision 7159f8faa8e0389874303f1bb03bc78bbb0c3446
fluent GIT Branch releases/release-25.1
prime GIT Branch mesh/stage
prime GIT Revision 729ade6704154b843ecf4d68c1c6dcbfacb0e1e2
prime GIT TIME_STAMP 2024-10-29 03:56:02 +0000

### 🐍 Which Python version are you using?

3.10

### 📦 Installed packages

```shell
about-time==4.2.1
alive-progress==3.2.0
ansys-api-fluent==0.3.28
ansys-api-platform-instancemanagement==1.1.0
ansys-api-tools-filetransfer==0.1.1
ansys-api-workbench==0.2.0
ansys-fluent-core==0.26.1
ansys-platform-instancemanagement==1.1.2
ansys-pythonnet==3.1.0rc4
ansys-tools-filetransfer==0.1.0
ansys-tools-path==0.7.0
ansys-units==0.3.2
ansys-workbench-core==0.7.0
asttokens==2.4.1
beartype==0.19.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
clr-loader==0.2.6
colorama==0.4.6
comm==0.2.2
debugpy==1.8.8
decorator==5.1.1
docker==7.1.0
exceptiongroup==1.2.2
executing==2.1.0
grapheme==0.6.0
grpcio==1.67.1
grpcio-health-checking==1.62.3
idna==3.10
importlib_metadata==8.5.0
ipykernel==6.29.5
ipython==8.29.0
jedi==0.19.2
joblib==1.4.2
jupyter_client==8.6.3
jupyter_core==5.7.2
lxml==5.3.0
matplotlib-inline==0.1.7
nest-asyncio==1.6.0
nltk==3.9.1
numpy==1.26.4
packaging==24.2
pandas==2.2.3
parso==0.8.4
platformdirs==4.3.6
prompt_toolkit==3.0.48
protobuf==4.25.5
psutil==6.1.0
pure_eval==0.2.3
pycparser==2.22
Pygments==2.18.0
python-dateutil==2.9.0.post0
pytz==2024.2
pywin32==308
PyYAML==6.0.2
pyzmq==26.2.0
regex==2024.11.6
requests==2.32.3
six==1.16.0
stack-data==0.6.3
tornado==6.4.1
tqdm==4.67.0
traitlets==5.14.3
typing_extensions==4.12.2
tzdata==2024.2
urllib3==2.2.3
wcwidth==0.2.13
WMI==1.5.1
zipp==3.21.0
```

Contributor guide

Open the contributing guide

Research direction

Start with examples/ansys-fluent-workflow/main.py and project.wbjn, focusing on lines 40, 51, and 53. Reproduce the failure on Windows with the reported ANSYS R251RC1P00 environment, comparing pyworkbench execution with manually running the journal file. Done means the workflow completes without hanging and failures provide more informative errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
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.