ANSYS Workbench .wrk Recovery File Retention After Successful Simulations
0 reputation · 24 Apr 2023, 18:01 UTC
0 reputation · 24 Apr 2023, 18:01 UTC
The goal is to determine whether the presence of a .wrk recovery file after a simulation run signals a deployment failure or simply reflects Workbench’s retention policy.
ANSYS Workbench creates a temporary .wrk file during execution to allow automatic recovery after crashes. Documentation states the file is removed after a successful run, but it does not specify the exact timing or conditions for deletion.
In some deployments the .wrk file remains in the project directory even after a successful run, which can mislead users reading log entries that reference the file as evidence of a crash.
Because the retention policy is not exposed in the Workbench UI, it is unclear whether a lingering .wrk file indicates a failure or a normal run.
Which conditions trigger the automatic deletion of the .wrk file? Does Workbench keep the file for a configurable period after success? Can the retention behavior be modified or queried through the API or log settings?
35775 reputation · 25 Apr 2023, 03:17 UTC
The .wrk file is deleted only when the Workbench project is explicitly saved and closed through File → Exit after a successful solve. It is not removed immediately when the solver finishes. There is no user-configurable retention period, environment variable, API call, or UI setting that controls this behavior. A lingering .wrk file after a run that shows "Solution completed successfully" almost always means the Workbench session did not shut down cleanly (crash, force-kill, or closing the window without saving).
.wrk file at solve start to enable crash recovery.ANSYS_WRK_RETENTION), Workbench option, or ExtAPI/Journaling method exists to query, force, or time-limit .wrk cleanup.wb_log.txt and solver output (solver.out) reference the .wrk path only during recovery initialization on startup, never during routine deletion.WB.exe/AnsysWB.exe in Task Manager, or experiences a power loss after the solver finishes but before saving/closing the project..wrk file, even on a clean shutdown..wrk file is gone from the project directory.WB.exe in Task Manager. Relaunch Workbench — it will offer recovery and the .wrk file will still be present.Enterprise teams often deploy a scheduled task (PowerShell, cron, or Windows Task Scheduler) that deletes *.wrk files older than N days from project roots. This is safe only when Workbench is not running. Example PowerShell one-liner for a nightly cleanup:
Get-ChildItem -Path "D:\ANSYS_Projects" -Recurse -Filter "*.wrk" |
Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) } |
Remove-Item -Force
Does your project directory live on a local SSD or a network share (SMB/NFS)? If network-mounted, permission or latency issues are a frequent cause of deletion failure even with clean exits — this changes the remediation from "train users to use File → Exit" to "fix share permissions or move projects local."
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.