What defines a prototype? 2018 UofA Engineering Design Day

Last week I had the distinct privilege to head down to the University of Arizona and help judge projects for the 2018 Engineering Design Day.  It is always fun to see all the different, multidisciplinary projects that combine teams from the mechanical, electrical, biomedical, optical, chemical, mining, and environmental departments.  Projects range from a new Secure Wireless Protocol, to autonomous UAVs, to medical devices of all types, to automated manufacturing process equipment used to cover electronics with epoxy. That last team had the forethought to demonstrate the equipment by programming it to put ketchup on hot dogs to give to the hungry judges. Good job, team!

In the morning, groups of judges visit 5 design teams and score their presentations and projects on a number of criteria.  They also decide if any of those teams should be nominated for any of the 27 cash awards given out this year.  In the afternoon, the same groups of judges go around to each of the nominated groups for a specific award and judge the project based on the criteria for that award. PADT sponsors the Phoenix Analysis & Design Technologies Award for Best Use of Prototyping, which this year, went to the Noncontact Detection of Bioelectric Fields project team. This innovative product is able to detect and monitora human heartbeat from a distance without the usual EKG wires and probes.

This was my sixth year judging, and I am always impressed with the amount of work and skill that the students put into their projects. I am also surprised each year by seemingly on-going confusion over what constitutes a physical prototype, not only from students but from the industry judges.  Among ten other nominations was the Laser-Guided Ankle Positioning for Total Ankle Arthroplasty team, which won the Raytheon Award for Best Overall Design.  These two teams, the winner and the runner up, stood out from the rest because in their presentations they used one small phrase for which I am always listening; “We made this to see if…”, or “to try out …”, or “to find out…”   They made a prototype specifically to learn from it.

 

Noncontact Detection of Bioelectric Fields Design Team (not in order): Kyle James Bachelor, James Norrid Lacey, Khalid Mobarak Omer, James Samuel Pelham, Bernd Francisco Steklis (I’m the young guy in the yellow.)

Since PADT is the southwest leader in 3D printing and rapid prototyping technologies, many of the nominations are made because the team had a large amount, or good use of, 3D printing in their final design.  The teams may even have jumped directly to 3D printing as a first pass, but many times much less expensive material could have been used. (i.e. don’t 3D print a $35 tubular housing when a $2 piece of PVC will fit the bill.)  Most of the other teams get nominated for the Best Use of Prototyping Award because they had many iterations of their design.  “Our first one broke, so we added a support here on the next one,” is a very common phrase heard in the presentations.  In my opinion, that constitutes a lack of foresight, planning, and analysis, but not a good use of a prototype.

The best prototype is one that is not only inexpensive but made to gather specific information or to be configured quickly to try out different scenarios. The winning team this year used a breadboard circuit first to layout all their electronics. They then converted to a pin-board to quickly make sure that they could isolate their components from the sensor signals when everything was packed in tighter, before following through with the final PCB design.  (See guys, I was listening.)  The ankle positioning team printed several individual pieces of the system to then have an orthopedic surgeon try out the different configurations to see what worked best and get his input on any missing features needed for the final design.  Last year’s winners of this award made an esophageal guidance system so doctors would know if they were in the esophagus or the trachea.  Their final product was an incredibly small sensor, but the first thing they did was use two beakers and a salt-bridge to see if they could tell the acidity level accurately enough to distinguish the two environments. They then made a full prototype of the proposed sensor array that was about 50 times larger than the final product. It was much easier to build and test, and modify, the larger prototype than the miniaturized final sensor array.  These are all good examples of using physical prototypes.

I was glad to see that we had only eleven nominees this year, down from 21 last year. I look forward to seeing if the trend continues next year as the judges listen for the phrases above.  Of course, I meant to write this article last year when I came back from Design Day, and the year before that, but I’ll talk about procrastination in my next article.  …when I get around to get it.

Finding curve directions in ANSYS SpaceClaim   

As it so often does, another blog article idea came from a tech support question that I received the other day. “How do you view edge directions in ANSYS SpaceClaim?

You can do it in Mechanical, on the Edge Graphics Options Toolbar:

This will turn on arrows so that you can see the edge directions. The directions of the edges or curves affects things like mesh biasing factors and mass flow rate boundary conditions. You need to make sure that all your pipes in a thermal analysis, for instance, are flowing in the same direction.

(I have also had three tech support calls about weird spikes showing up in customers’ geometry. The Display Edge Direction is also how you turn those off.)

In ANSYS SpaceClaim, there is no way to just display the edge directions. The directions are controlled by which point you pick first while sketching, so if you are careful, you can make sure they are all consistent. But that doesn’t help when you read in CAD files.  So I thought I would share with you what I found, after a little bit of digging and playing. I discovered that the Move Tool behaves in a very specific way, a way that we can use for our need.

When you pick on the edge of a surface or solid, or even a straight sketched line, the red arrow of the Move Tool will point in the direction of the curve. These directions match what gets shown in Mechanical.

For splines, it’s a little bit different. If you just pick a spline with the Move Tool, the triad will align with the global coordinate system.

To see the spline direction, you first have to hover over the spline, to show the vertices of the spline.

Then you can pick an interior vertex, and the Blue arrow of the Move Tool will follow the spline direction.

This only works at the interior vertices, and not at the ends. At the ends, the Blue tool arrow will always point outward from the spline endpoints, so you won’t really know which is the correct spline direction.

I have also found that this technique does not work on sketched circles or arc because the tool always anchors to the center of the curve, and not to the curve itself.  You can, however, use the Repair>Fit Curves tool to convert arcs to splines, using only the Spline option. Then the Move tool will show those directions as described above.  For circles, you have to make one more step, and first, use the Split tool to split the circle into two arcs.  All that though is, in my opinion, more work than it’s worth.

I hope this helps make your lives just a little easier. Have a great day.

Save, Save, Save! Setting up a Save after Solution in ANSYS Mechanical

NOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!!

Is this the reaction you have when you come in on Monday morning, and realize that another Windows update has, once again, rebooted your PC before you had a chance to save the 30-hour run that should have finished over the weekend? There a Workbench setting that can help relieve some of that stress.

The “Save Project After Solution” option will save the entire project as soon as the solution has finished. So when your model runs for 30 hours over the weekend, it gets saved before a Windows update shuts everything down.  These settings are persistent, so once you’ve changed them to ‘Yes’, then you are all set for next time. You just need to make sure that you change them for each ANSYS version if you have more than one installed.

Now on to my next blog… “How to recover a run if you forgot to change the settings above.” (Grumble Grumble!)

ANSYS ACT Console Snippets

So this is just a quick post to point out a handy feature in ANSYS Workbench, the ACT Console. There are times when you want some functionality in Mechanical that just is not yet there. In this example, a customer wanted the ability to get a text list of all the Named Selections in his model.  A quick Python script does just that.

import string,re

a=ExtAPI.DataModel.AnalysisList[0]  #Get the first Analysis if multiple are present 
workingdir=a.WorkingDir 
path=workingdir.split("\\\\") 

#Put the output file in the "user_files" directory for the project. 
userdir=string.join(path[:len(path)-4],"\\\\")+"\\\\user_files"  

#Use the name of the system in case the snippet is 
#used on multiple independent systems in the project. 
system_name=re.sub(" ","_",a.Name)  
model = ExtAPI.DataModel.Project.Model 
nsels = model.NamedSelections                  #Get the list of Named Selections 

if nsels:    #Do this if there are any Named Selections
     f=open("%s\\\\%s_named_selections_checked.txt"%(userdir,system_name), "w") 
     for child in nsels.Children:
        f.write("%s\n"%child.Name)
     f.close()

So to use a piece of Python code, like this, we use the ACT Console in Mechanical. To access the ACT Console in Mechanical 17.0, or later, just hit this icon in the toolbar.

The Console allows you to type, or paste, text directly into the black command line at the bottom.  But if we are going to reuse this code, then the use of Snippets is the way to go. In R17.0 they were called ‘Bookmarks’, but they worked the same way.

When you add a Snippet, a new window allows you to name the snippet and type in, or paste in, your code.

When you hit Apply, your named snippet is added to the list

From then on, to use the snippet you just click on it, and hit ‘Enter’. The text is basically, repasted into the command window, so you can set any variables needed prior to hitting your snippet.

The snippets are persistent and remain in the console, so they are available for all new projects. Using snippets is a great way to reduce time for repetitive tasks, without having to create a full blown ACT extension.

Happy coding!

ANSYS Video Tips: ANSYS SpaceClaim 18.0 Skin Surface Tool Changes

There were some changes in ANSYS SpaceClaim to the very useful tool that lets you create a surface patch on scan or STL data at 18.0.  In this video we show how to create corner points for a surface patch boundary and how to get an accurate measurement of how far the surface you create deviates from the STL or scan data underneath.

Video Tips: Changing Multiple Load Step Settings in ANSYS Mechanical

ANSYS Mechanical allows you to specify settings for load steps one at a time. Most users don’t know that you can change settings for any combination of load steps using the selection of the load step graph. PADT’s Joe Woodward shows you how in this short but informative video.

Video Blog: Copying Time Steps from a Thermal Transient to a Static Structural Model in ANSYS Mechanical

Transient Thermal to Static Structural Load Transfer, ANSYS MechanicalIn this The Focus Video Blog, Joe Woodward shares a nice little trick he found when answering a tech support question.

When you want to take timesteps from a transient thermal analysis in ANSYS Mechanical and use the results as loads in a series of static simulations, in just a few mouse clicks.

Can I parameterize ANSYS Mechanical material assignments?

So we have known for a long time that we can parameterize material properties in the Engineering Data screen. That works great if we want to adjust the modulus of a material to account for material irregularities. But what if you want to change the entire material of a part from steel to aluminum? Or if you have 5 different types of aluminum to choose, on several different parts, and you want to run a Design Study to see what combination of materials is the best? Well, then you do this. The process includes some extra bodies, some Named Selections, and a single command snippet.
The first thing to do is to add a small body to your model for each different material that you want to swap in and out, and assign your needed material to them. You’ll have to add the materials to your Engineering Data prior to this. For my example I added three cubes and just put Frictionless supports on three sides of each cube. This assures that they are constrained but not going to cause any stresses from thermal loads if you forget and import a thermal profile for “All Bodies”.

ansys-material-parameters-01

Next, you make a Named Selection for each cube, named Holder1, Holder2, etc. This allows us to later grab the correct material based on the number of the Holder.

ansys-material-parameters-02

You also make a Named selection for each group of bodies for which you want to swap the materials. Name these selections as MatSwap1, MatSwap2, etc.

ansys-material-parameters-03

The command snippet goes in the Environment Branch. (ex. Static Structural, Steady-State Thermal, etc.)

ansys-material-parameters-04

!###############################################################################################################################
! MATSWAP.MAC
! Created by Joe Woodward at PADT,Inc.
! Created on 2/12/2016
!
! Usage: Create Named Selections, Holder1, Holder2, etc.,for BODIES using the materials that you want to use.
! Create Named Selections called MatSwap1, MatSwap2, etc. for the groups of BODIES for which you want to swap materials.
! Set ARG1 equal to the Holder number that has the material to give to MatSwap1.
! Set ARG2 equal to the Holder number that has the material to give to MatSwap2.
! And so on....
! A value of 0 will not swap materials for that given group.
!
! Use as is. No Modification to this command snippet is necessary.
!###############################################################################################################################
/prep7
*CREATE,MATSWAP,MAC
*if,arg1,NE,0,then
 *get,isthere,COMP,holder%arg1%,TYPE
 *get,swapgood,COMP,matswap%ARG2%,TYPE
 *if,isthere,eq,2,then
 esel,s,,,holder%arg1%
 *get,newmat,elem,ELNEXT(0),ATTR,MAT
 !swap material for Body 1
 *if,swapgood,eq,2,then
 esel,s,,,matswap%ARG2%
 emodif,all,mat,newmat
 *else
 /COM,The Named Selection - MatSwap%ARG2% is not set to one or more bodies
 *endif
 *else
 /COM,The Named Selection Holder%ARG1% is not set to one or more bodies
