Iterative Workflow for Transient Thermal Simulation: Alternatives to APDL Commands?

Hello everyone,
Thank you in advance for your time and help!
I am currently working on a complex workflow for a transient thermal simulation. This workflow involves an iterative process where the solver is stopped at each timestep to perform some post-processing steps. The extracted information from these steps is then used to solve the next timestep.
Here’s my main challenge:
While I know this can be achieved by injecting APDL commands into the solver input file, I’d like to explore alternatives that are more Pythonic and easier to work with.
What I’ve tried so far:
Mechanical Scripting: As of my understanding it is high-level tool primarily designed for automating GUI processes, so it doesn’t seem to support this kind of workflow directly.
Python Objects with Get Solve Command Callback: While useful, this still requires injecting APDL commands, which I am trying to avoid.
PyMAPDL: I believe PyMAPDL could provide a more Pythonic approach to working with APDL, but I am unsure if it can be effectively coupled with a Mechanical instance.
Is it possible to replace the solver_input_file.WriteLine commands in the python object with PyMAPDL functions to achieve the same iterative process?
Can PyMAPDL work alongside an existing Mechanical instance, or would I need to export the Mechanical model/geometry to PyMAPDL and perform the workflow entirely outside Mechanical?
I would greatly appreciate any guidance or insights you can provide on how to achieve this workflow using Python or other alternatives to directly writing APDL commands.
Thank you!
Best Answer
-
@paschalis d. I think you are looking for a new command available starting from Ansys 2025R1 release.
Please note that this is beta in Ansys 2024R2.
1
Answers
-
@paschalis d.
I completely agree with @Rajesh Meena about the use of *PYTHON command in APDL as of release 25.1.You can stay in the /SOLU processor and continue with a single solution, but issue *PYTHON after each solve step and use PyDPF to post process the .rst file that is in -creation. You can also use PyMAPDL to update the loading or define parameters to then use in traditional APDL script after you exit the python interpreter with *ENDPY
1 -
Thank you for your help guys the *PYTHON command really helped.
1