Fluent hangs and license is not released when a journal containing exit is executed via PyFluent
- Dominant language
- Python
- Stars
- 497
- Forks
- 77
- Avg merge
- 22h 37m
- Merged PRs (30d)
- 45
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
When executing a journal (or Scheme) file through PyFluent, Fluent becomes unresponsive or hangs if the journal contains an explicit exit command. The same journal file exits Fluent correctly when executed directly in standalone Fluent (GUI or batch mode).
In the PyFluent workflow, after the exit command is encountered in the journal, Fluent does not terminate cleanly and the PyFluent session cannot proceed further. In some cases, Fluent remains running in the background and the license is not released.
The following error hits and fluent gets stuck
"Cannot invoke RPC on closed channel!"
### 📝 Steps to reproduce
1. Launch Fluent using PyFluent from a Python script.
2. Load any valid case file in Fluent.
3. Prepare a journal file that performs some solver setup operations and includes an exit command at the end.
**Example journal file:**
_it 5
/solve/set/discretization-scheme/temperature 1
/solve/set/equation/temperature no
/solve/set/discretization-scheme/mom 1
/solve/set/discretization-scheme/k 1
/solve/set/discretization-scheme/epsilon 1
it 5
exit_
4. Execute the journal file using PyFluent.
`py_fluent_session.file.read_journal.execute_command(["journal_file.jou"])`
5. Observe the Fluent behavior after the journal execution.
### 💻 Which operating system are you using?
Windows
### 📀 Which ANSYS version are you using?
fluent 232
### 🐍 Which Python version are you using?
3.11
### 📦 Installed packages
```shell
ansys-api-fluent==0.3.35
ansys-api-platform-instancemanagement==1.1.3
ansys-api-tools-filetransfer==0.1.1
ansys-fluent-core==0.32.2
ansys-platform-instancemanagement==1.1.2
ansys-tools-filetransfer==0.1.1
ansys-units==0.6.0
blinker==1.9.0
certifi==2025.4.26
charset-normalizer==3.4.2
click==8.2.1
colorama==0.4.6
contourpy==1.3.2
cycler==0.12.1
defusedxml==0.7.1
Deprecated==1.2.18
docker==7.1.0
Flask==3.1.1
fonttools==4.58.1
googleapis-common-protos==1.70.0
grpcio==1.72.1
grpcio-health-checking==1.62.3
grpcio-status==1.62.3
idna==3.10
importlib_metadata==8.7.0
itsdangerous==2.2.0
Jinja2==3.1.6
joblib==1.5.1
kiwisolver==1.4.8
lxml==5.4.0
MarkupSafe==3.0.2
matplotlib==3.10.3
nltk==3.9.1
Nuitka==2.8.4
numpy==2.2.6
opencv-python==4.12.0.88
ordered-set==4.1.0
packaging==25.0
pandas==2.2.3
pillow==11.2.1
protobuf==4.25.8
psutil==7.0.0
pyansys-tools-report==0.8.2
pycatia==0.8.3
pyparsing==3.2.3
python-dateutil==2.9.0.post0
python-pptx==1.0.2
pytz==2025.2
pywin32==310
PyYAML==6.0.2
regex==2024.11.6
requests==2.32.3
scooby==0.10.1
setuptools==80.9.0
six==1.17.0
tqdm==4.67.1
typing_extensions==4.14.0
tzdata==2025.2
urllib3==2.4.0
Werkzeug==3.1.3
wrapt==1.17.2
XlsxWriter==3.2.3
xmltodict==1.0.2
zipp==3.22.0
zstandard==0.25.0
```
Contributor guide
Research direction
Start at the PyFluent journal execution entry point, py_fluent_session.file.read_journal.execute_command, and trace how an explicit exit affects the session and RPC channel. Reproduce the journal on Windows with Fluent 232, then verify that execution terminates cleanly without the closed-channel error, leaves no background Fluent process, and releases the license.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100