TAGGED: apdl, time-stepping-method, transient-analysis
-
-
October 30, 2023 at 4:30 pm
Mathijs Verbist
SubscriberHi, I'm working on a transient analysis in (Py)MAPDL and I would like to read data inbetween loadsteps and continue after with a new loadstep. But when I go from /POST26 (to read the output) to /SOLU again and solve a new loadstep, the states (speed and displacement) of the previous loadstep are deleted and the simulation is started from 0. How can I make sure that the previous timestep is taken into account after exiting /POST26 to /SOLU?
Do I have to use initial conditions for the next step, or is there an option to keep the previous step?
/SOLU
!D, 20, ALL
D, 20, ROTY
D, 20, ROTZ
D, 20, ROTX
F, 20, MX, 0
ANTYPE, TRANS
NSUBST, 10,10,10
OUTRES, ALL, ALL
KBC, 1
F, 1, MX, 10
time, 1
lswrite, 1
solve
/POST26 !this step is needed for external processing and updating the loads in the next step
NSOL, 2, 1, ROT, X, ROTX
NSOL, 3, 1, OMG, X, ROTVELX
/SOLU
F, 1, MX, 100 !value here is dependant on the previous solutions
time, 2
lswrite, 2
solve -
October 31, 2023 at 7:37 am
Erik Kostson
Ansys EmployeeHi
Perhaps use restart option.
Example
end_time = arg1 ! WB parametersstep = arg2substep = arg3limpres = arg4delta_t = end_time/step ! time incrementsave,model,db ! (database saved for diagnosing purpose)/soluantype,4 ! transient analysisautots,off ! User turned off automatic time steppingtimint,ontime,1e-5 ! a very small initial timeallssolve*do,i,1,step,1 ! loop substep numberfini/post1set,i ! read ith step!do something hereallsel,allfiniparsav,all,my_par,txt ! save paramters/soluantype,4,rest ! restart from last steptimint,onautots,off ! User turned off automatic time steppingparres,new,my_par,txt ! resume parametertime,i*delta_tnsubst,substep!do something here/soluallssolve*enddoHope this helpsErik-
November 1, 2023 at 11:14 am
Mathijs Verbist
SubscriberHi Erik, thank you for responding.
It think it works in MAPDL itself, but when tested with PyMAPDL, it now only solves the first loadstep. Figure 1 is what the codes returns, while it is supposed to look like figure 2 after the second load step. (Figure 2 is created without going into POST26 and without restarting the solution)This is the code I run now:
mapdl.slashsolu()mapdl.keep(1)#mapdl.d(20, "ALL")mapdl.d(20, "ROTY")mapdl.d(20, "ROTZ")#mapdl.d(20, "ROTX")timesteps = 2substeps = 10substeps_max = 10substeps_min = 10mapdl.run("ANTYPE, TRANS")mapdl.timint("ON")mapdl.autots("OFF")mapdl.nsubst(substeps, substeps_max, substeps_min)mapdl.outres("ALL", "ALL")mapdl.kbc(1)#mapdl.d(20, "ALL")mapdl.d(20, "ROTY")mapdl.d(20, "ROTZ")#mapdl.d(20, "ROTX")mapdl.f(1, "MX", 10)mapdl.time(1)mapdl.lswrite(1)mapdl.solve()mapdl.post26()rot_displ = mapdl.nsol(2, 1, "ROT", "X", "ROTX")#print(rot_displ)mapdl.allsel("all")mapdl.finishmapdl.parsav("all","my_par","txt")mapdl.slashsolu()mapdl.antype(4,"REST")mapdl.timint("ON")mapdl.autots("OFF")mapdl.parres("new","my_par","txt")mapdl.f(1, "MX", -10)mapdl.slashsolu()mapdl.time(2)mapdl.lswrite(2)mapdl.solve()mapdl.post26()rot_displ = mapdl.nsol(2, 1, "ROT", "X", "ROTX")#print(rot_displ)# Plot nodal displacement against timeplt.plot( rot_displ, marker='o', linestyle='-')plt.xlabel('Time (seconds)')plt.ylabel('Nodal rotation')plt.title('Nodal rotation vs. Time')plt.grid(True)plt.show()mapdl.exit()
-
-
November 1, 2023 at 6:13 pm
Mathijs Verbist
SubscriberI got is working by using the restart in combination with lssolve, i ,i ,1 instead of just using solve. Now all the steps get solved while getting the data inbewteen the steps
-
- 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
- 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
- A solver pivot warning or error has been detected
-
8762
-
4658
-
3151
-
1678
-
1456
© 2023 Copyright ANSYS, Inc. All rights reserved.