Changing Results Values in ANSYS Mechanical APDL–DNSOL and *VPUT

Categories:

So it is Friday afternoon and that big, involved, deep-dive into some arcane ANSYS capability is still not written.  So, time for plan B and the list of not so involved but still somewhat arcane capabilities that we like to expose in The Focus.  At the top of that list right now is how to change the results in an ANSYS Mechanical APDL (MAPDL) solve.

One might ask why would you want to do this?  Well the most common usage is that you want to use APDL to calculate some result value and then display it in a plot.  Similarly, you may want to do some sort of calculation or post processing on MAPDL results but using and external piece of code, but still show the results in ANSYS.  Another common usage is to use MAPDL as a post processor for some external solver.

And, it turns out, it is pretty easy.  And, as you probably have learned by now if you use MAPDL a lot, there is more than one way to do it.

The “Database”

Before we get into how to do this, we need to talk about the “database” in MAPDL. If you read through the documentation on the commands we will use, it will talk about the database.  This is not the jobname.db file.  That is the db file.  The database refers to the representation of your model, including results and the currently active loads, in memory when you are running MAPDL.

When you do a RESUME command, MAPDL reads the DB file and stores the model, including geometry, mesh, loads, and run parameters, in memory.  When you do a SET command, it then adds the results and related information into memory.

So when we use the commands we will talk about next, you are changing what is in the database, not what is in the DB file on your disk.  And you are storing it temporarily.  Many different commands cause the database to go back to its original values.  So you need to be very careful in how you use these tools, and don’t assume that once you have used them, the changes are permanent.

DNSOL

The simplest way to do it is with the DNSOL command: DNSOL, NODE, Item, Comp, V1, V2, V3, V4, V5, V6

So, if you do a dnsol,32,u,x,3.145  the value in memory for deflection in the X direction will be changed to 3.145.  dnsol,32,s,x,1.1,2.2,3.3 will change the stress on node 32 in the X direction to 1.1, in the Y direction to 2.2, and in the Z direction to 3.3.

The second argument can also be a component, so you can assign a uniform result value to many nodes at the same time.

Here is an example, very simple, of a block where we set the deflection on the top nodes to 1 in.

   1: finish

   2: /clear

   3: /prep7

   4: blc4,-2,-2,4,4,20

   5: et,1,185

   6: mptemp,1,70

   7: mpdata,ex,1,1,20e6

   8: mpdata,nuxy,1,1,.23

   9: mpdata,dens,1,1,.001

  10:

  11: vmesh,all

  12: /view,1,1,1,1

  13: /vup,1,z

  14: /RGB,INDEX,100,100,100, 0

  15: /RGB,INDEX, 80, 80, 80,13

  16: /RGB,INDEX, 60, 60, 60,14

  17: /RGB,INDEX, 0, 0, 0,15

  18: /show,png

  19: eplot

  20:

  21: nsel,s,loc,z,0

  22: cm,nbt,node

  23: d,all,all

  24: nsel,s,loc,z,20

  25: cm,ntp,node

  26: f,all,fx,10

  27: f,all,fy,12

  28: allsel

  29: save

  30:

  31: /solu

  32: solve

  33: finish

  34: /post1

  35: plnsol,u,sum

  36:

  37: dnsol,ntp,u,y,1

  38: plnsol,u,sum

  39:

  40: /show,close

aa1003The Fancy Mesh

aa1004The Normal Solution

aa1005Solution with 1” deflection DNSOL’d onto the top nodes

Pretty simple.

NOTE: One key thing to remember is you can not use this with Powergraphics. You must have /graph,full turned on.

*VPUT

The DNSOL is great for a few nodes here and there, or a constant value. But it makes for a big nasty *do loop if you want to do a lot of nodes. So ANSYS, Inc. give us the *VPUT command:

*VPUT, ParR, Entity, ENTNUM, Item1, IT1NUM, Item2, IT2NUM, KLOOP

As you can see, this command has a lot of options, so read the Help before you use it. Most of the time you have an array that stores the value you want stuck on your model in an array (ParR).  Then you specify what MAPDL result you want to overwrite and it takes care of it for you.

*vput,nws1(1),node,1,s,1 will place new values for maximum principal stress on all the nodes covered in the array , starting at 1.