*endif
*endif
*END
MATSWAP,ARG1,1 !Use material from Holder1 for Swap1
MATSWAP,ARG2,2 !Use material from Holder1 for Swap2
MATSWAP,ARG3,3 !Use material from Holder1 for Swap3
MATSWAP,ARG4,4 !Use material from Holder1 for Swap4
MATSWAP,ARG5,5 !Use material from Holder1 for Swap5
MATSWAP,ARG6,6 !Use material from Holder1 for Swap6
MATSWAP,ARG7,7 !Use material from Holder1 for Swap7
MATSWAP,ARG8,8 !Use material from Holder1 for Swap8
MATSWAP,ARG9,9 !Use material from Holder1 for Swap9

alls
/solu

Now, each of the Arguments in the Command Snippet Details corresponds to the ‘MatSwap’ Name Selection of the same number. ARG1 controls the material assignment for all the bodies in the MatSwap1 name selection. The value of the argument is the number of the ‘Holder’ body with the material that you want to use. A value of zero leaves the material assignment alone and does not change the original material assignment for the bodies of that particular ‘MatSwap’ Named Selection. There is no limit on the number of ‘Holder’ bodies and materials that you can use, but there is a limit of nine ‘MatSwap’ groups that you can modify, because there are only nine ARG variables that you can parameterize in the Command Snippet details.

ansys-material-parameters-05

You can see how the deflection changes for the different material combinations. These three steps, holder bodies, Named Selections, and the command snippet above, will give you design study options that were not available before. Hopefully I’ll have an even simpler way in the future. Stay tuned.

Node & Element Selection in ANSYS Mechanical: Some Good News and Some Bad News (fixed)… And Some More Good News

ansys-mechanical-selection-f1First, some good news… 

In Workbench R14.5, ANSYS introduced nodal Named Selections, and in R15.0, they have added the ability to create Named Selections of elements. So now you can make groups of nodes or elements just like you can in MAPDL.  You can use these name selections for result plots to show just specific portion of the results. ansys-mechanical-selection-f2

In R15.0, you can right-click on a Name Selection in the tree and hit, “Create Nodal Name Selection”. This creates a Name Selection of all the nodes associated with the particular piece of geometry in the original Named Selection, whether that is a body, surface, edge, or vertex. Highlighting the nodal named selection in the tree will then take you to the Worksheet where you can add rows for limiting the selection of nodes to a location value or some other criteria.

ansys-mechanical-selection-f3

This is also where you can add a row to “Convert” the “Mesh Node” entity type to “Mesh Element”. The Mesh Element entity type has a criterion choice for how the elements are selected from the nodes.  

ansys-mechanical-selection-f4

“Any Node” will select all the elements that have any of their nodes in the list of nodes that make up the current named selection.  “All Nodes” will select only those elements that have all of their nodes in the current set. Many of you may already know this, and it is a great new feature, but there is a catch, and that brings us to the telling of the “Bad News”.

The Bad News…

After noticing the generation time of the name selection drastically increase when using the “All Nodes” criteria, I ran a small test case. With just a cube meshed to two different refinement levels, I tracked the generation time for the element name selection using the two different criterion. Here is what I found.

ansys-mechanical-selection-f5

I am not even going to speculate what is different with the “All Nodes” node-checking algorithm, but an increase in element count by a factor of eight caused more than a 13300% increase in generation time. But look at the generation time for the “Any Node” criteria. It stayed right on par for the different mesh sizes.

So, back to the Good News, and the Really Good News…

The Good News is that you can avoid the long generation times, in R15.0, by not using the “All Nodes” criteria. The Really Good news is that when I ran the same test in R16.0, I got 6.0 Sec for the “Any Node” criteria, and 6.3 Seconds for the “All Nodes” criteria. So ANSYS has already fixed the problem in R16.0, which just gives you another reason to upgrade. If you are going to continue using R15.0, then just stay away from the “All Nodes” criteria for the element named Selections. It is much better to use the location based filtering to cut down your nodal selection so that you can use the “Any Node” criteria.  

ansys-mechanical-selection-f6

/HBC: One of Those Little Known Commands

The other day we received a tech support call requesting a way to remove the space between the element faces on a pressure plot.  He wanted this so that he could get a contour plot without seeing the contours of the elements on the back side of the part. So I built my trusty test block and applied a pressure. By turning on the pressure load symbols with  the /PSF command, also under PlotCrtls > Symbols, you can get plots like this.

image

Face Outlines (/PSF,1,1)

 

image

Arrows (/PSF,1,2)

 

image

Contours (/PSF,1,3)

Of course the customer was using this last contour plot option, but as you can see below, if you have pressure on both sides of the model, then the backside pressures show through the gaps. The plot can get a bit confusing. So after some digging, starting with the /PSF command, and not finding any reference on how to change the plot behavior, I asked around if anyone else had a way to do it, other than my first inclination which was to write a macro. So as I reverted to creating a macro, to do what should be a simple task, I thought, “No, there HAS to be an easier way.” Of course there is.

image

The one thing I’ve learned over the years… Well, yes, I’ve learned more than ONE thing, but I’m trying to make a point here… The one thing I’ve learned over the years, is that no matter how much I learn, there is always someone who know more than me.  So I asked Sheldon! (Not the Sheldon on Big Bang Theory; ANSYS, Inc’s very own Sheldon Imaoka.) I thought, “Surely he will know some undocumented command to save me time.  It took him all of three minutes to get back to me with the /HBC command. It is a fully documented, but seldom used, command that is hidden in the recesses of the Command Reference that determines how boundary condition symbols are displayed. When turned on, it will “use an improved pressure contour display.” So you go from the picture on the top, to the picture on the bottom.

imageimage

So I learned two new things. One is the /HBC command can give you nicer looking plots. The other, and even more useful thing, is to click the links on the help page at the upper right corner.

image

For if I did, I would have found the /HBC command on my own.

image

It looks like I need to sit down with a nice cup of hot chocolate* and the Command Reference and just scan the listing for commands that I don’t recognize and learn what they do.  Oh, what I go through for you people. Well, I’ll just make sure that it’s really good hot chocolate*.   I’ll write a new post from time to time on cool commands I find useful.

Have a great day!!!

*It’s 85 degrees here this week and I really meant iced tea, but I didn’t want to rub it in. Smile

Beware the ARGS, Matey!!

Pirate Joke:
One day me ARG says, “ARG, go to ARG and get the ARG to ARG the mainsail.” I says to me ARG, “ARG went yesterday. The ARG is over yonder by the ARG and the rum! Ha-ha-ha-ha-ARG!!”

Yeah… pirate jokes don’t work so well when the same ARG is used in too many places. The same goes for command snippets.

Summary Note: This article got longer than I intended, so here is a summary of the important points.

1. When using multiple Command Objects in a single mechanical session, the ARG variables initialized in earlier scripts are still active in later snippets if the ARG values for that snippet are not filled in the details window. Don’t assume the ARG values are zero, unless you set them to zero.

2. Output arguments are evaluated at the end of the MAPDL run. If the same variable name is used in multiple command objects, all the snippets will show the same output value, which is the value of that variable at the end of the solution process.

Now you can keep reading if you’re bored, or curious, or just confused. Smile

Up until a few days ago, I was under the impression that each command snippet that was added to a Workbench Mechanical had it’s own set of ‘ARG’ variables, like MAPDL does for macros, since each one has a details window with it’s own set of ARG Variables. Well, they don’t.

image

When you hit the ‘Solve’ button in Mechanical, it builds one large input file that it sends to MAPDL. This input file contains all the nodes and elements, loads and supports. It also contains any command snippets that you have in the model. All command snippets are run in the main namespace. ARGS from one snippet carry over to another.

As an example I set up a small command snippet with the details from the above picture. It uses two arguments, ARG1 and ARG2.  Below shows exactly what get added to the overall input file.

image

 

The first two lines are added by Workbench to initialize the variables. All looks good and works fine, until I add another command snippet.  This one is even simpler and just stores the ARG variable to defined variables that Workbench will then read back to the details window, which is discussed below.

image

As you can see below, the ARG1 and ARG2 variables are left blank, but the two output variables match what was set in the previous command snippet.  This is because the*SET commands that Workbench adds, are only added when the details window has values given. So ARG1 and ARG2 are never overwritten from the previous command snippet.  The way to avoid the overlapping of input variables is to fill in the Input Arguments with zeros whenever using multiple command snippets.

image

image

Which brings up another point, about output variables. As many of you know, but some may not, each command snippet has a “Parameter Search Prefix”, which is set to “my_” by default. This allows Mechanical to search through your snippet and find any variables that you define that start with “MY_”. In the example above, the output variables are MY_ARG1 and MY_ARG2. (Remember that MAPDL stores all variable in uppercase.) The values of these variables are then pulled out of the MAPDL database and shown in the details window for that command snippet.  The values are taken at the end of the solution phase, and not at the time they are defined. So this means that if two or more command objects use the same output variable names, whatever value the last command object set for the variables, that is going to be the same value read back in and displayed for all of the command objects using that variable. The best way to avoid this is to use different output variable names in each command object.

Since I already gave you the good points in the summary, I won’t restate them here. I will just add that command objects are great for adding functionality to your Workbench Mechanical runs. Just be cautious ARGS when using multiple objects. (Or pirate jokes, for that matter.)

Stomp on a Bug in ANSYS Mechanical R14

image

Okay, so it’s not the ugly critter in the picture, (that on was found at my house), but the bug in ANSYS R14 can give you the willies just the same. ANSYS, Inc. is working very hard to get the situation remedied, and they will be sending out defect notices shortly.  They provided a quick-fix however, and we wanted to get it out to you as  quickly as possible. So I have done some screen captures while I ran through the fix.

The issue found is that if you close a Mechanical, or Meshing, session and then hit ‘Save’ on the project window, you may lose the contents of your Mechanical database.   The problem has arisen in R14 because ANSYS, Inc. has decreased the start up time of Mechanical by pre-loading it when Workbench is started. When you close Mechanical, it stays open in the background as an empty database. There is a 1-second ‘window of opportunity’ after you close the Mechanical editor and save the project file when the process threads are not fully synchronized.  If you save during this period, the blank session gets saved on top of the good session, and all data is lost.  If you wait longer than a second, there shouldn’t be an issue, but customers have been reporting longer times where they have still lost data.  ANSYS, Inc. is working with those customers to find out what is causing the longer times on their boxes.

Luckily the remedy is simple, and hopefully none of you will have to lose any data.  Since the issue is caused by the pre-loading of Mechanical, the remedy is to simply turn the pre-loading off.  This has to be done from  the Tools > Options menu on the Project window. Just uncheck the Pre-Load box in both the Mechanical and Meshing dialog boxes, and then close Workbench after hitting ‘OK’. The next time you open Workbench, the bug will be neutralized.

I just wish it was that easy for that creepy guy in the picture! Smile

  image

How do I Know that my Download was Successful?

With the release of ANSYS 14.0, I thought it would be good to get this topic on the Focus blog. Quite often, we get tech support calls about installs that crash or hang. Most of the time it is traced back to the fact that the download was not complete or had an error that the user didn’t see at the time.  So how can you check that your download was successful before starting you install?  Easy. Check the md5sum.

When you go to download software from ANSYS, or many other locations, they post the md5sum hash table value as shown below.

image

Md5sum is an algorithm used to calculate an identifier that functions as a compact digital fingerprint of a file.  Most UNIX and LINUX systems have it as a built in function. The Wikipedia article on md5sum says that Windows has it too, but I have never found it. So I went out on the internet and found one. Many actually. Here is a direct link to get MD5Sums, a useful one at PC-Tools.net, a  reputable download site.

“Md5sums” is nice in that it is fast, taking only about 30 seconds for a 4GB file, and you can use it two ways.  As with most other executables, you can use it at a command line or in a script, like this:

md5sums –u *winx64* > checksums.txt

to get a file, “checksums.txt”, with formatted output like this for all the matching files in a directory.

9febae323d5df015187c84f373db7a45 *ansys140_winx64_dvd1.iso
c90e04fd5e5bd94d1a39101bcbe18258 *ansys140_winx64_dvd2.iso

But MD5sums also allows you to drag-n-drop files onto it in the file explorer  and it starts processing those files, or a whole directory, in pop-up window. 

image

Then you just compare the output to the md5sum values that ANSYS posted on the download page.  If they are not the same, then something happened during the download process.  You’ll have to download the bad file again, but at least you haven’t started the install yet.  

Happy Downloads!!!

Why You Need a Good Text Editor: Finding What Changed in Your Model

There seems to come a time in everyone’s career, at least once, but usually for me, once a week, where I have made a change to something and didn’t even know it.  I copied a model, or made what I thought was a copy, but the results are coming out different.  So how do you tell what’s changed?

Well, you can spend time checking individual boundary conditions, part names, material properties, etc.  This can take a long time, especially with interactive programs that have a different menu or dialog box for each one.  This is where a good text editor can save you hours of work and years worth of frustration and stress.

So what can a good text editor do for you? In such a case it can compare two files and show you quickly exactly what is different.  For my money, GVIM gets my vote as the best text editor available. (Partly because it’s free and didn’t take any of my money. )

The “Split Diff with…” option in GVIM will show multiple files, side by side, and highlight differences between them.  Lines that are different are highlighted pink, with the actual difference highlighted in red. Lines that are present in one file, but not in the other, are highlighted purple, while blank lines are added to the other file to keep the similarities lined up.

image

So how do you use this feature to compare ANSYS, CFX, or Fluent, or any other models?  Most analysis programs have an export or archive feature that rights the model out in text format. In ANSYS, you can write out a text archive, CDB file, with the CDWRTE command.  In CFX, as in this example, you can export a CCL file.  In this example, GVIM quickly highlights what different between two CCL files.

In this case, the option on one of the boundary conditions was different.

imageimage

Another great thing about GVIM, is that it will also do the “Split Diff With…” on binary and Hex files, too. Now, you might not read hexadecimal, I don’t either, but at least you would know that the files differ somewhere.

image

There are a lot of good text editors out in the market these days. The key is to find one that you like, and learn it inside and out.  It can save you a lot of frustration and time in the long run.

Resources:

  • You can learn more about Vim and download a copy at: www.vim.org
  • Other text editors with text comparison capabilities:
    • Notepad++: Notepad on steroids, it has a nice difference utility
    • Emacs is the other editor that came out of Unix that people swear by, if they are not Vim users.
    • SlickEdit is not free, $299 for a single user license, but it is one of PADT’s favorite paid text editors.
  • A comprehensive list of text editors can be found on Wikipedia: http://en.wikipedia.org/wiki/Comparison_of_text_editors

Mid-side nodes: Do they really help?

Do those pesky mid-side nodes really do anything other than increase my node count and runtime?  Over the years, I have heard that question over and over. “Do I really need them?”  If you are using tetra elements, then the answer is absolutely, “Yes!”  They even do more than just give you nice curvature to follow your geometry.  For tetras, the midside nodes are necessary to predict proper stresses.  Lower ordered tetras are overly stiff and will under predict deflection and stresses.  Let’s look at the underlying equations that make up the shape functions in both element types.

image

Yeah, the equations for tetras are a little more complicated than that, but I really didn’t think you  wanted to go down that road. But I will remind you that low-order elements have linear shape functions, while high-order elements have quadratic shape functions. So let’s look at an example, instead, to show that lower-order tetras will give unconservative results.

For the example, I made a simply-supported, rectangular-cross-section plank.  It’s 100 inches long, by 10 inches wide, by 1 inch thick, with a 1 psi pressure load. I set the mesh size at 1 inch and solved with low-order tetras, high-order tetras, and also with low and high-order hex elements.  The results are tabulated below along with the hand-calculated solution from the 7th Edition of Roark’s Formulas for Stress and Strain, Table 8.1, case 2e.

image

