-
-
February 22, 2023 at 9:01 am
pavankonchada123
SubscriberHi Ansys Team,
I am able to run the ansys static structural with journal commands, but I want to run 2 to 3 systems in a sequential manner. So how can I modify my journal file so that one system is run will be followed by next system run.
SetScriptVersion(Version="22.2.192")
template1=GetTemplate(TemplateName="Static Structural",Solver="ANSYS")
system1=template1.CreateSystem()
geometry1=system1.GetContainer(ComponentName="Geometry")
geometry1.SetFile(FilePath="C:/Users/cadfem/Downloads/Geom.agdb")modelComponent1 = system1.GetComponent(Name="Model")
modelComponent1.Refresh()
model1 = system1.GetContainer(ComponentName="Model")
model1.Edit(Interactive=False)
DSscript = open("D:scrt.py", "r")
DSscriptcommand=DSscript.read()
DSscript.close()
model1.SendCommand(Language='Python', Command = DSscriptcommand)
######
system2=template1.CreateSystem()
geometry2=system2.GetContainer(ComponentName="Geometry")
geometry2.SetFile(FilePath="C:/Users/cadfem/Downloads/Geom.agdb")modelComponent2 = system2.GetComponent(Name="Model")
modelComponent2.Refresh()
model2 = system2.GetContainer(ComponentName="Model")
model2.Edit(Interactive=False)
DSscript = open("D:scrt.py", "r")
DSscriptcommand=DSscript.read()
DSscript.close()
model2.SendCommand(Language='Python', Command = DSscriptcommand)On executing the above journal both system are running at a time, Please help
Can the GetSimulationResultFile() helps the journal file to wait until one system run is done
-
February 24, 2023 at 10:45 am
Aniket
Ansys EmployeeHi,
I am not sure what are the contents of the D:\script.py but you can remove all the solve commands from it, and update the system one by one in the Workbench page to achieve what you want.
You can also record this operation in journal file.
-Aniket
-
February 24, 2023 at 1:12 pm
pavankonchada123
SubscriberScript file includes procedure such as imorting,assigning boundaries and post processing. And if I record the journal file and read it all the systems will try to run at same time right. I want to get them updated in sequential format (like update all design points) in workbench.
-
February 24, 2023 at 1:15 pm
pavankonchada123
SubscriberSo any advice that how I can achieve this with reading script file for each system and runing the systems sequentially
-
February 24, 2023 at 2:24 pm
Aniket
Ansys EmployeeHi like I mentioned, exclude all the commands that update or solve the project. You can add all the BCs and post-processing objects only (do not solve or evaluate anything in the DSscript)
i.e. after model1.SendCommand(Language='Python', Command = DSscriptcommand)
you may need something on the lines of:
resultsComponent1 = system1.GetComponent(Name="Results")
resultsComponent1.Update(AllDependencies=True)and then you will continue with second system in similar fashion. So the first system will update first and then second will be updated later from workbench page.
-Aniket
-
February 24, 2023 at 2:34 pm
pavankonchada123
SubscriberHI Aniket,
With out manual intervention I want all the systems through single journal file. But wnen I do this all the system are running at same time. Is there any method to stop workbench from going to second system until first system is completed (automatically)
-
February 25, 2023 at 11:45 am
Aniket
Ansys EmployeeThe code in the journal is executed line by line. So until
resultsComponent1.Update(AllDependencies=True)
is executed fully, it will NOT go to
resultsComponent2.Update(AllDependencies=True)
for a better understanding of this, remove the sendcommand from your code and try updating the model. You will see the mesh of the first system is generated first (obviously it won't solve after that due to lack of BCs) and the mesh of the second system is generated AFTER the generation of the first system. You can add print() messages in your code to verify that.
-Aniket
How to access Ansys help links
Guidelines for Posting on Ansys Learning Forum
-
- 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.
- Saving & sharing of Working project files in .wbpz format
- Solver Pivot Warning in Beam Element Model
- Understanding Force Convergence Solution Output
- An Unknown error occurred during solution. Check the Solver Output…..
- What is the difference between bonded contact region and fixed joint
- whether have the difference between using contact and target bodies
- User manual
- The solver engine was unable to converge on a solution for the nonlinear problem as constrained.
- Colors and Mesh Display
- material damping and modal analysis
-
3930
-
2649
-
1865
-
1272
-
610
© 2023 Copyright ANSYS, Inc. All rights reserved.