TAGGED: file.rst, mechanical, script
-
-
July 10, 2023 at 11:03 pm
Sizhe Ma
SubscriberI am now writing a script to loop through different loading conditions and material conditions. For each iteration, I perform the static structural analysis and collect the deformation from some nodes of the mesh (the node IDs are pre-set). In the end, I write all of them into a .csv file. The problem now is the code only collects data from the first iteration since I open Ansys Mechanical. From then on, if I don't reopen Ansys Mechanical, all the deformation collected is the same as the first iteration (for other conditions). Apart from the first iteration since I opened Ansys Mechnical, a warning like this popped up for every consecutive iteration: Failed to move file from solver directory to scratch directory: file.rst.
For the most inside loop, my code looks like this:
for load in loading:
####Change loading conditions (The location of loading)
pressure = DataModel.GetObjectById(3778)
selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
selection.Ids = [load]
pressure_3778.Location = selection####ClearGeneratedData and Resolve for new condition.
####I thought this step would solve the warning, but not really.
solution.ClearGeneratedData()
solution.Solve()####Later will be data collection...
May I ask if anyone ever encounters this? I searched for the warning message on the forum, but there was not much answer. Thanks!
Best,
Ted
-
July 11, 2023 at 5:16 am
Akshay Maniyar
Ansys EmployeeHi Ted,
The issue you are facing is a 0 kB file.rst problem. Sometimes, if you press the stop button, the analysis is stopped and an empty file.rst is copied into the Mech directory. Now Mechanical has access to this file. Now, if you run the analysis again, file.rst is written by the solver. But if the analysis has finished, the new file.rst can’t be moved into the Mech folder, as 0 kb file.rst is already present in the folder.The only option to get rid of is,- Copy the .rst file path or open that folder and then close the mechanical.
- Go to the directory where that 0kb file.rst is saved.
- Delete the 0 kB file.rst
- Now open mechanical and run the simulation.
Another option is to copy the Analysis System. As the results are not copied, the file.rst problem is gone. It is a known bug, and it is resolved in the 2023R2 version. With scripting, you can try to use the second option. You can make a copy of the analysis system and apply the second set of loads.Thank you,
Akshay Maniyar
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
-
July 11, 2023 at 2:53 pm
Sizhe Ma
SubscriberThank you for the reply Akshay! I am now following your second option. I am creating a duplicate using code for each condition right now. Luckily, the 0kb file.rst problem no longer exists. But I am now having unknown error for each of those solve (starting since the very first solve of the loop). I can see “writing results” at the left bottom for every solve, and when I go to the “solver output” in “solution information”, there is no error. I am quite sure it is the problem with writing the solution. Some behavior now it is having: all the solutions are capable of finishing as long as I don’t run my script (a for-loop doing duplicate analysis and solve). After I run my script, neither the solve within the script nor solve manually (right click solution – solve) was able to write the result. All circumstances stop at writing the result part. Could it be because I am connecting to a campus vpn? But I am sure all the calculations are done with my own computer (scratch and solve directory).
Red is the original simulation that I perform duplication on while the yellow are examples of four duplicates. All these four have the same files as the original, except there is no "file.aapresults" in these four folders. Could that be the problem?
Best,
Ted
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Solver Pivot Warning in Beam Element Model
- Saving & sharing of Working project files in .wbpz format
- Understanding Force Convergence Solution Output
- User manual
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- whether have the difference between using contact and target bodies
- Defining rigid body and contact
- Colors and Mesh Display
-
7584
-
4434
-
2951
-
1422
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.