image

  Deflection Def. % Diff Stress Stress  % Diff Nodes Elements
Roark’s -0.53864   7500.0 psi      
20-Node Hex -0.54159 0.55% 7527.0 psi 0.36% 7553 1,000
8-Node Hex -0.54142 0.52% 7529.5 psi 0.39% 2222 1,000
10-Node Tetra -0.54158 0.55% 7525.9 psi 0.35% 20661 11,998
4-Node Tetra* -0.27151 49.6% 2249.3 psi  –70.0% 3222 11,999

As you can see, the hex elements along with the 10-node tetras get close to the solution and provide conservative results.  The 4-node tetras, however, which are actually degenerate 8-node hex elements because ANSYS removed their 4-node tetra elements along time ago, show only half the deflection under the same load.   The extra stiffness also causes the modal frequencies to be higher. In this case, the frequencies of the low-order tetras were about 40% higher than the high-order tetras.  When you’re looking at operating ranges, this could also lead to unconservative conclusions.

Of course this is a pretty coarse mesh with only one element through the thickness. So how do the results change as the mesh is refined? We should only need to cut the element size by half to get the extra nodes and the same results, right? 

    Deflection Def. % Diff Stress Stress  % Diff Nodes Elements
Roark’s -0.53864”   7500.0 psi      
1”  -0.27151”

–49.6%

2249.3 psi

-70.0%

3,222 11,999
0.5” -0.39768”

-26.2%

4879.1 psi

-34.9%

17,624 77,612
0.3” -0.47582”

-11.7%

6069.5 psi

-19.1%

69,040 334,433
0.2” -0.51023”

-5.3%

6760.9 psi

-9.8%

213,122 1,105,641
0.1” -0.53345”

-0.96%

7309.6 psi

-2.5%

1,599,327 8,877,326

As you can see the answer is, “No.”  Because  the high-order elements have quadratic shape functions , it takes far more linear elements to make up the difference. Here is a little animation to show why. You can see the error left by each set of linear elements when try to match a quadratic function.JoeAnim1

For another example, I made a long square-cross-section bar with holes in it.  It is cantilevered with a shear load at the other end.  I set the Physics preference to Mechanical and the Relevance Center to ‘Fine’ and I got the mesh that you see below. (I’d say its not too bad for 15 seconds of works. )image

   imageimage

Just to make sure that my mesh was the same in both cases, I told Mechanical to Drop the midside nodes and then I added a Command Object in the high-order  case to convert the elements to Solid 187 tetras during the run. Since no geometry is sent from Mechanical, the midside nodes were added and the edges were kept straight, so no further curvature was picked up.  Here’s the command object to try out yourself.

imageimage

 

By scoping the results to just the hole closest to the fixed end we can see the difference in the stress values for the two runs.  The low-order tetras yield results that are 12% lower for deflection and over 19% lower for stress than the same mesh with midside nodes.  (But look, Boss! I saved 4 seconds on the solve time!!!)

  Elements Nodes Total
Deflection
SEQV Solver Runtime
Low-order 18383 4854 0.28744” 177.51 Ksi 6.677 Sec.
High-order 18383 31332 0.32633” 219.46 Ksi 10.951 Sec.

 

imageimage

imageimage

So how many low-order tetras are needed to get the same accuracy this time?   I used the Convergence Tool in Workbench to find out this time. The Convergence tool refines the mesh only for the scoped region of the results plot.  So the resultant mesh looks like this.

image

imageimage

 

clip_image001[6]

  Elements Nodes SEQV Solver Runtime
Low-order

1,271,619

234,484

21.951 Ksi

349.785 Sec.

High-order

18,383

31,332

21.946 Ksi

10.951 Sec.

The last pass took just under 6 minutes to run (349.8 sec). The stress finally gets as high as it is with the high-order elements, but the deflection results are still incorrect because the model was only refined at the hole.  And say it with me, “If the deflection is wrong, then the stress ain’t gonna be right!!!”  So basically I’ve wasted a half an hour getting the wrong solution so that you won’t have to do the same. Just remember, mid-side nodes are your friends. And just like any good friend, take advantage of them when you can!