-
-
April 22, 2024 at 4:45 amuser deletedSubscriber
I want to do the following:
Through Rocky PrePost, start a simulation for 20 seconds.
total_time = 20, but pause the simulation every 4 seconds and perform a certain operation.
stop_time = 4# Describing the study
study = project.GetStudy()
study.SetName('My Simulation')
study.SetDescription('My DEM Simulation')
study.SetCustomerName('My Customer')
study.DeleteResults()# Solver.
solver = study.GetSimulatorRun()
solver.SetSimulationDuration(total_time, 's')
solver.SetTimeInterval(0.25, 's')
solver.SetUseCompressedFiles(True)
solver.SetSimulationTarget('CPU')
solver.SetNumberOfProcessors(20)study.StartSimulation(skip_summary=False, delete_results=True)
While True:
  current_time_step = GetTimeStep('current').GetTime()
  if current_time_step % stop_time == 0:
    StopSimulation()
    print("stop.")
    break
    study.StartSimulation(skip_summary=False, delete_results=False)I understand that there are many errors here, but the main idea is as follows: there is a simulation - a total of 20 seconds. Every 4 seconds, it needs to be paused, perform 'block 1', and then resume the simulation. Can you advise how to implement this?
-
April 22, 2024 at 8:51 amRobForum Moderator
It'll be an API operation, so check that part of the documentation (in with the Ansys DOC as of 2024R1). Not sure why you want to delete the data every 4 seconds?Â
-
April 22, 2024 at 9:07 amuser deletedSubscriber
Not certainly in that way
I want to run the calculation for 20 seconds
but stop the calculation every 4 seconds
(upload some data)
continue calculationand so on
I actually can't solve the problem
how to put in "t_1" variable
current calculation time value
and check if necessary (multiples of 4) then stop the calculation, perform the action, continue the calculationif you can tell me how to implement something like this, or where there might be an example
I will be very grateful
I looked at the Rocky prepost manual until I found answers to my questions in it.thank you in advance for your help
-
April 22, 2024 at 9:30 amRobForum Moderator
I can't cover APIs on the public forum as they're generally very specific. I'll check for examples, but suspect there won't be much we can do.Â
-
April 22, 2024 at 12:26 pmRobForum Moderator
And having heard back. It's not available via the API at present, but pyRocky may work if you use threads. Check the Ansys GitHub for examples/ideas - we can't offer much assistance here.Â
-
- The topic ‘ansys rocky prepost’ is closed to new replies.
- Workbench license error
- Unexpected error on Workbench: Root element not found.
- Unexpected issues with SCCM deployment of Ansys Fluids and Structures 2024 R1
- AQWA: Hydrodynamic response error
- Questions and recommendations: Septum Horn Antenna
- access to path files denied error
- Tutorial or Help for 2 way FSI
- Unable to connect to the license
- Moment Reaction probe with Large deformation
- Ansys with Vmware and CPU configuration : I’m lost, good practice?
-
1727
-
630
-
599
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.