Running an APDL Command Snippet for Every Load Step in ANSYS Mechanical

Categories:

This week went by very fast, and I never got time to do the more advanced article on tables to follow up on last week’s article.  So I was going to give up till someone stopped by my office to ask a question and I thought my simple and clever answer would make a nice quick, but useful, posting.

What he need to do was apply fairly complicated loading over multiple substeps. Do some *get’s, calculate some stuff, then apply a load. I immediately thought of a trick we used in the early days of ANSYS Mechanical (before it was called ANSYS Mechanical) where we would put in a script that redefined the solve command as nall (*abbr,solve,nall).  You then used your own code to do the solves.

This made us feel very smart and clever.

However, something in the corner of my brain was saying “dumb and silly.” So I fired up 14.0 and realized that my brain was right, you don’t have to trick ANSYS Mechanical any more. The developers now allow you  to specify load steps and such for preprocessing command objects.  I should know this because I did a seminar on APDL Command Objects. .

Darn no article for this week, it was already covered. 

But just to make sure I looked through the PowerPoint and found that the ability wasn’t covered. Yipee! I have an article, now to stretch it out make it look important!

If you insert a command object into your model setup:

image

You end up with a Details view like so:

image

Under definition you can set “Step Selection Mode”  This simply lets you determine if the APDL code in the command object is applied every load step (All), at the first (First), at the last (Last), or if the command object is only applied to a specific load step number (By Number). 

  If your complicated loading/modification to your model is the same commands for every load step, pick All and enter your commands. If it varies by load step in some way, you have two choices. You can write a set of commands for each load step, or you can write a macro that uses a *get,nmstp,active,,solu,ncmls and then use logic to figure out what you need to do.

So, pretty simple, but it opens up a lot of possibilities when you need to do some simple tweaks during a multi-step solve.

There, now I don’t feel like a looser for not doing an article this week.

Categories

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Additive Manufacturing Success.

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

03/28/2024

SAF Blue Carpet Event

03/28/2024

2024 Arizona Space Summit

04/03/2024

Low Frequency Updates in Ansys 2024 R1 - Webinar

04/03/2024

Venture Madness Conference Reception + Expo

04/03/2024

Stratasys F3300: Game Changing Throughput - Webinar

04/08/2024

39th Space Symposium

04/09/2024

39th Space Symposium

04/10/2024

Discovery Updates in Ansys 2024 R1 - Webinar

04/10/2024

39th Space Symposium

04/11/2024

39th Space Symposium

04/22/2024

Experience Stratasys Truck Tour: Houston, TX

04/24/2024

Structures Updates in Ansys 2024 R1 (2)

04/24/2024

Experience Stratasys Truck Tour: Houston, TX

05/07/2024

Experience Stratasys Truck Tour: Albuquerque, NM

05/08/2024

Fluent Materials Processing Updates in Ansys 2024 R1 - Webinar

05/09/2024

Experience Stratasys Truck Tour: Los Alamos, NM

05/14/2024

Simulation World 2024

05/15/2024

Simulation World 2024

05/16/2024

Simulation World 2024

05/22/2024

Optics Updates in Ansys 2024 R1 - Webinar

06/12/2024

Connect Updates in Ansys 2024 R1 - Webinar

06/26/2024

Structures Updates in Ansys 2024 R1 (3) - Webinar

06/27/2024

E-Mobility and Clean Energy Summit

07/10/2024

Fluids Updates in Ansys 2024 R1 - Webinar

08/05/2024

2024 CEO Leadership Retreat

10/23/2024

PADT30 | Nerdtoberfest 2024

Search in PADT site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: