If you missed the presentation you can view a Recording here.
Or download a PDF of the presentation here:
As always, you can see which webinars are coming up, and view recordings of past webinars at:
If you missed the presentation you can view a Recording here.
Or download a PDF of the presentation here:
As always, you can see which webinars are coming up, and view recordings of past webinars at:
OK, it is Friday afternoon and if I do not write something soon the week will be missed. We did not do a seminar this week so I can not just post the notes and some comments from the webinar, bummer. All of the real tech support people at PADT have been busy with training, mentoring and doing tech support, so they did not kick anything out. So that leaves me to come up with something. So, as is usually with me, I looked for something I felt guilty or ashamed of. Because that is the way my brain works.
And I remembered that two posting ago I put out a piece of junk macro that printed out tables, as part of the second article on tables in APDL. Although it worked it was brute force and it used a bunch of *if statements to determine how many columns to write. Ugly.
While I was extruding that particular piece of bodily waste something in the back of my mind said that APDL had an undocumented command that would suppress a line-feed on a *VWRITE. This is what one does with ‘C’ and other languages invented after the 1970’s. If you suppress the line-feed, you can just loop over the number of columns.
Next step, go to the help and see if it is there is some clue as to if that tickle in my brain was valid. I found a posting on XANSYS from 2004… by some guy name Eric Miller… Go figure.
There are two descriptors that are not documented in the help: ‘/’ and ‘$’.
‘/’ adds a newline, and ‘$’ suppresses it. So if I want to write out the values in a 1D array all on one line but I don’t know how long the array is I can do:
myar(1) = 1,2,3,4,5,6,7,8,9,10
So, extrapolating this, we can rewrite the nothing-to-be-proud about old wrttbl.mac with
Have a great weekend!
Presentation PDF is here:
Zip file with the sample USERMAT.f and input file:
I was a bit confusing on state variables. The problem is with my use of them, not with the variables. The test model only had one integration point. My code is still not working right, the default USERMAT is overwriting my flag somewhere and I don’t have time to figure it out. It’s killing me but I have to do some real work.
But anyhow, my assertion that the state variables are per integration point is correct.
I am not aware of any way to use a debugger with ANSYS. There is nothing in the documentation, and to be honest, I’ve not used a real debugger in years. So there may be a way to do so, and see your routine in the debugger since you have the source code, but I have no idea on how to do that. Perhaps someone with more debugging experience can comment below.
Someone asked about other routines that are available and we ran out of time before I could go over them. Here is a list.
|UserElem.f||User Defined Element that use newer API|
|UEL100.f – UEL105.f
UEC100.f – UEC105.f
UEX100.f – UEX105.f
|User elements defined that access the program database directly|
|USEROU.f||Stores user-provided element output|
|USERAN.f||Modify orientation of material properties|
|USERRC.f||COMBIN37 (control/thermostat/spring/damper/resistor) user routine.|
|UEIMatx.f||Access to an elements matrix or load vector|
|UTHICK.f||Sets thickness at integration points|
|UsrFictive||Sets “fictive” temperature (I have no idea what that is)|
|UFLEX.f||Calculates pipe flexibility for PIPE288/289|
|UsrShift.f||Allows user to specify time shift|
|UserMat.f||User material models|
|UserHyper.f||User defined hyperelasticity models|
|UserCreep.f||User defined creep model|
|user_tbelastic.f||Allows definition of elastic stiffness at a given integration point based on user model. TB,ELASTIC,,,,USER|
|USERFC.f||User defined failure criteria|
|USERSWTRAIN.f||User defined swelling, for TB, SWELL,,,,USER|
|USERCK.f||Helper routine that passes material properties for a user material in|
|USERFRIC.f||User defined friction calculation. Not just friction but all values calculated in contact calculations with friction turned on.|
|USERFL.f||Changes scalar field values (temp, fluence, heat generation, moisture content, magnetic virtual displacement), by element.|
|USERPR.f||Calculates element pressure, by element|
|USERCV.f||Calculates element face convection.|
|USERFX.f||Calculates element face heat flux|
|USERCH.f||Calculates element face charge density surface values|
|USERFD.f||Computes complex load vectors for frequency domain logic|
|USERPE.f||Calculate the rotation of an elbow pipe element caused by internal pressure|
|Modifies the conduction, film coefficient, bulk temp for SURF151/152|
|userPartVelAcc.f||Ocean wave particle acceleration calculation for PIPE288/289|
|userPanelHydFor.f||Calcs hydrodynamic loading on SURF164 from ocean loading|
|USER01.f-USER10.f||Create your own ANSYS commands that are accessed through /UCMD,cmd,num where num refers to the subroutine number and cmd is the command name you want to assign it. Put this in your startxx.ans file to give regular access.|
About a month ago we published an article on “What Every User Should Know About Tables in ANSYS Mechanical APDL” At the end of that article we had a section on “Other Stuff” and expressed our hope to cover those subjects in the future. The future is now. If you are not very familiar with table arrays, make sure you review the previous article before delving into nesting and 4/5 dimension tables in this article.
By the way, the funky table at the end of the article got a lot of good feedback, so I’ve googled around and found some other interesting tables. The one here at the top is what you get if you google “complicated table”
As you will remember from memorizing the previous article, a common use for tables is the set them up to give you a value for a given “primary variable” that is determined by the solver at a given point in the solution. Possible primary variables are: TIME, FREQ, X, Y, Z, TEMP, VELOCITY, PRESSURE and SECTOR. But what if you want to use one of those primary variables to look up a value, then use that value to then interpolate a second value?
A good example is that you have a piece of rotating equipment and the value of the heat transfer coefficient (HF) is a function of RPM and the radius of a given element face. But RPM varies over time. What you can do is make the HF table point to and RPM table that is based on the primary variable time:
mycnv(1,1) = .25,4,10
mycnv(1,2) = .35,7,15
mycnv(1,3) = .45,10,28
This macro is missing stuff, like a model and selecting the nodes to apply the SF command to.
The tables look like this:
Table: mycnv RPM vs X
| 0.000 1.000 2.000
0.000 |0.2500 0.3500 0.4500
1000. | 4.000 7.000 10.00
0.2001E+08| 10.00 15.00 28.00
Table: rpm TIME vs
0.000 | 0.000
10.00 | 5.000
40.00 | 20.00
60.00 | 30.00
(We’ll cover the wrttbl macro below.)
So at a given substep, the program will take time and figure out what RPM needs to be. Then it will use RPM and the radius (X in CSYS 1) to figure out the convection coefficient for each node.
As you can imagine, you can get pretty sophisticated with this. The key is that the name of the table you use for the calculated value is input into the variables to interpolate on for the second table, using the *DIM command.
Another common use is scaling tables based on some value. Let say you have a pressure table and the total pressure is scaled over time, based on time. You would make a pressure table that is dependent on say X and y. It would have two planes. One with 0 values and one with the max values. Then you would make a scale table that scales from 0 to 1 based on time. It would look like this:
*DIM,pscl,table,5,,,time !Row label is CPTAB, the table of Cps
pscl(1,1) = .25,.5,1,1,.333
ptab(1,1,1) = 0,0,0,0
ptab(1,2,1) = 0,0,0,0
ptab(1,3,1) = 0,0,0,0
ptab(1,4,1) = 0,0,0,0
ptab(1,1,2) = 72,48,97,123
ptab(1,2,2) = 53,48,88,98
ptab(1,3,2) = 43,38,77,88
ptab(1,4,2) = 33,28,55,77
As always with tables, double check things and make sure you have your rows and columns correct. Start simple, and then add more detail. Testing out on a 2×2 or 3×3 tables is a good way to start.
Most users will simply use a one, two, or even three dimension array or table (row, column, plane). However, both arrays and tables support two more dimensions: books and shelves. Because this capability is a later addition to the program, it behaves a little differently. You need to add values for the size of the book (KMAX) and the shelf (MMAX) as well as variable names for each: VAR4 and VAR5
The first difference is in the *DIM command. For normal arrays and tables you use:
*DIM, Par, ARRAY, IMAX, JMAX, KMAX, Var1, Var2, Var3, CSYSID
*DIM, Par, TABLE, IMAX, JMAX, KMAX, Var1, Var2, Var3, CSYSID
For 4 dimension arrays or tables you use:
For 5 dimension arrays or tables you use:
It is important to be aware of this because if you look at the manual entry for *DIM it only lists the 3 dimension version of the command, and these variations are covered in the notes.
Once the array or table is defined you have to fill it using APDL commands, this size is not supported in the user interface. The same commands are used, but instead of supplying one, two or three indices values, you supply four or five.
The following is an example of defining a table in terms of location (X,Y,Z), Time, and Temperature. This is the most common usage of a five dimension table:
*dim,ldval,tab5,3,3,3,3,3,X,Y,Z,TIME,TEMP ! table
*taxis,ldval(1,1,1,1,1),1,-2.3,0,3.4 ! X Range
*taxis,ldval(1,1,1,1,1),2,-1.2,0,1.8 ! Y Range
*taxis,ldval(1,1,1,1,1),3,-3.6,0,4.5 ! Z Range
*taxis,ldval(1,1,1,1,1),4,0,5,10 ! Time Range
*taxis,ldval(1,1,1,1,1),5,32,320,500 ! Temp Range
!silly made up equation to fill the table with
ldval(ii,jj,kk,ll,mm) = ii*.123+jj/.2+ll*kk+mm*JJ*JJ
For simple 2D tables with up to 10 columns, I use a cheesy macro I wrote called wrttbl.mac. It was used above. It is a bit of a brute force method, because it has code blocks for from 0 to 10 columns. A more general approach would build the actual *VWRITE commands with *VWRITES… It should also be expanded to do Planes. Maybe for a future article.
Anyhow, here it is, maybe you will find it useful.
ttbl = arg1
fname = arg2
nmcl = nint((ncl*10)/2)
nmrw = nint(nrw/2)
('Table: ',A,' ',A,' vs ',A)
And with that, I think we have beaten the table topic to death.
PADT is proud to announce that it has added the VCollab 3D Visual Collaboration Software for CAE (http://www.vcollab.com) to its software product offerings. PADT will offer VCollab along with VCollab’s facilitating CAX file format to deliver on the growing need for smaller simulation result files and increased efficiency in data transfer to its customers in Arizona, New Mexico, Colorado, Utah and Nevada. You can read more at on our press release.
What does this mean to you the ANSYS user? Well it means you can share your models and results in 3D with others: over the web, imbedded in MS Word or PowerPoint, from within EKM, or as a stand alone file. The tool converts your monster ANSYS result file into a lightweight file that only has the results you want to share. We like it because of the small file size and the fact that we can send one 3D “image” instead of a bunch of different 2D images to our customers.
You can learn more about it at our next Webinar:
Using VCollab to Share 3D ANSYS Results
September 13, 2012
12:00 – 1:00 MST
You can also try it out yourself by signing up to get the free viewer:
Register and they will email you a login. Once you log in you can download the viewer (Download tab) and also look at some sample models they have.
Note: You need to set the following Environment Variable:
Variable : VCOLLAB_SKIP_OGL_DRIVER_CHECK
Value : 1
You can also look at the one we use in the Webinar:
We will be sharing more on this tool as time goes by.
We announced that we were a Geomagic reseller when we rolled out our 3D Laser and Cross Sectional Scanning hardware offerings. Although we added this as a tool for our scanning customers, we have found many ANSYS customers that are interested in it or that already had it in house.
If you don’t know Geomagic, it is a suite of tools that take scan or faceted (yes, meshes are included) and allows you to repair them, wrap them, compare them, or convert them to usable CAD solid geometry. Yes, this is the tool you have been looking for to take your distorted FEA mesh and convert it into a usable CAD model.
So we wanted to let everyone know that we are now certified to offer training on the Geomagic suite. As always, we can offer training when your want it and where you want it, or you can sign up for one of PADT’s scheduled classes. The first two are in October:
Click on the course names to get more information on the content and to register, or simply contact us at 480.813.4884 or email@example.com.
Look for some Focus articles on Geomagic, or a seminar for ANSYS users, later in the year when we get caught up on our backlog and Joe has some time to prepare something.
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:
You end up with a Details view like so:
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.
I was having a discussion with a user who is very experienced with a FEA tool other than ANSYS. He wanted to define some properties with respect to time and his rotational speed and wanted to know how hard it would be to write a custom routine in ANSYS to do that. I immediately explained that it was not that hard, as long as you have the right compiler. Then I realized that you did not need to compile any code. Unlike that other software, we have tables in ANSYS and you can use those to interpolate data relative to some other value. And, now that it is Friday morning and we still do not have a FOCUS article for the week, I thought it would be a good time to review the basics of Tables in APDL.
ANSYS Mechanical (Workbench) users, do not leave and go back to reading TMZ. This is useful to you as well because you can use code snippets in ANSYS Mechanical to define some very sophisticated loads without ever getting into Mechanical APDL. One of those cool powerful things you can do in Mechanical. In fact, if you look at the input file that ANSYS Mechanical sends to the solver, it is often full of tables that ANSYS Mechanical makes.
This article will just touch on the simple aspects of tables that every user should know. There is a lot more you can do with tables, but we will save that for future articles.
The APDL language has three type of parameters: variables (single numbers or 8 character strings), arrays, and tables. variables and arrays are just like variables and arrays in most programming languages. But tables are unique in that the indices are real numbers rather than integers. And when you refer to a value in a table the program does a linear interpolation between the numbers you supply to get the value at that location. Think of it as a graph where instead of points you have a line:
What makes it even better, is that the table can be multiple dimensions. So you can make a value dependent on a location in 3D space, val(x,y,z), space and time, val(x,y,z,t), or even some input you need to use, val(x,y,z,t,myVal).
You get an interpolated value by simply using it in a formula:
x = 2.4
y = 1.66
z = 23.5
frc = frc_tbl(x,y,z)
Also, many commands in ANSYS Mechanical APDL take a table as an argument. And the solver will input proper index values at solve time. The simples example of this is a nodal force using the F command:
For each substep, the solver will interpolate a force value for node 47 in the X direction based the value of things like time, frequency, position, temp, and such for the current substep. More on how to define what values to use as an index below.
One other key thing to know about tables before we get into the details is the way they work. What ANSYS does is take an actual array, and add a 0 column, row or plane to the array. So instead of going from 1 to 10, the array goes from 0 to 10. And the index values are stored in this 0 row, column, or plane. So to see the values using the *STATUS command, you have to tell it to start listing at 0 with the IMIN, JMIN, or KMIN arguments:
Another good way to look at a table is using the *VEDIT (Parameters->Array Parameters->Define/Edit->Edit.)
The hardest part of defining a table is defining the index and values. Arrays are simple, you just define you r size with a *DIM and then supply a value for each integer index value:
val(1) = 12.4,15.6,18.5,12.4,12.4,5,3.2
For tables, you need three steps: define the table with *DIM, define the indices (the axes), then provide the values.
val(1) = 12.4,15.6,18.5,12.4,12.4,5,3.2
Note that in the *DIM command, you have to specify that this is a table with TABLE. For array’s you can say ARRAY or leave it blank, because ARRAY is the default.
The next command, *TAXIS, is the important one. It does not call several cabs to pick you up. It defines the Table AXIS… get it, TAXIS. The first argument is the name of the table you want to fill, with the index put in for the row you want to start on, and the second is the index you want to fill. Then you give the actual values.
Finally we supply the actual values just like in an array, but each value corresponds to the index values specified in the *TAXIS command.
The above example results in:
This example is for a 1D table. A 3D table works the same, you just need to define 3 axes and 3 columns of values. Note that the first argument on the *TAXIS command is the column number that the axis refers to.
temptab(1,1,1) = 10,100,10
temptab(1,2,1) = 12,150,10
temptab(1,3,1) = 10,90,7
temptab(1,1,2) = 12,120,12
temptab(1,2,2) = 15,180,15
temptab(1,3,2) = 17,90,12
temptab(1,1,3) = 20,200,20
temptab(1,2,3) = 22,250,20
temptab(1,3,3) = 20,290,27
This will produce:
If you find the code a bit confusing, we recommend that you use Parameters->Array Parameters->Define/Edit->Add… to create your tables, then look at the log file to get the commands.
Using Tables with Loads
The real value of tables is their use with commands that accept a table as a value, and this is usually some sort of load. The help for a given command will tell you if it takes a table as an argument. If it does not, simply put the command in a *do-loop.
When you specify a table, you need to tell the command interpreter that it is a table and not variable or a string by placing the command in side percent signs: f,frc_nodes ,fx ,%fx_load%.
But how do you tell the solver what solver values your indices refer to? If you want the force applied based on the X,Y,Z position of the nodes in the component frc_nodes, you need to say which column in your table is X, Y, and Z. You do that with the *DIM command:
*DIM, Par, Type, IMAX, JMAX, KMAX, Var1, Var2, Var3, CSYSID
Var1, Var2, and Var3 are predefined keywords that are called Primary Variables. The possible values are:
|X||X location of entity|
|Y||y location of entity|
|Z||z location of entity|
|SECTOR||Cyclic sector number|
So to define loads that vary with Z position and time you would do:
val(1,1) = 12.4,17,10.5
At each substep the program will go through each node in FRCNDS and get its Z location and the current time and interpolate a force and apply it to that node. I do not know about you, but I think that is pretty slick.
The obvious next question is how do I deal with a different coordinate system? The last argument on *DIM is CSYSID. You supply a local coordinate system number here and the program will use that coordinate system to figure out the position of the entity it is applying a load to.
We strongly recommend you look at the *DIM and *TAXIS commands in the help. Also read section 3.10 of the ANSYS Parametric Design Language Guide, specifically the section on Table Type Array Parameters.
Some other things you can do with tables that we hope to cover in the future, but that you can also figure out on you own using the help are:
// Basic Analysis Guide // 2. Loading // 2.5. Applying Loads
And we will finish with a picture of a really cool table and bench I found on line: I want to get this for my patio.
There is a folder with a big fat exclamation point on the top of the Solutions branch in ANSYS Mechanical. It is called “Solution Information.” Most users click on it after their run is done and maybe look at the output from the ANSYS Mechanical APDL solve.
And it is very handy to check your output when your job is done:
But this feature has an exclamation point on its folder icon for a reason! It is a very useful tool! While doing tech support we have found that users often do not take advantage of the information displayed here, and if they did so their ANSYS Mechanical experiences would be more efficient and even more enjoyable.
When you click on the Solution Information branch in Solution, the graphics window turns to the worksheet window and you see Solver Output. This is the jobname.out file that ANSYS Mechanical APDL creates as it solves, and it is full of useful information. The window updates at a user defined interval, the default of 2.5 seconds seems to work well.
It is a good idea, even for a static run, to watch this window as things solve. It tells you where the solver is in the solver process, shows any warnings that might pop up, and lists the key information about your model and solver settings.
At first the information may seem a bit overwhelming. But give it time, study it, understand what each piece of information is and what it is telling you. Users who watch and understand the Solver Output when they solve understand their models better, and debug problems much faster.
The down side of the solver listing is that it is a text file. Text files are great for showing information at a certain portions of your run, but are not so great for comparing multiple points. But graphs are. And the same command can be changed to show all sorts of useful information about non-linear runs.
The list of available graphs varies depending on what type of solve you are doing. The most common values to look at are the Force Convergence for structural.
Take a look at this image. As you can see there are two graphs. The top one plots the convergence information you want to see vs. the number of iterations. The bottom graph shows time vs cumulative iterations. Notice that there is data being graphed, force convergence and criteria in this case. But there are also vertical dashed lines. These give you feedback on what events happen and at what iteration they occurred. Mostly they tell you that a substep or a load step converged.
You can watch these non-linear graphs while your model is running, or after the run to see what actually happened. I like to watch them as I solve because, honestly, it seems like the runs go faster. You find yourself watching that magenta line go up and down hoping it will go under the light blue line, and cheering when it does.
Take a look at the other types of non-linear graphs you can view and think about the impact of the data towards your run. As an example, if you see a lot of vertical lines indicating that you are bisecting, then you should look at setting up more substeps on each loadstep. The same thing if you see the convergence taking a long time. Such information can not only help converge a model that is having problems, but it can help you set up future runs such that they converge faster.
If you click on an item that there is no data for, you get a nice “No data to display” message. You will also get this before the data is available.
When you click on the Solution Information branch you will notice a “Solution Information” ribbon bar show up at the top of the window.
This allows you to define information you want to track while solving, things like displacement, gap on contacts, or energy. The values update as the problem is being solved, providing some nice insight into what your model is doing.
To use it, RMB on Solution Information or pull down the Result Tracker menu. Only results that are applicable to your solve will be available. Once you pick the ones you want, you need to specify the geometry you want to apply it to, if applicable. Usually it needs to be a vertex or a contact/joint. Do this in the normal way then fill out the rest of the detail view. As an example, if we want the deflection on the corner of an object, you pick the vertex on the corner then specify the axis you want the information in.
Note: You can not add a result tracker object during or after a solve, you have to do it up before you solve. So do not think about using this capability as a probe.
You can select as many of the objects as you want and plot them all at the same time, which is very handy. Once the run is done, you can save the graph as an image or export the data to a comma delimited file or as an Excel file.
We recommend you always set up a Result Tracker for tricky contact pairs and for any significant deflection that tells you a lot about your model.
The last feature in the Solution Information branch is really not solution information, but it kind of is. If you click on the branch you will notice a “FE Connection Visibility” area in the detail view. You will also find a “Graphics” tab under the Worksheet tab:
You use these tools to see things like beams, constraints and springs that are added to your model before the solve in ANSYS Mechanical APDL. So they can only really be seen as post processing entities. By default, all types are shown. But you can change the selection under “Display” in the details view to just show specific ones. You can also change the thickness of the display and do lines or points.
What is especially important about this is that beams, Constraint Equations and springs that you add in code snippets will also show up.
It is probably true that you could use ANSYS mechanical your whole career and never use this feature. but your career will be much more stressful and much less enjoyable than if just make their use part of your normal everyday process. It can save hours of trial and error debugging.
Plus, the reality is that while you are solving you could watch Justin Bieber videos on YouTube, or you can watch your model converge. That sounds like a much better way to go… watching the model convergence, of course… yea… cause Justin Bieber is lame… and… well, you know.
The ANSYS Mechanical APDL solver has a lot of contact options. KEYOPT(12) this and KEYOPT(4) that. I’m sure we all read Chapter 3.9 of the Contact Technology Guide to understand and remind ourselves on all these options. I know here at PADT we always do so on the third Tuesday of every month… OK, maybe not.
But as fate would have it I was looking something up in there the other month and came across one of the newer options: Surface Projection Based Contact. It is on of those little options that can make a big difference, so I thought I would put it on the list of potential Focus articles, and it just bubbled to the top.
The way contact works in an FEA program is that you define a contact and a target. The program goes in and calculates if a point on the contact surface is near, touching, or inside the surface or point that is the target. If they are touching or inside forces are calculated acting on the contact points in the normal and tangential (friction) directions. You use a slew of options to determine what that algorithm looks like. But hey all need to know what the gap or penetration is between the contact and target surfaces.
What is important for this article is how the program chooses those contact points to look at and, if needed, calculate forces on.
The default (KEYOPT(4) =0) is to use the gauss points on the elements. Here is a great illustration from the online help:
Gauss points are good because there are more per element than nodes and calculations are done at the gauss points anyhow. The down side is that if you have a lot of curvature or even a corner, the true surface of your contacting part can penetrate into the target.
For those times when you do need to control things at the nodes, you can use KEYOPT(4) = 1 or 2.
The down side is that the program now has to do a lot more calculations to make things happen at the nodes, and it has to calculate normals for the contact or target surface. Plus there are fewer points. But the worst thing that can happen is node drop off if your mesh is not refined enough:
Sometimes using points for contact results can cause problems. The node penetration or drop off being good example. it can also be an issue if there is a lot of “overhang” on an element. So the developers at ANSYS have added a third option, the Surface Projection Based Contact Method, or KEYOPT(4) = 3. What the method does is look at the element faces on each side of the pair, contact and target, and calculate the union of each. If we look at the following example you can see it. The green mesh are the contact surface elements, the cyan mesh is the target. If we put them on top of each other, each unique area becomes a surface projected contact area, shown in the third image.
So instead of calculating penetration/gap at each integration point or node, it calculates an average value for each overlapping area. This can really make a big difference when you have the contact hanging off of the target, as shown in this illustration:
So the three big advantages of this approach are:
No surprise, it is not perfect or it would be the new default. The disadvantages are:
Although we have been talking about how things work in the solver, and the KEYOPTs used in Mechanical APDL, you can still access this through ANSYS Mechanical. Any contact par will have an Advanced portion of its details view. In there you can access most of the KEYOPTs, including the Detection method, which is KEYOPT(4).
And here is the drop down for Detection Method. The last one, Nodal-Projection Normal from Contact is actually Surface Based Contact Projection:
The best way to get a feel for this is to find a couple of models you have already run with one of the other contact methods and run them with this option turned on and take a look at run time per iteration, number of iterations for convergence and the resulting stresses in the contact area. If you have flat, fairly refined contact/target meshes with no overhanging, you should just see things take longer. But if you do have a curvy surface, a corner, or a coarse mesh you should see better performance and accuracy.
On May 24, 2012 Matt Sutton gave a well attended webinar on the new moisture diffusion modeling capabilities in ANSYS Mechanical APDL at R14.
Although we didn’t get a successful recording for this one (Matt has been chastised and done his penance for forgetting to turn on the recording…) we do have a PDF of the PowerPoint and a copy of the sample macro he used:
Coordinate systems are one of those things that are fundamental to Finite Element Analysis, but that most of us do not think about a lot. They are there, but some users never fiddle with them. And some users are constantly futzing around with them. We thought it would be a good idea to do a quick review of how they work in ANSYS Mechanical. We will also go over the basics for Mechanical APDL (MADL) in case you need to work with snippets.
ANSYS cares a lot about coordinate systems because they allow the program to solve in a standard, global, Cartesian system while allowing loads, constraints, material directions, layer information, beam sections, joints, result values, and a whole slew of other important aspects of the model to be specified in unique coordinate systems. This avoids making the user do coordinate system transformations. At solve time, everything gets converted.
Since everyone reading this is an engineer, I’m going to assume that everyone already knows what a coordinate system is.
It is important to start at the beginning. Design Modeler and all CAD packages I’m aware of allow you to define some sort of coordinate system. Usually just Cartesian. In workbench you can import those coordinate systems into ANSYS Mechanical by clicking “Import Coordinate Systems” from the “Advanced Geometry Options” properties for the Geometry cell in you systems.
For DesignModeler, there is an extra step. Even if you turn on the import properties you need to dell DM which coordinate systems you want imported. But first, be aware that there is no “coordinate system” entity in DM. Instead it has planes, which is a coordinate system where you draw on the Z-normal plane.
To make these available in ANSYS Mechanical, you need to scroll down to the bottom of the details for the planes you want converted over to coordinate systems, and set “Export Coordinate System” to Yes.
The following three images show setting it in DM, setting the property on the Project page, and how it shows up in Mechanical:
In ANSYS Mechanical, coordinate systems reside in the Model Tree between Geometry and Connections. Once you define a coordinate system it becomes available for use with any other object that can use a coordinate system. This allows you to define it once, and then use it many times.
You always get a Global Cartesian coordinate system, called Global Coordinate System. It is Cartesian, has an ID of 0, and sits at 0,0,0. You can not change any of these values. Any imported coordinate systems will show up underneath the global.
To create a coordinate system you Right Mouse Button (RMB) on the Coordinate Systems branch and Insert->Coordinate System. Or, when you click on the branch you also get a Coordinate System toolbar:
Click on the three color triad icon and a new system will be inserted.
Let’s look at each of the options in the details view. But note before you go there, that the first set of group define a starting location and orientation, then you apply transformations in the last detail group in order to modify those locations.
This is the easiest part. You simply choose one of your defined coordinate systems from a dropdown list when you create an object that is dependent on a coordinate system. Usually this is when you can define a value based Components rather than on geometry:
Do note that you can also use coordinate systems to transform directional result values. Simply pick the Coordinate system from the dropdown list. This is especially important when looking at hoop or radial stresses in a cylindrical part.
Coordinate systems are huge in MAPDL. Nodes have them, elements have them, sections have them. Plus you can make a coordinate system active and every command you execute is done in that active coordinate system, and converted for you to the global. Very powerful.
If you do a search in help on “Coordinate System” you get hundreds of hits in the MAPDL manual. Way too much to go over here. We do recommend that you start with:
Mechanical APDL // Modeling and Meshing Guide // 3. Coordinate Systems // 3.1. Global and Local Coordinate Systems
It explains the types, the math, and the commands needed. Read that, then move on to 3.3, 3.4, and 3.5 which talk about nodal, element and result coordinate systems.
Some key things every user should know are:
Make sure you understand how Mechanical is using coordinate systems by bringing your models up in MAPDL. Look at your nodes and see if they are rotated and how. Check the coordinate systems with a CSLIST. Make sure you feel comfortable, don’t take it for granted.
A very common need in the world of ANSYS FEA simulation is to write text to a text file from within Mechanical APDL. Sometimes you are running in MAPDL, sometimes you are using ANSYS Mechanical but you still need to write stuff out using APDL with a code snippet. The way most people do that is with *VWRITE.
Originally written to write out data in arrays, it is a very flexible and powerful command that can be used to write pretty much any type of formatted output. Something that every ANSYS user should have in their back pocket.
*VWRITE, Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9, Par10, Par11, Par12, Par13, Par14, Par15, Par16, Par17, Par18, Par19
Looks pretty simple right, just *vwrite and list what you want printed. But there is a lot more to this command.
First off you need to open up a file to write to. You have a couple of options.
Now you have a place to write to, next you need to use *VWRITE to write. *VWRITE is a unique command because it actually uses two lines. The first contains *VWRITE and a list of parameters and/or arrays to write and the second contains a format statement. We will cover the first line first, and the format second.
As you can see from the command, you can have up to 19 parameters listed on a *VWRITE command. PAR1 through PAR19 can be array, scalar, or character parameters. They can also be a constant. This is where the real flexibility comes in. You can do something like (just look at the *VWRITE line, we will talk about the rest further on):
This mixes characters, arrays, and constants in one command. As output you get:
Temp: 1. 429.56308 | TREF: 70.0000
Temp: 2. 263.55403 | TREF: 70.0000
Temp: 3. 1482.8411 | TREF: 70.0000
Temp: 4. 605.95819 | TREF: 70.0000
Temp: 5. 782.33391 | TREF: 70.0000
Temp: 6. 1301.1332 | TREF: 70.0000
Temp: 7. 1119.4253 | TREF: 70.0000
Temp: 8. 202.87298 | TREF: 70.0000
Temp: 9. 1053.4121 | TREF: 70.0000
Temp: 10. 805.71033 | TREF: 70.0000
The first thing you will notice is no *do loop. If you supply an array parameter, *vwrite loops on the parameter from the given index (1 in this case) to the end of the array. But if you don’t want the whole array written, you can control by placing *VLEN and/or *VMASK in front of the *VWRITE command:
You can have a multiple dimensions on your array. *VWRITE only increments the first index. Say you specify X, Y, and Z coordinates in an array call xyz. It would look like:
Being an older program, you are limited in what you can do with character parameters. You are limited to 8 characters. So you just use a long string parameter several times and increment the index by 8:
Kind of hokey, but it works.
Sigh. This is the one thing that I’m not fond of in *VWRITE. The original command did not support outputting integer values. That is because the FORTRAN I descriptor was not supported, and ANSYS stores everything as an integer anyhow. But people needed to output integer values so they took the ‘C’ format routines for *MSG and made them work with *VWRITE. So you can do a %I. See the section on ‘C’ formatting below for more information on this.
Close the File
Before you can do anything with the file you create you need to close it. Not to hard: *CFCLOSE does the trick.
Other Stuff you Need to Know
Don’t put a blank in there. If you do, *vwrite stops looking at parameters. So if you need a blank in your file, put in a space ‘ ‘ or use the X FORTRAN descriptor.
Be aware of *CFWRITE as well. It is a way to write APDL commands to a file. If what you want to do is have your macro write a macro, *CFWRITE is better because you don’t have to do format statements. And those can be a pain when you need commas.
If your arrays are of different lengths, *VWRITE will loop for the length of the longest array. Any shorter arrays will be replaced with zeros for number arrays and blanks for character/string arrays.
You can not use *VWRITE by pasting or typing into the command line. You have to read it from a file.
The key, and the difficult part of using *VWRITE is the format statement. We recommend that you use the FORTRAN formatting when you are writing out large amounts of columnar data, and use the ‘C’ format if you are writing out text rich information for a report or to inform the user of something.
Many users today may not even know what a FORTRAN statement looks like. A good place to look is:
Just remember that you can’t use the Integer (I) format. The list directed format (*) also does not work. If you are new to it also remember everything goes in parenthesis and it has to fit on one line. It does not have to start in column 8 (if you think that is funny, you are old)
As to ‘C’ formatting, you have a lot more options but we have found that the behavior is not as consistent between Linux and windows as the FORTRAN. But if you are more comfortable with ‘C’, do that. Not all of ‘C’ formatting works in APDL, but what does is actually documented under the *MSG command.
We always recommend you work out your *VWRITE issues in a small macro that you can run over and over again as you work out the formatting. If you are writing a snippet for ANSYS Mechanical. Go ahead and save your model, bring it up in MAPDL, then work on your *VWRITE statement till you get it right.
Some other useful suggestions are:
It is a busy week and I’m in between meetings for about 30 minutes, just enough time for a very short Focus posting for the week. So, I thought I would share something I had to remember for the first time in a long time: How to access beta features in ANSYS Workbench.
First off a word of warning: Beta features are beta features. They are capabilities in the software that have either not finished testing, are not fully documented, or that have a known issue. They therefore must be used AT YOUR OWN RISK!!!! If you find a bug or a problem, report it to your technical support provider, they need that feedback. But don’t call up indignant because it is not working the way you want it, or because the documentation is non-existent. It is a beta feature.
Not too difficult. From the Project Schematic page go to the tools menu and select Options.
Now, in your project toolbar you should see (Beta) next to the exposed beta functions:
This will also impact any beta features, if any, in the workbench native applications: Parameter manager, Engineering Data, or DesignXplorer.
That is it. I promised short. Off to another meeting.
Remember, USE AT YOUR OWN RISK.