Description
🔍 Before submitting the issue
- I have searched among the existing issues
- I am using a Python virtual environment
🐞 Description of the bug
Hello! I came across a weird unpredictable bug that I wanted to share.
Thank you for your time and support!
I'm running a transient simulation over t timesteps using a for loop in Python. At each iteration, the Fluent model is executed for a single timestep (time_step_count = 1).
During each for loop timestep, I:
- Update the convection boundary conditions for two walls;
- Update the volumetric heat sources for 12 cell zones based on heat generation rates;
- Run Fluent for one timestep;
- Extract result values using predefined Fluent report definitions;
- Compute the heat generated using the temperature from the previous timestep and use it to update the sources for the next loop.
There are two causes or errors at random timesteps:
- Updating boundary condition: session.setup.boundary_conditions.wall[wall_name] = {"thermal_bc" : "Convection", "h" : h, "tinf" : T}
-> leads to immediate error and stops the for loop:
Error: wta(1st) to string->symbol
Error Object: #[free (3 cells)] - Updating the cell energy source: session.setup.cell_zone_conditions.solid[solid_name] = {"source_terms" : {"energy" : HGR}}
-> leads to immediate error, but Fluent doesn't crash at this moment:
Error: wta(1st) to string->symbol
Error Object: #[free (1 cells)]
An error occurred: wta(1st) to string->symbol
Error Object: #[free (1 cells)]
->the loop continues until the launch of the next timestep session.solution.run_calculation.dual_time_iterate(time_step_count = 1, max_iter_per_step = 20) and Fluent crashes:
Error: Attempt to mark a free block
Error Object: #[free (1 cells)]
Error encountered in critical code section
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 0 PID 10864 RUNNING AT MOUNTAIN24
= EXIT STATUS: -1 (ffffffff)
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 1 PID 8740 RUNNING AT MOUNTAIN24
= EXIT STATUS: -1 (ffffffff)
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 2 PID 7724 RUNNING AT MOUNTAIN24
= EXIT STATUS: -1 (ffffffff)
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 3 PID 10068 RUNNING AT MOUNTAIN24
= EXIT STATUS: -1 (ffffffff)
===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 4 PID 15224 RUNNING AT MOUNTAIN24
= EXIT STATUS: -1 (ffffffff)
This critical error has occurred in over 20 runs. It's not deterministic—the timestep where it fails varies, even when running the same model. (The random seed is fixed, so it is not the issue.)
I’ve observed that system RAM usage spikes sharply just before the crash, as seen in the monitoring screenshots below:
To mitigate this, I initially added time.sleep(0.5) after each boundary and source update, which seemed to help temporarily. However, the crash returned during longer simulations. Increasing the delay to time.sleep(1) didn’t significantly improve stability.
📝 Steps to reproduce
- Set up a transient simulation in Fluent:
- Use a model with at least two walls with convection boundary conditions and 12 cell zones with heat generation rates.
- Ensure that the model has predefined Fluent report definitions for extracting results.
- Prepare Python script:
- Implement a loop to run the simulation for multiple timesteps.
- In each iteration, perform the following steps:
- Update the convection boundary conditions for the walls. Example code:
session.setup.boundary_conditions.wall[wall_name] = {"thermal_bc": "Convection", "h": h, "tinf": T} - Update the heat generation rates for the 12 cell zones. Example code:
setup_cell_zone_HGR(session, cell_name, cell_HGR)
Run Fluent for a single timestep (time_step_count = 1). - Extract results using predefined Fluent report definitions.
- Compute the heat generated from the previous timestep's temperature, and update the sources for the next iteration.
-
Execute the script for multiple timesteps.
-
Monitor system RAM usage during execution (especially around the time of the crash).
💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
2023 R2
🐍 Which Python version are you using?
3.12
📦 Installed packages
Relevant packages:
ansys-fluent-core 0.29.0
ansys-api-fluent 0.3.35
numpy 1.26.4
pandas 1.5.3