Here is an example of the code, after the same solve as above, to do a *vput instead of a DNSOL:

   1: finish

   2: /post1

   3: plnsol,u,sum

   4:

   5: *get,nmnd,node,,num,max

   6: *dim,nwux,,nmnd

   7: *do,i,1,nmnd

   8:     nwux(i) =  i

   9: *enddo

  10:

  11: *vput,nwux(1),node,1,u,x

  12: plnsol,u,sum

aa1017

The code places a displacement in the X direction equal to its node number.  So node 80 has a UX of 80.

A key thing to note with *vput is that it is much more transient. Pretty much any other command that involves anything other than plotting or listing blows away the values you assigned with *VPUT.  So we recommend that you do a *vput before every plot or listing you do.

Thoughts, Questions, and Conclusion

Of course you should never use this to fudge results.

You can get very fancy with this. When I use it I often turn off all the plot controls and then create my own legend. That way I can put hours of life on as temperature or SX and then make my own legend that says LIFE or something of the sort.

Another thing to note is that if you DNSOL or *VPUT a displacement, then ANSYS will distort your plot by that much.  That is OK if you are changing deflection, but not so good if you are plotting life or some esoteric stress value.

A common question when you play with these commands is if you can store the modified results in the RST file.  You can for degree of freedom results, but not for stresses.  You use LCDEF and RAPPND.

And what about ANSYS Mechanical?  Well it works totally different, and better. You can do all of this using Design Assessment, which was covered in a webinar and a Focus article you can find here.

The key to using these two commands is pretty much the same as any APDL command: Start on a small test model, write a macro to do it, and keep things simple. And, read the manual.  Everything you need to know is in there.

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

09/26/2023

Experience Stratasys Truck Tour - Houston

09/22/2023

AIAA Rocky Mountain Section Technical Symposium 2023

09/22/2023

Experience Stratasys Truck Tour - Dallas, TX

09/21/2023

Accelerating the Energy Transition through Simulation

09/20/2023

3D Printing vs. CNC Machining - Webinar

09/13/2023

Maxwell Updates in Ansys 2023 R2 - Webinar

09/12/2023

Sandia Science & Technology Park 25th Anniversary

09/12/2023

Experience Stratasys Truck Tour - Tempe, AZ

09/08/2023

26th Annual New Mexico Flying 40 Awards

09/08/2023

New Mexico Tech Summit

09/07/2023

New Mexico Tech Summit

08/30/2023

Structures Updates in Ansys 2023 R2 (1) - Mechanical, Post & Graphics

08/23/2023

Improved Injection Molding with Additive - Webinar

08/22/2023

SPIE Optics & Photonics Exhibition 2023

08/16/2023

Fluids Updates in Ansys 2023 R2 - Webinar

08/04/2023

Experience Stratasys Truck Tour - Salt Lake City, Utah

08/01/2023

Experience Stratasys Truck Tour - Denver Colorado

07/26/2023

Solving Supply Chain Issues with Additive - Webinar

07/25/2023

Arizona Tech Leadership Golf Tournament

07/24/2023

Arizona Tech CEO Leadership Retreat

07/19/2023

System Automation & Optimization Updates in Ansys 2023 R1 - Webinar

07/13/2023

2023 AEROSPACE, AVIATION, DEFENSE AND MANUFACTURING CONFERENCE

07/12/2023

Materials Updates in Ansys Granta 2023 R1 - Webinar

06/30/2023

Turbo Expo 2023

06/29/2023

Turbo Expo 2023

06/28/2023

Turbo Expo 2023

06/28/2023

Revolutionize Packaging Design with Additive - Webinar

06/27/2023

Turbo Expo 2023

06/27/2023

2023 E-MOBILITY AND CLEAN ENERGY SUMMIT

06/26/2023

Turbo Expo 2023

06/21/2023

Optics Updates in Ansys 2023 R1 - Webinar

06/07/2023

LS-DYNA Updates in Ansys 2023 R1 - Webinar

05/31/2023

Driving Automotive Innovation with Additive - Webinar

05/24/2023

Hill Air Force Base Tech Expo

05/24/2023

Structural Updates in Ansys 2023 R1 (3) – Structural Optimization & Ex

05/23/2023

CROSSTALK 2023: Emerging Opportunities for Advanced Manufacturing Smal

05/10/2023

Signal & Power Integrity Updates in Ansys 2023 R1 - Webinar

04/26/2023

Additive Manufacturing Updates in Ansys 2023 R1 - Webinar

