How can I restart a Transient Thermal Analysis?

oliadag
oliadag Member Posts: 4
First Comment
**

Hello everyone,

I’m working on a script to automatically generate a restart analysis for a transient thermal analysis once the calculation is completed. Ideally, I would like to create a restart object within the existing tree structure rather than generating a new system. However, insights on both approaches would be helpful.

I came across this discussion that provided some useful information, but it seems like it is not applicable to transient thermal analysis:

https://discuss.ansys.com/discussion/3062/restart-analysis-in-mechanical

Does anyone have experience with this or any suggestions?

Best regards,
Olia

Comments

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 385
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Use a python code object for after solve or after post callback. Then use this code to create a restart analysis

    Analysis = Model.Analyses[0]  #Your analysis here
    Settings = Analysis.AnalysisSettings
    Settings.RetainFilesAfterFullSolve=RestartRetainFilesType.Yes
    Ext = ExtAPI.ExtensionManager.GetExtensionByName("RestartAnalysis")
    ExtMod = Ext.GetModule()
    ExtMod.createRestartAnalysis(Analysis)
    
  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 385
    25 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Woops, just realize you want a thermal analysis restart. That is not supported natively with Mechanical or the restart Add On. You would need to do that through command snippets.

  • oliadag
    oliadag Member Posts: 4
    First Comment
    **

    Thank you, Mike! I successfully managed the restart by using the AddCommandSnippet() method to insert a command snippet.