-
-
February 22, 2023 at 9:01 ampavankonchada123Subscriber
Hi 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 amAniketForum Moderator
Hi,
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 pmpavankonchada123Subscriber
Script 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 pmpavankonchada123Subscriber
So 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 pmAniketForum Moderator
Hi 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 pmpavankonchada123Subscriber
HI 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 amAniketForum Moderator
The 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
Â
-
- The topic ‘Running the system sequentially’ is closed to new replies.
- Problem with access to session files
- Ayuda con Error: “Unable to access the source: EngineeringData”
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Geometric stiffness matrix for solid elements
- How to apply Compression-only Support?
- How to select the interface delamination surface of a laminate?
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- SMART crack under fatigue conditions, different crack sizes can’t growth
-
1216
-
543
-
523
-
225
-
209
© 2024 Copyright ANSYS, Inc. All rights reserved.