04/20/2023

38th Space Symposium Arizona Space Industry

More Info

04/19/2023

38th Space Symposium
Arizona Space Industry

04/19/2023

Additive Aids for Manufacturing - Webinar

04/18/2023

38th Space Symposium
Arizona Space Industry

04/17/2023

38th Space Symposium

04/13/2023

Venture Madness 2023

04/12/2023

Fluid Meshing & GPU-Solver Updates in Ansys 2023 R1 - Webinar

03/29/2023

8th Thermal and Fluids Engineering Conference

03/29/2023

Structural Updates in Ansys 2023 R1 - Composites, Fracture & MAPDL

03/28/2023

8th Thermal and Fluids Engineering Conference

03/27/2023

8th Thermal and Fluids Engineering Conference

03/26/2023

8TH Thermal and Fluids Engineering Conference

03/24/2023

Arizona BioPreneur Conference | Spring 2023

03/22/2023

2023 Arizona MedTech Conference

03/22/2023

Optimize Jigs & Fixtures with Additive - Webinar

03/15/2023

3D Design Updates in Ansys 2023 R1 - Webinar

03/08/2023

Competitive Advantages of 1D/3D Coupled Simulation - Webinar

03/01/2023

High Frequency Updates in Ansys 2023 R1 - Webinar

02/22/2023

Additive Advantages in Aerospace - Webinar

02/15/2023

Structural Updates in Ansys 2023 R1 (1) - Webinar

02/09/2023

IME 2023: MD&M | WestPack | ATX | D&M | Plastek

02/08/2023

IME 2023 MD&M | WestPack | ATX | D&M | Plastek

02/07/2023

IME 2023 MD&M | WestPack | ATX | D&M | Plastek

01/27/2023

Arizona Photonics Days, 2023

01/26/2023

Arizona Photonics Days, 2023

01/26/2023

TIPE 3D Printing | 2023

01/26/2023

Venture Cafe Phoenix Talent Night - Job Fari

01/26/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/25/2023

Arizona Photonics Days, 2023

01/25/2023

Building A.M.- Utah: Kickoff!

01/25/2023

TIPE 3D Printing | 2023

01/25/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/24/2023

VFS 2023 Autonomous/Electric VTOL Symposium

01/24/2023

TIPE 3D Printing | 2023

01/18/2023

2023 AZ Tech Council Golf Tournament

12/21/2022

Simulation Best Practices for 5G Technology - Webinar

12/14/2022

Digital Twins Updates in Ansys 2022 R2 - Webinar

12/08/2022

Tech the Halls - AZ Tech Council Holiday Mixer

12/07/2022

Electric Vehicle and Other Infrastructure Update Panel

11/30/2022

SPEOS Updates in Ansys 2022 R2 - Webinar

11/23/2022

Simulation Best Practices for Electronics Reliability - Webinar

11/16/2022

Discovery Updates in Ansys 2022 R2

11/10/2022

VentureCafe Phoenix Panel: Venture Capital in AZ

11/08/2022

2022 GOVERNOR’S CELEBRATION OF INNOVATION AWARDS + TECH SHOWCASE

11/03/2022

VentureCafe Phoenix Panel: Angel Investment in AZ

11/02/2022

High & Low Frequency Electromagnetics Updates in Ansys 2022 R2

10/26/2022

Simulation Best Practices For Chip-Package-System Design & Development

10/20/2022

Nerdtoberfest 2022

10/19/2022

2022 Southern Arizona Tech + Business Expo

10/19/2022

LS-DYNA Updates in Ansys 2022 R2 - Webinar

10/17/2022

Experience Stratasys Truck Tour - Clearfield Utah

10/14/2022

ASU School of Manufacturing Systems and Networks - Formal Opening Cele

10/14/2022

Experience Stratasys Truck Tour - Midvale Utah

10/12/2022

Experience Stratasys Truck Tour - Littleton Colorado

10/06/2022

Fluids Updates in Ansys 2022 R2 - Webinar

10/05/2022

Experience Stratasys Truck Tour - Colorado Springs

09/29/2022

White Hat Life Science Investor Conference - 2022

09/28/2022

2022 AZBio Awards

09/28/2022

Simulation Best Practices for Rotating Machinery Design & Development

09/21/2022

ExperienceIT NM 2022

09/21/2022

Additive Updates in Ansys 2022 R2 - Webinar

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: