ansys / ansys/pyfluent-parametric
Fluent cannot compile code for session.project.save_as
- Dominant language
- Python
- Stars
- 29
- Forks
- 6
- 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
session.project.save_as(project_filepath=proj_path) gives the following error:
RuntimeError: Unable to compile python code:
Error Object: ()
This is only reproducible for Fluent 23.1. 22.2 works fine.
### 📝 Steps to reproduce
**Requirements (develop versions):**
ansys-fluent-core
ansys-fluent-parametric
**Set environment variables:**
PYFLUENT_FLUENT_ROOT = %AWP_ROOT231%\fluent
**Enter the following in a python interpreter:**
import os
from pathlib import Path
import shutil
import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.parametric import ParametricSession, ParametricSessionLauncher, ParametricProject, ParametricStudy, DesignPoint
# Step1: Read flprz
# Launch Fluent in 3D and double precision
temporary_resource_path = os.path.join(
pyfluent.EXAMPLES_PATH, "test_parametric_project_resources"
)
if os.path.exists(temporary_resource_path):
shutil.rmtree(temporary_resource_path, ignore_errors=True)
if not os.path.exists(temporary_resource_path):
os.mkdir(temporary_resource_path)
flprz_filename = examples.download_file(
"project-elbow-param.flprz", "pyfluent/mixing_elbow"
)
session = ParametricSession(
project_filepath=flprz_filename,
launcher=ParametricSessionLauncher(precision="double", processor_count=2),
)
# Save project
proj_path = str(
Path(temporary_resource_path) / "project-elbow-param.flprj"
)
session.project.save_as(project_filepath=proj_path)
### 💻 Which operating system are you using?
Windows
### 🐍 Which Python version are you using?
3.10
### 📦 Installed packages
```shell
ansys-fluent-core
ansys-fluent-parametric
```
Contributor guide
Research direction
Start with the supplied reproduction script and inspect the implementation of session.project.save_as and its tests, if present. Compare behavior under Fluent 23.1 and 22.2; the issue is resolved when saving the parametric project compiles successfully on the affected setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100