Lecture 6 Using APDL, Part 1 16.0 Release
ANSYS Mechanical Advances (Using Command Objects) 1
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
Chapter Overview This section will demonstrate how to use APDL commands to access advanced functionality within Mechanical : A. Preliminaries B. Useful directories C. Geometry Branch D.Remote Points E. Contact Regions F. Joints G.Springs and Beams
2
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
A. Preliminaries •
Before diving into the details of using “Commands” objects in Mechanical, some general topics will be reviewed: – – – –
3
Solver unit system Saving the Mechanical APDL database Creating/deleting elements and other entities Branches in the Outline Tree applicable to “Commands” objects behaves, which will be the focus of this chapter.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Unit System
4
•
Because “Commands” objects are general, there is no mechanism to convert entered arguments of APDL commands if a user decides to change the active unit system from the “Units” menu.
•
Consequently, it is strongly recommended to manually specify the solver unit system in the Details view of the “Analysis Settings” branch.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Saving the Mechanical APDL database
5
•
There may be circumstances where a user may wish to postprocess results in Mechanical APDL.
•
Because of this reason, it is highly recommended to save the Mechanical APDL database (file.db).
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Creating/Deleting Elements •
When elements or nodes are created or deleting using APDL commands, please note that Mechanical will not be aware of these changes to the mesh. – If elements/nodes need to be created using APDL commands in a “Commands” branch, postprocessing of these elements must be done inside of Mechanical APDL
6
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Inserting Commands Objects •
The following branches in the Outline tree allow users to insert “Commands” objects: – – – – – – – – –
• 7
Any Body under a “Geometry” branch Any Contact Region under “Connections” branch Any Spot Weld under “Connections” branch Any Joint under “Connections” branch Any Spring under “Connections” branch Any Beam under “Connections” branch Any Remote Point under a “Remote Points” branch Directly under any analysis branch Directly under the “Solution” branch
The details of each of these options will be covered in this chapter © 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Supplementary Branches •
Two branches that do not use “Commands” objects directly but are quite helpful are the “Coordinate Systems” and the “Named Selections” branches – As will be discussed later, a Coordinate System can be assigned a manual coordinate system ID number, which can be used in APDL commands. – Named Selections will appear as nodal or element components in Mechanical APDL, where a “component” is a “group” of nodes or elements.
8
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Supplementary Branches •
9
Other branches, such as “Construction Geometry”, “Virtual Topology”, “Symmetry”, “Mesh”, and “Solution Combination” branches, are not applicable to APDL commands, so “Commands” objects are not inserted under those branches.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
B. Useful Directories •
WorkBench writes a ds.dat text file containing all the MAPDL commands associated with the project. It can be generated by clicking on Tools -> Write Input File… Or it can be found in the working directory once the run is launched.
Tips : The working directory is easily accessed by right clicking on the analysis line -> Open Solver Files Directory:
10
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Useful Directories •
At the beginning of this file, 3 interesting lines can be found:
3 string parameters are automatically created by WorkBench: – _wb_ProjecScratch_dir containing the location of the scratch folder – _wb_SolverFiles_dir containing the location of the analysis folder – _wb_userfiles_dir containing the location of the user files folder
•
11
These parameters are very useful and can be used throughout the WB project for multiple operations (exporting results in the User Files dir, importing a load file located in the User Files dir, etc.) © 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
C. Geometry Branch •
A “Commands” object may be inserted under a Body under the “Geometry” branch
•
The below lists some reasons to use a “Commands” object associated with a Body: – Changing/adding some material properties – Solving other types of physics not native to Mechanical (Acoustics, etc.)
12
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Geometry Branch •
The “Commands” object inserted under a Body can be used to change the following element attributes for that Body: – – – –
•
13
Element type Material Properties Real Constants/Section Properties Element Coordinate System
Use the APDL parameter MATID to reference the element type, material property, real constant, or section property ID number.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Geometry Branch: Element Type •
As discussed in a previous chapter, changing element types is done via the following two commands: – ET,MATID,… – KEYOPT,MATID,…
•
Changing the element type allows a user to solve different physics or use a specialized element. However, the nodal connectivity must be the same between the original and target element type.
•
If any element-specific options (“keyoptions”) need to be set, use the KEYOPT command
14
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Geometry Branch: Element Type Note about Element Control:
• In the Details view of the “Geometry” branch, the user can change “Element Control” – By default, this is set to “Program Controlled,” where the Mechanical APDL solver may change keyoptions automatically prior to solution (ETCONTROL)
– If automatic resetting of keyoptions is not desired, be sure to set “Element Control: Manual” in the Details view of the “Geometry” branch 15
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Geometry Branch: Material Properties •
Deleting all existing material properties for the particular body is done via the following commands: – MPDELE,Label,MATID – TBDELE,Label,MATID
•
As a review, defining linear elastic material properties: – MP,Label,MATID,… (constant materials) – MPTEMP,… and MPDATA,Label,MATID,… (temperature-dependent)
•
To define nonlinear material properties, use: – TB,Label,MATID,… to activate a particular material table – TBTEMP,… and TBDATA,… or TBPT,… to define the parameters
•
16
In all of the above cases, Label refers to the material property name. See the MP or TB help in the Commands Reference for details.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Geometry Branch: Material Properties Examples: •
Linear: To define density and elastic modulus, one would repeat the MP command as follows: – MP,EX,MATID,10e6 – MP,DENS,MATID,0.1/386.1
•
Non Linear: To define bilinear isotropic plasticity and creep, one would do the following: – – – – – –
17
MP,EX,MATID,200e3 MP,NUXY,MATID,0.3 TB,BISO,MATID,1 TBDATA,1,300,2e3 TB,CREEP,MATID,1,3,10 TBDATA,1,3.125E-14,5,0
© 2015 ANSYS, Inc.
March 23, 2016
Defines linear elastic properties Defines bilinear plasticity constants Defines creep law and its coefficients
Release 16.0
… Geometry Branch: Section Properties •
The Elements Reference in the Mechanical APDL help system describes whether a particular element uses real constants or section properties
•
Deleting existing real constants or section properties: – RDELE,MATID – SDELETE,MATID
•
Recall the definition of a new real constant or section property: – R,ID,… – SECTYPE,ID,… and SECDATA,…
•
Modification of a real constant: – RMODIF,ID,…
– (No equivalent functionality is present for sections. One must delete an existing section and define a new section instead.)
18
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
D. Remote Points •
Remote Points are an integral part of many features in Mechanical: – – – – – – – –
•
19
Point Mass Joints Springs Bearing Beam Connector Moment Remote Force Remote Displacement
Each Remote Point has an (x, y, z) location and is scoped to a geometric entity.
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Uses for Remote Points •
The below are some reasons why one may wish to use “Commands” objects with Remote Points: – Reduce the interface nodes for creation of CMS superelements for more efficient system-level analyses – Define monitor locations, such as the average deformation of a given surface – Create an MNF file for use with Adams/Flex – Post-processing
20
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Remote Point Representation •
A Remote Point consists of contact and target elements – The target element is a 1-node element, representing the remote point location – The contact elements are associated with the vertex, edge, or surface that is scoped in the Remote Point Definition
TARGE170 Element (circled)
CONTA174 Elements (purple)
21
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Remote Point Behavior •
To better understand the “deformable” and “rigid” behavior, consider the simple 3D model with a remote force (via remote point) scoped to the face shown in red : Deformable
Rigid
22
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Remote Points •
Insert a “Commands” object under a Remote Point: – The parameter _npilot reflects the node ID number. One can define a new parameter to keep track of this node ID number for later use, such as defining master DOF: MY_INTERFACE_NODE = _npilot m,MY_INTERFACE_NODE,all
– The parameter TID is the target element’s element type ID number.
23
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Remote Points •
Tips on using APDL with Remote Points: – Keep in mind that APDL parameters are persistent throughout the Mechanical APDL run. Hence, per the previous slide, the parameter MY_INTERFACE_NODE will have the value of the node ID number and can be used in postprocessing as well. – Most functionality with regards to Remote Points, such as load application, postprocessing displacements or reaction forces, spring/joint definition, are already built into the Mechanical GUI.
24
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
E. Contact Regions •
“Commands” objects may also be inserted under any Contact Region
•
There are many situations where APDL commands can access advanced controls: – Use of fluid pressure-penetration loading – Near-field contact radiation and convection – Definition of multiphysics contact (coupled thermalelectric-structural) with frictional heat generation – Inclusion of orthotropic friction or dynamic coefficient of friction, along with cohesion …other options available as well!
25
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Contact Regions •
Insert a “Commands” object of the Contact Region of interest: – The parameters CID and TID are used to refer to the contact and target element type IDs, respectively. – To apply fluid pressure-penetration loading where pressure loading occurs when a contact status opens, use the following: ESEL,s,type,,cid SFE,all,1,pres,,120 ALLSEL,all
26
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
F. Joints •
Typical uses of “Commands” objects inserted for Joints include the following: – Definition of Screw Joints and other joints not available in the Mechanical GUI – Incorporation of nonlinear stiffness, nonlinear damping, and/or Coulomb friction – Obtaining more detailed control over joint behavior, such as applying rotational stops and locks on a General Joint – Create components for future post-processing
27
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Joints •
The element type used for joints is MPC184. Note that the joint (MPC184 element) is connected to the solid model via Remote Points. – If the connection between the joint and solid part needs to be modified, define a Remote Point with a “Commands” object, as discussed in an earlier section of this chapter.
Remote point 1 28
© 2015 ANSYS, Inc.
March 23, 2016
MPC184 element
Remote point 2 Release 16.0
… Joints •
The APDL parameter “_jid” refers to the element type, material, real constant, and section ID number of the MPC184 element: – To define nonlinear stiffness for a Translational Joint: TB,join,_JID,1,4,jnsa TBPT,,U1,F1 …repeat (Each TBPT command defines pair of displacements Ui and forces Fi)
– To add a rotational stop for relative Z-rotation for a General Joint between -45° and 45°: SECSTOP,6,-acos(-1)/2,acos(-1)/2
29
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Joints •
Tips on using APDL commands with Joints: – Not all Joints support stops, locks, and joint “material” definition (friction, stiffness, damping) – for example, the Spherical Joint supports neither. Consult the Elements Reference for details on each Joint type prior to using APDL commands to ensure that the feature is available for that joint type – Modifying the local coordinate system which defines the orientation of the relative joint DOF is highly discouraged since Mechanical will incorrectly report results for that joint.
30
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
G. Springs and Beams •
In addition to Contact Regions and Joints, the “Connections” branch allows use of Springs and Beams – Springs are longitudinal springs and/or dampers with preload capabilities – Beams have circular cross-sections and are meant to represent structural connections that carry bending loads
•
As with Joints, Springs and Beams are connected to 2D or 3D bodies via Remote Points – If a Remote Point is not explicitly used, the underlying finite element representation is still using surfacebased constraints of contact and target elements, as elaborated in the Remote Points section of this chapter
31
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Springs and Beams •
A Spring is represented with a COMBIN14 element, and a Beam is modeled with a single BEAM188 element. – Line Bodies are also represented with BEAM188 elements, and the two should not be confused with each other.
•
Using “Commands” objects for Springs and Beams is not as common as its usage in other branches, although a few reasons for doing so are listed below: – Changing the longitudinal Spring to a torsional one via keyoption – Replacing the Beam with a rigid beam (MPC184) – Replacing the Spring with nonlinear or other types of spring elements
32
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0
… Springs and Beams •
For Springs, after inserting a “Commands” object, use the parameter _sid to reference the spring’s element type, material, and real constant ID number – Example of changing to a torsional spring: KEYOPT,_sid,3,1
– Note that ‘stiffness’ and ‘force’ will refer to ‘torsional stiffness’ and ‘moment’
•
For Beams, the parameter _bid refers to the beam’s element type, material, real constant, and section ID number – To replace the deformable beam with a rigid one, use the following: MPDELE,all,_bid ET,_bid,184,1,0
33
© 2015 ANSYS, Inc.
March 23, 2016
Release 16.0