Home

Programmer`s Manual for Mechanical APDL application

image

Contents

1. 217 7 1 7 elnxdf Function Getting the Number of the Next Defined Element ssse 218 7 1 8 elsel Subroutine Selecting Unselecting Deleting or Inverting an Element 218 7 2 Node Information Routines cesses eene eeennne seen rne sese ree sse reti ss n aatis aee e nua 218 7 2 1 ndinqr Function Getting Information About a Node ceceeesssstcceceeceeeeensneeeeeeeeeeeees 218 7 2 2 getnod Function Getting a Nodal Point ecceeessssnccceeceeseesseneeceeeeeeeseesnnnaeeeeeeeess 219 7 2 3 putnod Function Storing a Node cssssccccccceessesssneececeeeeeseesnnaeeeeeeceeeeeesnneeeeeeeseseees 220 7 2 4 ndgall Function Getting the XYZ Rotation Coordinates Vector for a Node 220 7 2 5 ndspgt Subroutine Getting the Nodal Solution for a Node of an Element 220 7 3 Element Attribute Routines essen enne een rhe enn rat sse aae sen aet sena ates e nan 221 7 3 1 elmiqr Function Getting Information About an Element eene 221 7 3 2 elmget Function Getting an Element s Attributes and Nodes ssseeeeeseees 222 7 3 3 elmput Subroutine Storing an Element eene nennen 222 7 3 4 etyiqr Function Getting a Data Item About an Element Type eene 223 7 3 5 etyget Function Getting Information About an Element Type ccccc
2. HEM 278 7 7 54 emnget Function Getting an Element s Miscellaneous Non summable Data 279 7 7 55 emnput Subroutine Storing an Element s Miscellaneous Non summable Data 279 7 7 56 emndel Subroutine Deleting an Element s Miscellaneous Non summable Data 279 7 7 57 ecdiqr Function Getting Information About Element Current Densities 280 7 7 58 ecdget Function Getting an Element Current Density eeeeeeeeenee 280 7 7 59 ecdput Subroutine Storing an Element s Current Densities esses 280 7 7 60 ecddel Subroutine Deleting Element Current Densities eesseseeeeeeeeeee 281 7 7 61 enliqr Function Getting Information About Element Nonlinear Tables 281 7 7 62 enlget Function Getting Element Nonlinear Tables 281 7 7 63 enlput Subroutine Storing an Element s Nonlinear Tables 282 7 7 64 enldel Subroutine Deleting Element Nonlinear Tables sese 282 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 2 of ANSYS Inc and its subsidiaries and affiliates XI Programmer s Manual for Mechanical APDL 7 7 65 ehciqr Function Getting Information About Calculated Element Heat Generations 7 7 66 ehcget Function Getting a Calculated Element Heat Generation
3. eese 229 7 3 18 csyput Subroutine Storing a Coordinate System ssesssssssssssssssssssessseressssseessssresssseee 229 7 3 19 csydel Subroutine Deleting a Coordinate System eeeeeeeneen 230 7 3 20 userac Subroutine Demonstrates Use of Element Attribute Routines 230 7 4 Coupling and Constraint BOUES cerro oa kl Nea eee bien c ou AP Qn Eben ER 230 7 4 1 cpinqr Function Getting Information About a Coupled Set cccccccccccessssssnteceeeeeeeeees 230 7 4 2 cpget Function Getting a Coupled Set ecccessssccceceeeeseesneneeeeeeeeeseesenneeeeeeeeeseeeeeas 231 7 4 3 cpput Subroutine Storing a Coupled Set 2 0 00 eeeecessssecccceceeeeeesnneeeeeeceeeeeeesnneeeeeeeeeeeees 231 7 4 4 cpsel Subroutine Selecting or Deleting a Coupled Set cceeessscecccceeeeseesnteeeeeeeeeeeees 231 7 4 5 ceingr Function Getting Information About a Constraint Equation Set 232 7 4 6 ceget Function Getting an Constraint Equation cccccccccccccccceccccecececececceececeeeeeeeeees 232 7 4 7 ceput Subroutine Storing a Constraint Equation cc ccccccccccssesessnececeeecesssessneeceeeeees 233 7 4 8 cesel Subroutine Deleting or Selecting a Constraint Equation 233 7 5 Nodal Loading ROULINGS es cote wet nere rei ant beg en Ori e cv i ertt RR aa d asl 233 7 5 1 disiqr Function Getting a Information About Constraints
4. seeeeeeeeeeeeneneeeenn 8 3 15 vapcb1 Subroutine Multiplying a Vector to a Constant sseeeeeeeeenn 8 3 16 vamb Subroutine Gets a Third Vector by Subtracting One Vector from Another 8 3 17 vamb1 Subroutine Subtracting One Vector from Another eeeeeeeeee 8 3 18 vmult Subroutine Multiplying a Vector by a Constant eeeeeeeeen 8 3 19 vmult1 Subroutine Multiplying a Vector by a Constant seeeeeen 8 3 20 vcross Subroutine Defining a Vector via a Cross Product eeeeeen 8 3 21 vnorme Subroutine Normalizing a Three Component Vector eene 8 3 22 vnorm Subroutine Normalizing a Vector to Unit Length eeeeeeeeeeee 8 3 23 ndgxyz Function Getting the X Y Z Vector for a Node sss 8 3 24 ndpxyz Subroutine Storing X Y Z for a Node eeeeeeeeeeeen nennen B Ai Matrix SUDTOUTI IOS ees rore dro oid rra bu EE peer KEE EE AERA E EEE E EEE Pega pd 8 4 1 maxv Subroutine Multiplying a Vector by a Matrix eessecceeesseceeeeesneeeeesseeeeessnaeeeees 8 4 2 maxv1 Subroutine Multiplying a Vector by a Matrix seeeeeeeeeeennnen 8 4 3 matxv Subroutine Multiplying a Vector by a Full Transposed Matrix 8 4 4 matxv1 Subroutine Multiplying a Vector by a Full Transposed Matrix 8 4 5 matxb Sub
5. An array of Nchar characters 4 2 2 2 Directive Descriptions Characters from the common character set The next few pages describe each of the graphics file directives Parameters are always specified in the order shown below Graphics Command Parameters Parameter Directive Character Types Start_Plot keras Defines whether the display surface Int Int Int is cleared prior to the plot 0 do not clear Int Int the surface 1 clear it kras Defines whether the display uses ras ter mode or vector mode 1 raster mode 0 vector mode kcntr Defines whether the display uses a contour color map or shading color map 1 contour 0 shading kdocu Defines whether the Docu column is compressed 1 do not compress 0 compress ispare A spare value Window x1 y1 x2 y2 x and y coordinates Xy Xy Area Color iclra Sets the color for the displayed area Long See Color Specification below Graph Color iclrg Sets the color for the displayed graph Long See Color Specification below Text Color gt iclrt Sets the color for displayed text See Long Color Specification below Text Size 2 tsize Defines the size of displayed text 0 nt normal 1 small Line Type j Itype Defines the type of lines used in the Int display 0 solid 1 dashed Line Width 1 Iwidth Defines the width of displayed lines Int 0 normal 1 to 5 larger line s
6. eese enne 130 6 1 3 4 Subroutine uel100 Computing Element Matrices Load Vectors and Results 130 6 1 3 4 1 Subroutines uel101 through uel105 eene 131 6 1 3 5 Subroutine uep100 Printing Output for User Elements in POST1 via PRES OU ELEM ace os sects ees his pin eat eto ddr Pvt osha V de e cen wana n p NR CE P pas Ros ia cen apne 131 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates V Programmer s Manual for Mechanical APDL 6 1 3 5 1 Subroutines uep101 through uep105 ccccccccessssseneceeeeeeeeeessnteeeeeeeeseeeeees 132 6 1 3 6 Subroutine usertr Adjusting the Nodal Orientation Matrix cccssscccceeeeeeeeees 132 6 1 3 7 Subroutine userac Accessing Element Information eene 132 6 2 Supporting Subroutines for Element Creation ccccccccccsssssssnecccccecesseeesnseeceeeeceseeeseneeeeeesens 133 6 2 1 Subroutine nminfo Returning Element Reference Names sssscccccceeeeseessnneeeeeeeees 133 6 2 2 Subroutine svgidx Fetching the Index for Saved Variables cssscccccccceesesssnteeeeeeees 133 6 2 3 Subroutine svrget Fetching Saved Variable Data for an Element sssssssss 134 6 2 4 Subroutine svrput Writing an Element s Saved Variable Set sees 134 6 2 5 Subroutin
7. EDLCS R5 3 0ption CID XI Yl1 Z21 X2 Y2 22 X3 Y3 23 Option The EDLCS command option The only valid option is ADD CID The coordinate system ID X1 Y1 Z1 The X Y Z coordinate of a point on the local X axis X2 Y2 22 The X Y Z coordinate of a point on the local X Y plane X3 Y3 23 The X Y Z coordinate of the local origin NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 10 EDLOAD Command The EDLOAD command is used to define loading conditions for explicit dynamics The command format in Jobname CDB is EDLOAD R5 3 0ption Lab KEY Cname Length PHASE Parl Par2 LCID SCALE BTIME DTIME Option The EDLOAD command option The only valid option is ADD Lab The load labels Key The coordinate system number defined by EDLCS or the element face number for the pressure loading Cname The name of the existing component or part number to which this load will be applied Length The number of data values for the time array Par and the load array Par2 Phase Phase of the analysis in which the load curve is to be used Parl The time values with the number of values in the string defined by the Length argument above Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 78 of ANSYS Inc and its subsidiaries and affiliates 3 2 11 EDPREAD Command
8. deck elprev function elprev prev C primary function get the number of the previous selected element c c Notice This file contains ANSYS Confidential information c c typ int dp log chr dcp siz sc ar n func intent in out inout e input arguments c variable typ siz intent description c prev int sc in the last element used c 0 use for initial value c c output arguments c elprev int func out the previous selected element e 0 no more elements c Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 217 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database 7 1 7 elnxdf Function Getting the Number of the Next Defined Element deck KKK kkk OOA OG oo Modo ooo Moo elnxdf function elnxdf next primary function get the number of the next defined element Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description next int sc in the last element used 0 use for initial value output arguments elnxdf int func out the next defined element 0 no more elements 7 1 8 elsel Subroutine Selecting Unselecting Deleting or Inverting an Ele ment deck elsel subroutine elsel ielei ksel C primary function to select unselect delete or inver
9. e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed ic 1 return info about element nodal forces e ielem 0 return number of element nodal c forces for this element a record length e 0 return maximum number of element eG nodal forces on any element c max record length e DB NUMDEFINED return total number of element nodal e forces defined in model c output arguments c enfiqr int func out the returned value of enfiqgr is based on e setting of key 7 7 10 enfget Function Getting an Element s Nodal Forces deck enfget function enfget ielem value C primary function get element nodal forces c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c output arguments G enfget int func out status of element 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 60 of ANSYS Inc and its subsidiaries and affiliates 7 7 13 ensiqr Function Getting Information About an Element s Nodal Stresses a 0 element has no nodal forces c gt 0 number of nodal forces returned a value dp ar out element nodal forces 7 7 11 enfput Subroutine Storing an Element s Nodal Forces deck enfput subroutine enfput ielem nval value c primary function store nodal force result
10. external erhandler integer secId secIdCurr secIdWave kch x nsize nsizec nsizew iw in i nw kwav kcrc kmf double precision dWork dWorkC dWorkW rkd wvmax x rko rkdnew ch th dwwl tpd depth dperr 4 dperr 1 secIdWave c depth dWork 11 depth nw nint dWorkW 6 number of wave components kwav nint dWorkW 11 type of wave kcrc nint dWorkW 14 how to combine wave and current kmf nint dWorkW 15 MacCamy Fuchs flag Cc dummy logic th dWorkC 1 iw kerctkmft kch kwavtnsizetnsizectnsizewtsecIdt secIdCurr tpd DPPI2 depth wvmax 0 0d0 do iw 1 nw dperr 2 iw in ptr Layer 6 iw 1 c Cc compute wave length from other parameters dwwl acend 3 dWork in 2 2 DPPI2 C dwwl deep water wave length c if dWork in 4 eq 0 0d0 then Cc compute wave length if needed rko tpd dwwl rkd rko c test to see if deep water estimate is correct if rko 1t DPPI then do i 1 100 th tanh rkd ch cosh rkd rkdnew rkd rko rkd th rkd ch 2 th if abs rkd rkdnew le 1 d 7 go to 500 rkd rkdnew enddo call erhandler userPartVelAccSetup 5060 3 x The following wave length has not converged after 100 x iterations 0 0d0 c 500 rkd rkdnew endif dWork in 4 tpd rkd if dWork 16 eq 1 then dperr 3 dwwl dperr 4 dWork in 4 call erhandler userPartVelAccSetup 5070 1 x Ocean ID I wave number 1I OCTABLE command
11. DB_NUMDEFINED return the number of nodal thermal strains e defined in model c output arguments amp ethiqr int sc out the returned value of ethiqr is based on e setting of key 7 7 38 ethget Function Getting an Element s Nodal Thermal Stresses deck ethget function ethget ielem value C primary function get element nodal thermal strains c also the volumetric swelling strain c Notice This file contains ANSYS Confidential information e input arguments G ielem int sc in element number 272 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 7 39 ethput Subroutine Storing an Element s Nodal Thermal Stresses c output arguments c ethget int func out e c c o value dp ar out NOTE Q00000000000000000000000000Q status of element 0 element undefined gt 0 number of nodal thermal strains returned element nodal thermal strains Strains at each corner node in the order X Y Z XY YZ XZ epswel For solid elements strains at corner node For shell elements strains at each corner node first top durface bottom For layered elements w KEYOPT 8 0 strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node first the botto
12. Qo OY Qv OG o0 dp 1 2 nmrow Element force vectors This record contains both the applied force vector and the restoring or imaginary load vector KKKKKKKKKKKKKKK Internal CE information KKKKKKKKKKKKKKKKKKKKKKK The following records repeat numCE times one for each internal CE created during solution these are stored here for the psolve command such as the case of a prestressed nonlinear modal analysis CE i 3 numCE First part is the CE number the second part is the number of terms in this internal CE and the third part is the external element number of the element that created this internal CE 3 203 26 OV TO TO Ta TOGT TOTOO Q nTerms numCE integer info list of node 32 dof dp nTerms numCE dp info list of coefficients including constant term kygst global stiffness matrix calculate key kygm global mass matrix calculate key kygd global damping matrix calculate key kygss global stress stiffening matrix calculate key kygaf global applied force matrix calculate key kygrf global restoring force matrix calculate key 1 7 Description of the Substructure Matrices File This section explains the contents of the substructure matrices file jobname sub 1 7 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 8 1 7 2 SUB File Format comdeck fdsub e C copyright c 2008 SAS IP Inc All rights r
13. cccccccccccecceceeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeeeeeeeeeeeeeeeseseseseseseeeesss 191 6 5 12 3 Subro tine WVhyDl oie ptm terea t etu aee uve eror c AS ERR PRA UR eg 192 6 5 1 2 A SUDPOULING WWValqu certi ra tnr eR dre er verti QUIT tau AN ER vtt e redet n dotata 192 6 5 12 5 Subroutine wavHtSec ccesccccccccesssessnceecececceseeennaeeeeeeeceseeeesnaaeeeeeeceeseeeesaeeeeeeess 192 6 6 Running ANSYS as a Subroutine seem conce e edi iq Poen pe ERI gebe vio vota bed dis 193 6 7 Defining Your Own Comiiatmds ori cete d se addu E eo n EM AY ee eN Vd pr a EON Eu RE RE EUR ER RI Re ea CURIAE QUE 194 OAV FUNCH ON US ETOT o E Ea 194 6 7 2 Function user02 Demonstrates Offsetting Selected Nodes sees 195 Release 12 0 O 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information a of ANSYS Inc and its subsidiaries and affiliates VII Programmer s Manual for Mechanical APDL 6 7 3 Function user03 Demonstrates Using ANSYS Memory eeeeeeseeeeeeenenene nenne 196 6 7 4 FUNCTION ser04 odis oce e eee ren eec er ides Ente ee vex Vexoven ae esee n ences U ed ee VR YA E EE 199 6 7 5 Functions user05 through BSel10 us siesta reprae rer sa creme ha tp Rb rendra raa lic Pe 200 6 8 Supporting Subroutines arseenin i ea eri EAE nenne eene a sese ne nennt tnnt essen eser nennen nennen 200 6 8 1 Function GetRForce Getting Nodal Reaction Force values ee
14. element current densities c output arguments e none c NOTE If a value is not defined a very c small number should be used 2 100 7 6 24 edcdel Subroutine Deleting an Element Current Density deck edcdel subroutine edcdel ielem c primary function delete element current densities c Notice This file contains ANSYS Confidential information c input arguments ie ielem int sc in element number c output arguments none 7 6 25 evdiqr Function Getting Information About Element Virtual Displace ments deck evdiqr function evdigqr ielem key C primary function get information about element virt disps c Notice This file contains ANSYS Confidential information e input arguments C ielem int sc in element number or zero see below e key int sc in key as to the information needed e 1 or DB MAXRECLENG return element virt disps info e for ielem 0 number of virt disps defined for this e element rec length e 0 maximum number of virt disps defined e for any element max rec length e DB NUMDEFINED e DB MAXDEFINED return total number of virt disps defined e in model e NOTE both DB NUMDEFINED and DB MAXDEFINED e produce the same functionality c output arguments c evdiqr int func out the returned value of evdigr is based on c setting of key 7 6 26 evdget Function Getting an Element Virtual Displacement deck evdget function evdget
15. pointer to start of svr for element ol svindx int ar 10 2 in index to svr for this element e low and high parts of 64 bit address C output arguments ol locsvr LONGINT sc inout pointer to start of svr for next element 6 2 6 Subroutine mreuse Determining Which Element Matrices Can Be Reused deck mreuse subroutine mreuse kelrqq kelfil elem ielc kmasrt knlmg kconve x kpheno kprop nprop prop propo krvro rvr rvro amodo asymo kelin primary function determine which Matrices can be REUSEd and which must be recomputed from iteration to iteration Note a few special elements have some supplementary logic to adjust these results further No attempt as been made to include all such logic in these routines Second note this logic is essentially the same as the old sfrm logic Hopefully further simplifications and enhancements will be made in the future Especially in gap elements and in multilayer elements the whole idea of kpheno a holdover from the sfrm routines needs to be looked at and possibly eliminated Notice This file contains ANSYS Confidential information input arguments kelrqq int ar 10 in request keys needed for this analysis kelfil int ar 10 in keys indicating matrices on the file elem int sc in element number ielc int ar IELCSZ in array of element type characteristics kmasrt int sc in does the mass matrix have rotational DOF 0 no 1 yes with nlgeom s
16. 233 7 5 2 disget Function Getting a Constraint from the Database cccccccccssssssstteeeeeeeeseeees 234 7 5 3 disput Subroutine Storing a Constraint at a Node sse 234 7 5 4 disdel Subroutine Deleting a Constraint at a Node ssessssssssseresssssssssereeesssssssereeessssse 235 7 5 5 foriqr Function Getting Information About Nodal Loads ssseeeenee 235 7 5 6 forget Function Getting a Constraint from the Database seessseeee 235 7 5 7 forput Subroutine Storing a Nodal Load at a Node ssssssssssssssserssssssssssereeesssssserrresssss 236 7 5 8 fordel Subroutine Deleting a Nodal Load at a Node sss 236 7 5 9 ntpiqr Function Getting Information About a Nodal Temperature ssssssss 236 7 5 10 ntpget Function Getting a Specified Nodal Temperature cccccccccssessstteeeeeeeeeseeees 237 7 5 11 ntpput Subroutine Storing a Nodal Temperature ccccccceessssstecceeceeeesessnneeeeeeeeeeeees 237 7 5 12 ntpdel Subroutine Deleting a Nodal Temperature sseeeeeeenee 237 7 5 13 nhgiqr Function Getting Information About Nodal Heat Generations 238 7 5 14 nhgget Function Getting a Nodal Heat Generation seeeeeeeenn 238 7 5 15 nhgput Subroutine Storing Nodal Heat Generation ccesesscecceceeeeeeesssneeeeeeeeeeeees 238 7 5 16 n
17. Appendix B Creating External Commands in Windows accessed through the Control Panel For example the following string sets the environment variable to point to the C home mydir directory set ANSYS_EXTERNAL_PATH C home mydir B 1 7 Using External Commands To call an external command enter it as you would any other ANSYS command in the ANSYS command window You can also call external commands through either an APDL macro or UIDL routine Note Avoid recursive external commands that is avoid situations where an external command calls another external command B 1 8 Checking External Command Status You can check what shared libraries are currently accessible by entering the DEBUG command in the command input window The following figure shows an example of DEBUG command output External Command Mappings Command Library Function Accessed ee ee ee ee ko ck oko ce Ak X ok ck ee ee Te X Xo ok re Xo ko o Wo ko k o excmd home mydir mycode mycommand so excmd YES Note that the output lists the command the related shared library the function and whether or not the command has been accessed B 1 9 Resetting External Commands You can Close all shared libraries Free memory associated with external commands by issuing the RESET command This command issues the following message to confirm that the reset operation is complete RESET was processed The external command buffers h
18. DB NUMSELECTED return number of selected contraint equations DB MAXDEFINED return number of highest numbered constraint equation defined DB MAXRECLENG return length of longest contraint equation set max record length 2 return length data units 3 return layer number 4 address of first data word 11 return void percent integer 16 return location of next record 1 return master dof for this eqn output arguments ceingr int func out the returned value of ceingr is based on setting of key 7 4 6 ceget Function Getting an Constraint Equation deck ceget function ceget nce ieqn deqn c primary function get a constraint equation c Notice This file contains ANSYS Confidential information c input arguments c nce int sc in constraint equation number C output arguments c ceget int func out number of dof in equation c ieqn int ar ceget 1 out integer info c iegn 1 ceget list of node 32 dof 232 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 5 1 disiqr Function Getting a Information About Constraints e ieqn ceget 1l number of dof in equation e copy of return value i negative means internal CE ic deqn dp ar ceget 1 out dp info o deqn l ceget list of coefficients o deqn ceget 1 constant term
19. How Defined Element number Material number Output information Output information Call material sub routines At FE model creation At FE model creation Formulation request Specifying which matrices and load vec tors to form ANSYS code lumpm Mass matrix format 0 Consistent mass matrix 1 2 Lumped mass matrix Specifying how to form the mass matrix LUMPM com mand nDim Number of dimensions Element coding USRELEM command nNodes Number of element nodes Element coding USRELEM command Nodes Element node list Connectivity Output At FE model creation nlIntPnts Maximum number of element integration points Element coding USRELEM command nUsrDof Number of element DOFs Element coding The USRELEM and DOFs are ordered in USRDOF com the way in which mands they are listed via the USRDOF command for each node and re peated for all nodes All element matrices DOF values and load vectors must be arranged in the same way kEStress Element stress state Element coding USRELEM Calling material sub command routines if requested keyAnsMat Element formulation key Specifying howtocre USRELEM 0 Write your own material ate material data command formulation 1 Use standard ANSYS mater ial subroutines and call Elem GetMat subroutine keySym Flag for symmetricity of ele Element coding USRELEM ment matrices A
20. International Journal for Numerical Methods in Engineering 15 9 1980 1413 1418 6 4 1 2 Stress Strain and Material Jacobian Matrix The stress measure c used by the subroutine is the Cauchy stress true stress and the strain measure e is the logarithmic strain true strain The strains and incremental strains passed into UserMat are the total mechanical strains from which the thermal strains if they exist are subtracted JAG OA amp A AOi UserMat must also provide the material Jacobian matrix defined as is the stress increment Agi and is the strain increment UserMat is based on the current configuration for nonlinear geometry analysis NLGEOM ON ANSYS uses a co rotational approach to account for rigid body rotation Because ANSYS already accounts for the strains passed into UserMat for the rigid body rotation there is no need to apply additional rotation within UserMat Stress strain and the material Jacobian tensors are stored in a vector or matrix format The order of components for all tensors is as follows 3 D stress state 11 22 33 12 23 13 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 157 Chapter 6 UPF Subroutines and Functions 2 D plane stress strain and axisymmetric stress states 11 22 33 12 Beam element stress states 11 13 12 Link elem
21. Par2 The load values with the number of values in the string defined by the Length argument above LCD The curve ID created using the EDCURVE command If LCID is nonzero then Length 1 and Pari and Par2 will be equal to 0 Scale The Scale Factor applied to the load curve Btime The birth time Dtime The death time NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 11 EDPREAD Command The EDPREAD command is used to internally write the part information to the Jobname CDB file for explicit dynamics Prior to Release 8 0 the command format in Jobname CDB is EDPREAD R5 4 Nmat Npart Type Mat Real Used Nmat The number of materials Npart Number of parts and also the number of times to repeat the second Type Mat Real Used input line Type The element type number Mat The material number Real The real constant set number Used The flag indicating if the part is used 1 or not used 0 For Release 8 0 and beyond the command format is EDPREAD R8 0 Nmat Npart Part ID Type Mat Real Used Nmat The number of materials Npart Number of parts and also the number of times to repeat the second Type Mat Real Used input line PartID The part number Type The element type number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 7 of
22. amp primary function user operation on parameter for combin7 and combin37 e accessed with keyopt 9 1 G c copyright c 2008 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information G c input arguments c variable typ siz intent description c elem int sc in element number c ireal int sc in element real constant number ol type int sc in element type number e nusvr int sc in number of user supplied element variables c input with the NSVR command e usvr dp ar nusvr inout user supplied element variables Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 151 Chapter 6 UPF Subroutines and Functions either cl or c3 must be nonzero for this logic to be accessed c parm dp sc in current value of the paramater c parmld dp sc in value of the parameter at previous time ste c c1 dp sc in real constant c c c2 dp sc in real constant c2 c c3 dp sc in real constant c3 c c4 dp sc in real constant c4 e C output arguments c variable typ siz intent description c usvr dp ar nusvr inout user supplied element variables c may be sent rst file with usereo c fcon dp sc out result of calculation e e e 6 3 4 Subroutine UEIMatx Accessing Element Matrices and Load Vectors deck UElMatx USERSD
23. c epliqr int func out the returned value of epligr is based on e setting of key 7 7 30 eplget Function Getting an Element s Nodal Plastic Strains deck eplget function eplget ielem value C primary function get element nodal plastic strains c Notice This file contains ANSYS Confidential information 268 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 7 31 eplput Subroutine Storing an Element s Nodal Plastic Strains a nananana Q00000000000000000000000000n input arguments ielem int sc in output arguments eplget int func out value dp ar out NOTE element number status of element 0 element undefined gt 0 number of nodal plastic strains returned element nodal plastic strains Strains at each corner node in the order XX Wi XY YZ Xe For solid elements strains at each corner node For shell elements strains at each corner node first top durface then bottom For layered elements w KEYOPT 8 0 Strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node first the bottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were
24. c object library mem c Notice This file contains ANSYS Confidential information c input arguments o iLen int sc in length of the block in data elements c cl6Label chr 16 sc in 16 character name for the Block c key int sc in type of data for this block see ansysdef C output arguments e fAnsMemAlloc PTRFTN sc out Pointer to this data block needs to be e tied to a local variable in the calling amp amp routine 6 11 3 Subroutine fAnsMemFree Deallocating Space deck fAnsMemFree subroutine fAnsMemFree memPtr c primary function Free a Data Block given a pointer C keywords subroutine to free a mem block c object library mem c Notice This file contains ANSYS Confidential information c input arguments a ptr PTRFTN sc inout pointer for this block C output arguments c ptr PTRFTN sc inout pointer will be set to zero Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 209 Chapter 6 UPF Subroutines and Functions 6 12 Parameter Processing Subroutines The ANSYS distribution medium contains three subroutines you can use for parameter processing pardim parevl and pardef 6 12 1 Subroutine pardim Creating a Dimensioned Parameter deck pardim subroutine pardim cName labl4 nDim nxyz cLabels C primary function create a dimensioned paramet
25. iout int sc comm output unit number intpdp int sc comm number of integers per double precision word lenfnm int sc comm number of characters in the filename reclng int sc comm system record length NOTE bintwr is not part of binlib a it is included only as an aid to users 2 2 4 Program wrtsub Demonstrates Writing an ANSYS Substructure File deck wrtsub ae OOO OOO 070 0 00 program wrtsub primary function demonstrates use of binary access routines secondary function write an ANSYS substructure file Notice This file contains ANSYS Confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Program to write ANSYS substructure file with usrsub To be used as a base for 3rd party companies to create their routines for writing the file s KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 63 Chapter 2 Accessing Binary Data Files 2 2 5 Program rdsubs Demonstrates Reading a Substructure File Subroutine rdsubs demonstrates how you read an ANSYS substructure file This demonstration program can handle up to MAXNODE nodes and MAXDOF degrees of freedom deck rdsubs program rdsubs c
26. number of data items to get begdat dp ar ndat in data at the beginning of this load step output arguments dat dp ar ndat out data at this time point enddat dp ar ndat out data at end of this load step tlvf int sc out thermal load vector flag Should the thermal load vector be computed 0 no temperatures match tref 1 yes temperatures do not match tref Note that even if tlvf 0 temperatures may be used to compute temperature dependent material properties Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 147 of ANSYS Inc and its subsidiaries and affiliates Chapter 6 UPF Subroutines and Functions 6 2 30 Subroutine prsget Defining Current Pressure Loads deck prsget subroutine prsget iel ielc nfac ndat begdat dat enddat iexist le primary function define the current pressure loads e See also PrsRIGet c Notice This file contains ANSYS Confidential information ae input arguments c iel int sc in element number c ielc int ar IELCSZ in array of element type characteristics c nfac int sc in number of pressure faces c ndat int sc in number of pressure values c begdat dp ar ndat in pressure at the beginning of load step c output arguments c dat dp ar ndat out pressures at this iteration c enddat dp ar ndat out pressure at end of this load step c iexist int sc out flag if pr
27. number of state variable for current material at e gauss intg ie NCOMP number of vector components such as stresses e C subroutine get ElmData inquire elemId kIntg nvect vect e 320 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates C 5 Accessing Solution and Material Data qQaaqagqagqagqagagqagagqagnqaagaaaaaa qQaaqaqaaagnqagagqaagangqagagqaagaagaagaagnqaagqagqaaaaa description function to get such as stress definition inquire elemId kIntg nvect vect variables PEG 7t EPTO EPPL EPCR EPTH UTSIG PLEQ CREQ SVAR subroutine put_ElmData description function to put such as stress Use this in caut you should only SVAR definition inquire elemId kIntg nvect vect variables SEGA EPTO EPPL EPCR EPTH ISIG PLEQ CREQ SVAR inquire solution dependent variables strains at gauss intg point query argument string element number gauss intg number number of vector to be inquired vector to be inquired stress vector Total strain vector EPEL EPPL EPCR EPTH plastic strain vector creep strain vector thermal strain vector Initial stress vector accumulated equivalent plastic strain accumulated equivalent creep strain State variables define by tb state inquire e
28. saveVa xRef xCur TotVal IncVal ItrVal VelVal AccVal rs Dof Dof Dof Dof Dof int sc in int sc in int ar nNodes in int sc in int sc in int sc in int sc in int sc in int sc in 0 no lumped mass matrix 1 lumped mass matrix number of dimensions of the problem defined on USRELEM command as NDIM 2 2D 3 3D number of nodes of the element defined on USRELEM command as NNODES node list of this element maximum number of integration points defined on USRELEM command as NINTPNTS number of DOFs of this element matrix and load vector size kEStress defined on USRELEM command as KESTRESS key to indicate if ANSYS material routine is going to be called defined on USRELEM command as KEYANSMAT 0 No 1 Yes key to indicate if element matrices is symmetric defined on USRELEM command as KEYSYM 0 symmetric 1 unsymmetric number of element key options able to be used in this routine int ar nKeyOpt in values of element key option defined dp ar nNodes in dp ar nNodes in dp sc in int sc inout int sc in dp ar nPres int s in int sc in dp ar nReal int sc in S rin by et or keyopt command for the user elements only the first nKeyOpt values are passed in and can be used to branch the routine for different formulations nodal temperatures at current time nodal temper
29. sssssssse 7 7 67 ehcput Subroutine Storing an Element s Calculated Heat Generations 7 7 68 ehcdel Subroutine Deleting Element Calculated Heat Generations suus 8 Subroutines for Users Convenience eeeseeesseeeeeeeeeeee eene hene eene see sesne trenes ese sessi ee 8 1 Input and Output Abbreviations ccccccccccccesssssnnceccecceseeeesnnneeeceeeceseeseenaceceeeeeeeeeesnenaeeeeeseess 8 2 General SUDFOUCFIGS usc ci Cod eres ce ted baden a ET RAS OA PER VE eb Te neo rater as ease eeu 8 2 1 dptoch Subroutine Retrieve Eight Characters From a Double Precision Variable 8 2 2 wrinqr Function Obtain Information About Output cc ceeceesesteteeececeesseesenaeeeeeeees 8 2 3 erinqr Subroutine Obtaining Information from the Errors COMMON ssssss 8 2 4 TrackBegin Subroutine Beginning Tracking for a Subroutine Call 8 2 5 TrackEnd Subroutine Ending Tracking for a Subroutine Call sesseeee 8 2 6 erhandler Subroutine Displaying ANSYS Errors esee 8 2 7 intrp Subroutine Doing Single Interpolation csscccccceeeeeeessnnecceeeceeeesensaeeeeeeeeseees 8 2 8 tranx3 Subroutine Processing Geometry for 3 D Line Elements eese 8 2 9 systop Subroutine Stopping an ANSYS Program Run ccccccccesssesssete
30. the misc non summed data items c output arguments none e amp NOTE the contents of this record is element c dependent See NMISC on ETABLE command 7 7 56 emndel Subroutine Deleting an Element s Miscellaneous Non sum mable Data deck emndel subroutine emndel ielem C primary function delete element misc non summable data c Notice This file contains ANSYS Confidential information g input arguments c ielem int sc in element number c 0 delete for all defined elements G output arguments none Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 27 of ANSYS Inc and its subsidiaries and affiliates 9 Chapter 7 Accessing the ANSYS Database 7 7 57 ecdiqr Function Getting Information About Element Current Densities deck ecdiqr function ecdigqr ielem key c primary function get information about element current densities c Notice This file contains ANSYS Confidential information amp input arguments e ielem int sc in element number or zero see below c key int sc in key as to the information needed amp 1 return info about element current densities amp ielem 0 return number of current densities on amp this element G record length c 0 return maximum number of current c densities on any element max record length e DB NUMDEFINED return the number of element current c
31. 2 CSG Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 57 Chapter 2 Accessing Binary Data Files MATOTO MTO 700 3 U S Customary using feet 4 U S Customary using inches 6 MPA 7 uMKS code int se in code defining 3rd party vendor contact ANSYS Inc for code assignment output arguments none 2 1 10 Subroutine binhed Writing the Standard ANSYS File Header deck binhed Cc Cc c c Cc Q anaa Q0Q0n00000n0n0n0nQ0nQoaoaoaoaoaoaoaoaoaoaoaoaoaoaooooonononon subroutine binhed nblk nunit filpos buffer primary function put standard header on a binary file all permanent binary files should have this header secondary functions return the first data position This routine is intended to be used in standalone programs This routine should not be linked into the ANSYS program Notice This file contains ANSYS Confidential information input arguments nblk int sc in block number of open binary file as defined with subroutine binset nunit int sc in the unit number for this file buffer int ar inout work array for paging should be the same array as used in binset output arguments filpos int sc out the position after the header buffer int ar inout work array for paging ANSYS standard header data description
32. 6 return compressed record number 11 return void percent integer 16 return location of next record this increments the next record count 18 return type of file ehgiqr 0 integer double precision 2 real 3 complex 4 character 8 7 index 19 return virtual type of file ehgiqr 0 fixed length 4 4 form indexed variable length layer data 2 xref data tables 3 bitmap data for 32 data item packed records 4 data tables three dimensional arrays Q0Q000000000000000000000000000000000000mn I c output arguments c ehgiqr int func out the returned value of ehgigr is based on e setting of key 7 6 14 ehgget Function Getting an Element Heat Generation deck ehgget function ehgget ielem qgen Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 248 of ANSYS Inc and its subsidiaries and affiliates 7 6 17 efuiqr Function Getting Information About Element Fluences C primary function get element heat generations in raw form c Notice This file contains ANSYS Confidential information G input arguments c ielem int sc in element number c output arguments c ehgget int func out status of element c 0 heat generations undefined for this o element e gt 0 number of heat generations defined o qgen dp ar out the element heat generatio
33. C mpg ceget celist lstcmd utcmd mainan get CE 7 4 7 ceput Subroutine Storing a Constraint Equation deck ceput subroutine ceput nce n ieqn deqn C primary function store a constraint equation c Notice This file contains ANSYS Confidential information c input arguments c nce int sc in constraint equation set number c n int sc in number of degrees of freedom in set o ieqn int ar n 1 in integer info e ieqn 1 n node 32 dof for each dof in set c iegn n 1 number of dof in set copy of n above amp negative means internal CE G deqn dp ar n 1 in dp info c deqn 1 n coefficients of each dof in set c deqn n 1 constant term e C output arguments none 7 4 8 cesel Subroutine Deleting or Selecting a Constraint Equation deck cesel subroutine cesel ncei ksel C primary function select or delete a constraint equation c Notice This file contains ANSYS Confidential information c input arguments c ncei int sc in constraint equation number c ksel int sc in select delete flag G 0 delete equation c 1 select equation C output arguments none c mpg cesel cedele lt pr7rst edgung solvcl delete ce 7 5 Nodal Loading Routines 7 5 1 disiqr Function Getting a Information About Constraints deck disiqr function disiqr node key C primary function get information about constraints c Notice This file con
34. C primary function get calculated element heat generations c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c output arguments c ehcget int func out status of element o 0 element undefined e gt 0 number of calculated element o heat generations c value dp ar out calculated element heat generations 7 7 67 ehcput Subroutine Storing an Element s Calculated Heat Generations deck ehcput subroutine ehcput ielem nval value c primary function store calculated element heat generations c Notice This file contains ANSYS Confidential information input arguments c ielem int sc in element number c nval int sc in the total number of values c value dp ar nval in calculated element heat generations c output arguments none 7 7 68 ehcdel Subroutine Deleting Element Calculated Heat Generations deck ehcdel subroutine ehcdel ielem C primary function delete calculated element heat generations c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c 0 delete for all defined elements c output arguments none Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 283 284 Release 12 0 20
35. G ni int sc in number of rows in matrix c to fill c n2 int sc in number of columns in matrix c to fill c n3 int sc in number of rows in matrix a and o number of rows of matrix b e amp to work with the two need c to be the same for the inner product c if n3 is negative accumulate results in c C output arguments c c dp ar nc out product matrix c c o3 mpg C A B if n3 gt 0 c C C A B if n3 0 c A na B nb C nc C minor nl n2 n3 dot length e 8 4 6 maat Subroutine Changing a Matrix Value via Addition Multiplication and Transposition deck maat subroutine maat a c nc n con c primary function does con a at and sums the result onto c a is a vector c Notice This file contains ANSYS Confidential information e typ int dp log chr dcp siz sc ar n intent in out inout c input arguments e a dp ar in vector to be multiplied by itself to c generate an nxn square matrix e a by a transposed e c dp ar nc inout matrix to be accumulated onto c nc int sc in number of rows in the c matrix e n int sc in size of square matrix Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 299 Chapter 8 Subroutines for Users Convenience c con dp sc in multiplier on above square matrix C output arguments c c dp ar nc inout matrix t
36. Number of values per point c If 0 no data c iLoc int sc out Location of Comp in values 6 8 4 Subroutine ElResultGet Getting Results Values at Selected Points deck ElResultGet subroutine ElResultGet nPoints ebest elcord TypeData iLoc x nVal result c primary function postl Get results at selected points c Notice This file contains ANSYS Confidential information c prolog is not confidential c input arguments c nPoints int sc in Number of evaluation points Cc from ElInterp c ebest int ar nPoints in Element s containing points c elcord dp ar 3 nPoints in Element coordinates e from ElResultStrt c TypeData int sc in Data type code c iLoc int sc in Start of selected data c nVal int sc in Number of results per point C output arguments Result dp ar nvar nPoints out Array of results 6 8 5 Subroutine Ellnterp Finding Element Coordinates deck ElInterp subroutine ElInterp piFEML nPoints xyzPoints tolInsidein x tolOutsidein MoveTol ebest elcord Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 202 of ANSYS Inc and its subsidiaries and affiliates 6 9 Access at the Beginning and End of Various Operations C primary function Find element numbers containing xyz points c secondary functions Find element coordinates of these points c object library upf c Notice This
37. Programmer s Manual for Mechanical APDL ANSYS Inc Southpointe 275 Technology Drive Canonsburg PA 15317 ansysinfo ansys com http www ansys com T 724 746 3304 F 724 514 9494 Release 12 0 April 2009 ANSYS Inc is certified to ISO 9001 2008 Copyright and Trademark Information 2009 SAS IP Inc All rights reserved Unauthorized use distribution or duplication is prohibited ANSYS ANSYS Workbench Ansoft AUTODYN EKM Engineering Knowledge Manager CFX FLUENT HFSS and any and all ANSYS Inc brand product service and feature names logos and slogans are registered trademarks or trademarks of ANSYS Inc or its subsidiaries in the United States or other countries ICEM CFD is a trademark used by ANSYS Inc under license CFX is a trademark of Sony Corporation in Japan All other brand product service and feature names or trademarks are the property of their respective owners Disclaimer Notice THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS OF ANSYS INC ITS SUBSIDIARIES OR LICENSORS The software products and document ation are furnished by ANSYS Inc its subsidiaries or affiliates under a software license agreement that contains pro visions concerning non disclosure copying length and nature of use compliance with exporting laws warranties disclaimers limitations of liability and remedies and other provisions The soft
38. The NBLOCK command defines a block of nodes This is the recommended method for inputting nodes into the ANSYS data base The command syntax is NBLOCK NUMFIELD Solkey NDMAX NDSEL Format NUMFIELD The number of fields in the blocked format Solkey The solid model key The node is part of a solid model if the keyword SOLID appears here NDMAX The maximum node defined NDSEL The number of nodes written Format Data descriptors defining the format The format of the node block is as follows Field 1 Node number Field 2 The solid model entity if any in which the node exists if SOLID key Field 3 The line location if the node exists on a line and if SOLID key Field 4 6 The nodal coordinates Field 7 9 The rotation angles if NUMFIELD gt 3 Only the last nonzero coordinate rotation is output any trailing zero values are left blank The final line of the block is always an N command using a 1 for the node number The following example shows a typical NBLOCK formatted set of node information Note that this example has no rotational data It contains only the first six fields NBLOCK 6 SOLID 159707 113145 318 6e20 13 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidentialinformation of ANSYS Inc and its subsidiaries and affiliates 83 Chapter 3 The CDWRITE CDB File Format 1 0 0 8 9400000000000E 02 0 0000000000000E 00 2 78000000
39. The dofs to retrieve for the node dof degree of freedom The dofs array should be zeroed out except for the needed parts dofs is a bit pattern with true bits representing the GLOBAL Dof set desired That is dofs 1 is used for UX to SP06 and dofs 2 is used for TBOT to TTOP See ECHPRM for details For example dofs 1 UX TEMP dofs 2 TE3 TIOP is a special case If you want TTOP alone use dofs 2 ibset 0 TTOP If TBOT and TTOP are desired you must use dofs 2 TBOT dofs 2 ibset dofs 2 TTOP ndof int sc in The number of node dofs 1 2 or 3 nrot int sc in Key to rotate dofs from nodal to global coordinate systems if Q0 none if 2 2 d if 3 3 d if 0 dof set must include and only include all terms of the vector e g UX UY UZ or AX AY AZ xyzang dp ar 6 in The xyz virgin node coordinates including angles Not used if nrot 0 or ndof 2 nuvect int sc in Number of vectors to retrieve Can vary between 1 and 5 Normally 1 is what is wanted Other vectors include previous values and or velocities See elucom for all possibilites Contents are analysis type dependent Q0000000000000n00000000000000000000001 0 c output arguments c unode dp ar ndof nuvect out Element nodal solution vectors in ce the global coordinate system 7 3 Element Attribute Routines 7 3 1 elmiqr Function Getting Information About an Element deck elmiqr function elmigr ielem key
40. c node int sc in node number c idf int sc in reference number of DOF 1 32 c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 c AZ 9 VX 10 VY 11 V 12 c PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 c EMF 25 CURR 26 missing entries are spares c output arguments none 7 5 5 foriqr Function Getting Information About Nodal Loads deck foriqr function foriqr node key C primary function get information about nodal loads c Notice This file contains ANSYS Confidential information input arguments node int sc in number of node being inquired about Should be 0 for key DB MAXDEFINED or DB NUMDEFINED key dp sc in key as to information needed 1 return force mask for node DB MAXDEFINED DB NUMDEFINED return number of nodal loadings in model NOTE both DB MAXDEFINED and DB NUMDEFINED produce the same functionality Q0Q000n00n0n0nnon c output arguments c foriqr int func out the returned value of foriqgr is based on o setting of key 7 5 6 forget Function Getting a Constraint from the Database deck forget function forget inode idf value C primary function get a force from the data base in raw form c Notice This file contains ANSYS Confidential information c input arguments c inode int sc in node number negative value for no c partabeval c idf int sc in reference number for the DOF 1 32 c see echprm
41. gt The space character Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 88 of ANSYS Inc and its subsidiaries and affiliates 4 2 2 Graphics File Directives 4 2 2 Graphics File Directives Graphics files contain a set of directives that define various aspects of how ANSYS displays a plot such as window coordinates colors for graphs and test line dimensions and so on Each directive consists of a command character followed by one or more parameters Within a graphics file one directive directly follows the preceding directive For example below is the first line of a graphics file BBAAA2A0AAAAAAPPPLPO gt APSMEKLKBAJANSYS 5 3 MEKLEFALNOV 15 1996SMEKKOJAI10 01 40 The text of this example line breaks down as follows BBAAA The Start Plot directive beginning with com mand character B B A A and A are the val ues of parameters defining the plot environ ment Parameters for all plot directives and their possible values are explained later 2A The Text Size directive which determines the type size of displayed text strings The 2 is the command character and A represents the size value OAAAAAAPPPLPO The Window directive which sets the coordin ates for the displayed image 0 is the com mand character AAAAAA represents the first set of coordinates the lower left corner of the image and PPPLPO represents the second coordinate set th
42. increment first dimension of vector v2 o n int sc in length second dimension of vectors e vl v2 e e a ad 8 3 3 vsum Function Summing Vector Components deck vsum function vsum va n C primary function sum the components of a vector c Notice This file contains ANSYS Confidential information c input arguments c va dp ar n in vector va e n int sc in length of vector va Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 291 Chapter 8 Subroutines for Users Convenience c output arguments e vsum dp sc out vector sum 8 3 4 vmax Function Retrieving the Maximum Vector Value at a Given Loca tion deck vmax function vmax v n locmax C primary function return the max value and location in a vector c Notice This file contains ANSYS Confidential information c input arguments e v dp ar n in vector v e n int sc in length of vector v C output arguments s locmax int sc out location of max value in vector v e vmax dp sc out max value in vector v 8 3 5 lastv Function Retrieving the Position of the Last Nonzero Term in a Double Precision Vector deck lastv function lastv v n c find position of last non zero term in a d p vector x 8 3 6 izero Function Setting an Integer Vector to Zero deck izero
43. inout matrix to be solved or inverted c Second dimension must be at least Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 301 Chapter 8 Subroutines for Users Convenience CQ iQ os OE QA Co QC Qa 0c Q2 Q7 x Q3 05 22 1 202 09 49 70 Q9 17 Q2 Q2 100 Q2 7 02 c 2 Q2 0 9s AA n abs nc nd int sc in first dimension of the a matrix n int sc in number of equations nc int sc in number of additional columns if nc n or n invert n x n matrix and put result in the n l to 2xn columns if nc is 0 or negative nc will be reset to n and then symeqn will set up identity matrix after the input matrix where the result of the inversion will be put if nc is positive and less than n do a partial inversion see example 1 below defFlag int sc in flag indicating that incoming matrix MUST be 1 negative definite 0 positive or negative definite positive definite output arguments variable typ siz intent description symegn in sc out 0 non singular matrix 1 singular matrix 2 near singular matrix a dp ar nd inout results or inverted matrix starts in column ntl note original information is destroyed example 1 Solve three simultaneous linear equations i symegn a 1 1 3 3 1 calling routine has a dimensioned as a 3 4 each equation has its 3 coefficent
44. master output file frstot e WR COLINTER interactive columns per page intcol c WR COLBATCH batch columns per page batcol e WR LINEINTER interactive lines per page intlin a WR LINEBATCH batch lines per page batlin c WR CHARITEM characters per output item chrper c WR CHARDECIMAL characters past decimal chrdec e WR CHARINTEGER characters in leading integer chrint c WR CHARTYPE chrtyp e wringr 1 using E format in output e 2 using F format in output c 3 using G format in output c WR SUPTITLE tlabel supress key keyhed c WR SUPSUBTITLE subtitle supress key keytit e WR_SUPLSITER ls iter id supress key keyid e WR NOTELINE note line supress key keynot e WR SUPCOLHEADER column header supress key keylab e WR SUPCOLMAX column maximum supress key keysum c WR LISTOPT ListOpt from output command ListOpt Q output arguments c wrinqr int func out the value corresponding to key 8 2 3 erinqr Subroutine Obtaining Information from the Errors Common deck eringr function eringr key primary function obtain information from errors common Notice This file contains ANSYS Confidential information input arguments c c c c c key int sc in item to be returned 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 86 of ANSYS Inc and its subsidiaries and affiliates 8 2 3 eringr Subrout
45. number of values to put c value dp ar nval in the element convections c NOTE Two values at each node of an c element face if loading is a convection e the first first value is the film c coefficient and the second value is the Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 245 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database Qo Qo oov bulk temperature If loading is a heat flux the first value is the heat flux and the second value is a large number 2 100 output arguments none 7 6 8 ecvdel Subroutine Deleting a Convection on an Element deck ecvdel c KKK c kkk qgqQaQqaQqaQqQqaa Q a aAa subroutine ecvdel ielem iface primary function delete a convection on an element Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description ielem int sc in element number iface int sc in face number 0 delete all convections on this element 1 6 delete convections on this face output arguments none 7 6 9 etpiqr Function Getting Information About Element Temperatures deck etpiqgr c kkk c kkk Ma OG OO GA A Moo ani a aml aml ni ooo function etpigqr ielem key primary function get information about element temperature
46. o s 3 sz c S 4 7sigxy G s 5 sigyz c s 6 sigzx output arguments variable typ siz intent description s dp ar 11 inout stress vector s 7 sigl s 8 sig2 s 9 sig3 s 10 s i s 11 sige HATATA AA A Q note all changes to this routine must be made in postl paprst Q 6 3 Subroutines for Modifying and Monitoring Existing Elements The next few pages describe user subroutines for modifying or monitoring existing ANSYS elements These subroutines enable you to perform tasks including Computing load vectors for frequency domain logic Storing element output that users supply Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 149 Chapter 6 UPF Subroutines and Functions Modifying the orientation of material properties and stresses Modifying the orientation of material properties and stresses of layers within an element Performing a user defined operation on a parameter for the COMBIN7 and COMBIN37 elements Providing a user defined initial thickness for SHELL181 SHELL208 SHELL209 and SHELL281 Providing a user defined initial stress for PLANE42 SOLID45 PLANE82 SOLID92 SOLID95 LINK180 SHELL181 PLANE182 PLANE183 SOLID185 SOLID186 SOLID187 SOLSH190 BEAM188 BEAM189 SHELL208 SHELL209 REINF264 REINF265 SHELL281 and SOLID285 Modifying SURF151 and SURF152 film
47. p 201 6 13 1 Using Function RunCommand This function enables you to execute an ANSYS command from within a user subroutine Inputs and outputs for RunCommand are as follows deck RunCommand function RunCommand nChar command c primary function Execute an ansys command c object library upf c Notice This file contains ANSYS Confidential information c input arguments e nChar int sc in Length of the command string 8 min command ch nChar sc in A character string containing a c valid ANSYS command G output arguments c RunCommand int sc out An internally defined value ignore 6 13 2 Using the UNDO Command The undo file you create by issuing the UNDO command is similar to the File DB file created when you issue the SAVE command The UNDO command format is UNDO Action Action ON to write the undo file OFF to prevent the undo file from being written PROMPT to have ANSYS ask permission before writing the file STATUS to restore the file as it existed after executing the last command issued before the UNDO command Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 212 of ANSYS Inc and its subsidiaries and affiliates 6 13 3 Using the HOLD command 6 13 3 Using the HOLD command Issue the HOLD command to synchronize tasks in ANSYS The ANSYS program can synchronize tasks at the end of each results
48. qaaqaaaaqaa RRR IK RR KR IK RR RA I RRA IR RR IA II AR IA I I KY see user01 for additional information on user routines NCKCKCKCKCKCKCkCKCkCk A AA Ck Ck Ck Kk RA RA Ck CkCk kk Ck kk kc II AA k k k k k koe ek input arguments none output arguments user03 int sc out result code should be zero which is ignored for now KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Functions for accessing data on the command line integer function intinfun iField gets an integer from field iField double precision function dpinfun iField gets double precision character 4 ch4infun iField gets upper case 4 characters character 8 ch8infun iField gets mixed case 8 characters character 32 ch32infun iField gets mixed case 32 characters kkkkxkxkxkxkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxkkkkkkkkkkkkxxkxk include impcom inc include ansysdef inc 10 external TrackBegin TrackEnd external wringr ndingr ndgxyz ndnext fAnsMemAlloc x fAnsMemFree erhandler parreturn parstatus integer wrinqr ndingr ndgxyz ndnext PTRFTN fAnsMemAlloc integer user03 iott i ksel numnp node istat double precision xyz 3 xmean ymean zmean stdxyz 3 x Sodx sody sodz pointers pointer pdXnodeL Xnode pointer pdYnodeL Ynode pointer pdZnodeL Znode double precision Xnode Ynode Znode Wed Caled CO start timing FIAR call TrackBegin user03 Get nodal xyz locations and ca
49. real load vector for frequency domain complex load vector for frequency domain dynamic pressure wave information held for printout 6 5 7 Function userpe Calculating Rotation Caused by Internal Pressure deck userpe function userpe USERSDISTRIB prs rvrp angle ex nuxy c primary function calculate the rotation caused by internal pressure o on an elbow element e This function is only called by e118 pipel18 c if keyopt 5 1 c Notice This file contains ANSYS Confidential information c copyright c 2008 SAS IP Inc All rights reserved c ansys inc c typ int dp log chr dcp siz sc ar n intent in out inout c input arguments c variable typ siz intent description c prs dp ar 5 in pressure vector c rvrp dp ar 11 in real constants see elements manual c angle dp sc in subtended angle c ex dp sc in Young s modulus c nuxy dp sc in Poisson s ratio C output arguments c variable typ siz intent description c userpe dp sc out rotation caused by internal pressure on the c elbow element Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 183 Chapter 6 UPF Subroutines and Functions 6 5 8 Subroutine UsrViscEl Performs Viscoelastic Computation deck UsrViscEl USERSDISTRIB subroutine UsrViscEl veinpt ncomp tem dtem ex gxy eex egxy phil x zil gll g21 hsm hbm sm
50. zmean 2 enddo stdxyz 1 sqrt sodx numnp 1 stdxyz 2 sqrt sody numnp 1 stdxyz 3 sqrt sodz numnp 1 c write to output file iott wrinqr WR OUTPUT write iott 2000 xmean ymean zmean x stdxyz 1 stdxyz 2 stdxyz 3 2000 format MEAN FOR X COORDINATES G12 5 x MEAN FOR Y COORDINATES G12 5 x MEAN FOR Z COORDINATES G12 5 x STD FOR X COORDINATES G12 5 x STD FOR Y COORDINATES G12 5 x STD FOR Z COORDINATES G12 5 amp write to GUI window call erhandler user03 5000 2 x STD FOR X COORDINATES G x STD FOR Y COORDINATES G x STD FOR Z COORDINATES G stdxyz 1 e e set STATUS to 0 fof success xx istat 0 c release dynamically allocated memory call fAnsMemFree pdZnodeL call fAnsMemFree pdYnodeL call fAnsMemFree pdXnodeL c required return value 999 user03 0 c set RETURN to number of nodes processed call parreturn dble numnp e set STATUS for success 0 or no nodes 1 KORG OK OK call parstatus istat 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 98 of ANSYS Inc and its subsidiaries and affiliates 6 7 4 Function user04 3cek Call to end timing call TrackEnd user03 return end 6 7 4 Function user04 deck user04 user function user04 Go primary function user routine number 0
51. 100 words loc no words contents 1 1 fortran unit number 2 2 file format 0 internal format 1 external format 8 1 time in compact form ie 130619 is 13 06 19 4 1 date in compact form ie 19981023 is 10 23 1998 5 1 units 0 user defined units 1 SI MKS 2 CSG 3 U S Customary using feet 4 U S Customary using inches 6 MPA 7 uMKS 6 User_Linked 10 revision in text format 5 0 inexc4 tl date of revision release for this version 12 3 machine identifier 3 4 character strings 15 2 jobname 2 4 character strings LT 2 product name 2 4 character strings 19 special version label 1 4 character string 20 3 user name 3 4 character strings 23 3 machine identifier 3 4 character strings 26 System record size at file write 27 maximum file length 28 maximum record number 31 8 jobname 8 4 character strings 41 20 main title 20 4 character strings 61 20 first subtitle 20 4 character strings 95 split point of file NOTE Split files are not support by binlib 97 98 2 LONGINT of file size at write 58 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 2 1 12 Subroutine binwrt8 Writing Data to a Buffered File 2 1 11 Subroutine binrd8 Reading Data from a Buffered File deck binrd8 subroutine binrd8 nblk LongLocL leng ivect kbfint Buffer4 c ckckckckckckckckck
52. 138 prsget subroutine 148 pstev1 subroutine 139 putnod 220 R R 84 rdfull 64 rdsubs subroutine 64 Reading a results file 65 Reading an ANSYS substructure file 64 Reading and reformatting the FULL file 64 reading large data files rapidly 111 Real constant set defining 84 real constants debugging 110 fetching 137 Real constants getting information about a real constant set 227 getting real constant data 228 selecting or deleting a real constant set 228 ResRdBegin function 66 ResRdCsys function 67 ResRdDemo 65 ResRdDisp function 69 ResRdElem function 68 ResRdEstr function 70 ResRdFix function 69 ResRdForc function 69 ResRdGeomBegin function 67 ResRdNode function 68 ResRdReal function 67 ResRdRfor function 69 ResRdSolBeginl function 68 ResRdType function 67 restrictions on UPF creation 99 Results deleting at a node 258 Results file opening the file and retrieving global information 66 retrieving applied nodal constraints 69 retrieving applied nodal loads solution 69 retrieving coordinate systems 67 retrieving element solutions 70 retrieving element types 67 retrieving elements 68 retrieving geometry information 67 retrieving nodal coordinates 68 retrieving nodal solution 69 retrieving reaction solution 69 retrieving real constants 67 retrieving result set location 68 Results files retrieving information from 65 Results information routines 257 results values
53. 297 nonlinear debugging 110 ntpdel 237 ntpget 237 ntpiqr 236 ntpput 237 nvddel 242 nvdget 242 nvdiqr 241 nvdput 242 0 o extension 104 obj extension 105 object files 104 105 optimization program creating 204 linking to ANSYS 204 optimization variables 102 optimizing ANSYS file reads 111 outpcm inc file 102 output generating 111 Output obtaining information about 286 output control 102 deleting 237 P getting 237 l getting information about 236 parallel processing and UPFs 100 storing 237 Parameters Nodal viti displacement retrieving system dependent parameters 56 deleting 242 parameters adding 210 330 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidentialinformation of ANSYS Inc and its subsidiaries and affiliates Index ANSYS 102 creating a dimensioned parameter 210 defining in subroutines 128 element characteristics 102 finding and evaluating 210 performing user operations on COMBIN7 and COM BIN37 151 subroutines to process 210 pardef subroutine 210 pardim subroutine 210 plast1 subroutine 140 plast3 subroutine 140 plasticity laws creating 171 pointers to element data array 102 POST1 postprocessor 128 pressure loads defining 148 printer output 131 Printing file contents 62 program logic accessing 203 tracking 109 programmer debugging 109 programming UPFs 101 propel subroutine 139 propev subroutine
54. 7 4 Coupling and Constraint Routines 7 4 1 cpingr Function Getting Information About a Coupled Set deck cpingr function cpingr nce key c primary function get information about a coupled set C secondary functions none e c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout ic c input arguments c variable typ siz intent description c nce int sc in coupled set number c key int sc in inquiry key c should be zero for key 11 DB NUMDEFINED c DB NUMSELECTED DB MAXDEFINED and c DB MAXRECLENG DB_SELECTED return select status cpingr 1 coupled set is selected e 0 coupled set in undefined coupled set in unseleted c DB NUMDEFINED return number of defined coupled sets 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 30 of ANSYS Inc and its subsidiaries and affiliates 2 3 4 11 16 1 output arguments cpingr int func out Q000000000000000n000Q I 7 4 4 cpsel Subroutine Selecting or Deleting a Coupled Set DB NUMSELECTED return number of selected coupled sets DB MAXDEFINED return the number of the highest numbered coupled set DB MAXRECLENG return length of largest coupled set record max record length return length data units return layer number return address
55. C primary function get information about an element C secondary functions set current element pointer to this element c Notice This file contains ANSYS Confidential information g input arguments c ielem int sc in element number Cc should be zero for key 11 DB_NUMDEFINED G DB NUMSELECTED or DB MAXDEFINED a key int sc in information flag e DB SELECTED return select status 1 n elmiqr 0 element is undefined cas 1 element is unselected g element is selected c DB NUMDEFINED return number of defined elements 12 c DB NUMSELECTED return number of selected elements 13 a DB MAXDEFINED return maximum element number used 14 e DB MAXRECLENG return maximum record length 15 g int words Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 22 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database Y JO JO 3G JOG 2090 20 20 0 Oi 209 o0 JO 3 3G 2090 Oh c0 200 e DE BE e DE e DE t DE e output arguments elmiqr 7 8 1 101 pointer to element integers etc return length int words return layer number for cross reference files return number of entities return address of first data word return length in record type units return compressed record number return void percent integer return location of next record this increment
56. See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 4 1 9 2 FULL File Format comdeck fdfull 44 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 9 2 FULL File Format Q copyright c 2008 SAS IP Inc All rights reserved Qu E ansySs Ano e description of full stiffness mass file c mpg fdfull inc stff10 slvstr full file description character 8 FULLNM parameter FULLNM full 1 e NOTE if this variable is changed in the future it should be e ERR updated in spdefines h also for symbolic assembly jrb integer FULLHDLEN parameter FULLHDLEN 80 LONGINT fullfpL fullfp integer fullbk fullut wrLdstep wrSbstep wrEqiter common fdfull fullfpL fullbk fullut x wrLdstep wrSbstep wrEqiter equivalence fullfp fullfpL e common variable descriptions x co fullfpL file position on file full co fullbk block number for file full co fullut file unit for file full c Kkgoekeee dele format except For extopt 3 4 5k c See fddesc for documentation of how binary files are stored Cc ckckckck ck k kk file format ckckckck ck ck kk recid tells the identifier for this record Not all records will have e identifiers they are only indicated for those records whose e record pointers are st
57. c primary function delete element nonlinear tables c Notice This file contains ANSYS Confidential information amp input arguments e ielem int sc in element number amp 0 delete for all defined elements c output arguments none 7 7 65 ehciqr Function Getting Information About Calculated Element Heat Generations deck ehciqr function ehciqr ielem key C primary function get information about calculated elem heat generations c Notice This file contains ANSYS Confidential information e input arguments G ielem int sc in element number or zero see below e key int sc in key as to the information needed G return info about calculated element heat gens e for ielem 0 return number of heat gens for e this element s record length 0 return maximum number of heat gens e for any element e max record length c DB NUMDEFINED return the number of calculated element heat e generations defined in model 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 82 of ANSYS Inc and its subsidiaries and affiliates 7 7 68 ehcdel Subroutine Deleting Element Calculated Heat Generations G output arguments o ehciqr int func out the returned value of ehcigr is based on c setting of key 7 7 66 ehcget Function Getting a Calculated Element Heat Generation deck ehcget function ehcget ielem value
58. cmp 1 neqn the number used for storage to the actual node number The next two records are repeated as a group neqn times Matrix row indices The last item corresponds to the diagonal The length of this record will vary actual length is returned from routine BINRD8 Matrix terms record will contain the diagonal If keyuns 0 this terms before the If keyuns 1 this record will contain the the entire row Load vector terms Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 49 of ANSYS Inc and its subsidiaries and affiliates Chapter 1 Format of Binary Data Files c Imaginary part of Load Vector Cc IRHS dp neqn Imaginary load vector terms c Stiffness matrix diagonal vector c DIAGK dp cmp neqn diagonal vector data for stiffness matrix c Stiffness matrix diagonal scaling vector c SCLK dp cmp neqn diagonal scaling vector for stiffness matrix c DOF information c DOF i nNodes Nodal extent vector Number of DOFs at e each node Qr i neqn DOF vector If negative this DOF e constrained CT eae i neqn DOFs with imposed values Qs e dp cmp varies Imposed values c Mass Matrix e if lumpm 0 Cc The next two records are repeated as a group neqn times c MAS g 1 varies Matrix row indices The last item c corresponds to the diagonal The re length of this record will vary actual c length is returned from routine BINRD8
59. do NOT report errors pdserr 0 no error in main ansys during pds looping ER PDSLOOPING an error has happened in main ansys during pds looping mxpcmdw number of messages written to file err for any one 24 command O write all errors to file err only write displayed errors to file err icloads key to forbid the iclist command from listing solution 26 data instead of the input data O iclist is OK do not permit iclist Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 287 Chapter 8 Subroutines for Users Convenience co ifkey key on whether or not to abort during input on error 27 e 0 do not abort e l abort e Q Oo espare spare integer variables end of information from errcom output arguments eringr int sc out value corresponding to key mpg eringr lt elll7 e1115 e1126 e1109 e153 e196 e197 edg get error stat OO Oe 000 8 2 4 TrackBegin Subroutine Beginning Tracking for a Subroutine Call deck TrackBegin subroutine TrackBegin sub32 c function mark beginning of track ansys call c Notice This file contains ANSYS Confidential information c input arguments c sub32 char sc in name of subroutine being entered and left ei 32 characters max C output arguments none 8 2 5 TrackEnd Subroutine Ending Tracking for a Subroutine Call dec
60. dp ar inout updated user defined state variables dp sc inout updated effective plastic strain dp sc inout updated accumulated plastic work dp sc out stress value on stress strain curve dp sc out ratio of trial stress to yield stress dp ar ncomp ncomp out material modulus modified by dscpar dp ar ncomp ncomp out consistent tangent modulus formed only if kplst 1 internal variables deppl deck creepl subroutine creepl option elem intpt mat kstartL epel e epcrp x statev usvr tem dtem fluen dflu sig C primary function to update the creep history for 1 d elements c c Q dp sc equivalent plastic strain increment used by LINK1 LINK8 BEAM23 BEAM24 and SOLID65 reinforcing Notice This file contains ANSYS Confidential information input arguments option elem intpt mat kstartL epel e epcrp statev usvr tem int sc in creep option int sc in element number label int sc in element integration point number int sc in material reference number intL sc in virtual starting address of the data table dp sc inout elastic strain dp sc in elastic modulus dp sc inout creep strain at previous substep dp ar 7 inout state variables at previous substep dp ar inout user defined state variables for usercr dp sc in temperature at the end of this substep Release 12 0 2009 SAS IP Inc All
61. dpinfun vopwrt voper rdmac rdcmd utcmd get par getfun funevl evall gtparm r5get vopwrt Q00000000n000n000000000000n0n0n0Qn 6 12 3 Subroutine pardef Adding a Parameter deck pardef subroutine pardef cNameIn ctype nval subc valuein kerr string C primary function add a parameter to parameter list amp c Notice This file contains ANSYS Confidential information e Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 210 of ANSYS Inc and its subsidiaries and affiliates 6 12 3 Subroutine pardef Adding a Parameter qQaaqaqagaaqaaagqagangnaanaanaadaaagaadgqaaagaaanaaaanaanqanqaanaaagaagaaagaadgngaaagnaaaaaanaanqadnqagngnaaagaagaaagaadgqaaagnaaaanaanaadgqagdqaaaa input arguments cNameIn chr PARMSIZE sc in name of parameter cNameIn is a character variable that contains the name of the parameter that is to be defined Length PARMSIZE characters ctype int sc in 0 dp l character 2 string ctype is an integer key which describes the type of data that the parameter data holds This would also indicate the contents of value arg 5 O double precision data l character data packed in value 2 character data in string nval int sc in number of subscripts nval is the number of subscripts that the cNameIn arg 1 contains l single dimensioned variable ex x 10 2 double dimensioned variable ex y 10 3 3 triple dimensioned
62. dspiqr 257 dspput 258 E ecddel 281 ecdget 280 ecdiqr 280 ecdput 280 echprm inc file 102 echrtr 224 ecrdel 272 ecrget 270 ecriqr 270 ecrput 271 ecvdel 246 ecvget 245 ecviqr 244 ecvput 245 EDCADAPT 75 edcdel 252 EDCGEN 76 edcget 251 edciqr 251 edcput 251 EDCURVE 77 EDDRELAX 77 EDLCS 78 EDLOAD 78 EDPREAD 79 EDWELD 80 eeldel 268 eelget 266 eeliqr 266 eelput 267 efsdel 256 efsget 256 efsiqr 256 efsput 257 efudel 250 efuget 250 efuiqr 249 efuput 250 efxdel 277 324 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Index efxget 276 efxiqr 276 efxput 276 egen function 178 egrdel 266 egrget 265 egriqr 265 egrput 265 ehcdel 283 ehcget 283 ehciqr 282 ehcput 283 ehgdel 249 ehgget 248 ehgiqr 248 ehgput 249 eimdel 254 eimget 254 eimiqr 253 eimput 254 elccmt subroutine 128 elccmt inc file 102 eldwrnL subroutine 145 eldwrtL subroutine 145 elecom inc file 102 element array data pointers 102 Element Attribute Routines 221 Element calculated heat generation deleting 283 getting 283 getting information about 282 storing 283 Element convection deleting 246 getting 245 getting information about 244 storing 245 Element current densities deleting 281 getting 280 getting information about 280 storing 280 Element
63. el copyright c 2008 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information g C this subroutine is provided for user information x C user programmable features may not be used in parallel processing G c input arguments ic iott int sc in output unit number c elem int sc in element number fel nodes int ar 2 in node numbers c mat int sc in material number G kept int sc in key to print temperatures e tem dp ar 2 in nodal temperatures Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 131 Chapter 6 UPF Subroutines and Functions Qi OVI 20 6G Oi JO Y JG 2090 OG 200 OG Oh 1 200 kemn fluen kems force kens sig keel epel keth eptho epswel epino kenl sigepl sigrat hpres epeq kepl eppl kecr epcrp output argu inr sc in key to print fluences dp ar 2 in neutron fluences int sc in key to print moment forces int sc in member force fx int sc in key to print strains dp sc in axial stress int sc in key to print elastic strain dp sc in axial elastic strain int sc in key to print thermal initial swelling strai dp sc in axial thermal strain dp sc in swelling strain dp sc in initial axial strain int sc in key set if any
64. element characteristics kerr int sc inout error flag up to this point do not initialize to zero output arguments variable typ siz intent description elcdn chr sc out name of element ielc int ar IELCSZ inout element characteristics kerr int sc inout error flag set to 1 if error note to programmers the validity of keyopt values may be checked here G0 or oO AG GR oO GY AO AG SO ooo oO oe oc Oeo Q 0O 6 1 3 2 1 Subroutines uec101 through uec105 The input and output arguments for subroutines uec101 uec102 uec103 uec104 and uec105 is identical to the uec100 subroutine listed above Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 129 Chapter 6 UPF Subroutines and Functions 6 1 3 3 Subroutine uex100 Overriding Element Characteristic Defaults deck uex100 USERSDISTRIB subroutine uex100 ielc kerr subroutine to override element characteristic defaults hence this routine is needed only in rare cases copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information input and output are the same as for uecl100 except that this logic is called after the defaulting logic is finished this defaulting is done in ansys subroutine echdft not a upf as indicated above this ro
65. esses 61 2 2 Demonstration ROUTINES soonest tren eee a Ep e ee eo STERBEN EXTUS ROSA RES AN EN ERR UTR i ea e ERES REM EN AUS 61 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information a of ANSYS Inc and its subsidiaries and affiliates n Programmer s Manual for Mechanical APDL 2 2 1 Program bintst Demonstrates Dumping a Binary File and Copying It for Comparison Pur DOSES ee 62 2 2 1 1 Common Variables ret rre rere UNNIN ATONE Tene e vue evt Y reo 62 2 2 2 Subroutine bintrd Demonstrates Printing a Dump of File Contents cssscecceeeeeeeeees 62 2 2 3 Subroutine bintwr Demonstrates Copying Binary File Contents eeeeeeeese 63 2 2 4 Program wrtsub Demonstrates Writing an ANSYS Substructure File ssss 63 2 2 5 Program rdsubs Demonstrates Reading a Substructure File eee 64 2 2 6 Program rdfull Demonstrates Reading and Reformatting the FULL File 64 2 2 7 Program ResRdDemo Demonstrates Reading a Results File seeeseesssssss 65 2 2 8 Program ResWrDemo Demonstrates Writing a Results File esee 65 2 3 Results File Access Routines cccecccccssseccccssesccceessecsseuececsssseecessueuecsseueeessssuuesessueeseseueesseseus 65 2 3 1 OV
66. for creating new materials 156 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 33 of ANSYS Inc and its subsidiaries and affiliates Index for defining material linear elastic properties 168 User subroutines 128 user defined commands 194 making available to all ANSYS sessions 194 user defined elements 113 user defined materials 156 User defined variable storage 102 user programmable features defining material linear elastic properties 168 user defined elements 113 user defined materials 156 user01 command 194 user02 command 195 user03 command 196 USER300 user defined element 115 user_tbelastic subroutine 168 userac 230 userac subroutine 128 132 useran subroutine 151 userch subroutine 182 userck subroutine 174 UserCR subroutine 165 UserCreep subroutine 165 usercv subroutine 180 UserElem subroutine 116 usereo subroutine 144 userfd subroutine 182 userfx subroutine 181 UserHyper subroutine 164 UserMat subroutine 156 userop subroutine 99 205 userou subroutine 150 userPartVelAcc subroutine 187 userpe function 183 UserPL subroutine 171 userpr subroutine 179 userrc subroutine 151 usersw subroutine 173 usertr subroutine 128 132 UserVisLaw subroutine 174 USolBeg subroutine 203 USolFin subroutine 203 USRCAL command 178 203 usrefl subroutine 178 UsrFictive subroutine 153 usrsurf116 subroutine 184 UsrViscEl subro
67. getting at selected points 202 ResWrDemo 65 Retrieving maximum vector value for a location 292 position of last nonzero term in a vector 292 reusing element matrices 135 RLBLOCK 84 riget 228 rlinqr 227 rlsel 228 rottr subroutine 146 RunCommand function 212 rvrget subroutine 137 S saved variables debugging 110 fetching 134 Scalar constants assigning to vectors 293 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 331 Index scalar fields to user defined values 178 SECBLOCK 85 SFBEAM 85 SFE 86 Simultaneous linear equations 301 solution control debugging 109 solutions accessing program logic 203 debugging 109 soptcm inc file 102 source files 104 stack storage definition 102 stack inc file 102 Standard ANSYS file header 57 58 START ANS file 194 stepcm inc file 102 Stopping ANSYS 290 storing user supplied element output 150 subrd subroutine 136 Subroutines accessing results files 65 matrix 297 tracking calls to 288 subroutines for elements 102 for memory management 208 for processing parameters 210 running ANSYS as 193 supporting for user created elements 133 supporting user defined commands 200 subwrt subroutine 137 Surface load defining 86 defining as beams 85 svgidx subroutine 133 svpidx subroutine 135 svrget subroutine 134 svrput subr
68. has x deep water wave length G x small amplitude wave length G x Called from userPartVelAccSetup F dperr 1 endif endif c if antype ne 3 then c previous th not usable if wavelength input directly rkd tpd dWork in 4 endif is c compute total wave height for later checking wvmax wvmax abs dWork in 1 enddo c return 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 90 of ANSYS Inc and its subsidiaries and affiliates 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accelerations end 6 5 12 2 Subroutine userWavHt The userWavHt subroutine calculates the wave height of a user defined wave for the userPartVelAcc subroutine deck userWavHt parallel subroutine userWavHt ktyp xyzg doext depth watwav nw eta etadot el primary function calculate wave height for user wave kwav 9 e KER over point at xyzg of the element G secondary functions none e c Notice This file contains ANSYS Confidential information e c input arguments e ktyp int sc in key what argument is to be used c 0 compute value in wvargu e 1 pass directly in doext position Cc ktyp 1 used for stream function only e xyzg dp ar 3 in updated coordinates of point of interest in el doext dp sc in outside diameter with insulation e if ktyp 1 doext argu G depth dp sc in water depth G wa
69. how to call Fortran subroutines from C functions For more information on Fortran compilers please refer to the ANSYS Installation Guide specific to your op erating system 5 6 Developing UPFs a Suggested Strategy When developing UPFs by compiling and linking a custom version of ANSYS you can avoid problems and reduce debugging time by following a gradual orderly process Start with a trivial test Then add a few changes at a time so that if something goes wrong the error that caused the problem should be isolated and relatively easy to locate The example procedure below illustrates this type of gradual process The example assumes that you are creating a new element for the ANSYS program using the method described in Creating a New Element by Directly Accessing the ANSYS Database p 128 You develop and test it by performing these steps 1 Get the applicable element subroutines for ue1101 from the ANSYS distribution medium Add a small change such as a misspelling in an output heading then compile and link the subroutines 2 Using a production version of the ANSYS program run several analysis problems using LINK8 and maybe other elements to form a base for comparison 3 Replacing LINK8 with USER101 run the same problem on your custom version of ANSYS 4 Compare the results from Steps 2 and 3 If they show discrepancies other than the misspelled output heading resolve them before you go on to Step 5 5 Choose the st
70. ielem value C primary function get element virtual displacements c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number a c output arguments 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 52 of ANSYS Inc and its subsidiaries and affiliates 7 6 28 eimiqr Function Getting Information About Element Impedances c evdget int func out status of element o 0 no virt disps defined for this c element c gt 0 number of element virtual e displacements o value dp ar out element virtual displacements g c NOTE If a value is not defined it will G be a very small number 2 100 7 6 27 evdput Subroutine Storing an Element Virtual Displacement deck evdput subroutine evdput ielem n value C primary function store element virtual displacements c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number c n int sc in the total number of values c value dp ar n in element virtual displacments c output arguments none amp NOTE If a value is not defined a very c small number should be used 2 100 7 6 28 eimiqr Function Getting Information About Element Impedances deck eimiqr function eimiqr ielem iface key C primary function get information about element imp
71. in the Program Files Ansys IncNV120NansysNcustomNuserN platform directory The procedure then loads all object files files ending with obj along with the default ANSYS objects and libraries and creates custom ansys executables The executable file s created will be named ansys exe and will reside in the folders described above Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 1 of ANSYS Inc and its subsidiaries and affiliates 05 Chapter 5 Using User Programmable Features UPFs Caution When creating custom ANSYS executables the executables must be named ansys exe This requirement is due to shared library usage Note On any Windows system if you are attempting to create a relinked version of ANSYS by using ANSCUST instead of using the ANS_ADMIN120 utility as recommended above error messages may occur These messages may state that object files have been created but the ANSYS execut able has not been created or the errors may state that some libraries necessary to complete the link cannot be found These errors usually indicate that required compiler environment variables are not set To avoid these errors use the following workaround when relinking ANSYS with ANSCUST Pick Start gt Programs gt Microsoft Visual Studio 2005 gt Visual Studio Tools gt Visual Studio 2005 Command Prompt which should open a new command prompt window In
72. iott listk 20 list1 20 lista 20 x i num ktype nkpnts nlines nareas character 4 type lab2 iott wringr WR OUTPUT setup with UCMD GNSME 4 gnsme group num type group kp ln or ar num entity number of kp ln or ar type interior or all lab2 ch4infun 2 write iott 2010 lab2 format group name type of entity a4 num intinfun 3 write iott 2020 num format entity number i4 if lab2 ne KP then type ch4infun 4 if type eq INTE then write iott 2030 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 199 Chapter 6 UPF Subroutines and Functions 2030 format interior nodes only ktype 0 elseif type eq ALL then write iott 2040 2040 format all interior and edge end nodes ktype 1 else write iott 2050 2050 format Only INTE or ALL are acceptable in last field x on user written gnsme command endif endif if lab2 eq KP then nkpnts ndkpnt num listk 1 write iott 2110 nkpnts 2110 format number of nodes on keypoint i4 write iott 2115 listk i i 1 nkpnts 2115 format node on keypoint i4 elseif lab2 eq LN then nlines ndline num ktype listl1 1 write iott 2120 nlines 2120 format number of nodes on line i4 write iott 2125 listl i i 1 nlines 2125 for
73. mentaccording tothe number of nodes number of dimensions number of real constants etc specified element type 3 Specify nodal DOFs Issue the USRDOF command You can specify a maximum of 10 DOFs per USRDOF command to define additional DOFs issue the command again Each node will have the same DOFs Although you can specify any valid DOFs the total number of DOFs for your element cannot exceed 480 and the number of DOFs for each node cannot exceed 32 Define real constants If needed Create finite element Use either of these methods models Direct generation Create elements directly from nodes using command such as E EGEN EN ENGEN or EMORE You can also use the CDREAD command if the cdb file is available This method is the only way to create an element with a topology different from that of any standard ANSYS element Meshing commands This method is available only if your element has the same topology as that of a standard ANSYS element and you have Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 115 Chapter 6 UPF Subroutines and Functions specified any standard element shape USRELEM KeyShape value ex cept ANYSHAPE Apply boundary condi As needed tions and loads Specify solution op If your element has multi field degrees of freedom displacement
74. none ce This file contains ANSYS Confidential information As a time saving device this routine will not fetch the coordinate system data from the database an expensive operation if ncsy csyinx 4 as this would indicate that the data is current If you wish to force this routine to fetch coordinate system data in the case of loading a local array for example you MUST set ncsy csyinx 4 before function call int dp log chr dcp siz sc ar n func intent in out inout rguments able typ siz intent description csycom name int sc in coordinate system number nx 4 int sc inout coordinate system number csyact arguments px dp ar 18 out csydpx 1 9 transformation matrix 10 12 origin XC YC ZC 13 1 coordinate system parameters cparm cparm2 15 spare 16 18 defining angles nx int ar 6 out csyinx 1 2 theta phi singularity keys 3 coordinate system type icdsys csyinx 4 is inout 4 coordinate system number csyact 5 spare 6 spare et int func out status of coordinate system 0 coordinate system exists 1 coordinate system doesn t exist 7 3 18 csyput Subroutine Storing a Coordinate System deck csyput subroutine csyput ncsy csydpx csyinx C primary function store a coordinate system c Notice This file contains ANSYS Confidential information c input arguments c ncsy int sc in coordinate system number c csydpx
75. o E dp varies Matrix terms e if lumpm 1 Qo 9 dp neqn Matrix diagonals c Mass matrix diagonal vector c DIAGM dp neqn diagonal vector data for mass matrix c Damping Matrix The next two records are repeated as a group neqn times c DMP al varies Matrix row indices The last item c corresponds to the diagonal The c length of this record will vary actual c length is returned from routine BINRD8 oa dp varies Matrix terms c Damping matrix diagonal vector c DIAGD dp negn diagonal vector data for damping matrix c G matrix if ncefull O0 c CE i ncefull List of slave DOFs Quom dp ncefull g vector constant terms o dp ncefull imaginary g vector constant terms This e vector only exists for harmonic analyses c Antype 3 Qo mer i 4 Header l nRows 2 nRows 3 1 4 0 Ga i nRows Vector of 1 s Go oc i nRows Number of non zero terms in each row 50 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 9 2 FULL File Format qgqaaqaaqaa qaqaaqaaa Repeat for each row n i varies Column indices dp varies Column values Nodal graph vectors NGPH E nNodes number of nonzeroes for each node Repeat for each node i varies Index vector Meaning of K11 K12 and G matrices Given K x F subject to the constraints xl G x2 g where xl are the slave DOFs x2 the maste
76. opvar xl dv 1 10 define lst dv range 1 to 10 opvar x2 dv 1 10 define 2nd dv range 1 to 10 opvar y obj 1 define objective function tol 1 opvar g sv 1 define state variable lower limit 1 optype user opt method is user supplied Q000000000000800080n0200000080n000000000000o000000nnn opuser 10 1 1 2 0 defime user opt modifiers max iterations 10 opexe execute opt oplist all list results finish When you finish customizing the userop subroutine you relink it using either of the methods described in the Installation and Configuration Guide You must include the cmopt common block in your subroutine to allow it to pass common data such as design variables state variables and objective function values to and from the ANSYS program 6 10 3 Structuring Your Input When your userop optimization subroutine finishes executing program control returns to the ANSYS design optimizer so that the ANSYS commands on Jobname LOOP can execute for the next optimization loop To use your own customization subroutine you should issue the following ANSYS commands in the order shown OPT OPTYPE USER ANSYS optimization logic bypassed OPUSER user defined optimization to be done OPVAR design and state variables amp objective function values defined OPEXE looping begins Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and a
77. pointer to the sorted substructure DOF set to the original ptrORG pointer to the DOF set of the model during the generation pass stfmax maximum diagonal stiffness term packed into an integer ptrLodh High 32 bits of 64 bit pointer nmodes number of modes used to generate CMS s e keydim dimensionality key 1 axisymmetric 2 2 D 3 3 D cmsMethod component mode synthesis method name5 fifth four characters of the substructure file name in integer form name6 sixth four characters of the substructure file name in integer form name7 seventh four characters of the substructure file name in integer form name8 eighth four characters of the substructure file name in integer form nvnodes number of virtual nodes that contain the modal coordinates ptrCTXM coordinate transformation ptrColL H pointer to the iCol sparse matrix array ptrCofL H pointer to the of the sparse matrix Sk l1 nTerm Sm 1 nTermL Sc 1 nTermL Ss 1 nTermL Each matrix is a single large record note namel 2 3 4 5 6 7 8 are the inexc4 representation of the 32 character filename namel 2 5 6 7 8 will be O for pre rev 5 2 files cwa records from position ptrDOF to ptrGDF will be identical to the data for the copied substructure 125 Substructure transformations 5 25 double precisions This record has meaning only if ntrans 0 You can define up to five levels of transformations with 25 v
78. sc inout updated swelling strain G usvr dp ar inout updated user defined state variables 6 2 20 Function elLenPsvrBuf Determining additional ESAV Record for Plasticity deck elLenPsvrBuf function elLenPsvrBuf mat plOpt ncomp CER KKK KKK KKKKK KKK Ck kk kk k k k k k kk k k kk k k k k k kc k ck ck k k k ck kckck kc k k k k k k k k k k ck KKK KKK KKK Ge primary function Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 143 Chapter 6 UPF Subroutines and Functions e e input arguments c c mat int sc in c plopt int sc in re ncomp int sc in c output arguments c t s c elLenPsvrBuf int sc out local variables c C n determine additional esave record for plasticity material ID plasticity option number of strain components 1 4 or 6 number of extra data items saved QUNCKCKCkCKCKCk kk Ck Ck Ck Ck kk Ck KC kk Ck Ck Kk kc kk KC kk KK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK 6 2 21 Function nlget Retrieving Material Nonlinear Property Information deck nlget function nlget C primary function mat iprop prop get a material non linear property TB table c Notice This file contains ANSYS Confidential information input arguments variable typ siz intent mat int sc in iprop int sc in qgqaqaQqaqa
79. used by LINK1 LINK8 BEAM23 BEAM24 and SOLID65 reinforcing to compute the material tangent matrix if requested c Notice This file contains ANSYS Confidential information c input arguments c option int sc in plasticity option c elem int sc in element number label c intpt int sc in element integration point number c mat int sc in material reference number c kstartL intL sc in virtual starting address of the data table c tem dp sc in temperature at the end of this substep c dtem dp sc in temperature increment over this substep c e dp sc in elastic modulus a ktform int sc in request key for tangent matrix formation c dens dp sc in material density c flu dp sc in fluence at the end of this substep c dflu dp sc in fluence increment over this substep c epel dp sc inout modified total strain trial strain c eppl dp sc inout plastic strain at previous substep c statev dp ar 6 inout state variables at previous substep e usvr dp ar inout user defined state variables for userpl c epeq dp sc inout effective plastic strain at prev substep c plwork dp sc inout accumulated plastic work at prev substep C output arguments c epel dp sc inout elastic strain c eppl dp sc inout updated plastic strain c statev dp ar 6 inout updated state variables c usvr dp ar inout updated user defined state
80. 0 0 position not used c 0 0 position not used c 030 position not used c 0 0 position not used c 0 0 position not used c 0 0 position not used c 0 0 position not used c 0 0 position not used c 0 0 position not used c 0 0 position not used e 0 0 position not used c 0 20 position not used c DOF i J numdof Degrees of freedom per node c DOF reference numbers are c UX l sUY E62 002 5S S ROTS 4C ROIYS 5 ROIZE 6 AX S Tan AY 8 c AZ 9 VX 10 VY 11 VZ 12 13 18 are spares c TO Kk PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 Cc EMF 25 CURR 26 ckckckck ck ck ck k 27 32 are Spares ck ck ck ck ck ck ck ck ck ck ck ock ck ck ck ock ok ko kockockckockckok e curdof i i 1 numdof c BAC i 1 lenbac Nodal equivalence table This table equates c the number used for storage to the actual e node number c Back i i 1 lenbac c ELM als 1 nume Element equivalence table The ANSYS program Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 36 of ANSYS Inc and its subsidiaries and affiliates 1 6 2 EMAT File Format Q qaaaa qaqaaa qaqaaqaaa qa anaana aa aa qaaaa Q Q0o0nQ0n0nQ0nQ0nQ0nQonQoaoooaoaQaoaoaoaoaonoaoooaoonononn FST LST BIT IDX lenu lenu lenu 2 nume stores all element data in the numerical order that the SOLUTION processor solves the e
81. 1 S x SX BISO esol 3 2 S x SX USER esol 4 1 S y SY BISO esol 5 2 S y SY USER esol 6 1 eppl x EPX BISO esol 7 2 eppl x EPX USER esol 8 1 eppl y EPY BISO esol 9 2 eppl y EPY USER exit no save C 3 UserMat Example POST26 Output Results 9eeek ANSYS POST26 VARIABLE LISTING TIME 1 8 X 258 X 1 S Y 2 S Y SX BISO SX USER SY BISO SY USER 0 10000 0 188102E 02 0 188102E 02 1509 45 1509 45 0 28750 0 110968 0 110968 1525 07 1525 07 314 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates C 4 USERMAT F List File for This Example 0 45625 0 66204 0 89592 1 0000 TIME 10000 28750 45625 66204 89592 1 0000 O OOOO 0 814415 0 814415 1536 67 1536 67 1 73160 1 73160 1548 95 1548 95 1 86240 1 86240 1561 97 1561 97 0 176924E 01 0 176924E 01 1569 16 1569 16 wGoee ANSYS POST26 VARIABLE LISTING 1 EPPLX 2 EPPLX 1 EPPLY 2 EPPLY EPX BISO EPX USER EPY BISO EPY USER 0 472687E 01 0 472687E 01 0 945374E 01 0 945374E 01 0 125917 0 125917 0 251834 0 251834 0 187417 0 187417 0 374835 0 374835 0 253409 0 253409 0 506818 0 506818 0 319141 0 319141 0 638282 0 638282 0 345853 0 345853 0 691707 0 691707 C 4 USERMAT F List File for This Example subroutine usermat m m m mm mmm in amp QUNCKCKCkCKCKCk kk Ck Ck Ck CKCk Ck kk Ck Kk kk kk KC Ck kc kk Ck Ck Ck Ck kc k ck kck
82. ANSYS Inc and its subsidiaries and affiliates 9 Chapter 3 The CDWRITE CDB File Format Mat The material number Real The real constant set number Used The flag indicating how many elements use Part ID If USED 0 Part ID is not used 3 2 12 EDWELD Command The EDWELD command is used to define a spotweld or a generalized weld for explicit dynamics There are two command formats for spot and generalized welds The command format for the spotweld appears in Jobname CDB as follows EDWELD R5 3 Option NWELD N1 N2 SN SS EXPN EXPS Option The EDWELD command option The only valid option is ADD NWELD The spotweld ID number N1 The node number of the first node connected by the spotweld N2 The node number of the second node connected by the spotweld SN The normal force at the spotweld failure SS The shear force at the spotweld failure EXPN The exponent for spotweld normal force EXPS The exponent for spotweld shear force The command format for the generalized weld appears in Jobname CDB as follows EDWELD R5 3 0ption NWELD CNAME SN SS EXPN EXPS EPSF TFAIL NSW CID Option The EDWELD command option The only valid option is ADD NWELD The generalized weld ID number CNAME The name of the node component SN The normal force at the weld failure SS The shear force at the weld failure EXPN The exponent for weld normal force Release 12 0 200
83. Accessing Binary Data Files Use the userprog command line option when writing your own customized program naming the routine userprog F The resulting executable will be named userprog exe When userprog is used no files are copied from Program Files Ansys Inc V120 ANSYS custom misc lt platform gt to your working directory These files will be loaded onto your system only if you performed a custom installation and chose to install the customization tools On UNIX systems The FORTRAN source for these programs is located in ansys_inc v120 ansys customize misc and the files are named ResRdDemo F ResWrDemo F rdsubs F wrtsub F and rdfull F To link these demonstration programs use the ansys_inc v120 ansys custom ize misc rdrwrt link procedure file and specify the program that you want to build on the command line Valid command line options are ResRdDemo ResWrDemo rdsubs wrt sub rdfull and userprog For example to build the program to read a results file type ansys_inc v120 ansys customize misc rdrwrt link ResRdDemo Appropriate files will then be copied from ansys_inc v120 ansys customize misc to your working directory compiled and linked The resulting executable will also be placed in your current working directory Procedure files are available in the ansys_inc v120 ansys bin directory to run these programs once linked The procedure files are named ResRdDemo120 ResWrDemo120 rdsubs120 wrtsub120 an
84. C primary function retreive 8 characters from a dp variable c Notice This file contains ANSYS Confidential information Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 285 of ANSYS Inc and its subsidiaries and affiliates Chapter 8 Subroutines for Users Convenience c NOTICE to progammers this routine does not convert from a c machine independent format Use dpexttoch if this dp word c came from a common or non char database record rit c input arguments er dp8 dp sc in dp variable containing characters C output arguments e ch8 ch 8 sc out characters retreived from the dp word 8 2 2 wrinqr Function Obtain Information About Output deck wringr function wrinqr key C primary function obtain information about output c Notice This file contains ANSYS Confidential information C caution the following variables are saved resumed C key WR_COLINTER thru WR_SUPCOLMAX in wringr wrinfo c data for fmt page header commands note that the whole common cannot be saved resumed cwa c typz int dp log chr dcp siz sc ar n func intent in out inout c input arguments c variable typ siz intent description wrcom name c key int sc in e WR PRINT print flag kprint prtkey c wrinqr 0 no output le 1 print c WR OUTPUT current output unit number iott outfil c WR MASTEROUT
85. D nodal coordinates 146 creep history 141 plastic history 140 swelling history 142 updating rotational pseudovector 147 user defined creating 113 writing saved variable set 134 ElemGetMat subroutine 125 elfdel 278 elfget 277 elfiqr 277 elfput 278 Ellnterp subroutine 202 elLenPsvrBuf function 143 elmiqr 221 elmput 222 elnext 217 elnxdf 218 elparm inc file 102 elprev 217 ElResultGet subroutine 202 ElResultStrt subroutine 202 elsel 218 elucom inc file 102 emndel 279 emnget 279 emniqr 278 emnput 279 emsdel 260 emsget 259 emsiqr 259 emsput 259 EN 81 enfdel 261 enfget 260 enfiqr 260 enfput 261 engdel 264 engget 264 engiqr 263 engput 264 enldel 282 enlget 281 enliqr 281 enlput 282 ensdel 263 ensget 262 ensiqr 261 ensput 262 epldel 270 eplget 268 epliqr 268 eplput 269 eprdel 244 eprget 243 epriqr 243 eprput 244 erhandler subroutine 288 erinqr subroutine 286 Errors displaying 288 obtaining information 286 esfdel 256 esfget 255 esfiqr 255 esfput 255 ethdel 274 ethget 272 ethiqr 272 ethput 273 etpdel 247 etpget 247 etpiqr 246 etpput 247 etycom inc file 102 etyget 223 etyiqr 223 etyput 224 etysel 225 euldel 275 eulget 274 euliqr 274 eulput 275 evaluating material properties for 1 D elements 139 evdget 252 evdiqr 252 evdput 253 exinc4 subroutine 60 Release 12 0 2009 SAS
86. IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 35 Chapter 1 Format of Binary Data Files c index table e numCE number of internal CEs e maxLeng maximum length of any internal CE e ptrCEl low pointer to internal CE list e ptrCEh high pointer to internal CE list e ptrDOF pointer to degrees of freedom per e node used in model c ptrBAC pointer to nodal equivalence table c ptrELM1 Low pointer to element equivalence e table c ptrFSTl Low pointer to first element at a e DOF table Cc ptrLSTl Low pointer to last element at a el DOF table c ptrBITl Low pointer to dof bits c ptrEHDl1 Low pointer to the start of the c element matrices e ptrIDXl Low pointer to element matrices c index table c ptrendH High pointer to end of file c ptrendL Low pointer to end of file c Note the analysis type sets the global calculate keys Qs ee dp A 20 Time information c c timval timinc frqval timbeg timend c 0 0 0 0 0 0 0 0 0 0 c 0 0 0 0 0 0 0505 0 0 c 0 0 00 0 0 0 0 0 0 c each item is described below c timval the current time c timinc the time increment e frqval the current frequency from a c harmonic analysis c timbeg the start time for the analysis c timend the end time for the analysis c 0 0 position not used c 0 0 position not used c 0 0 position not used c
87. IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 185 Chapter 6 UPF Subroutines and Functions SURF151 or SURF152 calls this routine indirectly to compute the film coefficient and bulk temperature This routine in turn gets the average velocity at the extra node using getvl116 as shown below Other quantities brought in by getv116 are also averaged Q0 0 e E a 6 5 10 Subroutine User116Cond Computing the conductance coefficient for FLUID116 deck User116Cond USERSDISTRIB subroutine Userl116Cond elem prop rvr aleng re fric uptot uttot x bco c primary function compute bc for conductance coefficient for fluidl116 c Notice This file contains ANSYS Confidential information e e copyright c 2008 SAS IP Inc All rights reserved e ansys inc c input arguments G elem int sc in element number e prop dp ar 4 in material property vector c order is dens visc kxx c e rvr dp ar 24 in real constant vector c aleng dp sc in element length e re dp sc in reynold s number s fric dp sc in friction factor e uptot dp ar 2 in nodal pressure values from previous iteration e uttot dp ar 4 in nodal temperature values from prev iteration e bco dp sc inout the conductance coefficient from TB fcon c output arguments e bco dp sc inout the desired conductance coefficient 6 5 11 Su
88. JobName subroutine ResRdGeomBegin MaxType MaxReal MaxCsys subroutine ResRdTypeBegin NumType function ResRdType itype ielc subroutine ResRdTypeEnd subroutine ResRdRealBegin NumReal NumPerReal function ResRdReal iReal Rcon subroutine ResRdRealEnd subroutine ResRdCsysBegin NumCsys function ResRdCsys iCsys Csys subroutine ResRdCsysEnd subroutine ResRdNodeBegin function ResRdNode iNode xyzang subroutine ResRdNodeEnd subroutine ResRdElemBegin function ResRdElem iElem nodes ElemData subroutine ResRdElemEnd subroutine ResRdGeomEnd function ResRdSolBegin key lstep substep ncumit kcmplx time subroutine ResRdDispBegin function ResRdDisp node Disp Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 65 Chapter 2 Accessing Binary Data Files subroutine ResRdDispEnd subroutine ResRdRforBegin nRForce function ResRdRfor node idof value subroutine ResRdRforEnd subroutine ResRdBCBegin BCHeader subroutine ResRdFixBegin BCHeader nFixed function ResRdFix node idof value subroutine ResRdFixEnd subroutine ResRdForcBegin BCHeader nForces function ResRdForc node idof value subroutine ResRdForcEnd subroutine ResRdBCEnd subroutine ResRdEresBegin function ResRdEstrBegin iElem function ResRdEstr iStr Str subroutine ResRdEstrEnd subroutine ResRdEresEnd subroutine ResRdSolEnd sub
89. Nodal Results ssscccccccesseessnneeeeeeees 7 7 2 dspget Function Getting a Nodal Result from the Database cccccccecessessstteeeeeeeees 7 7 3 dspput Subroutine Storing a Result at a Node sssssssseesssssssssserseesssssssereressssssesrereeesss 7 7 4 dspdel Subroutine Deleting a Result at a Node cceeescccccceeeesessnneeceececesseessnneeeeeeens 7 7 5 emsiqr Function Getting Information About an Element s Miscellaneous Summable bir X 7 7 6 emsget Function Getting an Element s Miscellaneous Summable Data 7 7 7 emsput Subroutine Storing an Element s Miscellaneous Summable Data 7 7 8 emsdel Subroutine Deleting an Element s Miscellaneous Summable Data 7 7 9 enfiqr Function Getting Information About Element Nodal Forces sssssse 7 7 10 enfget Function Getting an Element s Nodal Forces ccccccccessssssececeeeeeessessnseeeeeeees 7 7 11 enfput Subroutine Storing an Element s Nodal Forces ssssccccccceseeesssneeeeeeeeeseees 7 7 12 enfdel Subroutine Deleting an Element s Nodal Forces ssssecccceeeeeseessneeeeeeeeeeeees 7 7 13 ensiqr Function Getting Information About an Element s Nodal Stresses Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confident
90. Notice This file contains ANSYS Confidential information The updating of the pseudovector uses the mathematics of quarternions ref eqn a5 of J H Argyris CMAME 32 1982 85 155 The pseudovector uses the nomalization proposed by Rankin and Brogan ref eqn 15 JPVT 108 1986 165 174 CMAME Computer Methods in Applied Mechanics and Engineering JPVT Journal of Presssure Vessel Technology ASME variable descriptions input v2 rotation increment wl previous rotation pseudovector output wl updated pseudovector vl cos vl1 2 1 2 wl wl 2 sin vl1 2 el v2 cos v2 2 1 2 w2 w2 2 sin v2 2 e2 v21 v2 vl cos v21 2 1 2 w21 quarternion multiplication wl v21 wl is updated 6 2 29 Subroutine tmpget Defining Current Temperature Loads deck tmpget 35 30373030 303 303 303 Oe Oe 3 3 203 103 03 103 a Oe Ot 23 203 107 Oe TO 3 subroutine tmpget iel ielc nnod nodes ref ndat0 begdat dat x enddat tlvf primary function define the current temperature loads Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description iel int sc in element number ielc int ar IELCSZ in array of element type characteristics nnod int sc in number of nodes in the nodes array nodes int ar nnod in list of nodes ref dp sc in reference temperature ndat int sc in
91. Running ANSYS as a Subroutine p 193 5 2 What You Should Know Before Using UPFs Before you do anything with linked UPFs contact your on site ANSYS system support person to get the permissions needed to access the appropriate ANSYS files The UPF subroutines are written in Fortran some extensions are used They contain comments intended to give you enough detail to develop your own versions of the subroutines User routines that can be modified have the term USERDISTRIB in the first line of the routine These routines are provided with the ANSYS distribution media You can modify these routines to tailor the ANSYS program to your specific needs Certain other routines described in this document are not provided on the distribution media but can be called using the provided header information To use UPFs successfully you need strong working knowledge of the following The ANSYS program The UPF subroutines themselves Study the UPF subroutines before customizing them and make sure that you fully understand the subroutines as well as any applicable functions Unless you review them carefully a few UPF subroutines may seem like a maze with many logic paths to consider You may have to set special variables correctly in order to run your customized ANSYS program without errors Even if you have in depth knowledge of the ANSYS input and your desired outputs you still need to ensure that everything that needs to be done in the UPF s
92. TE26 58 TE27 59 TE28 60 TE29 61 TE30 62 TE31 63 TTOP 64 65 128 are spares i 1 nnod 3 1 nelm i 1 2 resmax dp resmax 3 3 resmax i resmax curdof i i 1 numdof Nodal equivalence table This table equates the number used for storage to the actual node number Back i i 1 nnod Element equivalence table The ANSYS program stores all element data in the numerical order that the SOLUTION processor solves the elements This table equates the order number used to the actual element number Data sets index table This record contains the record pointers for the beginning of each data set The first resmax records are the first 32 bits of the index the second resmax records are the second 32 bits To create the 64 bit pointer use LONGPTR largeIntGet first second Read the solution data header as follows call bioBasePut nblk LONGPTR loc bioigr nblk 12 call biord nblk loc The rest of the file reading continues to use the ptrXXX s that are in the headers This record contains the or frequency values for each data Time freq table time set Data set identifiers This record contains the load step substep and cumulative iteration numbers for each data set Cyclic symmetry harmonic index Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 Chapter 1 Format of Bi
93. Young s modulus and Poisson s ratio initial yield stress and others young prop 1 posn prop 2 sigyO prop 3 C calculate the plastic slope dsigdep young prop 4 young prop 4 twoG young ONE posn threeG ONEHALF twoG c C calculate elastic stiffness matrix 3 D c c elast1l young posn 1 0D0 posn 1 0D0 TWO posn elast2 young TWO 1 0D0 posn dsdeEl 1 1 elast1 TWO elast2 G 1 G 1 dsdeE1 1 2 elast1 G 1 G 2 elast2 TWO G 4 G 4 dsdeE1 1 3 elast1 G 1 G 3 telast2 TWO G 5 G 5 dsdeE1 1 4 elast1 G 1 G 4 elast2 TWO G 1 G 4 dsdeE1 1 5 elast1 G 1 G 5 telast2 TWO G 1 G 5 dsdeE1 1 6 elast1 G 1 G 6 telast2 TWO G 4 G 5 dsdeEl 2 2 elast1 TWO elast2 G 2 G 2 dsdeEl 2 3 elast1 G 2 G 3 telast2 TWO G 6 G 6 dsdeEl 2 4 elast1 G 2 G 4 elast2 TWO G 1 G 4 dsdeE1 2 5 elast1 G 2 G 5 telast2 TWO G 1 G 5 dsdeEl 2 6 elast1 G 2 G 6 telast2 TWO G 2 G 6 dsdeEl 3 3 elast1 TWO elast2 G 3 G 3 dsdeE1 3 4 elast1 G 3 G 4 telast2 TWO G 5 G 6 dsdeE1 3 5 elast1 G 3 G 5 telast2 TWO G 5 G 3 dsdeE1 3 6 elast1 G 3 G 6 telast2 TWO G 6 G 3 dsdeEl 4 4 elast1 G 4 G 4 telast2 G 1 G 2 G 4 G 4 dsdeE1 4 5 elast1 G 4 G 5 telast2 G 1 G 6 G 5 G 4 dsdeEl 4 6 elast1 G 4 G 6 telast2 G 4 G 6 G 5 G 2 dsdeE1 5 5 elast1 G 5 G 5 elast2 G 1 G 3 G 5 G 5
94. a tilde and each command name must be unique within the first four characters The command name must be eight characters or less including the tilde function name Is the name of the function that is referenced by the specified command name This must be unique within the first four characters if multiple external commands are specified For example the following entry references the home mydir mylibs myobject so shared library and the myob ject function It specifies myobj as the related command home mydir mylibs myobject so myobj myobject_ ANSYS also makes use of external commands and places its own shared libraries and the associated external table file in the ansys_inc v120 ansys lib lt platform gt directory where platform is the directory specific to your computing platform such as sgi64 or hppa8000 64 ANSYS loads external commands in the following order e ANSYS first checks the ans ext tb1 file in the ansys_inc v120 ansys lib lt platform gt directory and loads any external commands referenced there ANSYS then loads external commands referenced by the external table file in the directory designated with the ANSYS EXTERNAL PATH environment variable see section Setting the ANSYS EXTERNAL PATH Environment Variable p 306 If you designate a command name that has the same first four characters as a command listed in the an sys inc vi120 ansys lib platform ans ext tb l file you wil
95. and the old e values rvro have been saved However any change c of real constants will cause the run to terminate because the results would be too unpredictable e e g gap elements c 2 element is nonlinear so do not bother to check c 3 real constants are used by this element and the old c values rvro have been saved However no checking is c done in this routine because of needed customized logic c 4 real constants are used by this element but the old eG values rvro have not been saved because it was c decided not to use this much storage therefore no check e can be made to determine if matrices should be reformed e e g 100 layer elements c 5 real constants are used by this element but the old values rvro have not been saved because the real e constants have no effect on matrix formulation e e g acoustic elements e rvr dp ar in current real constants c rvro dp ar inout previous real constants c amodo dp sc inout previous value of mode c asymo dp sc inout previous value of isym e C output arguments c propo dp ar nprop inout current material properties le rvro dp ar inout current real constants c amodo dp sc inout current value of mode c asymo dp sc inout current value of isym c kelin int ar 10 out keys indicating matrices to form e 6 2 7 Subroutine subrd Reading Element Load Data for a Substructure Gen era
96. as vector b Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 163 of ANSYS Inc and its subsidiaries and affiliates 6 Chapter 6 UPF Subroutines and Functions The value n is the dimension for both arrays vmult1 a n c Multiplies vector a by constant c and outputs the result as itself that is a a c The value n represents the array dimension maxb a b Multiplies two double precision matrices and outputs the result as c that is c a b c na nb nc ni n2 The value na is number of rows in matrix a nb the number of rows in matrix b and nc n3 the number of rows in matrix c The n1 value is the number of rows in matrix c to fill and n2 the number of columns in matrix c to fill The value n3 is the number of columns in matrix a and the number of rows in matrix b to work with The number of columns in a and rows in b is the same in order to generate the inner product correctly 6 4 2 Subroutine UserHyper Writing Your Own Hyperelasticity Laws Use the subroutine UserHyper when you issue the TB command with the HYPER option and with the command option TBOPT 100 deck UserHyper USERSDISTRIB subroutine UserHyper amp prophy incomp nprophy invar amp potential pInvDer CR KKK RK RK RK KK RK RK KK ck ckck ckck kck kck kck kck kck kck kck kck kck kck kck kck Ck k Ck k Ck k kck Ck k ck k ck k Ck k ck k ck k ck k k k k Exa
97. binary files access routines use these pointers to locate data on the various binary files 6 All data is written out as 32 bit integers Double precision data and pointers therefore take up two integer words To create a 64 bit pointer from the two 32 bit integers use the function largelntGet Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 54 of ANSYS Inc and its subsidiaries and affiliates 2 1 6 Function sysiqr Retrieving the Status of a File 2 1 3 Viewing Binary File Contents To view the contents of certain ANSYS binary files you issue the command AUX2 or choose menu path Utility Menu gt File gt List gt Binary Files or Utility Menu gt List gt File gt Binary Files You can do so only at the Begin level The ANSYS program then enters its binary file dumping processor AUX2 and dumps the binary file record by record In AUX2 you can use either the record number DUMP command or the record pointer PTR command If the file was written in parallel NP gt 2 on the command line only the PTR command may be used 2 1 4 Abbreviations The input and output for the routines discussed in this chapter are described with the following abbreviations Type of variable is one of the following int integer dp double precision log logical true or false char character Size of variable is one of the following sc scalar variable ar n array of
98. c variable typ siz intent description c Node int sc in Node Number User c Label ch 4 sc in DOF Label Upper Case c UX UY TEMP VOLT ROTY etc C output arguments c variable typ siz intent description c GetStackDisp int sc out status pointer o 0 data not valid c gt 0 UDisp pointer to data for fast access c see comments below c Value dp sc out Solution value for Node Label c example usage Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 201 Chapter 6 UPF Subroutines and Functions c external GetStackDisp c include handlecom inc only if UDisp ptr form is used e integer GetStackDisp ptr Node2 c double precision Value c ptr GetStackDisp Node2 UY Value e later e Value UDisp ptr 6 8 3 Subroutine ElResultStrt Getting Load Data from Analysis Results deck ElResultStrt subroutine ElResultStrt Label Comp LabAvg TypeData nVal iLoc C primary function postl Load data for later ElResultGet c Notice This file contains ANSYS Confidential information c prolog is not confidential c input arguments c Label ch 4 sc in Result Type c Comp ch 4 sc in Result Component 8 char for ESTR c LabAvg ch 4 sc in AVG or NOAV AVG default c output arguments c TypeData int sc out Code for data type a nVal int sc out
99. ck ck ck ck ck ck ockock KKK KKK KK G m al lenbac This table equates the actual node number to c the number used for storage c Back i i 1 lenbac Qi dp 10 Unused record contents c 120 0505 0 0 0 05 0 0 c Ox 004 Os 105105 0 0 c DOF EH nmrow Degree of freedom set used c The DOFs are calculated as N 1 numdof DOF c where N is the position number of the node in c the nodal equivalence table and DOF is the c DOF reference number given above Cc If the analysis uses the reduced method the c original DOF order see next record is c rearranged so that DOFs having nodal c constraints are listed first c c If the analysis uses the mode superposition c method using the reduced mode extraction c technique the DOF order is the same as the el original order see next record c 1 i i 1 nmrow i J nmrow l Original reduced set of DOFs used c The DOFs are calculated as N 1 numdof DOF c where N is the position number of the node in c the nodal equivalence table and DOF is the c DOF reference number given above c If the analysis uses the reduced method the e original DOF order plus the number of nodal c constraints nbcdsp is stored c If the analysis uses the mode superposition el method using the reduced mode extraction c technique this record matches the previous el record The nmrowt l entry will be zero c lorig i i 1 nmrow nbcdsp c DNC i 1 nbcdsp This record is present only if the analysis Cc us
100. coefficients and bulk temperatures based on information from FLUID116 6 3 1 Subroutine userou Storing User Supplied Element Output deck userou USERSDISTRIB subroutine userou X nCSVr CSVr nusvr usvr nnode nodes xyz vol leng time x timinc nutot utot maxdat numdat udbdat primary function store user supplied element output in nmisc record in order to activate this user programmable feature the user must enter the usrcal command copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information this routine is called by almost every element the data is stored on the nmisc record other data may be stored between the documented data and this data in order to see the actual information on the nmisc record insert the command dblist elp elnuml elnum2 elinc 11 where elnuml the first element elnum2 the last element warning elem iout nbsvr bsvr nnrsvr nrsvr npsvr psvr Y Y Qe y o0 o0 Y Y v6 OOOO OGOOGO QOO CQ 9X 6X SG OOOO 20 0 0 0 0X OGO GOAO QUO elinc the element increment number after a set command in postl input arguments variable typ siz intent description elem int sc in element number iout int sc in output unit number nbsvr int sc in number of basic element variables bsvr dp ar nbsvr in basic element variables nnrsvr int sc in number of nonlinear element variables nrsvr dp ar nnrsvr i
101. contents and number data items for this record is element dependent See the description for item NMISC of the ETABLE command in the ANSYS Commands Reference Element current densities This record contains the calculated current densities in the order X Y Z Element nodal nonlinear data This record stores nonlinear data at each corner node in the order SEPL SRAT HPRES EPEQ PSV or CREQ PLWK CRWK and ELENG followed by 2 spares is described below equivalent stress parameter stress ratio hydrostatic pressure accumulated equivalent plastic strain plastic state variable accumulated equivalent creep strain Applies to current technology element types 180 181 182 1905 185 186 187 188 189 208 209 265 281 288 289 290 plastic strain energy density work creep strain energy density work elestic strain energy density SEPL SRAT HPRES EPEO PSV CREO PLWK CRWK ELENG See ENS record section for details on Solid and shell elements For beam elements the contents and number of data items in this record is element dependent See the description of item NLIN in the Output Data section for the particular element in the ANSYS Elements Reference Element heat generation This record stores the calculated heat generation Element structural nodal temperatures For solid elements and SHELL41 the record contains nodal temperatures at each node and the number of items in this recor
102. current density deleting 252 getting 251 getting information about 251 storing 251 element data converting to fixed format blocks 111 writing to a file 145 Element energy deleting 264 getting 264 getting information about 263 storing 264 Element euler angle deleting 275 getting 274 storing 275 Element euler angles getting information about 274 Element face flagged surface deleting 256 getting 256 getting information about 256 storing 257 Element face impedance getting 254 Element face pressure getting 243 storing 244 Element fluence deleting 250 getting 250 getting information about 249 storing 250 Element fluxes deleting 277 getting information about 276 storing 276 Element Fluxes getting 276 Element heat generation deleting 249 getting 248 getting information about 248 storing 249 Element impedance deleting 254 getting information about 253 storing 254 Element loading routines 243 Element local force deleting 278 getting 277 storing 278 Element local forces getting information about 277 element matrices 130 accessing 152 reusing 135 Element miscellaneous non summable data deleting 279 getting 279 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 325 Index getting information about 278 storing 279 Element miscellaneous summable data deleti
103. data tables 3 bitmap data for 32 data item packed records 4 data tables three dimensional arrays output arguments etpiqr int func out the returned value of etpigqr is based on setting of key 7 6 10 etpget Function Getting an Element Temperature deck etpget c KKK c kkk aa qgqaqaQqaqaaa qa Q function etpget ielem tem primary function get element temperatures in raw form Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number output arguments etpget int func out status of element 0 this element has no element temperatures gt 0 number of element temperatures retrieved tem dp ar n 2 out the element temperatures new old NOTE THAT TEM MUST DOUBLE THE NUMBER OF DESIRED TEMPERATURES IN THE CALLING ROUTINE NOTE If a value is not defined i e defaults to TUNIF value will be a very small number 2 100 7 6 11 etpput Subroutine Storing an Element Temperature deck etpput c kkk c kkk OOOO Oe 1 300 subroutine etpput ielem n temp primary function store element temperatures Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number n int sc in number of element temperature values temp dp ar n in element temperatures output arguments none NOTE If a value is not defined i e defaults to TUNIF
104. defined element API in most cases The direct access method is generally for special purpose use only or if you are already using preexisting elements created with this method This table highlights the differences between the two methods Interface User defined element API Accessing ANSYS database and files directly Description Offers a simpler interface while pre No special interface If an element cap serving much of the underlying user _ ability exists for an ANSYS element it element capability An understanding will exist here with a few exceptions Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 113 Chapter 6 UPF Subroutines and Functions Interface User defined element API Accessing ANSYS database and files directly Relative level of difficulty of the database subroutines and the file structure is rarely necessary to use the interface Medium The logic necessary for using this inter face effectively is more complex High Expected compatibility between versions High Medium Element names USER300 USER100 to USER105 Demonstration logic in cluded on the ANSYS distribution media 4 node quad and 20 node brick ele ments MASS21 and LINK8 elements Typical linear material access subroutine getMatProp propev New nonlinear material proper
105. deformation ANSYS will lessen deformation if pos sible by cutback Element convergence key 1 Converged preset value before calling 0 Not converged Provides manual con trol of convergence when you introduce any constraint at the element level such as volumetric constraint for mixed u P ANSYS code End of special purpose variable group eStiff O Small deformation stiffness Solution Requested matrix when In global Cartesian coordinate keyMtx 1 system e Mass matrix Solution Requested In global Cartesian coordinate when system keyMtx 2 1 eDamp O Damping matrix Solution Requested In global Cartesian coordinate when system keyMtx 3 1 eSStiff O Stress stiffness matrix Solution Requested In global Cartesian coordinate when system keyMtx 4 1 fExt O External load vector Solution Requested In global Cartesian coordinate when system keyMtx 5 1 fInt O Internal nodal force vector Solution Requested In global Cartesian coordinate when system keyMtx 6 1 elVol O Element volume Output UserElem subroutine elMass O Element mass Output UserElem subroutine elcG O Element centroid coordinates Postprocessing UserElem In global Cartesian coordinate subroutine system nRsltBsc Number of basic result data Specifying the size of ANSYS code saved in result file RsltBsc RsltBsc O Basic result data saved in AN Postprocessing UserElem SYS result
106. double precision data 0 integer data usually the same as leng Buffer4 int ar inout work array for paging should be the same array as used in binset on this block OY 203 26 Oi Gy Y OG 06 0 Ova output arguments LongLocL LONG sc inout location in integer words of the current position on the file It is updated after each write operation ivect int ar out vector containing record to be written Buffer4 int ar inout work array for paging GUTO Oe 200 Versions of binrd8 binwrt8 exist without the 8 suffix binrd binwrt that take a regular integer for the second argument These subroutines therefore cannot address large files where the file position exceeds 2 31 Use the binrd8 binwrt8 versions for any new programs 2 1 13 Subroutine exinc4 Decoding an Integer String into a Character String deck exinc4 subroutine exinc4 ichext chin n primary function decode externally formatted integer versions of 4 character strings to plain 4 character strings used to convert data from externally formatted files to data for interally formatted files Notice This file contains ANSYS Confidential information ichext int ar n in externally formatted integer form of 4 character strings n int sc in number of strings to convert output arguments chin char ar n out strings in character form c c c c c e c c input arguments e c c c e c c C mpg exinc4
107. dp ar 18 out c csydpx 1 9 transformation matrix c 10 12 origin XC YC ZC c 13 14 coordinate system parameters cparm c cparm2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 229 Chapter 7 Accessing the ANSYS Database c 15 spare c 16 18 defining angles c csyinx int ar 6 out c csyinx 1 2 theta phi singularity keys el 3 coordinate system type icdsys c 4 coordinate system number csyact re 5 spare e 6 spare c output arguments none 7 3 19 csydel Subroutine Deleting a Coordinate System deck csydel subroutine csydel ncsy c primary function delete a coordinate system C secondary functions none a c typ int dp log chr dcp siz sc ar n func intent in out inout a c Notice This file contains ANSYS Confidential information a c input arguments c variable typ siz intent description c ncsy int sc in coordinate system number a C output arguments c none e 7 3 20 userac Subroutine Demonstrates Use of Element Attribute Routines See Subroutine userac Accessing Element Information p 132 for an example that demonstrates how to use the userac subroutine to extract information about an element type and element real constants from the ANSYS database You can find this subroutine on your ANSYS distribution media
108. dsdeE1 5 6 elast1 G 5 G 6 telast2 G 4 G 3 G 5 G 6 dsdeE1 6 6 elast1 G 6 G 6 telast2 G 2 G 3 G 6 G 6 do i 1 ncomp do j itl ncomp dsdeEl j i dsdeEl i j end do end do c C calculate the trial stress and c copy elastic moduli dsdeEl to material Jacobian matrix do i 1 ncomp SigElp i stress i do j 1 ncomp dsdePl j i dsdeEl j i SigElp i sigElp i dsdeE1 j i dStrain j end do end do c hydrostatic pressure stress pEl THIRD sigElp 1 sigElp 2 sigElp 3 C compute the deviatoric stress tensor sigDev 1 sigElp 1 pEl sigDev 2 sigElp 2 pEl sigDev 3 sigElp 3 pEl sigDev 4 sigElp 4 sigDev 5 sigElp 5 sigDev 6 sigElp 6 C compute von mises stress qEl Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 318 of ANSYS Inc and its subsidiaries and affiliates C 4 USERMAT F List File for This Example c Q kk kk k k k k kk k k kk KKK KKK kk kk we o wo RY amp amp amp sigDev 1 sigDev 1 sigDev 2 sigDev 2 sigDev 3 sigDev 3 TWO sigDev 4 sigDev 4 sigDev 5 sigDev 5 sigDev 6 sigDev 6 qEl sqrt ONEHALF qEl compute current yield stress sigy sigyO dsigdep pleq fratio qEl sigy ONE check for yielding IF sigy LE ZERO or fratio LE SMALL GO TO 500 sigy t sigy threeOv2qEl ONEHALF
109. e 8 4 2 maxv1 Subroutine Multiplying a Vector by a Matrix deck maxvl subroutine maxvl a v nr nc c primary function multiply a vector by a matrix c Notice This file contains ANSYS Confidential information c input arguments c a dp ar nr nc in matrix a c v dp ar nc inout vector v c nr int sc in number of rows in matrix a c nr limited to 60 c nc int sc in number of columns to multiply in matrix a C output arguments c v dp ar nr inout product stored in vector v e C mpg v A v A nr nc matrix vector product max 60 rows e 8 4 3 matxv Subroutine Multiplying a Vector by a Full Transposed Matrix deck matxv subroutine matxv a v w nr nc C primary function multiply vector by full transposed matrix c Notice This file contains ANSYS Confidential information c input arguments a dp ar nr in matrix a first dimension must nr Ge v dp ar nv in vector v nv must be greater or equal c to nr c nr int sc in first dimension and number of active c rows of the untransposed matrix a also the number of active rows c of vector v c nc int sc in number of columns of the untransposed matrix a c also the number of computed items c in the product vector w c if negative accumulate C output arguments w dp ar na out product vector w amp amp c mpg A nr nc matrix transpose vector prod
110. e DB MAXDEFINED return total number of current densities e defined in model c NOTE both DB NUMDEFINED and DB MAXDEFINED o produce the same functionality c output arguments c edciqr int func out the returned value of edcigr is based on amp setting of key 7 6 22 edcget Function Getting Element Current Densities deck edcget function edcget ielem value C primary function get element current densities c Notice This file contains ANSYS Confidential information c typz int dp log chr dcp siz sc ar n func intent in out inout c ielem int sc in element number c output arguments c 0 element has no current densities e defined c gt 0 number of element current c densities defined c value dp ar out element current densities c NOTE If a value is not defined it will c be a very small number 2 100 7 6 23 edcput Subroutine Storing an Element Current Density deck edcput subroutine edcput ielem n value C primary function store element current densities c Notice This file contains ANSYS Confidential information Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 251 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database e input arguments c ielem int sc in element number c n int sc in the number of current densities to store c value dp ar n in
111. e Use GET Parm NODE num RF DOFLAB to access the reaction c sum from the command line c secondary functions Return pointer for fast access c object library usr c Notice This file contains ANSYS Confidential information c Prolog is not CONFIDENTIAL INFORMATION c input arguments c variable typ siz intent description c Node int sc in Node Number User c Label ch 4 sc in DOF Label Upper Case c UX C UY TEMP VOLT ROTY etc C output arguments c GetRForce int func out status pointer e 0 data not valid e gt 0 Rfsum pointer to data for fast access c see comments below o Value dp sc out Solution value for Node Label o All results are in the nodal coordinate c system C example usage c external GetRForce o integer GetRForce ptr Node2 e double precision Value c include handlecom inc if Value Rfsum ptr form is to be used ie ptr GetRForce Node2 UY Value e later G Value Rfsum ptr 6 8 2 Function GetStackDisp Getting Current Displacement Values deck GetStackDisp function GetStackDisp Node Label Value c primary function Get the displacement at a node from the disp vector c secondary functions Return pointer for fast access c object library usr c Notice This file contains ANSYS Confidential information c Prolog is not CONFIDENTIAL INFORMATION c typz int dp log chr dcp siz sc ar n intent in out inout c input arguments
112. each layer real constant THETA qgqQaqaqaqagqaqgqaqaaaa 7 7 43 eulput Subroutine Storing an Element s Euler Angles deck eulput subroutine eulput ielem nval value c primary function store nodal euler angles for an element c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number c nval int sc in the total number of values c 3 number of display nodes c value dp ar nval in the euler angle values output arguments none NOTE For lower ordered elements rotations at centroid For higher ordered elements rotations at each corner node For layered shells rotations at each corner node plus layer rotation angle for each layer real constant THETA For layered solids rotation angles at centroid plus layer rotation angle for each layer real constant THETA Q0Q0n0n0n0n0n0n0nnon 7 7 44 euldel Subroutine Deleting an Element s Euler Angles deck euldel subroutine euldel ielem C primary function delete element euler angles c Notice This file contains ANSYS Confidential information c input arguments Cc ielem int sc in element number c 0 delete for all defined elements c output arguments none Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 275 Chapter 7 Accessing the ANSYS Data
113. elVol dp sc out element volume c elMass dp sc out element mass c elCG dp ar 3 out element centroid coordinates in current 124 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API configuration nRsltBsc dp sc in number of basic elemental results saved in result files RsltBsc dp ar nRsltBsc out basic elemental results see EXPLANATION below nRsltVar int sc in number of elemental results saved in result file as non summable miscellaneous variables defined on USRELEM command as NRSLTVAR RsltVar dp ar nRsltVar out variables to saved in result files as non summable miscellaneous variables requested when outkey 1 nElEng int sc in number of energies fixed at 3 elEnergy dp ar nElEng out elemental energy elEnergy 1 element strain energy elEnergy 2 element plastic strain energy elEnergy 3 element creep strain energy EXPLANATION OF RsltBsc Basic element results are saved and total number of result quantities is nRsltBsc where nRsltBsc 7 7 number of corner nodes at one element To process the quantites by post processing properly the results must be in the following order 1 Stresses Sx Sy Sz Sxy Syz Sxz Seqv at all corner points followed by 2 Strains Ex Ey Ez Exy Eyz Exz Eeqv at all corner points where Seqv and
114. energies e value 1 volume of element e 2 strain energy e 3 dissipation energy e 4 kinetic energy e 5 plastic energy e 6 creep energy e 7 stabilization energy e 8 spares e 9 thermal energy 10 11 spares Q output arguments none 7 7 20 engdel Subroutine Deleting an Element s Energies deck engdel subroutine engdel ielem C primary function delete element energies c Notice This file contains ANSYS Confidential information c input arguments G ielem int sc in element number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 264 of ANSYS Inc and its subsidiaries and affiliates 7 7 23 egrput Subroutine Storing an Element s Nodal Gradients a 0 delete for all defined elements c output arguments none 7 7 21 egriqr Function Getting Information About an Element s Nodal Gradients deck egrigr function egrigr ielem key C primary function get information about element nodal gradients c Notice This file contains ANSYS Confidential information G input arguments ielem int sc in element number or zero see below es key int sc in key as to the information needed fo 1 return info about nodal gradients a for ielem gt 0 return number of nodal gradients on o this element record length ad 0 return maximum number of nodal o gradients
115. equivalent plastic strain not used they are reserved arguments for further development loading bisect cut control 0 no bisect cut 1 bisect cut factor will be determined by ANSYS solution control material jacobian matrix KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK ncomp 6 for 3 D ncomp 4 for plane strain stress axisymmetric ncomp 1 for 1 D stresss and strains plastic strain vectors lli Z9 93 12 4 x3 13 for 3 D lLl o22 33 42 for Plane strain stress axisymmetry 11 for 1D material jacobian matrix 3 D dsdePl 1 122 L33 T2 1123 ILES dsdeP1 22 2222 2233 2212 2223 2213 dsdePl 33 3322 3333 3312 3323 3313 dsdePl 2 222 233 212 1223 1213 dsdePl 23 2322 2333 2312 2323 2313 dsdeP1 3 322 333 312 1323 l313 plane strain stress axisymmetric dsdePl 1 122 L33 Liz dsdePl 22 2222 2233 2212 dsdeP1 33 3322 3333 3312 dsdePl 2 222 233 212 for plane stress entities in third colum row are zero 1d dsdePl1 T KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK include impcom inc c INTEGER amp matId elemId amp kDomIntPt kLayer kSectPt amp ldstep isubst keycut amp nDirect nShear ncomp nStatev nProp DOUBLE PRECISION amp Time dTime Temp dTemp sedEl sedPl epseq epsZZ DOUBLE PRECISION amp stress ncomp statev nStatev amp dsdePl ncomp ncomp 316 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subs
116. etadot dp sc out time derivative of wave height G used for kwav 1 wheeler only 6 6 Running ANSYS as a Subroutine To call the ANSYS program use the following program ansys If you are running ANSYS on a UNIX system but not under Windows you also can call the ANSYS program as a subroutine in a program you ve written To do so use the following subroutine ansys For multiple calls to subroutine ANSYS you must open and close standard input in the calling subroutine Usually input and output are Fortran units 5 and 6 respectively The calling subroutine can t use the database access subroutines However other user programmable features can use the database access subroutines freely There may be times when ANSYS exits abnormally Check the ile err file to see if ANSYS wrote an exit code to the file before ending These error codes may help you to understand the problem ANSYS had Table 6 1 ANSYS Exit Codes Code Explanation Code Explanation 0 Normal Exit 14 XOX Error 1 Stack Error 15 Fatal Error 2 Stack Error 16 Possible Full Disk 3 Stack Error 17 Possible Corrupted or Miss ing File 4 Stack Error 18 Possible Corrupted DB File 5 Command Line Argument 21 Authorized Code Section Error Entered Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 193 Chapter 6 UPF Sub
117. file contains ANSYS Confidential information Prolog is not CONFIDENTIAL INFORMATION Q c input arguments c piFEML ptr sc in If non 0 pointer of a FEM Object rel nPoints int sc in Number of points to find do in one group G xyzPoints dp ar 3 nPoints in XYZ coordinates of each point G tolInsidein dp sc in Tolerance for point inside element G 0 0d0 defaults to 1 0d 4 c tolOutsidein dp sc in Maximum distance outside to be associated c with an element 0 0d0 defaults to 0 25 rel MoveTol dp sc in Node move tolerance 0 0d0 no move Q output arguments fel ebest int ar nPoints out Best element number for each point fel elcord dp ar 3 nPoints out Element coordinates of the point 6 9 Access at the Beginning and End of Various Operations You can access the logic just before an ANSYS run begins or just after a run ends and at many other inter mediate points by using the ANSYS subroutines listed below These subroutines can perform actions such as evaluating results or performing calculations None of the subroutines have input or output arguments Issue the USRCAL command or use an equivalent menu path to activate or deactivate these subroutines User Subroutine Is Called UAnBeg At ANSYS start up USolBeg Before solution ULdBeg Before a load step USsBeg Before a substep ItBeg Before an iteration ItFin After an iteration USsFin After a
118. file contains ANSYS Confidential information c input arguments c nblk int sc in the block number to close e as defined with subroutine binset c pstat chr sc in keep or delete flag o K keep file e D delete file c Buffer4 int ar inout work array for paging should be the e same array as used in binset C output arguments ol Buffer4 int ar inout work array for paging 2 1 16 Subroutine largelntGet Converting Two Integers into a Pointer deck largeIntGet function largeIntGet small large c primary function Convert two short integers into a long integer c object library res c Notice This file contains ANSYS Confidential information c input arguments c small int sc in least significant part c large int sc in most significant part C output arguments c largeIntGet LONGINT sc out 64 bit integer 2 2 Demonstration Routines The demonstration routines demonstrate several ways to use the binary file access routines provided with ANSYS The programs described below all available on your distribution media see Accessing ANSYS Binary Files p 53 for their location demonstrate other tasks that the binary access routines can do Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 61 Chapter 2 Accessing Binary Data Files 2 2 1 Program bintst Dem
119. for current technology elements com The material subroutine provided as the example com is the same as the TB BISO com A side by side comparison is made for two 185 elements com among which one is defined by TB BISO and another com is defined as TB USER They are expected to produce com the same results com uniaxial tension stress large deformation com nopr nolist prep7 elel 185 ele2 185 matl 1 mat2 2 et l elel keyopt 1 2 1 mat matl BloGk 0 15 0 1 0 1 esize 1 vmesh 1 mat mat2 bloGk 0 15 07 1 0 1 esize 1 vmesh 2 elist Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 313 Appendix C User Material UserMat Subroutine Example define material 1 by tb biso mp ex matl 20e5 mp nuxy mat1 0 3 tb biso mat1 2 4 btemp 1 0 bdata 1 1e3 100 btemp 2 0 t t t tbdata 1 2e3 100 define material 2 by tb user tb user mat2 2 4 tbtemp l1 0 first temp tbdata 1 19e5 0 3 1e3 100 E posn sigy H tbtemp 2 0 tbdata 1 21e5 0 3 2e3 100 tb state mat2 8 define 8 state variables boundary condition nsel s loc x d all ux nall nsel s loc y d all uy nall nsel s loc z d all uz nall fini solu turnif l 5 nlgeom on nsel s loc y 1 nsubst 20 100 1 d all uy 1 0 time 1 nall outres 10 outpr all 10 solv fini post26 esol 2
120. image X2 y2 Sets coordinates for the upper right corner of the z buffer image The following three parameters are run length encoded data which repeats until all pixels are read in as defined by the window X2 X1 1 Y2 Y1 1 n Defines the number of pixels in a row inrm Sets the normal for pixels Byt3 Xy Xy Long Long Long Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 91 of ANSYS Inc and its subsidiaries and affiliates Chapter 4 ANSYS Graphics File Format Graphics Command Parameters Parameter Directive Character Types iclr Sets the color for the pixmap 4 2 2 3 Color Specification Below is the list of color specifications used by the directives that set colors for areas graphs and text If more than a single intensity of a color is available use the value specified by the Normal directive to complete the selection Normal of 0 represents the lowest intensity and normal of 255 represents the highest intensity Value Color 0 Black 1 Cyan 2 Blue Magenta 3 Red 4 Cyan Blue 5 Magenta Red 6 Green 7 Orange 8 Magenta 9 Yellow Green 10 Blue 11 Green Cyan 12 Yellow 13 Dark Gray 14 Light Gray 15 White 16 Reserved for future use 127 128 Blue Cyan Green Indices 128 through 255 rep resent the color spectrum used to display the Low Blue to High Red contour values Yellow 92 Release 12 0 2009SASIP In
121. in the table starting at STLOC 3 2 17 MPTEMP Command The MPTEMP command defines a temperature table You repeat the command until all temperature values are defined The command format in Jobname CDB is MPTEMP R5 0 LENGTH STLOC TEMP1 TEMP2 TEMP3 LENGTH The total number of temperatures in the table STLOC The starting location in the table for the next three temperature values TEMP 1 TEMP2 TEMP3 Temperatures assigned to three locations in the table starting at STLOC 3 2 18 N Command If the UNBLOCKED option is used with the CDWRITE command then the N command defines a node This is also the method used for defining nodes in CDB files before ANSYS 5 4 The command format in Job name CDB is N R5 3 Type NODE SOLID PARM VAL1 VAL2 VAL3 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 82 of ANSYS Inc and its subsidiaries and affiliates 3 2 19 NBLOCK Command Type The type of data to be defined Valid labels are LOC read in coordinates and ANG read in rotation angles NODE The node number SOLID The solid model reference key Not present for Type ANG PARM Line parameter value 0 if not on line Not present for Type ANG VAL1 VAL2 VAL3 Values to be read f Type is LOC values are the coordinates in the global Cartesian system f Type is ANG values are the rotation angles in degrees 3 2 19 NBLOCK Command
122. information uncommented code Tal input arguments o mat int sc in ad e e e iprop int sc in e if iprop 0 e material number e e MP command labels c EX de BY 22 EZ By c GXZ 9 ALPX 10 ALPY 11 c KYY 17 KZZ 18 RSVX 19 c EMIS 25 ENTH 26 LSST 27 c MURZ 33 PERX 34 PERY 35 c EGYY 41 EGZZ 42 SBKX 43 e USR1 49 USR2 50 USR3 51 e HGLS 57 BM 4 58 QRAT 59 c THSY 65 THSZ 66 DMPR 67 c zug eua 75 e o see mpinit for re key int sc in ic c DB SELECTED 1 e mpingr 0 o 1 c DB NUMDEFINED 12 c DB MAXDEFINED 14 material number should be 0 for key 11 DB NUMDEFINED 12 DB MAXDEFINED 14 DB MAXRECLENG 15 and property reference number test for existence of any material property with this with key DB SELECTED 1 NUYZ 5 NUXZ 6 DENS 13 MU 14 RSVZ 21 C 22 PRYZ 29 PRXZ 30 MGXX 37 MGYY 38 SBKZ 45 SONC 46 FLUI 53 ORTH 54 CTEX 61 CTEY 62 69 79 77 78 GXY 7 DAMP 15 HF 23 MURX 31 MGZ2 39 SLIM 47 CABL 55 CTEZ 63 71 79 GYZ 8 KXX 16 VISC 24 MURY 32 EGXX 40 ELIM 48 RIGI 56 THSX 64 72 80 RSVY 20 PRXY 28 PERZ 36 SBKY 44 USR4 51 REFT 60 LSSM 68 76 and for TB command information key as to the information needed about material property return select status material prop is undefined material prop is selected number of defin
123. information flag G DB SELECTED return select status c etyiqr 0 element type is undefined o element type is unselected c 1 element type is selected o DB NUMDEFINED return number of defined element types c DB NUMSELECTED return number of selected element types o DB MAXDEFINED return highest element type number defined c DB MAXRECLENG return maximum record length int words c n return element characteristic n from etycom for element e type itype o n is correlated to the parameter names in echprm e See elccmt for definitions of element characteristics e note this will not overwrite the current setting of c etycom c output arguments c etyiqr int func out the returned value of etyigr is based on o setting of key 7 3 5 etyget Function Getting Information About an Element Type deck etyget function etyget itype ielx C primary function get element type data c Notice This file contains ANSYS Confidential information c input arguments c itype int sc in element type number c output arguments c etyget int func out status of element type c 0 element type is undefined c lt 0 number of data items on unselected Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 223 Chapter 7 Accessing the ANSYS Database element typ
124. input element characteristics in positions 21 to 150 kdim ishap idegen etc See elccmt for a full list Qr CE OOG 0O O COE COE COE COE COE O 00 an O OO EO COD kerr int sc out error flag 0 no errors 1 errors c 224 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 3 9 mpingr Function Getting Information About a Material Property 7 3 8 etysel Subroutine Selecting Unselecting Deleting or Inverting an Element Type deck etysel subroutine etysel primary function secondary functions none typ int dp log chr dcp input arguments variable typ siz intent itypi int sc in ksel int sc in output arguments none Q0000000000000000000010n itypi ksel to select element type siz sc ar n func unselect delete or invert an Notice This file contains ANSYS Confidential information intent in out inout description element type number 0 all element types type of operation to be performed 0 delete element type 1 select element type unselect element type 2 invert element type 7 3 9 mpinqr Function Getting Information About a Material Property deck mpingr function mpingr C primary function mat iprop key get information about a material property c Notice This file contains ANSYS Confidential
125. int sc in length of vectors vl v2 e e e amp e amp 8 3 10 vimove Subroutine Moving One Vector into Another Incrementally deck vimove subroutine vimove vl incl v2 inc2 n on vector vl on vector v2 items to be moved i vector incremental move C primary function move one vector into another c c Notice This file contains ANSYS Confidential information e c input arguments c v1 dp ar incl n in vector vl c incl int sc in increment c inc2 int sc in increment c n int sc in number of e C output arguments Cc v2 dp ar inc2 n in vector v2 c c mpg VZ 1 inc2 i Vl1 1 incl c 8 3 11 vinit Subroutine Assigning a Scalar Constant to a Vector deck vinit subroutine vinit v n const C primary function initialize a vector to a constant c Notice This file contains ANSYS Confidential information set vector v to c input arguments c n int sc in length of vector v c const dp sc in constant to C output arguments c v dp ar n out vector v Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 293 Chapter 8 Subroutines for Users Convenience 8 3 12 viinit Subroutine Assigning a Scalar Constant to a Vector Incrementally deck viinit subroutine viinit v inc n const c primary function se
126. intent in out inout amp input arguments c variable typ siz intent description node int sc in node number c idf int sc in reference number for the DOF 1 32 c FX l FY 2 FZ 3 MX 4 MY 5 MZ 6 CSGX 7 CSGY 8 c CSGZ 9 VFX 10 VFY 11 VFZ 12 c FLOW 19 HEAT 20 AMPS 21 FLUX 22 NPKE 23 NPDS 24 c CURT 25 VLTG 26 missing entries are spares c output arguments c none 7 5 9 ntpiqr Function Getting Information About a Nodal Temperature deck ntpiqr function ntpigr node key C primary function get information about a nodal temperature c Notice This file contains ANSYS Confidential information e typz int dp log chr dcp siz sc ar n func intent in out inout e input arguments c variable typ siz intent description c node int sc in node number c should be zero for key 2 c key int sc in key for operation G 1 return temperature status ae ntpiqr 0 node has no temperature Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 236 of ANSYS Inc and its subsidiaries and affiliates 7 5 12 ntpdel Subroutine Deleting a Nodal Temperature c constraint defined e 1 node has a temperature c constraint defined as 2 return total number of nodal c temperatures defined in model c output arguments G ndingr int func out the returned value of ndingr is based on e setting of ke
127. length The reduced damping matrix is present only if nmatrx 2 There will be nmrow records of this type stored here Row order is the same as the DOF order in record at ptrDOF If the analysis uses the mode superposition method using the reduced mode extraction technique each record will be nmode items in length These records contain mode shapes eigenvectors of the frequencies eigenvalues actually used in the harmonic analysis There will be nmode records of this type stored here with the first N records containing the mode shapes and the other records containing zeros where N is the number of modes actually used in the harmonic analysis Order corresponds to the DOF order given in record at ptrDOF If the analysis uses the mode superposition method this record will not be present psi i j i 1 nmrow or ac 1 nmrow Frequencies extracted from the modal analysis This record is present only if the analysis uses the mode superposition method The first nmode values are the frequencies extracted from the modal analysis The remaining values have no meaning freq i i 1 nmrow The next 4 records are repeated as a pair until the time value equals the value of timend The number of iterations is stored as ncumit dp see above records that deal with time J nmrow 6 Calculated displacements The first nmrow entries are the displacements in the same order as the original set of DOFs see record AFTER ptrDOF I
128. lt sectionlist ansres getsecnm int gt ch4 conversion 2 1 14 Subroutine inexc4 Coding a Character String into an Integer String deck inexc4 subroutine inexc4 chin ichext n c primary function encode plain 4 character strings into externally formatted amp integer versions of 4 character strings used to convert c data from internally formatted files to data for e externally formatted files c Notice This file contains ANSYS Confidential information fel c input arguments e chin char ar n in strings in character form c n int sc in number of strings to convert e C output arguments Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 60 of ANSYS Inc and its subsidiaries and affiliates 2 2 Demonstration Routines ichext int ar n out externally formatted integer form of 4 character strings mpg inexc4 sectype ansres anssav ch4 int conversion 00000 2 1 15 Subroutine binclo Closing or Deleting a Blocked Binary File deck binclo subroutine binclo nblk pstat Buffer4 c primary function close a blocked file every block file opened with od binset should be closed with binclo C secondary function the file can be deleted by specifying D in pstat c This routine is intended to be used in standalone programs c This routine should not be linked into the ANSYS program c Notice This
129. n nth location in digested water wav table e de distance from the ocean floor de depth xyzg 3 c de is sometimes negative for a large deflection problem c this is because routine WATERL has to leave a tolerance c for gaps at the mudline if de lt TINY de TINY kmf nint watwav 15 kpeak nint watwav 13 con watwav 12 DTORAD cswav 1 cos con cswav 2 sin con r cswav 1 xyzg 1 cswav 2 xyzg 2 c calculate eta water height over integration point eta 0 0d0 call wavHtSec 0 xyzg 1 doIns depth watwav 1 nw eta etadot e eta total wave height over point being studied c vr 0 0d0 ar 0 0d0 axyz 3 0 0d0 pdynam 0 0d0 c small amplitude airy wave theory e compute effect of all components combined before continuing on c facdep is always positive because eta must be less than depth facdep depth depth eta c now continue on c loop on waves do iw 1 nw in ptr Layer 6 iw 1 1 c compute water height due to only this wave eti rk DPPI2 watwav in 3 tpt DPPI2 watwav in 1 argu wvargu kpeak kmf watwav in r doIns ao watwav in 0 5d0 eti ao cos argu asint ao sin argu etidot tpt asint rkd rk depth ca rk de c cs cosh ca sinh rkd cs wvhybl 2 ca rkd Cc ss sinh ca sinh rkd ss wvhybl 3 ca rkd c compute dynamic pressure c accel 3 is from the acelcm include deck and is
130. new eqn b 4 simo and vu quoc cmame 58 1986 79 116 c removes singularities at pi and 2 pi amp c input arguments c variable typ siz intent description c rot dp ar 4 in rotation parameter in radians amp C output arguments c variable typ siz intent description c tr dp ar 3 3 out transformation matrix corresponding to rot 6 2 27 Subroutine xyzup3 Updating an Element s 3 D Nodal Coordinates deck xyzup3 subroutine xyzup3 nnod u nr xyz nx Xyzup primary function update a 3 d ele nodal coords for large deformation c Notice This file contains ANSYS Confidential information c e input arguments Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 146 of ANSYS Inc and its subsidiaries and affiliates 000000000 6 2 29 Subroutine tmpget Defining Current Temperature Loads nnod int sc in number of nodes u dp ar nr in displacement vector nr int sc in size of the u vector XYZ dp ar nx nnod in coordinates to be updated nx int sc in row size of xy output arguments xyzup dp ar 3 nnod out updated coordinates 6 2 28 Subroutine updrot Updating the Rotation Pseudovector deck updrot c Cc Cc c c c c c Cc c Cc c Cc Cc Cc c c c c c c Cc Cc subroutine updrot v2 wl primary function update the rotation pseudovector for 3 d large rotations
131. nodal heat generation is defined c hg dp ar 2 out the nodal heat generation new old 7 5 15 nhgput Subroutine Storing Nodal Heat Generation deck nhgput subroutine nhgput node hg C primary function store nodal heat generation c Notice This file contains ANSYS Confidential information amp input arguments c node int sc in node number c hg dp sc in nodal heat generation output arguments none 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 38 of ANSYS Inc and its subsidiaries and affiliates 7 5 18 nfuget Function Getting a Nodal Fluence 7 5 16 nhgdel Subroutine Deleting a Nodal Heat Generation deck nhgdel subroutine nhgdel node c primary function delete nodal heat generations c Notice This file contains ANSYS Confidential information c c typ int dp log chr dcp siz sc ar n func intent in out inout c e input arguments c variable typ siz intent description c node int sc in node number a output arguments none a 7 5 17 nfuiqr Function Getting Information About Nodal Fluences deck nfuiqr function nfuiqr node key C primary function get information about nodal fluences c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout e input arguments c variable typ siz intent desc
132. nodes defining this element if Solkey SOLID otherwise Field 9 0 Field 10 The exclude key p elements Field 11 The element number Fields 12 19 The node numbers The next line will have the additional node numbers if there are more than eight The format without the SOLID keyword is Field 1 The element number Field 2 The type of section ID Field 3 The real constant number Field 4 The material number Field 5 The element coordinate system number Fields 6 15 The node numbers The next line will have the additional node numbers if there are more than ten The final line of the block will be a 1 in field 1 If you are in the GUI the EBLOCK command must be contained in an externally prepared file and read into ANSYS i e CDREAD INPUT etc 3 2 5 EDCADAPT Command The EDCADAPT command specifies adaptive meshing control for explicit dynamics analysis The command format in Jobname CDB is EDCADAPT R5 3 FREQ TOL OPT MAXLVL BTIME DTIME LCID ADPSIZE ADPASS IREFLG ADPENE ADPTH MAXEL FREQ The time interval between adaptive mesh refinement TOL The adaptive angle tolerance in degrees OPT The adaptivity option MAXLVL The maximum number of mesh refinement levels BTIME The birth time to begin adaptive meshing DTIME The death time to end adaptive meshing LCID The curve ID defined by EDCURVE ADPSIZE The minimum element size to be adapted bas
133. nonlinear materials present dp sc in stress in stress strain curve dp sc in stress ratio dp sc in hydrostatic pressure dp sc in plastic equivalent strain int sc in key to print plastic strain dp sc in plastic strain int sc in key to print creep strain dp sc in creep strain ments none 6 1 3 5 1 Subroutines uep101 through uep105 The source code for subroutines uep101 uep102 uep103 uep104 and uep105 is identical to subroutine uep100 listed above 6 1 3 6 Subroutine usertr Adjusting the Nodal Orientation Matrix deck usertr Q00000000n000n0000000000000000n00Dn subrouti primary function secondar accessed with ielc notran typ int dp log chr dcp ne usertr y function input arguments variable node EE output argu variable Er CE of it IE nr ele typ siz intent int sc in dp ar 32 32 inout ments typ siz intent dp ar 32 32 inout USERSDISTRIB node tr adjust nodal orientation matrix study nodal orientation matrix 100 copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information siz sc ar n intent in out inout description node number being acted upon nodal to global orientation matrix description nodal to global orientation matrix is a matrix that is already defined based on the degrees freedom selected does not norma
134. not present if failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPCR item of ETABLE command 7 7 35 ecrput Subroutine Storing an Element s Nodal Creep Strains deck ecrput subroutine ecrput c primary function ielem nval value store nodal creep strains at an element c Notice This file contains ANSYS Confidential information c input arguments e ielem int sc in element number c nval int sc in the total number of values e 6 nnod nface c value dp ar nval in the strain values c output arguments none e NOTE Strains at each corner node in the order c X Y ZL XY Yzy XZ c For solid elements strains at each o corner node ol For shell elements strains at each Ge corner node first top durface then c bottom c For layered elements w KEYOPT 8 0 c strains for first layer at each c corner node first at the bottom ol surface of the bottom layer then the c top surface of the top layer o Strains for second layer at each c corner node first the bottom surface c then the top surface for the layer with c the largest failure criteria G The second layer is not present if Release 12 0 2009 SAS IP Inc All rights reserved Contains propriet
135. not used or are not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPPL item of ETABLE command 7 7 31 eplput Subroutine Storing an Element s Nodal Plastic Strains deck eplput subroutine eplput a primary function ielem nval value store nodal plastic strains at a element c Notice This file contains ANSYS Confidential information qgqaqaqaa AAAA AAAA MA AAA input arguments ielem int sc in nval int sc in value dp ar nval output arguments none in NOTE element number the total number of values 6 nnod nface the strain values Strains at each corner node in the order X Y Z XY YZ XZ For solid elements strains at each corner node For shell elements strains at each corner node first top durface then bottom For layered elements w KEYOPT 8 0 Strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node first the bottom surface then the top surface for the layer with Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 269 Chapter 7 Accessin
136. of masters pointer to nodal solution pointer to element solution pointer to reaction forces pointer to the masters pointer to the boundary conditions key to extrapolate integration point results to nodes 0 move 1 extrapolate unless active non linear 2 extrapolate always mode number of harmonic loading for cyclic symmetry this is cs_LSF first load step for this SOLVE symmetry for harmonic loading for cyclic symmetry this is cs_LSL last load step for this SOLVE complex key 0 real imaginary number of DOFs nodes for this data set DOF node reference numbers numdof values main title in integer form lst subtitle in integer form time in compact form when the database was last modified date in compact form when the database was last modified number of times that the database was modified time in compact form when the Solution for this data set was done date in compact form when the Solution for this data set was done pointer to the ordered node list load case files only pointer to the ordered element list load case files only number of extra Flotran DOFs nodes for this data set pointer to header extension for FLOTRAN DOF extra DOF list pointer to header extension Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 11 Chapter 1 Format of
137. on any element G maximum record length a DB NUMDEFINED return the number of nodal gradients defined G in model c output arguments o egriqr int func out the returned value of egrigqr is based on G setting of key 7 7 22 egrget Function Getting an Element s Nodal Gradients deck egrget function egrget ielem value C primary function get element nodal gradients c Notice This file contains ANSYS Confidential information G input arguments c ielem int sc in element number c output arguments e egrget int func out status of element co 0 element undefined e gt 0 number of nodal gradients c returned e value dp ar out element nodal gradients Note If a coupled field a set of gradients are stored in the following order as available fluid thermal electric magnetic qgqaaqa c mpg egrget lt pagend magget lt hsnget2 get elem gradient H 7 7 23 egrput Subroutine Storing an Element s Nodal Gradients deck egrput subroutine egrput ielem nval value C primary function store nodal gradients at an element Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 265 Chapter 7 Accessing the ANSYS Database c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c n
138. order ANSYS first checks the ans_ext tbl file in the C Program Files Ansys Inc V120 1lib platform directory and loads any external commands referenced there ANSYS then loads external commands referenced by the external table file in the directory designated with the ANSYS EXTERNAL PATH environment variable see Setting the ANSYS EXTERNAL PATH Envir onment Variable p 311 If you designate a command name that has the same first four characters as a command listed in the C Program Files Ansys Inc V120 1lib plat form file you will not be able to access your command Therefore it is a good practice to check the ANSYS external table file to make sure you have no external command name conflicts Do not modify the C Program Files Ansys Inc V120 lib platform ans_ext tbl file You can also use the DEBUG command to verify that no external command name conflicts exist Note The shared library must be consistent with the computer type and OS level on which ANSYS will be executed B 1 6 Setting the ANSYS EXTERNAL PATH Environment Variable Before launching ANSYS you must first set the ANSYS EXTERNAL PATH to point to the directory containing the external table file In Windows NT the environment variables are in System Properties which can be Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 311
139. order is the same as the DOF order in record at ptrDOF If the analysis uses the mode superposition method using the reduced mode extraction technique each record will be nmode items in length These records contain mode shapes eigenvectors of the frequencies eigenvalues actually used in the harmonic analysis There will be nmode records of this type stored here with the first N records containing the mode shapes and the other records containing zeros where N is the number of modes actually used in the harmonic analysis Order corresponds to the DOF order given in record at ptrDOF If the analysis uses the mode superposition method this record will not be present psi i j i 1 nmrow or ac Frequencies extracted from the modal analysis This record is present only for analyses using the mode superposition method freq i i 1 nmrow The next 3 records are repeated as a pair The number of iterations is stored as ncumit cmp ncumit nmrow 5 Calculated complex displacements The first nmrow entries are the displacements in the same order as the original set of DOFs see record AFTER ptrDOF If DSPfmt 0 these are physical displacements If DSPftm 0 For the last five entries Real part Imag part 1 frequency for these frequency increment values 2 load step number substep number 3 cumulative iteration zero number 4 zero zero 5 scale factor zero zero if the analysis uses the reduced meth
140. rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 141 Chapter 6 UPF Subroutines and Functions GG 8 00 Y e DE e Oe dtem fluen dflu epel sig dp sc in temperature increment over this substep dp sc in fluence at the end of this substep dp sc in fluence increment over this substep dp sc inout elastic strain adjusted for creep increment dp sc inout stress not really used output arguments epcrp statev usvr sig dp sc inout updated creep strain dp ar 7 inout updated state variables dp ar inout updated user defined state variables dp sc inout stress recomputed if requested 6 2 17 Subroutine creep3 Updating an Element s Creep History 3 D Elements deck creep3 subroutine creep3 option elem intpt mat kstartL ncomp epel e x posn d epcrp statev usvr tem dtem fluen dflu kplst sig hsig C primary function to update the creep history for 3 d elements used by PLANEO2 PLANE13 PIPE20 PLANE42 SHELL43 SOLID45 Cc Cc Cc Q Q0Q0000n0n0n0n0nQonQooaoaooaooonononon Q0Qo0n0n0n0nn SHELL51 PIPE60 SOLID62 SOLID65 PLANE82 SHELL91 SOLID92 SHELL93 SOLID95 SHELL143 SOLID191 Notice This file contains ANSYS Confidential information input arguments option elem intpt mat kstartL ncomp epel e posn d epcrp statev usvr tem dtem fluen df
141. sc in the last node number used e 0 use for initial value c output arguments c ndnext int func out the next selected node number a 0 no more nodes 7 1 2 ndprev Function Getting the Number of the Previous Selected Node deck ndprev function ndprev next C primary function get the number of the previous selected node e c Notice This file contains ANSYS Confidential information amp c typz int dp log chr dcp siz sc ar n func intent in out inout amp amp input arguments c variable typ siz intent description c next int sc in the next node number used e 0 use for initial value amp c output arguments c ndprev int func out the previous selected node number amp 0 no more nodes amp 7 1 3 ndnxdf Function Getting the Number of the Next Defined Node deck ndnxdf function ndnxdf next C primary function get the number of the next defined node ic c Notice This file contains ANSYS Confidential information amp typ int dp log chr dcp siz sc ar n func intent in out inout ic e input arguments c variable typ siz intent description e next int sc in the last node number used e 0 use for initial value o c output arguments e ndnxdf int func out the next defined node number e 0 no more nodes e Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential inform
142. spares X949 PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 KKKKKKKKK 27 32 are spares KKKKKKKKKKKKKKKKKKKKKKKKK al A lenbac This table equates the actual node number to dp A the number used for storage Back i i 1 lenbac 10 Time information dtime 0 0 0 0 0 0 eo o0 0 0 0 0 timend each item is described below dtime the time increment timend the final time of the analysis 0 0 position not used i 1 nmrow Degree of freedom set used The DOFs are calculated as N 1 numdof DOF where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above If the analysis uses the reduced method the original DOF order see next record is rearranged so that DOFs having nodal constraints are listed first If the analysis uses the mode superposition method using the reduced mode extraction technique the DOF order is the same as the original order see next record 1 i i 1 nmrow i t nmrow 1 Original reduced set of DOFs used The DOFs are calculated as N 1 numdof DOF where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above If the analysis uses the reduced method the original DOF order plus the number of nodal constraints nbcdsp is stored If the analysis uses the mode superposition method using the reduced mode extraction technique thi
143. subroutine izero ivect n Cl Aw Wem seb an Integer vector to ZeLO EW RARERS 8 3 7 imove Function Assigning Equal Values to Two Integer Vectors deck imove subroutine imove il i2 n p eek move a vector from one to another x c 8 3 8 vzero Subroutine Initializing a Vector to Zero deck vzero subroutine vzero v n C primary function initialize a vector to zero c Notice This file contains ANSYS Confidential information c input arguments c v dp ar n inout vector to be zeroed out e n int sc in number of words to zero out 292 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 8 3 11 vinit Subroutine Assigning a Scalar Constant to a Vector c output arguments c V dp ar n inout zeroed vector amp c mpg V 0 clear vector parallel optimize e 8 3 9 vmove Subroutine Moving One Vector into Another deck vmove subroutine vmove v1 v2 n output arguments v2 dp ar out vector v2 mpg V2 V1 vector move see vimove for incremental move C primary function copy a vector into another vector e c Notice This file contains ANSYS Confidential information e c Note This function can have unpredictable results if v1 and v2 o reference the same array and overlap o c input arguments o v1 dp ar in vector vl c n
144. the bottom surface then the top and finally the middle surface Therefore the number of items in this record is NL 3 nodstr ncomp For layered membrane elements SHELL181 SHELL281 SHELL208 and SHELL209 with KEYOPT 1 1 and KEYOPT 8 1 the record contains stresses for each layer at each corner node and the number of items in this record is NL nodstr ncomp For beam elements the contents and number of data items is element dependent See the Output Data section for the particular element in the ANSYS Elements Reference 1 11 Element volume and energies volume senergy aenergy kenergy coenergy incenergy 0 0 0 0 thenergy 0 0 0 0 each item is described below volume element volume senergy element energy associated with the stiffness matrix aenergy artificial hourglass energy kenergy kinetic energy coenergy co energy magnetics incenergy incremental energy magnetics 0 0 position not used 0 0 position not used thenergy thermal dissipation energy see ThermMat shelll131 132 only Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 17 Chapter 1 Format of Binary Data Files position not used position not used Q O X oo EGR dp 1 varies Element nodal field gradients This record contains the gradients at each corner node in the order X Y Z Nodal order c
145. the corresponding TB commands UPFs that are not activated by the means described above must be activated by either of the following methods e Issuing the USRCAL command e Choosing menu path Main Menu gt Preprocessor gt Loads gt Load Step Opts gt Other gt User Routines or Main Menu gt Solution gt Load Step Opts gt Other gt User Routines To activate or deactivate the routines issue the command USRCAL Rnaml1 Rnam9 where Rnam1 and Rnam9 are the names of specific routines You can specify up to nine routines with one USRCAL command or you can issue multiple USRCAL commands Issue the command USRCAL NONE to deactivate all valid user subroutines To list the status of the routines issue the command USRCAL STAT For a list of the user routines that the USRCAL command or its equivalent menu paths affects see the USRCAL command description in the Command Reference If you do not activate the UPFs in this manner standard ANSYS logic will be used by default For instance when you apply a convection load standard ANSYS logic is the default even if you have a user convection routine linked in The user convection routine must be activated by the USRCAL command or its menu equivalent 5 12 Running Your Custom Executable You can run a custom executable from the Customization Preferences tab of the launcher Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 107 of ANSYS I
146. the ratio of two hyperbolic functions Specialized to the needs of wave loading The options are as given with kclass below Further only positive values of x and y are used secondary functions none Notice This file contains ANSYS Confidential information input arguments variable typ siz intent description kclass int sc in 0 cosh x cosh y 1 sinh x cosh y 2 cosh x sinh y 3 sinh x sinh y x dp sc in argument of numerator y dp sc in argument of denominator output arguments variable typ siz intent description wvhybl dp sc out resulting fraction Q0Q0n0n0nQ0nQnnQonQoaoaooaoooanononononon 6 5 12 4 Subroutine wvargu The wvargu subroutine computes the appropriate position with regard to the wave It is a utility subroutine called by the userPartVelAcc subroutine deck wvargu parallel function wvargu kpeak kmf wavdat r doext output arguments wvargu dp sc out wave position as determined by the argument output in radians primary function to find appropriate position wrt wave c secondary functions none e c Notice This file contains ANSYS Confidential information c input arguments G kpeak int sc in keyopt for when peak effect occurs e kmf int sc in key for maccamy fuchs adjustment c wavdat dp ar 6 in wave data from water wave table c wavdat 1 wave amplitude not used c wavdat 2 period e wavd
147. unwanted side effects In testing your custom user routines you also should verify that the changes you have made do not affect standard non customized ANSYS features To do so you can compare the results of a set of problems from the Verification Manual run on the standard version and on the customized version Input for these problems is also available on your ANSYS distribution medium Always remember your last step a series of steps or even your concept may be wrong Proceed in clear steps and verify your work as often as possible Keep intermediate versions of your modified source code on backup media Note If you contact your site s ANSYS system support person or any ANSYS Inc representative about the performance of a custom version of ANSYS always tell him or her explicitly that you are using a user programmable feature If you feel that an error exists in an unrelated feature of the ANSYS program demonstrate the suspected error in an non customized production version of the pro gram before you report the error to an ANSYS Inc representative 5 14 Debugging Commands To debug errors in your user routines you can use commands and other features not documented in the Command Reference Use these commands only for extremely small models with few solution iterations otherwise they will generate an excessive amount of output TRACK and DEBUG are described in detail below Two other useful commands are OUTEQ and NERR T
148. variable typ siz intent description dat dp ar ndat inout fluxes defines input values for each corner Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 181 Chapter 6 UPF Subroutines and Functions e of each face 6 5 5 Subroutine userch Changing Element Face Charge Density Surface In formation deck userch USERSDISTRIB subroutine userch ielc ielem time nr u ndat dat primary function change element face charge density surface info in order to activate this user programmable feature the user must enter the usrcal command this routine is called during each substep of each load step it is called once per element it is called only during the heat flow load vector formulation stage and not during the heat flow evaluation stage the call to get the standard ansys input charge densities of surfaces is made just before entering this routine so this information is available to be modified if desired copyright c 2006 SAS IP Inc All rights reserved eee ansys Ino input arguments variable typ siz intent description ielc int ar IELCSZ in array of element type characteristics ielem int sc in element number for operation time dp sc in time of current substep nr int sc in number of nodal temperatures of the element u dp ar nr in vector of most recent values of the
149. version of the command after the CE command described above This command repeats until all terms are defined The alternate format for the CE command is CE R5 0 Type N1 Dlab1 C1 N2 Dlab2 C2 Type The type of data to be defined NODE is the valid label N1 The node number of the next term Dlabl The DOF label of N1 Cl The coefficient of N1 N2 The node number of the next term Dlab2 The DOF label of N2 G2 The coefficient of N2 3 2 2 CP Command The CP command defines a coupled node set You repeat the command until all nodes are defined The command format in Jobname CDB is CP R5 0 LENGTH NCP Dlab N1 N2 N3 NA N5 N6 N7 LENGTH The total number of nodes in the coupled set NCP The coupled node reference number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 7 of ANSYS Inc and its subsidiaries and affiliates 3 Chapter 3 The CDWRITE CDB File Format Diab The degree of freedom label for the set N1 N2 N3 N4 N5 N6 N7 The next seven node numbers in the coupled set 3 2 3 CMBLOCK Command The CMBLOCK command defines the entities contained in a node or element component The command format in Jobname CDB is CMBLOCK Cname Entity NUMITEMS Format Cname Eight character component name Entity Label identifying the type of component NODE or ELEMENT NUMITEMS Number of items written Format Data descriptor
150. vol leng time timinc nutot utot maxdat variable numdat udbdat Q0000000000000n00000000000000000000001 0 input arguments typ siz intent int sc in int sc in int sc in dp ar nbsvr in int sc in dp ar nnrsvr in int sc in dp ar npsvr in int sc in dp ar ncsvr in int sc in dp ar nusvr in int sc in int ar nnode in dp ar 6 nnode in dp sc in dp sc in dp sc in dp sc in int sc in dp ar nutot in int sc in output arguments typ siz intent int sc out dp ar maxdat out Notice This file contains ANSYS Confidential information description element number output unit number number of basic element variables basic element variables number of nonlinear element variables nonlinear element variables number of plasticity element variables plasticity element variables number of creep element variables creep element variables number of user supplied element variables user supplied element variables number of nodes node numbers nodal coordinates and rotations element volume or area if 2 d element length beams spars etc current time current sub step time increment length of dof solution vector utot solution vector size of user output array actually ielc nmnmup virgin 3 x nnode description number of user output items in array udbdat user output items to
151. was in 14 11 112 ptrBC was in 15 13 114 ptrTRF was in EXT 125 15 116 ptrOND was in 96 17 118 ptrOEL was in 97 19 120 ptrESL was in 12 31 132 ptrVSL was in EXT 196 TA E OP E Pa ee a Me Oa Ma lL TE a emo eee Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates _ eo 1 2 3 Results File Format qgqaaqaaqaa Q Q0nQ0n0n0000n0nn0nnooaooaoaoaonoaoooaonoaooaonoaonoaooaoaoanoaoanoaonoanooaoaonoaoanoaonoaonoanoonoaonononononononon 133 134 139 141 142 143 145 146 147 each item pv3num nelm nnod mask itime iter ncumit nrf cs LSC nmast ptrNSL ptrESL ptrRF ptrMST ptrBC rxtrap mode isym kcmplx numdof DOFS title stitlel dbmtim dbmdat dbfncl soltim soldat ptrOND ptrOEL nfldof ptrEXA ptrEXT ptrASL was in EXT 197 numRotCmp ptrRCM nNodStr ptrNODSTR AvailData in header is described below current solu set number number of elements number of nodes bitmask for the existence of several records If a bit is set here it indicates that the corresponding record exists on the file The items in the bitmask that correspond to each record are shown in the record descriptions below loadstep iteration number cumulative iteration number number of reaction forces cyclic symmetry count of the load step for this SOLVE number
152. x value will signal the end of the table 1 a repeated x value will not signal the end of the table only known use c evaluation Y value end of table signal 0 a yval of zero will not signal the end of the table e g stress fitting 1 a yval of zero will signal the end of the table in general material properties exception alpx the end of the table will be signaled thru either of the above conditions or more commonly that nmax values have been processed or that the present x table entry is less than the previous one ax i lt ax i 1 evaluations done after the end of the table are evaluated as if they were at the end of the Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 289 Chapter 8 Subroutines for Users Convenience c table similarly evaluations done before the c beginning of the table are done as if they were c done at the beginning of the table e el xval dp sc in value of x with which to go into the table c ax dp ar in table of x values in ascending order c ay dp ar in table of y values c nmax int sc in maximum table size allowed e C output arguments le yval dp sc out value of y which comes back from the table c kyoff int sc out xval status flag e 0 xval in x range e 1 xval less than minimum x e 2 xval greater than maxi
153. 00000000000000n0n0o0o0o0oooon Primary function hich are availabl LDA NOMI VISC valuel LDA COF1 VISC valuel LDA COF2 VISC value2 LDA COF3 VISC value3 copyright c EEX 3mgys LNG to provide a user defined viscosity relationship in terms of the following pressure velocity temperature position time amp velocity gradient This routine is for use with the FLOTRAN elements input arguments typ siz intent dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in int sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp ar 4 in dp ar 6 in int sc in dp sc in dp sc in output arguments typ siz intent dp sc out Fluid141 and Fluid142 only In order to activate this subroutine the user must issue FLDA PROT VISC USRV command In addition the initial value of viscosity must be specified via DA PROP IVIS value This value is not available in this routine ptionally the user may specify 4 additional coefficients le in this routine by the commands 2008 SAS IP Inc All rights reserved description velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component velocity gradient component vel
154. 00000E 14 3 0 0 3 2690000000000E 01 5 1620000000000E 02 1 1200000000000E 02 4 0 0 8 8310000000000E 02 3 9980000000000E 02 5 8490000000000E 02 157130 0 0 1 6831820040000E 03 2 0010350750000E 03 2 0000000000000E 02 157131 0 0 1 6831785460000E 03 1 9922750340000E 03 4 9000000000000E 02 157132 0 0 1 6107399970000E 03 1 9408449890000E 03 5 2888200000000E 02 N R5 3 L0C 1 If you are in the GUI the NBLOCK command must be contained in an externally prepared file and read into ANSYS i e CDREAD INPUT etc 3 2 20 R Command The R command defines a real constant set You repeat the command until all real constants for this set are defined The command format in Jobname CDB is R R5 0 NSET Type STLOC VALI VAL2 VAL3 NSET The real constant set reference number Type The type of data to be defined LOC is the valid label STLOC The starting location in the table for the next three constants VAL1 VAL2 VAL3 Real constant values assigned to three locations in the table starting at STLOC 3 2 21 RLBLOCK Command The RLBLOCK command defines a real constant set The real constant sets follow each set starting with Format1 and followed by one or more Format2 s as needed The command format is RLBLOCK NUMSETS MAXSET MAXITEMS NPERLINE Formatl Format2 NUMSETS The number of real constant sets defined MAXSET Maximum real constant set number MAXITEMS Maximum number of reals in any one set NPERLINE Number of
155. 03 29 SP04 30 SP05 31 SP06 32 a missing entries are spares c output arguments c value dp ar ndf out result values 7 7 3 dspput Subroutine Storing a Result at a Node deck dspput subroutine dspput node ndf idf value C primary function store a result at a node c Notice This file contains ANSYS Confidential information amp input arguments c node int sc in node number c ndf int so in number of results to be stored c idf int ary ndf in reference number for the DOF 1 32 c value dp ar ndf in displacement values c output arguments none 7 7 4 dspdel Subroutine Deleting a Result at a Node deck dspdel subroutine dspdel node ndf idf C primary function delete a result at a node c Notice This file contains ANSYS Confidential information e input arguments e node int s in node number 0 to delete DOF at all e nodes e ndf int sc in number of DOFs to delete 0 to delete e all DOFs c idf int ar in reference number for the DOF 1 32 c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 c AZ 9 VX 10 VY 11 VZ 12 c PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 EMF 25 CURR 26 missing entries are spares 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 58 of ANSYS Inc and its subsidiaries and affiliates 7 7 7 emsput Subroutine Storing
156. 09 SAS IP Inc All rights reserved Contains proprietary and confidential information 8 of ANSYS Inc and its subsidiaries and affiliates Chapter 8 Subroutines for Users Convenience This chapter describes ANSYS routines available to you for use in programming Using these routines isn t required but may make your life easier These routines include a set of general routines that perform utility type functions a set of routines supporting vector functions a set of routines supporting matrix functions and routines supporting message processing options The following topics are discussed in this chapter 8 1 Input and Output Abbreviations 8 2 General Subroutines 8 3 Vector Functions 8 4 Matrix Subroutines 8 1 Input and Output Abbreviations The descriptions of inputs and outputs for the routines discussed in this chapter use the following abbrevi ations Argument type is one of the following int integer dp double precision log logical chr character dcp double precision complex Argument size is one of the following sc scalar variable ar n array variable of length n func functional return value Argument intent is one of the following in input argument out output argument inout both an input and an output argument 8 2 General Subroutines 8 2 1 dptoch Subroutine Retrieve Eight Characters From a Double Precision Variable deck dptoch subroutine dptoch dp8 ch8
157. 1 Row order is the same as the DOF order stored at position ptrRDF am i j i 1 nmrow Reduced damping matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx 2 Row order is the same as the DOF order stored at position ptrRDF ac i j i 1 nmrow ds Participation factors for this spectra Mode coefficients for this spectra Modal damping values svcom inc freqtb misc spectra data nelm mask nItems ptrELM ptrERS trCER ptrCERh ptrESL ptrESLh nRF ptrFR ptrRFh each item in header is described below nelm number of elements mask output mask OUTRES nItems number of element records 7 VOL not included ptrELM pointer to element equivalence table ptrERS pointer to element record sizes rCER h pointer to constant element records rESL h pointer to element index nRF number of reaction forces trRF h pointer to reaction forces rs are relative to ptrELD Total size of each element record LONGINT Element equivalence table This table equates the order number used to the actual element number Sizes of the nItem element results sets for each element Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 33 Chapter 1 Format of Binary Data Files c CER int 5 ptrVOL ptrEPT ptrEUL 0 0 e above pointers are relative to ptrCER e
158. 2 8 EDDRELAX Command The EDDRELAX command activates initialization to a prescribed geometry or dynamic relaxation for the explicit analysis The command format in Jobname CDB is EDDRELAX R5 4 Option NRCYCK IRELAL EDTTL DRTOL DFFCTR DRTERM TSSFDR Option EDDRELAX command option Valid options are ANSYS relaxation is based on the implicit analysis see the EDDRELAX command in the Command Reference or DYNA where the relaxation parameters are controlled within the LS DYNA analysis The following arguments are valid for Opt ion DYNA only NRCYCK The number of iterations between the convergence checks IRELAL Automatic control based on Papadrakakis not active 0 or active 1 EDTTL The convergence tolerance when automatic control is used DRTOL The convergence tolerance DFFCTR The dynamic relaxation factor Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 77 Chapter 3 The CDWRITE CDB File Format DRTERM The termination time for dynamic relaxation TSSFDR The scale factor for each computed time step NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 9 EDLCS Command The EDLCS command is used to define a local coordinate system for explicit dynamics The command format in Jobname CDB is
159. 288 and PIPE289 The userPartVelAcc subroutine works with the following subroutines userPartVelAccSetup which initializes the data for use by userPartVelAcc and userWavHt which calculates the wave height for a user defined wave For your convenience three I O service subroutines are called by the userPartVelAcc subroutine wvhybl wvargu and wavHtSec all described below deck userPartVelAcc USERDISTRIB parallel subroutine userPartVelAcc elemId secId xyzg doIns depth denswat x pCur watcur nw watwav timval x argu eta vXyz axyz ar pdynam phead primary function compute particle velocities and accelerations due to waves and current secondary function compute dynamic pressures copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information input arguments elemId int sc in element id secld int sc in section id of element xyzg dp ar 3 in coordinates of point of interest doIns dp sc in outside diameter with insulation depth dp sc in water depth denswat dp sc in water density pCcur int sc in pointer in current table i e first item is at watcur pCur 1 watcur dp ar in water current table nw dp sc in number of wave components watwav dp ar in water wave table timval dp sc in current time value output arguments While the below 7 arguments are output they can also be use
160. 3 2133 EN COMMANG seneni E T 81 32 44 LOCAL Commnard reor AN eorr eoe etea Coe eeee edere ree epa e voe vete v eoe dace tudedoneetesddenteess 81 3 2 15 2 M Gomnmandd o oerte edet ote eesectee vana Peres edet ese so Seven OA N OAREN 82 32 16 MPDATA Command RA este fees eesdeseeci as daw epe a ee Paesi ee ducbachiaeees 82 3 2 17 MPTEMP Command i eec ee Rt eet i er eis esed e Isis 82 3 2 18 N Comlmandqd ice etr taedet be He e S 82 3 2 19 NBEOCK Comtnahd uuo rere Ert het eue ren reete eec saveetobavedle Meetedlerdhardecatusaceonsbay eue stbe 83 3 220 R GOMMANG zs ico tree crt tre e ree Eee Te eed voee EAE e ERR TER AAEE 84 3 2 21 REBEOCK Command t e Rete eei eese rae a aede eus 84 3 2 22 SECBELOCK Cominand teer rer eee rr eder n een eau eel ne ese eua reed 85 3 2 23 SFBEAM Comimalid eoe ce eres tope eere ee arbore aede vees ee oet ee e dea tete ao ue eoe edet runs de A AEE 85 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Programmer s Manual for Mechanical APDL 3 2 24 SFE COMMANG 86 4 ANSYS Graphics File Format reete eee aeree E Ce ie Re ERE Y d eei e aeree d areae d aee na 87 4 1 Pixmap Format for Graphic Display Files ccccccccssssssnnccccceeseeessneeeceeeeceseeesenseeeeeeeeseeeeenaaes 87 4 2 Neutral Graphi
161. 4 demonstrates gettting a c list of nodes attached to a keypoint line or area Q qa MATA AA A A c kk VS in ou copyright c 2006 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information Fe RR AK kk CkCk kk KC kk Ck kk Ck Ck Kk e kk A kk Ck Ck Kk Ck kk Ck kk Fe e Kk II e e e e KC KK see user01 for additional information on user routines Fe RR AK kk CkCk kk KC kk Ck kk Ck Ck Kk KC kk KC kk kk Kk KC kk ko ko kk ke kk kc ko kk IK k k k k k k k put arguments none tput arguments user04 int sc out result code should be zero which is ignored for now ck ck ck ck ck ck ck ck ck ck ck ck ck ok ck ck kk kk kk kk kk kk ke kk kk kk kk kk kk kk kk ko ko ko ko ko kock ck k ck kc kc kc kckok Functions for accessing data on the command line integer function intinfun iField gets an integer from field iField double precision function dpinfun iField gets double precision character 4 ch4infun iField gets upper case 4 characters character 8 ch8infun iField gets mixed case 8 characters character 32 ch32infun iField gets mixed case 32 characters kkkkkxkxkxkxkkkxkkkxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxkkkkkkkkkkkkkk include impcom inc include ansysdef inc TATA AA 2010 2020 external wrinqr ndkpnt ndline ndarea ch4infun intinfun integer wringr ndkpnt ndline ndarea intinfun character 4 ch4infun integer user04
162. 5009 OV Oh 1 TOTO 200 4 ll relative starting loc for each set 4 structural svrs 5 thermal electric fluid svrs 6 magnetic svrs 7 nonlinear svrs 8 plasticity svrs 9 creep svrs 10 coupled svrs ll user svrs 12 initial strain svrs 13 section data after FiberSIM conversion shell181 only 14 20 spares 6 2 3 Subroutine svrget Fetching Saved Variable Data for an Element deck svrget subroutine svrget C primary function svindx nset get svr data set for an element nsvr svr c Notice This file contains ANSYS Confidential information c input arguments c svindx int ar 20 in index for svr for this element see svgidx c nset int sc in the set number in this index e l structural svrs 2 thermal electric fluid svrs e 3 magnetic svrs c 4 nonlinear svrs e 5 plasticity svrs e 6 creep svrs c 7 coupled svrs e 8 user svrs e 9 initial stress svrs 2 42 82 45 92 95 only e 10 section data after FiberSIM conversion G shelll181 only c 11 17 spares note that the first three c items in svindx are not available c nsvr int sc inout number of dp words expected in this set C output arguments c nsvr int sc inout Cc Svr dp ar nsvr in number of dp words in this set data in this set 6 2 4 Subroutine svrput Writing an Element s Saved Variable Set deck svrput subroutine svrput c primary function svind
163. 55 AUX2 process 55 basic element pass debugging 110 Beam cross sections reading 85 Binary files accessing 53 characteristics of 54 closing or deleting a blocked binary file 61 Converting Two Integers into a Pointer 61 copying contents 63 opening a blocked binary file 57 viewing contents 55 binclo subroutine 61 binhed subroutine 58 binini subroutine 55 biniqr function 56 binlib library 53 binrd8 subroutine 59 binset function 57 bintfo subroutine 57 bintrd subroutine 62 bintst program 62 bintwr subroutine 63 binwrt8 subroutine 59 Buffered binary I O systems initializing 55 Buffered file reading data from 59 writing data to 59 C C 99 101 Fortran shell for 101 c extension 104 calculating rotation caused by internal pressure 183 Calculating dot product of two vectors 291 dot product of two vectors with increments 291 sum of vector components 291 CDWRITE using the command 71 CE 73 ceget 232 ceinqr 232 ceput 233 cesel 233 Character string converting to integer string 60 Characters retrieved from a double precision variable 285 CMBLOCK 74 cmopt common block 205 cmopt inc file 102 cnvget subroutine 148 COMBIN7 and COMBIN37 parameters 151 commands creating 194 common blocks 102 cmopt 205 component entities defining 74 constitutive material models creating 156 Constraint equation defining constant term in 73 Constraint equations deleting or selecting 233 get
164. 6 GXY 7 GYZ 8 GXZ 9 ALPX 10 ALPY 11 ALPZ 12 DENS 13 MU 14 DAMP 15 KXX 16 KYY 17 KZZ 18 RSVX 19 RSVY 20 RSVZ 21 C 22 HF 23 VISC 24 EMIS 25 ENTH 26 LSST 27 PRXY 28 PRYZ 29 PRXZ 30 MURX 31 MURY 32 MURZ 33 PERX 34 PERY 35 PERZ 36 MGXX 37 MGYY 38 MGZZ 39 EGXX 40 EGYY 41 EGZZ 42 SBKX 43 SBKY 44 SBKZ 45 SONC 46 SLIM 47 ELIM 48 USR1 49 USR2 50 USR3 51 USR4 51 FLUI 53 ORTH 54 CABL 55 RIGI 56 HGLS 57 BM 58 QRAT 59 REFT 60 CTEX 61 CTEY 62 CTEZ 63 THSX 64 THSY 65 THSZ 66 DMPR 67 LSSM 68 69 79 i 72 73 74 75 76 77 78 79 80 see mpinit for uncommented code see chapter 2 of the elements volume of the user s manual for a detailed description c tem dp sc in temperature at which to evaluate material c n int sc in number of properties to be evaluated 20 maximum c If n 1 use propel instead c output arguments c prop dp ar n out values of material property c mpg propev lt elll7 el53 elofrm gtprop el96 evaluate material properties 138 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information oi Inc and its subsidiaries and affiliates f ANSYS d its subsidiari d affili 6 2 13 Subroutine tbuser Retrieving User Table Data 6 2 11 Subroutine prope Evaluating One Material Property deck propel subroutine propel iel mtr icon tem propl primary functio
165. 6 e197 write nmisc db e input arguments c elem int sc in element number c ielc int ar IELCSZ in element characteristic vector c defined in elccmt c lcerstL LONG sc inout pointer to results file position c edindxL LONG ar NUMELEDATASETS inout index to results file data c nudb in sc inout size of what the user wants to add c udbdat dp ar in what the user wants to add c nval int sc in the total number of values to e be output does not include nudb e this should always be ielc NMNMIS e unless there is a variable number as e in the layered shell elements c value dp ar ndval in output values c ndval int sc in dimension of value must be no less than e e e 6 2 25 Subroutine trrot Computing the Rotation Vector deck trrot subroutine trrot tr rot primary function get the rotation vector from a transformation matrix Notice This file contains ANSYS Confidential information input arguments tr dp ar 3 3 in transformation matrix output arguments rot dp ar 3 out rotation vector Q0Q0n0n0n0n0n0nnon 6 2 26 Subroutine rottr Computing the Transformation Matrix deck rottr subroutine rottr rot tr c primary function compute transformation matrix from rotation vector c Notice This file contains ANSYS Confidential information es c ref old eqn 20 transposed rankin and brogan jpvt 108 1986 165 174 c ref
166. 64 C output arguments le a dp ar na na inout resulting matrix G still square nnew x nnew and symmetric e e 8 4 10 tran Subroutine Transposing a matrix deck tran subroutine tran zs tr nz ntr nrow irot c primary function perform tr transpose zs Cr AJ d Xx e c Notice This file contains ANSYS Confidential information c input arguments c variable typ siz intent description c zs dp ar nz nz inout matrix to be transformed c tr dp ar ntr ntr in transformation matrix ol nz int sc in dimensioned size of zs matrix c ntr int sc in dimensioned size of tr matrix c nrow int sc in number of rows of zs matrix to transform c irot int sc in block size to transform size of tr matrix C output arguments c variable typ siz intent description ol ZS dp ar nz nz inout transformed matrix 8 4 11 symeqn Subroutine Solving Simultaneous Linear Equations deck symeqn function symeqn a nd n nc defFlag c c primary function solve a set of simultaneous linear equations e c secondary functions invert a matrix e e NOTE this routine assumes that the matrix to be solved or c inverted is positive or negative definite This routine c also assumes that the diagonals are all non zero If c this assumption is not true use isimeq F c c Notice This file contains ANSYS Confidential information c c input arguments c variable typ siz intent description c a dp ar nd
167. 9 SAS IP Inc All rights reserved Contains proprietary and confidential information 80 of ANSYS Inc and its subsidiaries and affiliates 3 2 14 LOCAL Command EXPS The exponent for weld shear force EXPF The effective plastic strain at ductile failure TFAIL The time of failure of the weld NSW The number of spotwelds for the generalized weld CID The coordinate system ID as defined by the EDLCS command NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 13 EN Command The EN command is used to define an element If an element contains more than eight nodes the EN command is repeated until all nodes are defined The command format in Jobname CDB is EN R5 5 Type NUMN I1 I2 I3 14 15 16 17 I8 The type of data to be defined Valid labels are ATTR read in element attributes and NODE read in nodes defining the element NUMN The number of nodes T1 12 13 1415 16 17 18 The integer values to be read f Type is ATTR the integer values are the element attributes Attributes are in the order NUMN MAT TYPE REAL SECNUM ESYS NUMELEM SOLID DEATH EXCLUDE f Type is NODE the integer values are the node numbers 3 2 14 LOCAL Command The LOCAL command defines a local coordinate system The command format in Jobname CDB is LOCAL R5 0 Type NCSY CSYTYP VALI1 VAL2 VAL3 Type The type of
168. ANSYS Inc and its subsidiaries and affiliates 8 3 19 vmult1 Subroutine Multiplying a Vector by a Constant 8 3 16 vamb Subroutine Gets a Third Vector by Subtracting One Vector from Another deck vamb subroutine vamb a b c n C primary function subtract vector b from vector a to get vector c c Notice This file contains ANSYS Confidential information c input arguments c a dp ar n in vector a c b dp ar n in vector b e n int sc in length of vectors a b c C output arguments a G dp ar n out vector c o c mpg C A B vector substruct co 8 3 17 vamb1 Subroutine Subtracting One Vector from Another deck vamb1 subroutine vambl a b n c primary function subtract vector b from vector a and save in vector a c Notice This file contains ANSYS Confidential information c input arguments G a dp ar n inout a vector b dp ar n in b vector e n int sc in length of vectors a b C output arguments e a dp ar n inout a vector ral c mpg A A B vector substruct e 8 3 18 vmult Subroutine Multiplying a Vector by a Constant deck vmult subroutine vmult vl v2 n const c primary function multiply a vector by a constant c Notice This file contains ANSYS Confidential information c input arguments e v1 dp ar n in vector vl s n int sc in length of vectors vl v2 c const dp sc in constant to multi
169. AXRECLENG key as to information needed about the node return select status node is undefined node is unselected node is selected return number of defined nodes return number of selected nodes return highest node number defined return maximum record length dp words 2 return length dp words 3 4 pointer to first data word 11 return void percent integer 17 pointer to start of index 2 superelement flag 3 master dof bit pattern 4 active dof bit pattern 5 solid model attachment pack nodal line parametric value 7 constraint bit pattern 8 force bit pattern 9 body force bit pattern 10 internal node flag 11 orientation node flag 1 is 0 isnot 11 contact node flag lt 0 12 constraint bit pattern for DSYM 13 if dof constraint written to file k for LSDYNA only 14 nodal coordinate system number set by NROTATE 101 pointer 102 pointer 103 104 pointer 105 pointer 106 pointer 107 pointer 108 pointer 109 pointer 110 111 112 pointer 113 pointer 114 115 pointer 116 Q0000000000000000nn0n0nn0n0nn0nnonooooaooaoaoaoaoaoaoaoaoaoaoaoaooooooooonononon ll o Q output arguments ndingr int func out a to to to to to to to to to to to node data record angle record attached couplings attacted constraint equations nodal stresses specified dis
170. Advanced Analysis Techniques Guide 6 10 1 Linking a Custom Optimization Program to ANSYS If you are performing iterative analyses for design optimization and you wish to use the standard ANSYS optimizer you simply choose GUI path Main Menu gt Design Opt or issue the ANSYS command OPT However if you plan to use an optimization subroutine of your own design you must do the following 204 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 10 2 Subroutine userop Defining a Custom Optimization Subroutine 1 Define parameters for your external optimization subroutine using either the OPUSER command or GUI path Main Menu gt Design Opt gt Method Tool For more information about OPUSER see the Command Reference 2 Either issue the OPTYPE USER command or choose menu path Main Menu gt Design Opt gt Method Tool and specify User Optimizer 3 Issue the OPEXE command or choose GUI path Main Menu gt Design Opt gt Run Issuing the OPTYPE USER command or its GUI equivalent instructs the ANSYS program to bypass the standard ANSYS design optimizer logic and instead execute your custom optimization subroutine The userop subroutine below includes a flow chart showing how a user defined optimization subroutine interacts with the ANSYS program It also contains a commented example that shows you sample ANSYS command input for
171. B 7 7 47 efxput Subroutine Storing an Element s Fluxes deck efxput subroutine efxput ielem nval value C primary function Store nodal fluxes at an element c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c nval int sc in the total number of values e ndir nnod nscalr value dp ar nval in the flux values c output arguments none 276 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 7 50 elfget Function Getting an Element Local Force Note If a coupled field a set of fluxes is stored in the following order as available fluid thermal electric magnetic qgqaaqa 7 7 48 efxdel Subroutine Deleting Element Fluxes deck efxdel subroutine efxdel ielem C primary function delete element nodal fluxes c Notice This file contains ANSYS Confidential information e input arguments o ielem int sc in element number e 0 delete for all defined elements G output arguments none 7 7 49 elfiqr Function Getting Information About Element Local Forces deck elfiqr function elfigqr ielem key C primary function get information about elem local forces c Notice This file contains ANSYS Confidential information input arguments ielem int sc in element numbe
172. BAC ptrELMl ptrFSTl ptrLSTl ptrBITl ptrEHDl ptrIDXl ptrendH ptrendL fun02 nume numdof lenu lenbac maxn 0 0 nodref lumpm kygst kygm kycd kygss kygaf kygrf oOo fo ptrELM ptrFST ptrLST ptrBIT ptrEHD ptrlIDX each item in header is described below unit number emat file is 2 number of elements number of dofs per node total DOFs of model number of nodes maximum node number position not used position not used actual number of nodes referenced lumped mass key glo calculate key glo calculate key glo LO 0 0 default matrix type lumped bal stiffness matrix calculate do not calculate calculate bal mass matrix calculate key do not calculate calculate bal damping matrix calculate key do not calculate calculate bal stress stiffening matrix do not calculate calculate bal applied force vector do not calculate calculate bal restoring force vector calculate key Newton Raphson only 0 do not calculate calculate position not used position not used position not used position not used ig ig DOF ig DOF ig ig ig hpointer to element equivalence table h pointer to first element at a table h pointer to last element at a table h pointer to dof bits h pointer to the start of the element matrices h pointer to element matrices Release 12 0 2009 SAS
173. Binary Data Files CY OX Qc a Qe o IQ da 0c x A CY Qa Qr oso Q Q CY Gs eoo ooo ome Qu QS Qr Qe oa ooo Q CY OX N A Q GY QE Qc xo QU Queso EXA EXT dp DENS 1 LMD4 9 EMD6 17 YPLU 25 KKKKKKKKKKKKKKKKKKKKKKKKKKK 29 32 are spares numRotCmp number of rotating components ptrRCM pointer to RCM nNodStr O0 1 one set 2 two sets 3 three sets TOP no nodal component stresses for shells TOP BOT for shells TOP BOT MID ptrNODSTR pointer to nodal component str AvailData bits indicating available data in this data set Note ptrXXX are relative 1 100 timfrq lfacto lfactn cptime tstep tunif tbulk volbase See resucm inc to ptrDSI Solution header double precision data tref Oy velocity acceleration center of gravity terms if pmeth 0 if pmeth 1 positions 31 100 positions 11 28 load data ht positions 51 100 p convergence values each item is described below time value or for a modal or the old load timfrq lfacto values the new load lfactmn cptime tref Cunt c tbulk Bulk temp for F VolBase Initial total tstep Time Step size 0 0 lits 14 16 1j 459 20 22 positions positions positions positions elapsed cpu time the reference temperature the uniform temperature frequency value harmonic analysis factor used in ramping a load between old and new fac
174. CTEZ 63 THSX 64 c THSY 65 THSZ 66 DMPR 67 LSSM 68 69 79 71 72 c 73 74 75 76 77 78 79 80 c 226 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 3 13 rlinqr Function Getting Information About a Real Constant Set c see mpinit for uncommented code and TB command information c ntab int sc in number of entries in the table a L to 100 o tem dp ar ntab in temperature vector ascending o prp dp ar ntab in property vector c output arguments as none 7 3 12 mpdel Subroutine Deleting a Material Property Table deck mpdel subroutine mpdel mat iprop c primary function delete materi c Notice This file contains ANSYS input arguments mat int sc in ma iprop int sc in pr MP command labels EX l EY 2 EZ 3 NUXY GXZ 9 ALPX 10 ALPY 11 ALPZ KYY 17 KZZ 18 RSVX 19 RSVY EMIS 25 ENTH 26 LSST 27 PRXY MURZ 33 PERX 34 PERY 35 PERZ EGYY 41 EGZZ 42 SBKX 43 SBKY USR1 49 USR2 50 USR3 51 USR4 HGLS 57 BM 58 QRAT 59 REFT 73 74 75 qQqgqaqaqagqagqagqagqagaagaaaAAAAA A see mpinit for uncommen G output arguments none 7 3 13 rlinqr Function Getting Information About a Real Constant Set deck rlingr function rlingr nreal key c primary function get informati c secondary functions none
175. CURR 26 KKKKKKKKK 27 32 are spares KKKKKKKKKKKKKKKKKKKKKKKKK e curdof i i 1 numdof Qu i 1 lenbac Nodal equivalence table This table equates Cc the number used for storage to the actual C node number Cc Back i i 1 lenbac c NOTE The next five records are repeated as a group negn times c When the matrices get written one row of each matrix is written to the file e at a time i e the first row of each matrix is written then the second row c of each matrix etc this pattern continues until all the rows of each el matrix have been written to the file If kan 3 the matrix rows will be c complex valued otherwise they will be double precision values c IDX a 1 varies Matrix row indices The first e item signifies what term in the row belongs el to the pivot The second term signifies what c DOF is being eliminated and the remaining c items signify the new DOFs being introduced e if any The length of this record will Cc vary actual length is returned from routine 46 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 9 2 FULL File Format Q qgqaaqaaqaa Q qaaaa qaqaaqaaa qaqaaqaaqaaa qa qaqaaa qaaaa qgqaaqaaqaaaa qa qaaaa qaaaa qaqaaa een i 1 varies ER dp cmp 1 varies eue dp cmp 1 varies San dp cmp 1 varies BINRD8 111 i i 1 m A second level of indexing for
176. Cartesian co ordinates Current deformed coordin ates of element nodes Values in global Cartesian co ordinate system equal to xRef when nlgeom off Element coding Element coding At FE model creation ANSYS code TotValDofs Total values of DOFs displace ments for structural analysis Values in global Cartesian co ordinate system Element coding ANSYS code IncValDofs Increment values of DOFs oc curring at the current substeps Values in global Cartesian co ordinate system Element coding ANSYS code ItrValDofs Iteration values of DOFs occur ring at the last iteration Values in global Cartesian co ordinate system Element coding ANSYS code First time derivatives of DOFs Velocities ANSYS code Second time derivatives of DOFs Accelerations ANSYS code Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 119 Chapter 6 UPF Subroutines and Functions Key indicating first time enter Initializing data ANSYS code ing the element subroutine 1 First time 0 Other than first time Flag indicating whether large Element coding NLGEOM displacement deformation is in command effect Newton Raphson algorithm Output key Element coding 1 Any nonlinear analysis 0 Pure linear analysis Key indicating output result Elem
177. Currently all node boundary flags appear as Os in a cell mesh file Because all node boundary flags are 0 SECBLOCK ignores them when it reads a cell mesh file Sample User Section Cell Mesh File Following is a sample excerpt from a custom section mesh file for a section with 27 nodes 4 cells and 9 nodes per cell First Line 27 4 Cells Section 1 3 12 9 2 6 10 4 5 2 7 9 23 21 8 16 22 14 15 1 9 11 25 23 10 18 24 16 17 1 11 13 27 25 12 20 26 18 19 i Nodes Sec e Hon 0 0 0 0 0 lon 0 0 025 0 0 0 0 05 0 0 0 5 0175 0 0 0 19 98 10 00 0 20 00 10 00 3 2 23 SFEBEAM Command The SFBEAM command defines a surface load on selected beam elements Remaining values associated with this specification are on a new input line with a 4116 9 format The command format in Jobname CDB is SFBEAM ELEM LKEY Lab R5 0 DIOFFST DJOFFST ELEM The element number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 85 Chapter 3 The CDWRITE CDB File Format LKEY The load key associated with these surface loads Lab A label indicating the type of surface load PRES for pressure is the only valid label DIOFFST Offset distance from node I DJOFFST Offset distance from node J 3 2 24 SFE Command The SFE command defines a surface load Values associated with this specification are on a new input line with a 4f16 9 format T
178. E NESES 34 1 7 Description of the Substructure Matrices File ssssesesesesesesesesssesssssssesssssesssesesssesssesssessssseses 38 1 7 1 Standard ANSYS File Header ccccccccccesssssssseeceeceeeseeesnneceeeecesseeeeeaeeeeeeeeeeeeesnnaeeeeeeeess 38 1 2 2 SUB File Foltriat ore rere t A EA EE A E E URS ERE Ue a 38 1 8 Description of the Component Mode Synthesis Matrices CMS File cccccccccsseesssttteeeeeeeeeeees 43 1 8 1 Standard ANSYS File Header ccccccccccsssssssnnecececeeeseeesnnnacecccceesseeeeaeeeeeceseseeesnnaaeeeeeeeess 43 1 8 2 CMS File Format 2 tro ceto eee pedes nero eaae ea e oce evade eei e teo M ER SORTE gcc us 43 1 9 Description of the Full Stiffness Mass File 0 0 0 0 cceccsssssssecccccccesssesneeeeeeeceseeeesneeeeeeseseseeensnaeess 44 1 9 1 Standard ANSYS File Header cccccccccccssssessnscecceceeesseesneneceeeeeeesseeseaeeeeeeeeeeeeesnnaaeeeeeseess 44 1 9 2 FULL File FOttriat 5 eei eie reca ch estie e nre tanen etra teet aout are Foie enaa ERa eaaa 44 2 Accessing Binary Data Files iter recor a Ve UD RR XE EREE EHE PH EA HEU EE p ER PPAR VIRES 53 2 1 Accessing ANSYS Bitiary Files souscrit Coo PX Verba s dera abi xke dier b PX PER Rete a ER 53 2 1 1 Access Routines to Results Substructure and Matrix Files eeeee 53 2 1 2 Characteristics of ANSYS Binary Files a acre tape Ua pepe vp tpa dar t p p pen d gen 54 2 1 3 Viewing Binary File Conte
179. EGER C16Label For double precision numbers pdArray fAnsMemAlloc dleng MEM DOUBLE C16Label For complex numbers pcArray fAnsMemAlloc cleng MEM COMPLEX Cl6Label For real numbers prArray fAnsMemAlloc rleng MEM REAL C16Label Where the arguments are Xleng is the desired size of the array MEM xxx is the keyword indicating the type of data Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 208 of ANSYS Inc and its subsidiaries and affiliates 6 11 3 Subroutine fAnsMemFree Deallocating Space C16Label is a character 16 name of the memory block You must include the ansysdef inc include file to get the parameter values of MEM INTEGER MEM_DOUBLE MEM_COMPLEX and MEM_REAL Note If there is insufficient memory fAnsMemAlloc returns PTRFTNNULL 4 Use the arrays 5 Deallocate the space using the fAnsMemF ree subroutine as follows call fAnsMemFree piArray The next two sections provide input and output listings for the memory management subroutines For an example see Function user03 Demonstrates Using ANSYS Memory p 196 which appears earlier in this chapter 6 11 2 Function fAnsMemaAlloc Allocating Space and Returning a Pointer deck fAnsMemAlloc function fAnsMemAlloc iLen key cl6Label c primary function Get A Block of Space from mem manager and Return Pointer C keywords integer function for mem allocate
180. ERVIEW OF the ROUTINES ertt eret roh eoe do ee eee aane eue fo re deae ER 65 2 3 2 ResRdBegin Opening the File and Retrieving Global Information sse 66 2 3 3 ResRdGeomBegin Retrieving Global Geometry Information eeeeeeeeeeee 67 2 3 4 ResRdType Retrieving Element Types eese esee eee eene enne nne nennen nnne 67 2 3 5 ResRdReal Retrieving Real Constants cceeeessssecceceeceeseessnaceeeeeceeseeesneeeeeeeeeeeeeessnaeess 67 2 3 6 ResRdCsys Retrieving Coordinate Systems eesessseeeeeeeeeeeeee eene 67 2 3 7 ResRdNode Retrieving Nodal Coordinates c ccccccccccessssssnccececeessesesneeeeeeeeeeeeesnnaeess 68 2 3 8 ResRdElem Retrieving Elements ccccccccccssssssssecceccceseeessneceeeeceesseeseneeeeeeeseeeeesenaaes 68 2 3 9 ResRdSolBegin Retrieving Result Set Location ccsscccccccecessesseneeceeceesseeseneeeeeeeeeeseees 68 2 3 10 ResRaDisp Retrieving Nodal Solution sees eene enne 69 2 3 11 ResRdRfor Retrieving Reaction Solution ccsessscccccceeseeesnnceeeceeceeseeseaeeeeeeeeseeensnaaes 69 2 3 12 ResRdFix Retrieving Applied Nodal Constraints cccccccsssssstececceeeesseesnneeeeeeeeeseeeeees 69 2 3 13 ResRdForc Retrieving Applied Nodal Loads Solution eese 69 2 3 14 ResRdEstr Retrieving Element Solutions 0 eeceeeseecc
181. Eeqv equivalent stress and strain respectively Q00000000n20000000n200000000000n0000n0nnn 6 1 2 2 Subroutine ElemGetMat Calling the ANSYS Standard Structural Material Lib rary The ElemGetMat subroutine is the API to the ANSYS materials When you issue the USRELEM command after setting the command s KEYANSMAT argument the subroutine accesses the ANSYS standard structural material library It allows you to focus on the kinematic portion of element formulation while ANSYS handles the material part of the formulation When calling the subroutine input the associated material data via the standard method There is no need to access this subroutine only to call it The following table shows the input and output arguments and their definition and usage Argument Input I or Definition Purpose How Defined Output O elld Element number Output At FE model creation matid Material number Output information At FE model Getting material data creation nDim Number of dimensions of ele Material calculation At FE model ment geometry creation 2 2 D element geometry 3 3 D element geometry Specifying the size of the nodal coordinates nTens Number of stress strain tensor Specifying the data UserElem components size subroutine Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 125 Chap
182. Element Nonlinear Tables 7 7 60 ecddel Subroutine Deleting Element Current Densities deck ecddel subroutine ecddel ielem c primary function delete element current densities c Notice This file contains ANSYS Confidential information e input arguments o ielem int sc in element number e 0 delete for all defined elements G output arguments none 7 7 61 enliqr Function Getting Information About Element Nonlinear Tables deck enliqr function enligr ielem key C primary function get information about element nonlinear tables c Notice This file contains ANSYS Confidential information e input arguments ielem int sc in element number or zero see below c key int sc in key as to the information needed e 1 return info about element nonlinear tables c ielem 0 return number of nonlinear tables for e this element c record length c 0 return maximum number of nonlinear c tables for any element c max record length c DB NUMDEFINED return the number of element nonlinear e tables defined in model c output arguments c enliqr int func out the returned value of enligr is based on e setting of key 7 7 62 enlget Function Getting Element Nonlinear Tables deck enlget function enlget ielem value C primary function get element nonlinear tables c Notice This file contains ANSYS Confidential information e input argu
183. Fictive USERSDISTRIB OOOO OOOO OOOO 0 0 70 70 70 OO 0 70 0 0 O O O subroutine UsrFictive tref toffst tem ftl veinpt ftc primary function allow users to write their own fictive temperature relationship this logic is accessed with c5 11 on the tb evisc table secondary function demonstrate the use of a user written fictive temperature relationship this routine could also be used to modify the viscoelastic data during solution i e to make the viscoelastic coefficients themselves time dependent notice this routine contains ansys inc confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc input arguments variable type sze intent description tref dp sc in reference temperature toffst dp sc in temperature offset from absolute zero tem dp sc in temperature at the end of this substep ftl dp sc in previous fictive temperature veinpt dp ar 95 inout table from tb evisc output arguments variable type sze intent description veinpt dp ar 95 inout table from tb evisc ftc dp sc in fictive temperature 6 3 7 Subroutine Us Surf Str Captures surface stresses deck Us Surf Str USERSDISTRIB subroutine Us Surf Str elem face area temp pressure ep stress C primary function User routine to capture surface stresses e called by PLANE2 42 82 and SOLID45 92 95 Qa a Notice This file contains ANSYS Confidentia
184. IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 327 Index F F extension 104 faces convection surface information 180 fAnsMemAlloc function 208 fAnsMemFree subroutine 208 File access routines abbreviations 55 file headers 111 File status retrieving 55 Files ansyscust 105 binary accessing 53 characteristics of 54 files 104 105 START ANS 194 FILNAM 71 fordel 236 forget 235 foriqr 235 forput 236 Fortran 99 101 Full transposed matrix 298 functions miscellaneous 212 Functions vector 291 G Geometry relaxing 77 getnod 219 GetRForce function 200 GetStackDisp function 201 GFILE 87 Graphics files neutral graphics file format 88 pixmap fromat for graphic display files 87 z buffered graphics 87 H heat generation defining loads 148 hgnget subroutine 148 HOLD command 213 hyperelastic material models creating 164 l I O systems 55 imove function 292 impcom inc file 102 files Anc 102 inc extension 102 include files 102 inexc4 subroutine 60 Initializing paging space 57 Integer string converting to character string 60 Interpolation 289 intrp subroutine 289 izero function 292 J Jobname cdb defining 79 L large data files 111 largelntGet subroutine 61 lastv function 292 Libraries 53 linking UPFs to ANSYS 99 103 load data getting from analysis res
185. ISO PLASTIC to define the plastic behavior of materials Creep and plastic strain will be cal culated simultaneously when both creep and plasticity are defined for a material Through this subroutine you can specify a uniaxial creep law that will be generalized to the multi axial state by the general time dependent viscoplastic material formulation implemented in ANSYS You can use and update internal state variables in the subroutine The number of state variables has to be defined by TB STATE Please see the TB command description for more information deck usercreep USERSDISTRIB SUBROUTINE usercreep impflg ldstep isubst matId elemId amp kDInPt kLayer kSecPt nstatv nprop amp prop time dtime temp dtemp amp toffst Ustatev creqv pres seqv amp delcr dcrda CRRKKKKKKKKKKKKKKKKKKKK KKK Ck Ck KKK KKK KKK KKK KKK KK KKK ck kckckckck ck ck KKK KKK KKK KKK KK KKK primary function Define creep laws when creep table options are TB CREEP with TBOPT 100 Demonstrate how to implement usercreep subroutine Creep equation is dotcreq k0 seqv n creqv m exp b T seqv is equivalent effective stress Von Mises stress creqv is equivalent effective creep strain T is the temperature k0 m n b are materials constants Le tam haar haa fam hau aan au GE OQ d Qoo This model corresponds to primary creep function TBOPT 1 Release 12 0 2009 SAS IP I
186. ISTRIB subroutine UElMatx elem nr ls zs zsc uelm ielc nodes x ElDofEachNode elmdat xyzang lenu c primary function User routine to access element matrices and load vectors G Needs to have USRCAL UELMATX to be accessed e Called after the call to the element routine and c before the solver c May be used to monitor and or modify the element matrices e and load vectors c copyright c 2008 SAS IP Inc All rights reserved c ansys inc c typ int dp log chr dcp siz sc ar n intent in out inout c input arguments c variable typ siz intent description c elem int sc in User element number c nr int sc in number of rows in element matrix c ls int ar nr in Dof Index vector for this element matrix c zs dp ar nr nr 4 inout K M C SS matrices for this element c ZSC dp ar nr 2 inout Element load vector and N R correction vec c uelm dp ar nr 5 in Nodal displacements for this element c ielc int ar in Element type characteristics c nodes int ar in Nodes for this element c ElDofEachNode int ar nr in list of dofs for each node in Global c elmdat int ar 10 in Element data for this element c xyzang dp ar 6 in X Y Z2 THXY THYZ THZX for each element node c lenu int sc in Length of global displacement vector C output arguments c zs dp ar nr nr 4 inout K M C SS matrices for this element c ZSC dp ar nr 2 inout Element load vector and N R correction vec c WARNING any CHANGES to t
187. In arg 1 If ctype 1 arg 2 then this value would be a packed character data from the chtodp Ansys function output arguments kerr int sc out error flag 0 ok 1 error kerr is an integer error flag that is returned to the calling subroutine Any non zero number would indicate an error was detected in subroutine pardef mpg pardef lt parstore pardim ntableget rdsset lt rdmac lt rdcmd define param Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 211 Chapter 6 UPF Subroutines and Functions 6 13 Miscellaneous Useful Functions The ANSYS program has several miscellaneous functions you may find useful for working with UPFs The erhandler subroutine displays output messages notes warnings and errors The RunCommand function lets you issue an ANSYS command from within a user subroutine The GetStackDisp subroutine retrieves current displacement values The UNDO command writes an undo file at critical points as a user subroutine executes The HOLD command allows you to synchronize multiple tasks in ANSYS The TRACK command enables you to do program tracing and timing For further descriptions of erhandler and TRACK see Chapter 8 Subroutines for Users Convenience p 285 For details about the Get StackDi sp function see Function GetStackDisp Getting Current Displacement Values
188. Inc and its subsidiaries and affiliates Appendix B Creating External Commands in Windows This section describes the steps required to create external commands on Windows platforms B 1 Tasks in Creating an External Command To create a functional external command you will need to complete the following general steps Create compatible C source code Create an external definition file pro jname def Create a new project in Microsoft Developer Studio Create a shared library Create an external table file ans ext t1 listing the various shared libraries each function and the related command Setthe ANSYS EXTERNAL PATH environment variable The following sections detail each of these tasks B 1 1 Creating Compatible Code You can create your functions using any of the API functions described in Program Files MAnsys Inc V120 customize include cAnsInterface h cAnsQuery h and cAnspick h You can then execute these functions via the external command feature within ANSYS In addition ANSYS provides special commands that list all available external commands and allow you to reset all currently referenced external commands The following code segment demonstrates at a minimal level how to create functions that can be used as an entry point into a custom coded shared library The most important point in the following example is The C program interface is an integer function that has one argument a cha
189. M 47 ELIM 48 a USR1 49 USR2 50 USR3 51 USR4 51 FLUI 53 ORTH 54 CABL 55 RIGI 56 c HGLS 57 BM 58 QRAT 59 REFT 60 CTEX 61 CTEY 62 CTEZ 63 THSX 64 a THSY 65 THSZ 66 DMPR 67 LSSM 68 69 79 71 72 c 73 74 75 76 77 78 79 80 a c see mpinit for uncommented code and TB command information c output arguments c mpget int func out number of temperature values c temp dp ar mpget out vector of the temperature values c prop dp ar mpget out vector of the property values 7 3 11 mpput Subroutine Storing a Material Property Table deck mpput subroutine mpput mat iprop ntab temp prop C primary function store material property tables c Notice This file contains ANSYS Confidential information amp input arguments c mat int sc in material number e iprop int sc in property reference number c MP command labels c EX 1 EY 2 EZ 3 NUXY 4 NUYZ 5 NUXZ 6 GXY 7 GYZ 8 c GXZ 9 ALPX 10 ALPY 11 ALPZ 12 DENS 13 MU 14 DAMP 15 KXX 16 KYY 17 KZZ 18 RSVX 19 RSVY 20 RSVZ 21 C 22 HF 23 VISC 24 c EMIS 25 ENTH 26 LSST 27 PRXY 28 PRYZ 29 PRXZ 30 MURX 31 MURY 32 c MURZ 33 PERX 34 PERY 35 PERZ 36 MGXX 37 MGYY 38 MGZZ 39 EGXX 40 c EGYY 41 EGZZ 42 SBKX 43 SBKY 44 SBKZ 45 SONC 46 SLIM 47 ELIM 48 G USR1 49 USR2 50 USR3 51 USR4 51 FLUI 53 ORTH 54 CABL 55 RIGI 56 c HGLS 57 BM 58 QRAT 59 REFT 60 CTEX 61 CTEY 62
190. MATRICES 8 nmrow nmatrx nedge numdof maxn wfmax lenbac nnod kunsym kstf kmass kdamp kss nvect nWorkL lenUl sesort lenlst ptrLodL ntrans ptrMtx ptrXFM ptrHED namel name2 0 0 name3 name4 ptrDOF ptrDST ptrBAC ptrTIT ptrNOD ptrXYZ ptrEDG ptrGDF thsubs ptrPOS ptrORG stfmax ptrLodH nmodes keydim cmsMethod name5 name6 name7 name8 nvnodes ptrCTXM nWorkH ptrCG 0 0 0 0 0 0 HED i 1 60 SUB FILE HEADER SPARSE MATRICES 9 nEqn nmatrx numdof maxn lenbac nnod kunsym kstf kmass kdamp nvect nTermL A ptrLodL ptrMtxL ptrHED namel name2 name3 name4 ptrDOF ptrBAC ptrTIT ptrNOD ptrXYZ F thsubs r Stfmax ptrLodH F F name5 name6 name7 names nTermH ptrMtxH ptrColL ptrColH ptrCofL ptrCofH 0 0 each item in header is described below fun08 unit number full sub file is 8 sparse substructure file is 9 nmrow number of rows in matrices also number of dofs in substructure nmatrx number of matrices on file nedge number of edges for outline numdof number of dofs per node Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 39 Chapter 1 Format of Binary Data Files maxn maximum node number of complete model presently in database wfmax maximum wavefront of substruct during generati
191. Manual for ANSYS provides information about the various programming interfaces available to customers This manual assumes that you have at least a basic knowledge of programming a working knowledge of Fortran would be very helpful The two part manual includes Part Guide to Interfacing with ANSYS This guide describes a group of utilities as well as a set of Fortran routines that you can use to directly access the ANSYS database You can also use these capabilities to access data in any of the binary files that ANSYS writes or uses Part Il Guide to ANSYS User Programmable Features ANSYS provides a set of Fortran functions and routines that are available to extend or modify the pro gram s capabilities Using these routines requires relinking the ANSYS program resulting in a custom version of ANSYS ANSYS provides an external commands capability which you can use to create shared libraries available to ANSYS either from ANSI standard C or Fortran You can use this feature to add custom extensions to ANSYS without the need to rebuild the ANSYS executable In addition you can find the ANSYS Parametric Design Language Guide as part of the ANSYS online document ation This guide was designed for ANSYS users that have some programming skills and wish to tap the power of the ANSYS Parametric Design Language APDL to increase the productivity APDL is a scripting language that is very similar to Fortran The guide describes how to define paramete
192. NSYS assembly logic command nKeyOpt Maximum number of element Element coding ANSYS code key options allowed Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 117 Chapter 6 UPF Subroutines and Functions Example If nKeyOpt 2 only KEYOPT 1 and KEYOPT 2 are allowed KeyOpt Element key options Branching the user ET command KEYOPT 1 0 99 element codes to dif ferent formulations This could be equival entto 100x 100 differ enttypes of elements temper Nodal temperatures at current Temperature depend BF and BFE time ence and thermal commands if loads keyShape is specified in the UserE lem sub routine temperB Nodal temperatures atthe end Temperature depend ANSYS code of the last substep ence and thermal loads tRef Reference temperature Temperature depend TREF com ence and thermal mand loads kTherm Key indicating whether a Element coding ase thermal load exists 1 Calculate the thermal load 0 No thermal load calcula tion nPress Number of pressure values Element coding USRELEM The size of the press command vector At FE model creation Press Pressures at nodes of element Pressure load and SF and SFE facets available only when pressure load stiffness commands keyShape is specified via the USRELEM command The pressure vect
193. Node int sc out Node number 2 3 8 ResRdElem Retrieving Elements deck ResRdElem function ResRdElem iElem nodes ElemData c primary function Read an element c object library ResRd c input arguments c iElem int sc in The element number C output arguments c ResRdElem int sc out Number of nodes e nodes int ar n out Element nodes c ElemData int ar 10 out Element information e mat material reference number c type element type number e real real constant reference number e secnum section number e esys element coordinate system c death death flag e 0 alive e 1 dead e Solidm solid model reference c shape coded shape key oi elnum element number c pexcl P Method exclude key 2 3 9 ResRdSolBegin Retrieving Result Set Location deck ResRdSolBegin function ResRdSolBegin key lstep substep ncumit kcmplx time x Title DofLab c primary function Read the solution header records c object library ResRd c input arguments c key int sc in 1 find by lstep substep c 2 find by ncumit amp 3 find by time e lstep int sc in out Load step number c substep int sc in out Substep of this load step c ncumit int sc in out Cumulative iteration number c kcmplx int sc in 0 Real solution 1 Imaginary solution c time int sc in out Current solution time C output arguments c Title ch 80 ar 5 out Title and 4 subtitles DofLab c
194. OF for this result set positions 33 64 current DOF labels for this result set positions 65 84 The third title in integer form positions 85 104 The fourth title in integer form positions 105 124 The fifth title in integer form position 125 ptrTRF pointer to FLOTRAN previous time step DOF vals position 126 trnvar dof in FLOTRAN prev time st DOF vals Note 2 old steps saved thus DP is 2 trnvar nNode position 127 numvdof number of velocity items per node ANSYS transient position 128 numadof number of acceleration items per node ANSYS transient position 131 133 position of velocity in DOF record ANSYS transient position 134 136 position of acceleration in DOF record ANSYS transient position 137 142 velocity and acceleration labels ANSYS transient position 143 number of stress items 6 or 11 a 11 indicates to use principles directly and not recompute for PSD position 144 146 position of rotational velocity in DOF record ANSYS transient position 147 149 position of rotational accel in DOF record ANSYS transient position 150 155 rotational velocity and acceleration labels ANSYS transient position 160 ptrDMI J Integral results position 161 nContours if pmeth positions 164 200 p convergence specs The DOF solution for each node in the nodal coordinate system The DOF order is the same as shown above in the DOF number reference table The n
195. OLID92 and SOLID95 deck userpl USERSDISTRIB subroutine userpl elem intpt mat ncomp kfirst kfsteg e nu dens x prop d ktform timval timinc tem dtem toffst flu dflu epel eppl x statev usvr epeq plwork sigepl sigrat depeq dt primary function allow users to write their own plasticity laws this logic is accessed with tb user the below demonstration logic is the same as using tb bkin without adaptive descent nropt off Other plasticity rules may require internal iterations and or the more general definition of plasticity theory discussed in the Theory Manual secondary function demonstrate the use of user written plasticity laws in this routine a update the nonlinear strain history b compute the material tangent matrix if requested Notice This file contains ANSYS Confidential information ansys r copyright c 2008 ansys inc input arguments variable type sze intent description elem int sc in element number label intpt int sc in element integration point number mat int sc in material reference number ncomp int sc in no of stress strain components 1 4 or 6 lI x 4 x y Z Xy 6 x y Z Xy YZ XZ kfirst int sc in 1 if first time through 0 otherwise useful for initializing state variables to a non zero value kfsteq int sc in 1 if first equilibrium iteration of a substep 0 otherwise e dp se in average elastic modulus nu dp sc in aver
196. Program ResWrDemo demonstrates how to write an ANSYS readable results file This file resides in the subdirectory Program Files Ansys Inc V120 ANSYS custom misc lt plat form gt on Windows systems or ansys_inc v120 ansys customize misc on UNIX systems 2 3 Results File Access Routines You can use the low level routines in described in Accessing ANSYS Binary Files p 53 to retrieve data from the results file Alternatively you can use the routines described in this section that retrieve the data specific to the format of the results file These files reside in the subdirectory Program Files Ansys Inc V120 ANSYS cus tom misc lt platform gt on Windows systems or ansys_inc v120 ansys customize misc on UNIX systems See Access Routines to Results Substructure and Matrix Files p 53 for information on compiling and linking these routines 2 3 1 Overview of the Routines For each data record in the results file routines exist that Read the record index and allocate space for the data These are named ResRdrecordBegin where record is a descriptive name of the record e g ResRdNodeBegin Read the data itself These are named ResRdrecord e g ResRdNode Deallocate space for the data These are named ResRdrecordEnd e g ResRdNodeEnd Below is a complete listing of all the routines with the indentation indicating the required nested calling sequence function ResRdBegin Nunit Lunit Fname ncFname Title
197. Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 227 Chapter 7 Accessing the ANSYS Database kkk output arguments rlingr int func out the returned value of rlingr is based on setting of key mpg magnetic interface usage 7 3 14 rlget Function Getting Real Constant Data deck c kkk c KKK rlget function rlget nreal rtable primary function get real constant data Notice This file contains ANSYS Confidential information input arguments nreal int sc in real constant table number output arguments rlget int func out number of real constant data obtained rtable dp ar out real constant data obtained 7 3 15 rlsel Subroutine Selecting or Deleting a Real Constant Set deck c kkk c KKK c Qr OE QE COE COE COP OF COP COE COE COE COE COE COP 0E CON rlsel subroutine rlsel nreai ksel primary function select or delete a real constant set secondary functions none Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description nreai int sc in real constant table 0 all real constant tables ksel int sc in type of operation to be performed 0 delete real constant table 1 select real constant table 1 unselect re
198. S IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 21 Chapter 1 Format of Binary Data Files ssh torsion shear stress sl SQL s2 SG s3 S3 sint S INT seqv S EQV 0 0d0 position not used HON Qo oov EXY dp 1 varies Element integration point coordinates The length of the record is numint 3 where numint is the number of integration points Even two dimensional elements use the 3 They are output only if requested with the OUTRES loci command Applicable only to legacy element types 2 42 45 82 92 95 and current technology element types 180 181 182 183 185 186 187 188 189 208 209 265 281 288 289 290 JO JO Gy Owe JO Oi EBA dp 1 varies Element structural nodal back stresses Record has the same form as the plastic strains They are output if the form of plasticity is kinematic hardening and the plastic strains are requested Applicable only to legacy element types 2 42 45 82 92 95 and current technology element types 180 181 182 183 185 186 187 188 189 208 209 265 281 288 289 290 269000 e E e DE e E e Or ia a ESV dp 1 varies Element state variable record Exists only if written by user in usermat or usercreep Q e MNL dp 1 varies Material nonlinear record eG records marked with to the left of the record id can be read and stored ge into database with ldread command c Nodal Component
199. Stresses unused c NODSTR dp 1 6 nnod Nodal component stresses TOP for shells ic nNodStr gt 0 re dp 1 6 nnod BOT nodal component stresses for shells c nNodStr gt 1 le dp 1 6 nnod MID nodal component stresses for shells c nNodStr 2 1 3 Description of the Reduced Displacement File This section explains the content of the reduced displacement file jobname rasp 1 3 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 10 1 3 2 RDSP File Format comdeck fdrdsp C copyright c 2008 SAS IP Inc All rights reserved C ansys inc c Kee see eer descryption of reduced displacement file xavae Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 22 of ANSYS Inc and its subsidiaries and affiliates 1 3 2 RDSP File Format character 8 RDSPNM parameter RDSPNM rdsp v LONGINT rdspfpL rdspfp integer rdspbk rdsput common fdrdsp rdspfpL rdspbk rdsput equivalence rdspfp rdspfpL c write lnfrcl lnfrin lnfrwr c write rdtrcl rdtrin rdtrwr c read rdtrs e common variable descriptions x co rdspfpL file position on file rdsp co rdspbk block number for file rdsp co rdsput file unit for file rdsp fel See fddesc for documentation of how binary files are stored Cc KKKKKKKKKK file format KKKKKKKKKK c r
200. Subroutine pardim Creating a Dimensioned Parameter cceesesesccceeeeseseesnneeeeeees 210 6 12 2 Function parevl Finding and Evaluating a Parameter cccsesesssecccececeeseessneeeeeeeees 210 6 12 3 Subroutine pardef Adding a Parameter sse eene 210 6 13 Miscellaneous Useful Functions eeeeeeseeeeeee nene nnn nnne rhe enn rhe sene re tesa neis 212 6 13 1 Using Function RUDC ODIT Ost Vita ER eas cba A dco Re ERA RUD eo A Do Na PADS 212 6 13 2 Using the TUNDO Comimabdas svesecerreta pu eene teuer Qt etd ene E e ONU 212 6 13 3 Using the HOLD command sei e binder rnb nay Nerd EH uS aa EX V Sae a 213 7 Accessing the ANSYS Database ose enar tro aei od eter etes enu pira ea Ve elatis 215 7 1 Routines for Selecting and Retrieving Nodes and Elements seeee 216 7 1 1 ndnext Function Getting the Next Node Number cccccccccceessssssnteceeeeeeeseesnneeeeeeeeess 216 7 1 2 ndprev Function Getting the Number of the Previous Selected Node 216 7 1 3 ndnxdf Function Getting the Number of the Next Defined Node sssssss 216 7 1 4 ndsel Function Selecting Unselecting Deleting or Inverting a Node 217 7 1 5 elnext Function Getting the Number of the Next Element ccccccccsssssstereeeeeeeeeeees 217 7 1 6 elprev Function Getting the Number of the Previous Selected Element
201. UserCreep when you issue the TB command with the CREEP option and with the command option TBOPT 100 Use the subroutine UserCr when you issue the TB command with the CREEP option with TBOPT 0 and data constant C6 100 Subroutine UserCreep is incorporated with an implicit time integration algorithm while subroutine UserCr is incorporated with an explicit time integration algorithm In general the implicit time integration algorithm is more effective for long time periods The explicit creep algorithm is more effective for short time periods such as transient analyses with very small time increments or when the creep behavior of materials is not that significant In the finite deformation analysis you should interpret the strain variables in the subroutines as logarithmic strains and you should interpret the stresses as true stresses 6 4 3 1 Creep Subroutine UserCreep Use the subroutine UserCreep to define viscoplastic creep behavior of materials The subroutine is applicable when you issue the TB command with the CREEP option and with TBOPT 100 UserCreep supports shared memory and distributed parallel processing however you are responsible for ensuring that your code can use parallel processing The subroutine is called at all integration points of elements for which the material is defined by this com mand ANSYS always uses implicit time integration for this creep option You can use plasticity options BISO BKIN MISO NL
202. a description material number property number tbpnum in tblecm use 13 for tb user use 14 for tb nl description number of property values vector of the property values the first 15 tbhdsz items are a header given below The terms are defined in tblecm inc c output arguments c variable typ siz intent c nlget int sc out c prop dp ar nlget out a e a c terms of the descriptor record c header 1 tbtyp e header 2 tbtems a header 3 temloc c header 4 dprtem e header 5 tbrow e header 6 tbcol c header 7 rowkey a header 8 nxtloc a header 9 nxttem c header 10 temptr c header 11 tbpt a header 12 tbsiz c header 13 tbopt c header 14 hypopt c header 15 tbnpts 6 2 22 Subroutine usereo Storing Data in the nmisc Record deck usereo subroutine usereo elem iout nbsvr bsvr nnrsvr nrsvr npsvr psvr X nCSVr CSVr nusvr usvr nnode nodes xyz vol leng time x timinc nutot utot maxdat numdat udbdat c C primary function to call userou which allows user to store data in nmisc record 144 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 2 24 Subroutine eldwrnL Writing Element Nonsummable Miscellaneous Data to the Results File variable elem iout nbsvr bsvr nnrsvr nrsvr npsvr psvr ncsvr CSVI nusvr usvr nnode nodes XYZ
203. a header Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 3 Chapter 1 Format of Binary Data Files Type indicates what kind of information this record stores Number of records indicates how many records of this description are found here Record length indicates the number of items stored in the record In some record descriptions actual variable names used may appear in the record contents area 1 1 2 The Standard Header for ANSYS Binary Files Each of the ANSYS program s binary files contains a standard 100 integer file header that describes the file contents The header contains the items listed below always in the order shown The file number The file format This item has a value of 1 if the file is small format 1 if large format The time in compact form i e 130619 is 13 06 19 The date in compact form i e 20041023 is 10 23 2004 The units of measurement used The value of this item is as follows 0 for user defined units 1 for SI units 2 for CSG units 3 for U S Customary units feet 4 for U S Customary units inches 5 for MKS units 6 for MPA units 7 for uMKS units Item 10 The ANSYS release level in integer form X X in character form Item 11 The date of the ANSYS release Items 12 14 The machine identifier in integer form three four c
204. a shared library called mylibrary so you would issue the following command 9 gen share mylibrary so The utility will produce a Makefile in the current directory You will be able to generate the shared library by issuing the following command make 304 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates A 1 3 Creating an External Table File For example to create the shared library for mylibrary so you would issue the following command make You will then find the specified shared library file in the current directory You may also see warnings from the make process and you may need to modify the Makefile or your source code A 1 3 Creating an External Table File The external table file ans ext tb1 can reside in any directory but you must specify that directory in the ANSYS EXTERNAL PATH environment variable The file contains an entry for each shared library function you wish to allow ANSYS to access There is no limit to the number of entries The file entries have the following format shared library path library so cm name function name where shared library path library so Is the path to the directory that contains the shared library file Remotely mounted file systems are not re commended cm name Is the command used to invoke the function within ANSYS The command name must begin with
205. a very small number should be used 2 100 7 6 12 etpdel Subroutine Deleting an Element Temperature deck etpdel Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 247 Chapter 7 Accessing the ANSYS Database subroutine etpdel ielem c primary function delete element temperatures c Notice This file contains ANSYS Confidential information c input arguments e ielem int sc in element number a output arguments none 7 6 13 ehgiqr Function Getting Information About Element Heat Generation deck ehgiqr function ehgiqr ielem key C primary function get information about element heat generations c Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number should be 0 for key 11 DB NUMDEFINED DB MAXDEFINED and DB MAXRECLENG key int sc in information flag DB SELECTED return status ehgiqr 0 heat generation is undefined heat generation is defined DB NUMDEFINED return number of defined heat generations in model DB MAXRECLENG return maximum number of heat generations on any element max rec length 2 return length dp words 3 return layer number for cross reference files return number of entities 4 return address of first data word 5 return length record type units
206. ace elements only the input array dat may be used in one of three ways 1 it may be simply passed thru 2 it may be used as a flag e g if dat 1 3 0 use a certain set of logic 3 it may be completely ignored and instead defined with new logic 6 5 3 Subroutine usercv Changing Element Face Convection Surface Inform ation deck usercv USERSDISTRIB QQ cQ Q cQ 9 Q9 Q9 9 9 Q9 Q9 Q9 QQ Q0 o Q Q9 9 9 Q9 Q9 Q9 QQ OO Q9 subroutine usercv elem ielc time nr u ndat hc tb primary function change element face convection surface info copyright c 2006 SAS IP Inc All rights reserved ansys inc in order to activate this user programmable feature the user must enter the usrcal usercv command the input arguments hc and tb may be used in one of three ways 1 they may be simply passed thru 2 they may be used as a flag e g if hc 2 3 0 use a certain set of logic 3 they may be completely ignored and instead redefined with new logic this routine is called during each substep of each load step it is called for each equilibrium iteration it is called once per element it is called only during the heat flow load vector formulation stage and not during the heat flow evaluation stage the call to get the standard ansys input convection surfaces is made just before entering this routine so this information is available to be modified if desired velocity dependent film coefficients can be c
207. ad ores vds rp AU an tva edd 101 5 4 Studying the ANSYS User Routines oorr rere E EI IRR EA P RA US PER RYE 101 5 5 Programming in Languages Other than Fortran eeeeesseeeeeeeeeeeeeeee eene nnne 101 5 6 Developing UPFs a Suggested Strategy ioa inveterata et ota ae au deti Re pura eid ve ben ira n ERRARE 102 5 Titel le CADETE CRM DM 102 5 8 LINKING User ROUTINES c coroectvei trOn Fes OM PEL OG RHENO EUG REACHED OPERAR EET CER VER ANE URGE r 103 5 9 Compiling and Linking UPFs on UNIX Linux Systems 2 0 eeesceceessneeeeeessneeeeeesnaeeeeestaaeeeeesaaees 104 5 10 Compiling and Linking UPFs on Windows Systems esee 105 5 TT Activating UPES ssaa a rene a erue geetke ke ede nae ecedtesdee Tr daegee tke kae name aa 107 5 12 Running Your Custom Exec table sieo eee dro a rr etr n er RR Capa Kb x lO RR 107 5 13 Verifying Your RoUEPIBS coa morta ae ta vie epu ect piace Be nt pad pre meten 108 5 14 Debugging Command Siis sessies reped br m try arte ovp mai rr oido ars 108 5 14 t Tracking the Path of Program Logic at bera ese trien tar CH Ea red EY EUR Ege ee eL QR TTA RA 109 5 14 2 Debugging Elements and Solutions sees eee 109 514 21 solution Debug Format ra eranen RH RATE ern ERU EET Ve LA OR E 109 5 14 2 2 Element Debug Format s esse d eec eo atr INASRE Du Puteo etti red see UR e ult 110 5 14 2 3 General Debug EO sain rear emet s re e prep toam repe ape 111 5 15 Other Usef
208. age poisson ratio dens dp se in current material density mass volume prop linear material property array dp ar 9 in ex ey ez gxy gyz gxz nuxy nuyz nuxz dp ar 1 in if ncomp 1 ex d dp ar ncomp ncomp in elastic stress strain matrix ktform int sc in request key for tangent matrix formation 71 form tangent ne 1 do not form timval dp sc in current time value timinc dp sc in time increment over this substep tem dp sc in temperature at the end of this substep dtem dp sc in temperature increment over this substep toffst dp sc in temperature offset from absolute zero Qo0Q0nQ0Q0nQ0nQnQoanQaoaonoaoaoaoaoaoaoanoaonoaoaoaoanoaoanoanoanoanoanoanoaaoanoaoaoanoaoaaoaoanoaaoanoaoanoaoaoanoaonoaaoanoaoanoanoanoanoaonoanonononnn flu dp sc in fluence at the end of this substep dflu dp sc in fluence increment over this substep epel dp ar ncomp inout modified total strain trial strain epel eptot eppl eptherm if a large strain analysis epel is rotation neutralized and is the hencky i e log strain eppl dp ar ncomp inout plastic strain from previous substep statev dp ar ncomp 6 inout state variables from previous substep usvr dp ar nuval nintp inout additional state variables from 172 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 4 6 Subrou
209. ains e defined in model c output arguments c ecriqr int func out the returned value of ecriqgr is based on e setting of key 7 7 34 ecrget Function Getting an Element s Nodal Creep Strains deck ecrget function ecrget ielem value C primary function get element nodal creep strains c Notice This file contains ANSYS Confidential information a input arguments Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 270 of ANSYS Inc and its subsidiaries and affiliates 7 7 35 ecrput Subroutine Storing an Element s Nodal Creep Strains a 000000 Q00000000000000000000000000Q ielem int sc in output arguments ecrget int func out value dp ar out NOTE element number status of element 0 element undefined gt 0 number of nodal creep strains returned element nodal creep strains Strains at each corner node in the order Ky OV Bp XY YZ X7 For solid elements strains at each corner node For shell elements strains at each corner node first top durface then bottom For layered elements w KEYOPT 8 0 strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node first the bottom surface then the top surface for the layer with the largest failure criteria The second layer is
210. al constant table 2 invert real constant table output arguments none 7 3 16 csyiqr Function Getting Information About a Coordinate System deck c kkk c kkk csyiqr function csyiqr ncsy key primary function get information about a coordinate system Notice This file contains ANSYS Confidential information input arguments ncsy int sc in coordinate system reference number should be zero for key DB NUMDEFINED or DB MAXDEFINED key int sc in information flag DB SELECTED return status csyigr 0 coordinate system is not defined l coordinate system is not selected Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 3 18 csyput Subroutine Storing a Coordinate System qgqaaqaa a a output csyi 1 coordinate system is selected DB NUMDEFINED number of defined coordinate systems DB MAXDEFINED maximum coordinate system reference number used arguments qr int func out the returned value of csyigr is based on setting of key 7 3 17 csyget Function Getting a Coordinate System deck csyget Q aAA AA A Q Q Q00n0000000000000n0n00Q func prim seco AK NOGI NOTE typ input a vari ncsy csyi output csyd csyi csyg tion csyget ncsy csydpx csyinx ary function get a coordinate system ndary functions
211. al stress Section input Input of fluences Swelling Material TB labels PLASTIC NLISO AHYPER HYPER PRONY SHIFT ELASTIC ANEL SDAMP SMA CAST EDP and GURSON 114 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API 6 1 1 Input and Output Abbreviations The descriptions of the subroutines or functions within this chapter describe both the input arguments and output arguments Argument information includes the argument s type size and intent Argument type is one of the following int integer dp double precision log logical chr character dcp double precision complex Argument size is one of the following sc scalar variable ar n array variable of length n func functional return value Argument intent is one of the following in input argument out output argument inout both an input and an output argument 6 1 2 Creating a New Element via the User Defined Element API Following is the general process for creating your own element via the user defined element API Sp Description Comments 1 Specify the element Issue the ET and TYPE commands The name of the element must be USER300 type 2 Define your new ele ssuethe USRELEM command Specify the element characteristics such as the
212. an Element s Miscellaneous Summable Data c output arguments none 7 7 5 emsiqr Function Getting Information About an Element s Miscellaneous Summable Data deck emsiqr function emsigr ielem key c primary function get information about element misc summable data c Notice This file contains ANSYS Confidential information a input arguments a ielem int sc in element number or zero see below e key int sc in key as to the information needed o 1 return info about misc summed data records ielem gt 0 return number of misc summed e data items for this element G record length o 0 return maximum number of misc c summed data items on any G element max record length DB_NUMDEFINED return total number of misc summed data al items defined in model c output arguments emsiqr int func out the returned value of emsigqr is based on e setting of key 7 7 6 emsget Function Getting an Element s Miscellaneous Summable Data deck emsget function emsget ielem value C primary function get element misc summable data c Notice This file contains ANSYS Confidential information g input arguments a ielem int sc in element number c output arguments e emsget int func out status of element amp 0 element is undefined amp gt 0 number of data items returned G value dp ar out element misc summed data nd NOTE the conte
213. and intent Argument type is one of the following int integer dp double precision log logical chr character dcp double precision complex Argument size is one of the following sc scalar variable ar n array variable of length n func functional return value Argument intent is one of the following in input argument out output argument inout both an input and an output argument Types of Database Access Routines The rest of this chapter describes the functions and subroutines available for accessing information in the ANSYS database The function and subroutine descriptions are grouped into the following sections 7 1 Routines for Selecting and Retrieving Nodes and Elements 7 2 Node Information Routines 7 3 Element Attribute Routines 7 4 Coupling and Constraint Routines 7 5 Nodal Loading Routines 7 6 Element Loading Routines 7 7 Results Information Routines Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 215 Chapter 7 Accessing the ANSYS Database 7 1 Routines for Selecting and Retrieving Nodes and Elements 7 1 1 ndnext Function Getting the Next Node Number deck ndnext function ndnext next c primary function get the number of the next selected node c Notice This file contains ANSYS Confidential information ae input arguments c next int
214. andard ANSYS element that most closely resembles your new custom element and run some problems on a production version of ANSYS using that element 6 Modify the element subroutines to match the element you chose in Step 5 Then compile and link those subroutines into a custom version of ANSYS 7 Again compare the results from Steps 5 and 6 If they don t match resolve the discrepancies before moving on to Step 8 8 Modify your element subroutines to include the features you want Then compile and link the sub routines into a custom version of ANSYS 9 Test the changes with a series of increasingly complex problems for which you already know the answers 5 7 Include Decks In addition to the subroutines and functions described in this chapter most of the include decks files with the extension inc used by ANSYS are on your ANSYS distribution medium These include decks also called commons contain important but relatively small amounts of data The ANSYS program also handles large amounts of data using various access routines GET and PUT as described elsewhere in this manual 102 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 0 of ANSYS Inc and its subsidiaries and affiliates 5 8 Linking User Routines To insert include decks in a subroutine or function use the INCLUDE or an analogous statement Do not modify an include deck under any circumstances T
215. ariables in each level Up to the first seven variables are used as follows If the substructure was transferred via the SETRAN command lst variable 1 0 2nd variable nodal increment 3rd variable reference number of coordinate system where substructure will be transferred Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 41 Chapter 1 Format of Binary Data Files o ooo Oe Oa a Oa nO iQ Qu Qs A Os Qu qeu opo po Moo oe Qon Q Qa Or xi oae qa Q Qi iQ ooo Qc Qe HOS O80 Qi iQ oso CTXM DOF Ux AZ dp 1 9 2 10 KKKKKKKKKKKKKKKK EMF 25 DST POS ORG BAC TIT NOD XYZ dp CURR 26 nnod 4th variable reference number of coordinate system where substructure is presently defined 5th variable x coordinate increment 6th variable y coordinate increment 7th variable z coordinate increment If the substructure used symmetry via the SESYMM command lst variable 2 0 2nd variable nodal increment 3rd variable number of coordinate component to be used in operation 1 x coordinate 2 y coordinate 3 z coordinate 4th variable reference number of coordinate system to be used for symmetry operation 250 Substructure transformations numdof Degrees of freedom per node Global curdof i i 1 numdof DOF refe
216. ary and confidential information of ANSYS Inc and its subsidiaries and affiliates 271 Chapter 7 Accessing the ANSYS Database failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPCR item of ETABLE command OOO Oe OG Ov 7 7 36 ecrdel Subroutine Deleting an Element s Nodal Creep Strains deck ecrdel subroutine ecrdel ielem c primary function delete element creep strains c Notice This file contains ANSYS Confidential information a input arguments c ielem int sc in element number ae 0 delete for all defined elements Cc output arguments none 7 7 37 ethiqr Function Getting Information About an Element s Nodal Thermal Strains deck ethiqr function ethiqr ielem key C primary function get information about element nodal thermal strains c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed e 1 return info about thermal strains e ielem 0 return number of nodal thermal strains e on this element c record length c 0 return maximum number of nodal thermal el strains on any element c max record length
217. ary and confidential information 148 of ANSYS Inc and its subsidiaries and affiliates 6 3 Subroutines for Modifying and Monitoring Existing Elements subroutine hgnget iel ielc nnod nodes ndat begdat dat enddat x iexist primary function define the current heat generation loads Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description iel int sc in element number ielc int ar IELCSZ in array of element type characteristics nnod int sc in number of nodes in the nodes array nodes int ar nnod in list of nodes ndat int sc in number of data items to get begdat dp ar ndat in data at the beginning of this load step output arguments dat dp ar ndat out data at this time point enddat dp ar ndat out data at end of this load step iexist int sc out flag if heat generation exist 0 no heat generation yes heat generation Q00000000000000000000010n 6 2 33 Subroutine prinst Computing principal stress and stress intensity deck prinst subroutine prinst s e primary function computes principal stresses and stress intensity c secondary functions none c Notice This file contains ANSYS Confidential information c input arguments c variable typ siz intent description g s dp ar 11 inout stress vector c s 1 sx e s 2 sy
218. at 3 phase shift e wavdat 4 wave length c r dp sc in radial location of point of interest e doext dp sc in effective outside diameter of pipe e e e amp 6 5 12 5 Subroutine wavHtSec The wavHtSec subroutine calculates wave height over point at xyzg of the element It is a utility subroutine called by the userPartVelAcc subroutine Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 192 of ANSYS Inc and its subsidiaries and affiliates 6 6 Running ANSYS as a Subroutine deck wavHtSec parallel pck subroutine wavHtSec ktyp xyzg doext depth watwav nw eta etadot rel primary function Calculate wave height G over point at xyzg of the element G If KWAVE 10 this routine calls userWavHt G secondary functions none e c Notice This file contains ANSYS Confidential information e c input arguments c ktyp int sc in key what argument is to be used G 0 compute value in wvargu G 1 pass directly in doext position c ktyp 1 used for stream function only c Xyzg dp ar 3 in updated coordinates of point of interest in c doext dp sc in outside diameter with insulation g if ktyp 1 doext argu c depth dp sc in water depth ic watwav dp ar in water wav table ic nw int sc in number of waves g c output arguments G eta dp sc out wave height initialized before entering he G
219. ation 216 of ANSYS Inc and its subsidiaries and affiliates 7 1 6 elprev Function Getting the Number of the Previous Selected Element 7 1 4 ndsel Function Selecting Unselecting Deleting or Inverting a Node deck c kkk c kkk c kkk c 1 3030 303 309 103 1038 203 33 82 30 86 Oe Oi ndsel subroutine ndsel ndmi ksel primary function to select unselect delete or invert a node secondary functions none Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description ndmi int sc in node number 0 all nodes lt 0 do not delete CPs and CEQNs merge offset compress ksel int sc in type of operation to be performed ksel 0 delete node 1 select node 1 unselect node 2 invert select status of node output arguments none 7 1 5 elnext Function Getting the Number of the Next Element deck c KKK c KKK c c Cc Qon elnext function elnext next primary function get the number of the next selected element Notice This file contains ANSYS Confidential information input arguments next int sc in the last element number used 0 use for initial value output arguments elnext int func out the next selected element 0 no more elements 7 1 6 elprev Function Getting the Number of the Previous Selected Element
220. ation of ANSYS Inc and its subsidiaries and affiliates 319 Appendix C User Material UserMat Subroutine Example END IF con2 threeG threeGtdsigdep conl con2 TWOTHIRD con2 DO i 1 ncomp DO j 1 ncomp JM j i ZERO END DO END DO DO i 1 nDirect DO j 1 nDirect JM i j THIRD END DO JM i i JM i i ONE END DO DO i nDirect 1 ncomp JM i i HALF END DO DO i 1 ncomp DO j 1 ncomp dsdePl i j dsdeEl i j twoG amp con2 dfds i dfds j conl JM i j END DO END DO c goto 600 500 continue c Update stress in case of elastic unloading do i 1 ncomp stress i sigElp i end do 600 continue c Claculate elastic work sedEl ZERO DO i 1 ncomp sedEl sedEl stress i Strain i dStrain i epsP1 i END DO sedEl sedEl HALF e 990 CONTINUE e return end C 5 Accessing Solution and Material Data These APIs are provided for your convenience to help you access solution and material data easily C subroutine get ElmInfo inquire value e c description fe function to inquire element and solution information e definition c inquire query argument string c value value of query argument e variables e inquire value c LDSTEP load step number c ISUBST substep step number e IEQITR current interation number e NUMINTG number of gauss integration e ELEMID element number c MATID material number of current element e NSVAR
221. ation needed e 1 return info about element euler angles e ielem 0 return number of euler angles on this rel element a record length e 0 return maximum number of euler angles e on any element c max record length e DB NUMDEFINED return the number of element euler angles e defined in model c output arguments c euligr int func out the returned value of euligr is based on e setting of key 7 7 42 eulget Function Getting an Element s Nodal Euler Angles deck eulget function eulget ielem value C primary function get element nodal euler angles c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number 274 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 7 44 euldel Subroutine Deleting an Element s Euler Angles output arguments eulget int func out status of element 0 element undefined gt 0 number of euler angle values returned value dp ar out element euler angles qgqaqaaqaqaa NOTE For lower ordered elements rotations at centroid For higher ordered elements rotations at each corner node For layered shells rotations at each corner node plus layer rotation angle for each layer real constant THETA For layered solids rotation angles at centroid plus layer rotation angle for
222. ations and addition 300 matsym subroutine 300 matxb subroutine 299 matxv subroutine 298 matxv1 subroutine 298 maxv subroutine 297 maxv1 subroutine 298 mctac subroutine 300 memory management subroutines 208 Meshing defining 75 meshing debugging 111 miscellaneous functions 212 monitoring elements 149 Moving one vector into another 293 mreuse subroutine 135 multifield debugging 109 N N 82 ndcdel 241 ndcget 241 ndciqr 240 ndcput 241 ndgall 220 ndgxyz function 297 ndinqr 218 ndnext 216 ndnxdf 216 ndprev 216 ndpxyz subroutine 297 ndsel 217 ndspgt 220 Neutral graphics file character set used in 88 color specification for 92 decoding 93 examples of 93 format 88 general format of 88 plot directives 89 Anno Size 91 Area Color 90 Draw 91 End Plot 91 Font Control 91 Graph Color 90 Line Type 90 Line Width 90 Marker Size 91 Move 91 No Opt 91 Normal 91 parameter types for directives 89 Pixmap 91 Pixmap Style 91 Point 91 Polygon 91 Start Plot 90 Text 91 Text Justification 91 MPDATA 82 Text Color 90 mpdel 227 Text Size 90 mpget 226 Window 90 mpinqr 225 Newton Raphson debugging 109 mpput 226 nfudel 240 MPTEMP 82 nfuget F 239 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 329 Index nfuiqr 239 nfuput 240 nhgdel 239 nhgg
223. atrix Number of nodes Number of body loads for example temperatures Number of surface loads for example pressures Number of real constants Number of variables to be saved Number of rows in element matrices Linear or nonlinear element Subroutines ue1100 through ue1105 calculate the element matrices stiffness specific heat and so on the element load vector force heat flow and so on and any element output quantities The element printout also is generated and the variables to be saved are calculated and stored in the results file Other user subroutines available for manipulating element information include the following Subroutines uep100 through uep105 provide printed output of line elements The general ANSYS postprocessor POST1 calls the subroutines or you can call them using ue1100 through ue1105 Subroutine usertr allows access to the nodal transformations Subroutine userac describes some of the data handling 6 1 3 2 Subroutine uec100 Defining Characteristics of the usr100 Subroutine deck uec100 USERSDISTRIB subroutine uecl100 elcdn ielc kerr this subroutine defines the characteristics of userl00 copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information typ int dp log chr siz sc ar n intent in out inout input arguments variable typ siz intent description ielc int ar IELCSZ inout
224. atures at the beginning of this incremental step substep reference temperature input flag for thermal loading 1 Temperatures at nodes are different from the reference temperature thermal loading might be needed 0 Temperatures at nodes are the same as the reference temperature thermal loading is not needed output flag for thermal strains number of pressure values for this element applied elemental face load pressure flag for pressure loading 1 pressure load is applied and equivalent nodal forces should be calculated 0 no pressure loading number of real constants defined on USRELEM command as NREAL user defined real constants number of saved variables defined on USRELEM command as NSAVEVARS dp ar nSaveVars inout user saved variables dp ar nDim nNodes in nodal coordinates in initial configuration dp ar nDim nNodes in dp ar nUsr dp ar nUsr dp ar nUsr dp ar nUsr dp ar nUsr DO Do Do Do Do nodal coordinates in current configuration f in total values of DOFs displacements from time 0 in incremental values of DOFs displacements for the current step f in iterative values of DOFs displacements for the current iteration normally needed for debug only in first time derivatives of DOFs velocities normally not needed f in second time derivatives of DOFs Release 12 0 2009 SAS IP Inc All rights re
225. ave been cleared Note The CLEAR command also closes resets all external command shared libraries Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 312 of ANSYS Inc and its subsidiaries and affiliates Appendix C User Material UserMat Subroutine Example This example of a simple bilinear plasticity material model identical to TB BISO demonstrates the user material subroutine UserMat described in Subroutine UserMat Creating Your Own Material Model p 156 C 1 UserMat Example Description The example subroutine defines a 3 D material with plane strain and axisymmetric stress states The analysis uses the 3 D solid element SOLID185 Comparison is made with the prediction by ANSYS TB BISO material option The example is a two element test case under simple tension Element 1 has material defined using the TB USER option while Element 2 has material defined using the TB BISO option A 100 percent deformation is applied to both elements Finite deformation NLGEOM ON is considered The POST26 processor results of stress components Sxx Syy and plastic strain components EP xx EPyy are printed for both elements They are expected to be the same C 2 UserMat Example Input Data batch list title mvpl um01 gal usermat F test case com com This is a single element test case for testing usermat F com usermat F is the user materials subroutine com
226. base 7 7 45 efxiqr Function Getting Information About Element Fluxes deck efxiqr function efxigr ielem key C primary function get information about element fluxes c Notice This file contains ANSYS Confidential information amp input arguments e ielem int sc in element number or zero see below c key int sc in key as to the information needed amp 1 return info about element fluxes c ielem 0 return number of fluxes on this c element G record length c 0 return maximum number of fluxes e on any element max record length e DB NUMDEFINED return the number of element fluxes defined c in model c output arguments c efxiqr int func out the returned value of efxiqr is based on c setting of key 7 7 46 efxget Function Getting an Element Flux deck efxget function efxget ielem value C primary function get element nodal fluxes c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c output arguments c efxget int func out status of element e 0 element undefined e gt 0 number of nodal fluxes returned e value dp ar out element nodal fluxes c Note If a coupled field a set of fluxes is stored in the following order as available fluid thermal c electric magnetic C mpg efxget pagend paberrwb edgzzx panavg papres paterr get ele nd flx
227. be placed at the end of the nmisc record 6 2 23 Subroutine eldwrtL Writing Element Data to a File deck eldwrtL subroutine eldwrtL Go primary function ielem edtype lcerstL edindxL nval value output element data to result file c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number c edtype int sc in element data type see elparm c lcerstL LONG sc inout pointer to results file position c edindxL LONG ar NUMELEDATASETS inout index to results file data c nval int sc in the total number of values c if edtype EDEMS c this should always be ielc nmsmis e unless there is a variable number as o in the layered shell elements ol value dp ar nval output values real 6 2 24 Subroutine eldwrnL Writing Element Nonsummable Miscellaneous Data to the Results File deck eldwrnL subroutine eldwrnL x 6 primary function c elem ielc lcerstL edindxL nudb udbdat nval value ndval output element nonsummable miscellaneous data to result file c Notice This file contains ANSYS Confidential information Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 145 Chapter 6 UPF Subroutines and Functions ielc NMNMIS ielc NMNMUP mpg eldwrnL lt e1117 e1126 e1109 e153 e19
228. binrd binwrt that take a regular integer for the second argument These subroutines therefore cannot address large files where the file position exceeds 2 31 Use the binrd8 binwrt8 versions for any new programs 2 1 12 Subroutine binwrt8 Writing Data to a Buffered File deck binwrt8 subroutine binwrt8 nblk LongLocL leng ivect kbfint Buffer4 C primary function buffer write routine c This routine is intended to be used in standalone programs c This routine should not be linked into the ANSYS program c Notice This file contains ANSYS Confidential information c input arguments c nblk int sc in block number see fd i e fdtri for tri e c LongLocL LONG sc inout location in integer words of the starting c position on the file c leng int sc in number of words to read from ivect must be c less or equal to dimension given to ivect in Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 59 Chapter 2 Accessing Binary Data Files the calling routine if ivect is to be used as integers use as is if ivect is to be used for double precision numbers it must be increased by multiplying it by INTPDP ivect int ar in data to be written onto the file can be either integer or double precision in the calling routine kbfint int sc in key for type used only for AUX2 dump 0
229. bly process termed frontal assembly and is now the default assembly process for most analyses This program demonstrates how to read and reformat the FULL file that was created using frontal assembly or symbolic assembly ANSYS writes the FULL file if the PSOLVE ELFORM PSOLVE ELPREP PSOLVE TRIANG sequence is used ANSYS will also write the FULL file when the sparse ICCG or JCG solver is used as well as when most mode extraction methods are used CY 4Q lt Q 20 AQ 206 Y 0X Gy OOOO OGOGO A a Be sure to set up for modal ANTYPE 2 and Block Lanczos MODOPT LANB nmode 0 0 OFF c nmode is not used it can be any value a c If the free free stiffness and mass matrices are desired e make sure there are no constraints on the model 4 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 6 of ANSYS Inc and its subsidiaries and affiliates 2 3 1 Overview of the Routines 2 2 7 Program ResRdDemo Demonstrates Reading a Results File Program ResRdDemo demonstrates how to read a results file using the results file access routines The file must be named test rst and the file contents are written to the screen This file resides in the subdirectory Program Files Ansys Inc V120 ANSYS custom misc lt plat form on Windows systems or ansys_inc v120 ansys customize misc on UNIX systems 2 2 8 Program ResWrDemo Demonstrates Writing a Results File
230. broutine 295 vnorm subroutine 296 vnorme subroutine 296 vsum function 291 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 333 Index vzero subroutine 292 W wavefront reordering debugging 111 Weld defining 80 Windows systems compiling and linking UPFs on 105 wrinqr function 286 Writing an ANSYS substructure file 63 wrtsub subroutine 63 X xyzup3 subroutine 146 Z Z buffered graphics 87 4 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 33 of ANSYS Inc and its subsidiaries and affiliates
231. broutine User116Hf Computing the film coefficient for FLUID116 deck Userll16Hf USERSDISTRIB subroutine Userll6Hf elem prop rvr aleng re uptot uttot hf c primary function compute hf for film coefficient for fluid116 c Notice This file contains ANSYS Confidential information c c copyright c 2008 SAS IP Inc All rights reserved c ansys inc c input arguments c elem int sc in element number c prop dp ar 4 inout material property vector e order is dens visc kxx c c rvr dp ar 18 in real constant vector c aleng dp sc in element length c re dp sc in reynold s number c uptot dp ar 2 in nodal pressure values from previous iteration c uttot dp ar 4 in nodal temperature values from prevs iteration c hf dp sc inout the film coefficient from TB hflm C output arguments c hf dp sc inout the desired film coefficient 186 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accelerations 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accel erations The userPartVelAcc subroutine is the primary component of the API for inputting your own wave and current information The API supports the hydrodynamic capability available with current technology pipe elements PIPE
232. but not hydrodynamic effects ex dp sc in Young s Modulus pois dp sc in Poisson s ratio sflex dp ar 6 inout input flexibility factors axial bending about element z bending about element y twist y shear z shear twten dp sc inout twist tension factor output arguments sflex dp ar 6 inout output flexibility factors axial bending about element z bending about element y twist y shear z shear twten dp sc inout twist tension factor deck uflex USERSDISTRIB c Cc Cc Cc Cc Cc Cc Cc Cc Cc c Cc c Cc Cc Cc kk KKK KKK el subroutine uflex elemId pressInt pressExt ex pois sflex twten primary function to re compute the flexibility factors for pipe288 and pipe289 this is accessed by inputting the axial flexibility factor as 10 secondary functions none Notice This file contains ANSYS Confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc typz int dp log chr dcp siz sc ar n intent in out inout input arguments emId int sc in element number pressInt dp ar 2 in internal pressures at end nodes 154 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 3 10 Subroutine UsrShift Calculates pseudotime time increment pressExt dp ar 2 in external pressures at end nodes Pressures include hy
233. c Notice This file contains ANSYS a typ int dp log chr dcp siz sc ar input arguments variable typ siz intent de nreal int sc in rea S D D key int sc in in 5 return DB SELECTED return rlingr 0 real real 1 real DB NUMDEFINED return DB NUMSELECTED return DB MAXDEFINED return DB MAXRECLENG return al property tables Confidential information terial number operty reference number 0 all properties 4 NUYZ 5 NUXZ 6 GXY 7 GYZ 8 12 DENS 13 MU 14 DAMP 15 KXX 16 20 RSVZ 21 C 22 HF 23 VISC 24 28 PRYZ 29 PRXZ 30 MURX 31 MURY 32 36 MGXX 37 MGYY 38 MGZZ 39 EGXX 40 44 SBKZ 45 SONC 46 SLIM 47 ELIM 48 51 FLUI 53 ORTH 54 CABL 55 RIGI 56 60 CTEX 61 CTEY 62 CTEZ 63 THSX 64 THSY 65 THSZ 66 DMPR 67 LSSM 68 69 79 71 72 76 7 7 78 79 80 ted code and for TB command information on about a real constant set Confidential information n func intent in out inout scription l constant table number hould be 0 for key 11 DB_NUMDEFINED B_NUMSELECTED DB_MAXDEFINED and B_MAXRECLENG formation flag number of values stored for nreal select status constant table is undefined constant table is unselected constant table is selected number of defined real constant tables number of selected real constant tables highest real constant table defined maximum record length dp words
234. c Allrights reserved Contains proprietary and confidentialinformation of ANSYS Inc and its subsidiaries and affiliates 4 3 1 The Example Command Stream Value Color Orange 255 Red 4 3 Decoding a Graphics File an Example The following example shows you the following The ANSYS command stream used to create a simple graphics plot shown in Figure 4 2 Example Display of a Graphics File p 93 below The encoded graphics file that these commands produce The decoded graphics plot directives Figure 4 2 Example Display of a Graphics File ANSYS 5 3 NOV 15 1996 15257207 PLOT NO 1 ELEMENTS ELEM NUM ZV 1 DIST 0 5 XE 1 5 5 D YF 0 CENTRO HIDDEN 1 ANSYS 5 3 Example Graphics File 4 3 1 The Example Command Stream To create the graphics display shown in Figure 4 2 Example Display of a Graphics File p 93 you would issue the following ANSYS commands PREP7 TITLE ANSYS 5 3 Example Graphics File Nd N 2 2 NGEN 2 2 1 2 1 1 ET 1 42 E 1 2 4 3 PNUM ELEM 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 93 of ANSYS Inc and its subsidiaries and affiliates Chapter 4 ANSYS Graphics File Format PNUM NODE 1 SHR 1 SHOW F33 EPLOT FINISH 4 3 2 Example Graphics File Contents The commands listed above produce the display shown in Figure 4 2 Example Display of a Graphics F
235. c in starting location in buffer array usually 1 for nblk 1 paglen npage 1 for nblk 2 etc paglen int sc in page length in integer 4 words for external files paglen should always be a multiple of 512 words for efficiency npage int sc in number of pages 1 to BIO MAXBLOCKS max pname chr ar in name of the file nchar int sc in number of characters in the file name not used kext int sc in no longer used always external format Buffer4 i4 ar inout work array for paging should be Q00000000000000000000000n dimensioned to paglen npage nblk max C output arguments c binset int func out error status e 0 no error ce lt gt 0 error occurred G Buffer4 i4 ar inout work array for paging 2 1 9 Subroutine bintfo Defining Data for a Standard ANSYS File Header deck bintfo subroutine bintfo title jobnam units code C primary function set information necessary for binhed C This routine is intended to be used in standalone programs C This routine should not be linked into the ANSYS program ie c Notice This file contains ANSYS Confidential information c e typz int dp log chr dcp siz sc ar n intent in out inout ie c input arguments variable typ siz intent description title chr 80 ar 2 in main title and lst subtitle jobnam chr 8 sc in jobname units int sc in units 0 user defined units c 1 SI MKS e
236. ccceesseessnneceeceeceseesnneeeeeeeeeeeeeeees 70 3 The CDWRITE CDB File Format cccccccssscscccssscsceessscsceesscscesesscscusesecsceeensceceeenscscusencceeuens 71 3 1 Using the CDWRITE Command esineet perterriti altre EEEE gin proa p dteg TAER soles 71 3 1 1 Customizing Degree of Freedom Labels the DFLAB Command cesessecceeeeeeeeeeneees 71 3 2 Coded Database File Commands esee hee hne nene nnne ene rnnt sen ane tese are inen 72 3 2 1 CE Cornmarnid 5 ede EE e e eve beste esr epe e Pes te eese ipio 73 3 22 CP CONAN oroa eerte rere etr eet een AAN AAAA 73 3 2 3 CMBEOCK Command 22 5 4 ste s t e s eher e e et eiui 74 3 24 EBLOCK Command reete tree EYE ae e PR ERN TOWE aee TER ERN TT eve e VE ERN TOR Deed ee LE EE 74 3 2 5 EDCADAPT Command iot repa redeo kae pado O ar me REX UE eoa Pe OUS E EV des 75 32 6 EDCGEN Command etre ere ret ener ee es e NERON TENE Ee sh Tene sa rx e x PRU 76 3 2 7 EDCURVE CONAN v uscire eee eee oue Ee ebore ev eee boddaghileczae des veas ae eroe ee TEES N EU EES 77 3 2 8 EDDREEAX Command 5 dien etie eoe e EAN eerte e ea re e eee bee Ue bw ausu eat eR e Ue vus 77 32 9 EDECS Command cie e eR eee 78 3 2 10 EDLOAD Command ree rte re e E VETE rS ER EUNT ERE Y NEP a 78 3 24 12EDPREAD Corfmand ate ete eter eee e NT rettet cote veste le ee orem Ri 79 3 2 2 EDWELED Command 5 5 retener eerte ede seveesvee see yae erede vete exi sey duro 80
237. ccsesssssteeeeeeeeeeees 223 7 3 6 etyput Subroutine Storing Element Type Data eee eeessececeessneeeceessaeeeeeesneeeseestaneeees 224 7 3 7 echrtr Subroutine Getting Information About Element Characteristics 224 7 3 8 etysel Subroutine Selecting Unselecting Deleting or Inverting an Element Type 225 7 3 9 mpingr Function Getting Information About a Material Property sesesesssss 225 viii Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Programmer s Manual for Mechanical APDL 7 3 10 mpget Function Getting a Material Property Table eee eseeessseeeeeeesneeeeeesnneeeeensee 226 7 3 11 mpput Subroutine Storing a Material Property Table ccssscscccceeeeeeesnneeeeeeeeeeeeees 226 7 3 12 mpdel Subroutine Deleting a Material Property Table ccssssssscceeeeeesseesneeeeeeeees 227 7 3 13 rlinqr Function Getting Information About a Real Constant Set eeesssss 227 7 3 14 rlget Function Getting Real Constant Data sesseeeeeeeeeeeeee nennen nennen 228 7 3 15 rlsel Subroutine Selecting or Deleting a Real Constant Set 228 7 3 16 csyiqr Function Getting Information About a Coordinate System esses 228 7 3 17 csyget Function Getting a Coordinate System
238. cements 7 5 22 ndcget Function Getting a Nodal Current Density deck ndcget function ndcget node currd c primary function get specified nodal current density c Notice This file contains ANSYS Confidential information e input arguments c node int sc in node number c output arguments c ndcget int func out current density status of node c 0 node has no current density defined c 1 node has a current density defined c currd dp ar 4 2 out the node current density new old 7 5 23 ndcput Subroutine Storing a Nodal Current Density deck ndcput subroutine ndcput node currd C primary function store nodal current density c Notice This file contains ANSYS Confidential information e input arguments o node int sc in node number c currd dp ar 4 in nodal current densities Ge output arguments none 7 5 24 ndcdel Subroutine Deleting a Nodal Current Density deck ndcdel subroutine ndcdel node output arguments none C primary function delete nodal current densities c Notice This file contains ANSYS Confidential information c ei typ int dp log chr dcp siz sc ar n func intent in out inout c e input arguments c variable typ siz intent description c node int sc in node number c c 7 5 25 nvdiqr Function Getting Information About Nodal Magnetic Virtual Displacements deck nvdiqr function nvd
239. ck buffer read routine ckckckckckckckckckck c Notice This file contains ANSYS Confidential information input arguments nblk int sc in block number see fd ize fdtri f r tri e e e e as defined with subroutine bioset c LongLocL LONG sc inout location in integer 4 words of the startin e position on the file c leng int sc inout number of words to read into ivect must be c less or equal to dimension given to ivect in e the calling routine if ivect is to be used c as integers use as is if ivect is to be c used for double precision numbers it must be c increased by multiplying it by INTPDP c if negative skip record and do not return c data results c data results c Buffer4 i4 ar inout work array for paging should be the c same array as used in binset 0 double precision data 0 integer data usually the same as leng Buffer4 i4 ar inout work array for paging C output arguments c LongLocL LONG sc inout location in integer 4 words of the current c position on the file It is updated after c each read operation c leng int sc inout tells you how many items it actually read in c integer words o if zero end of file error case c ivect int ar out results can be either integer or double c precision in the calling routine c kbfint int sc out key for type used only for AUX2 dump e e e Versions of binrd8 binwrt8 exist without the 8 suffix
240. ckckckck ck kckckckckckckckckckckckckckck KK KKK KKK KKK Q000000000000000000000000000000000000001 0 matId elemId kDomIntPt kLayer kSectPt ldstep isubst keycut nDirect nShear ncomp nStatev nProp Time dTime Temp dTemp stress statev dsdePl sedEl sedPl epseq Strain dStrain epsPl prop coords var0 defGrad t defGrad tsstif epsZZz varl var2 var3 var4 var5 var6 var7 var8 eee primary function user defined material constitutive model Attention User must define material constitutive law properly according to the stress state such as 3 D plain strain and axisymmetry plane stress and beam a 3 D material constitutive model can be used for plain strain and axisymmetric cases When using shell elements the plane stress algorithm must be used The following demonstrates a USERMAT subroutine for a plasticity model in 3 D stress state The plasticity model is the same as TB BISO See ANSYS user material subroutine USERMAT for detailed description of how to write a USERMAT routine KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKK kk kk kk kk kk kk Sk kk kk Sk kk kk ko ko ko ko ko ko ko k kc k kk kk input arguments matid int sc l material elemId int sc i element i4 kDomIntPt int sc i k th domain integration point kLayer int sc 1 k th layer kSectPt int sc i k th Section point ldstep int sc i load step number isubst int sc i substep number nDirect int sc in of direct compone
241. cm bmcm epsl epst ftl dftl tref tvc dvc x dsig rsig cm kerr cml perform visco elastic computation stiffness pass notice this routine contains ansys inc confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc input arguments veinpt dp ar 95 in viscoelastic input data ncomp int sc in number of components 4 or 6 tem dp sc in temperature dtem dp sc in incremental temperature ex dp sc in bulk modulus at infinite time gxy dp sc in shear modulus at infinite time smcm dp ar ncomp ncomp in material matrix for shear modulus bmcm dp ar ncomp ncomp in material matrix for bulk modulus epsl dp ar ncomp in strain for previous iteration epst dp ar ncomp in total strain for current iteration tref dp sc in reference temperature output arguments eex dp sc out effective bulk modulus egxy dp sc out effective shear modulus phil dp sc inout previous shift factor zil dp sc inout previous pseudo time gll dp ar ncomp 10 out recursive shear relaxation g21 dp ar ncomp 10 out recursive bulk relaxation hsm dp ar 10 out recursive shear relaxation hbm dp ar 10 out recursive bulk relaxation ftl dp sc inout previous fictive temperature dftl dp ar 10 out incremental fictive temperature tvc dp sc inout total volume change dvc dp sc out incremental volum
242. code section entered e 25 unable to open x11 server c 30 quit signal a 31 failure to get signal in max time 290 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 8 3 3 vsum Function Summing Vector Components syhold gt 32 system dependent error 35 fatal error on another process distributed ANSYS output arguments none 8 3 Vector Functions 8 3 1 vdot Function Computing the Dot Product of Two Vectors deck vdot function vdot vl v2 n c primary function compute dot product of vectors vl and v2 c Notice This file contains ANSYS Confidential information c input arguments G v1 dp ar n in vector vl a v2 dp ar njin vector v2 e n int sc in length of vectors vl and v2 C output arguments o vdot dp sc out dot product of vl and v2 ras 8 3 2 vidot Function Computing the Dot Product of Two Vectors with Incre ments deck vidot function vidot vl incl v2 inc2 n c primary function compute the dot product of vectors vl and v2 output arguments vidot dp sc out dot product c with increments c Notice This file contains ANSYS Confidential information a c input arguments v1 dp ar incl n in vector vl rei incl int sc in increment first dimension of vector vl G v2 dp ar inc2 n in vector v2 e inc2 int sc in
243. components DefGrad are equivalent to deformation gradient F at the current time UserMat Input Output Arguments stress Double precision array containing the stresses Its size is defined by the ncomp input value The stress measure is the true stress It is passed as the values of stresses at the beginning of the time increment and must be updated to the values of stress at the end of the time increment For finite deformation problems the stresses are rotated to account for rigid body motio before they are passed in and thus only the co rotational portion of stress integration is required in UserMat Double precision array containing the state variables Its size is defined via the TB STATE command It is passed as the values of state variables at the beginning of the time in crement and must be updated to the values of the state variables at the end of the time increment For finite deformation problems any vector or tensor type of state variables must be rotated to account for rigid body motion before they are used in any constitutive calcu lations the rotation matrix rotatM is passed in for that purpose Double precision array containing the plastic strains The strain measure is the true strain Its size is defined by the ncomp input value It is passed as the values of the plastic strains at the beginning of the time increment and must be updated to the values of the plastic strains at the end of the time increm
244. constant element records do not vary by mode rel VOL dp nelm 1 Element volume e EPT dp nelm size Element structural nodal temperatures e EUL dp nelm size Element Euler angles c ESL int 10 ptrENS ptrEEL ptrEMS ptrENF ptrENG re ptrENSh ptrEELh ptrEMSh ptrENFh ptrENGh e above pointers are relative to ptrESL c non constant element records do vary by mode e ENS dp nelm nmode size Element nodal component stresses e EEL dp nelm nmode size Element nodal component elastic strains e EMS dp nelm nmode size Element summable miscellaneous data e ENF dp nelm nmode size Element nodal forces e ENG dp nelm nmode 3 Element energies e see fdresu inc for more information on the element results 1 6 Description of the Element Matrices File This section explains the content of the element matrices file jobname emat 1 6 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 2 1 6 2 EMAT File Format comdeck fdemat c copyright c 2008 SAS IP Inc All rights reserved c ansys inc dcc GO ee description of element matrix file 4AXX mpg fdemat inc eoelem elostr eofini outelm elfini EmatAssemble sffini eqprep sfform elstrt slvstr emat file description Y Y vo GO character 8 EMATNM parameter EMATNM emat V LONGINT ematfpL ematfp integer ematbk ematut common fdemat ematfpL ematbk ematut equivalence ematfp
245. contains ANSYS Confidential information ae input arguments c node int sc in node number c vctn dp ar 6 in array of 3 nodal coordinates and c 3 nodal rotation angles c kcrot int sc in local coordinate system in which the nodal c coordinates and angles are defined c output arguments none 7 2 4 ndgall Function Getting the XYZ Rotation Coordinates Vector for a Node deck ndgall function ndgall node xyz C primary function get x y z rotx roty rotz vector for a node c Notice This file contains ANSYS Confidential information e input arguments c node int sc in node number for operation c output arguments c ndgall int sc out status of node e 0 node is undefined c l node is unselected e l node is selected c XYZ dp ar 6 out vector containing x y z rotx roty rotz 7 2 5 ndspgt Subroutine Getting the Nodal Solution for a Node of an Element deck ndspgt subroutine ndspgt node dofs ndof nrot xyzang nuvect unode C primary function get the nodal solution for a node of an element Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 220 of ANSYS Inc and its subsidiaries and affiliates 7 3 1 elmiqr Function Getting Information About an Element c Notice This file contains ANSYS Confidential information input arguments node int sc in The node number dofs int ar DOFBITLENG in
246. coordinates of a unique node in the order X Y Z THXY THYZ and THZX Nodal order corresponds to that of the node list given above xyzang j i j 1 6 42 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 8 2 CMS File Format EDG dp nedge 6 This record contains beginning and ending locations X1 Y1 21 X2 Y2 22 coordinates of a straight line comprising an edge of the substructure qaaaqa This record describes global degrees of freedom of the unique nodes in ascending order as used during the analysis use pass This index is calculated as N 1 324DOF where N is the node number and DOF is the DOF reference number given above 1 i i 1 nmrow sorted GDF 3 E nmrow 00n0n00n00nn CG dp 1 10 total mass CGx CGy CGz 6 moments of inertia Q The substructure matrices are written at this position in the file One row of each matrix is written to the file at a time i e the first row of each matrix is written then the second row of each matrix etc this pattern continues until all nmrow rows of each matrix have been written to the file MAT dp nmrow Row of the stiffness matrix if nmatrx gt 0 ak i j i 1 nmrow dp nmrow Row of the mass matrix if nmatrx gt 1 am i j i 1 nmrow dp nmrow Row of the damping matrix if nmatrx gt 2 ac i j i 1 nmrow dp nmrow Row of the stress st
247. cs File Contents SAILLHCAB3 Text 139 2930 3 2A Text Size Default OAAAAAAPPPLPO Window 0 0 4095 3070 AAAAAA Move 0 0 LPOAAA Draw 3070 0 LPOLPO Draw 3070 3070 AAALPO Draw 0 3070 Draw 0 0 BLLKBAB1 Text Color Cyan Text 27 2977 1 Text Color White EKJBLAGZV 1 Text 3146 2331 ZV 1 EKILPAJDIST 0 55 Text 3146 2239 DIST 0 55 EKIGCAIXF 1 5 Text 3146 2146 XF 1 5 EKIAGAIYF 0 5 Text 3146 2054 YF 0 5 EKHKKAPCENTROID HIDDEN Text 3146 1962 CENTROID HIDDEN BOABOCA ANSYS 5 3 Example Graphics File Text 30 30 ANSYS 5 3 Example Graphics File End Plot No Op Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 95 96 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Part Il Guide to ANSYS User Programmable Features Chapter 5 Using User Programmable Features UPFs The ANSYS program has an open architecture allowing you to write your own routines or subroutines in C or in Fortran and either link them to ANSYS or use them as external commands Some standard ANSYS features originated as user programmable features UPFs You can take adva
248. cs File Format cccccccccccsssssssnsceececceseseesnneeceeeceeseeesnnaeeeeeceeseneesnaeeeeeeseeseeeeaaees 88 4 2 1 Characters the Graphics File Uses ccceecesssssssccceeceesseessnneeeceececesseessnaeeeceeeeseeeesnnaeeeeees 88 4 22 Graphics File Directives cccccccccssssssssneccceeccsssessnssceceeccesseessnaeeceesecssssessauseeeeesessseeeennees 89 4 2 2 1 Parameter Types for Graphics File Directives cccssssssecccceceesseseneeeeeeeeeeeesesenaeees 89 42 2 2 Directive Descriptlons aa usse dus d or eee dd eer Ee ete ave epe pe EL eR o ey Pede Y eR uds 90 4 2 2 3 Color Specification 5 1 eroe rtm nente eontra te ee Rame Re esp ert eene rere eer 92 4 3 Decoding a Graphics File an Example ccesesccccccceceesseeenneceeeeceeeeeeesnnneeeceecceseeessnaeeeeeeeeeeeees 93 4 3 1 The Example Command Stream ccccccccessssssneccececceeeeeesnnceeeeeeceesseesnneeceeeeeeeeeesnneeeeeeeeess 93 4 3 2 Example Graphics File Contents ssssssssseseeeee eene e e nnn nnn n enn nnns sns sss s senis 94 Il Guide to ANSYS User Programmable Features eese eene 97 5 Using User Programmable Features UPFs essseeeeeeeeneeeeeenn nennen nnne 99 5 1 What Are UPES 55i eerte er terere te reete vet ce edet vdd 99 5 2 What You Should Know Before Using PES eser ta rx oe eei veter o ee elu ede en RR 100 5 3 Planning Youb UPES 5s dtess testor areis vasa esr ret AV
249. d ansys inc Notice This file contains ANSYS Confidential information BRK IK RK KI I KK e e RK I kk Ck kk e e Kk Ck Kk Fe kk Ck Ck kk e Fe kk KC kk Ck kk Ck Ck Kk KC Ck I Ke see user01 for additional information on user routines NCKCKCKCKCkCkCkCkCkCkCkCk A I RR e Fe A kk kk Kk e e e Ck kk Ck ko kk A A ke k kc ko k k k k k k k kk ke kkk eek f input arguments none output arguments user02 int sc out result code should be zero which is ignored for now Kk Ck Ck Ck Ck Ck Ck C CC Ck CC 00k Ck KKK Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck Ck kk ck ck ck ck ck ckckckckckckckckck Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 195 Chapter 6 UPF Subroutines and Functions e ON Oo oo c Functions for accessing data on the command line integer function intinfun iField gets an integer from field iField double precision function dpinfun iField gets double precision character 4 ch4infun iField gets upper case 4 characters character 8 ch8infun iField gets mixed case 8 characters character 32 ch32infun iField gets mixed case 32 characters kkxkxkxkxkkxkxkkkkkxkxkkkkkkkkkkkkkkkkkkkkkkxkxkkkkkkkkkkkxkxkkkkkkkkkkxkxxkx k include impcom inc include ansysdef inc external TrackBegin TrackEnd external wringr ndingr ndgxyz ndpxyz erhandler dpinfun in
250. d as input based on other ANSYS input Ge SOE 3090 SO EU SGI SOG SG SOY SO SOG SG 3030 563 SOG BO QU SGI SOG 303 SOY SG EGY SON S19 SGN SOC 503 5039 SG SO 300 argu dp sc out position in wave radians eta dp sc out total wave height VXyZ dp ar 3 out particle velocities axyz dp ar 3 out particle accelerations ar dp sc out radial particle acceleration pdynam dp sc out dynamic pressure head phead dp sc out pressure head c include impcom inc include ansysdef inc include acelcm inc include sectionsize inc G arguments integer x elemId secId pCur nw double precision x xyzg 3 doIns depth denswat watcur watwav timval x argu eta vxyz 3 axyz 3 ar pdynam phead c local integer x iw in kmf kpeak double precision Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 187 Chapter 6 UPF Subroutines and Functions x con tpt ao rkd asint eti etidot ss cs ca de x vr etadot r cswav 2 tothead facdep rk dperr 2 external erhandler wavHtSec external wvargu wvhybl double precision wvargu wvhybl c e also remove the following used only for the ANSYS code analyzer in elemId secId con watcur pCur 1l timval Cc The below demonstrates a simple Airy wave sequence c The current is not demonstrated C 2222222222 222 2 2 2 c watwav
251. d is nodfor For shell elements except SHELL41 and SHELL91 the record contains nodal temperatures at each corner node for the top surface and the bottom surface The number of items in this record is nodstr 2 For SHELL91 and SOLID191 the record contains nodal temperatures at each corner node for the bottom of the bottom layer and each succeeding interlayer surface up to the top of the top layer The number of items in this record is NL 1 nodstr For layered shell elements SHELL181 N eo Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format qQaaqaqaqagnqagagqagagqagaagaagaagaagqaaaa qa qaaaa Q qaqaaa Q qaqaaa Q qgqaaqaaqaaa Q Q000000000000000n n0n0 ESF dp SHELL281 SHELL208 SHELL209 and layered solid elements SOLID185 SOLID186 and SOLSH190 the record contains temperatures for each layer at each corner node first at the bottom layer surface then the top Therefore the number of items in this record is NL 2 nodstr for layered shells and NL nodstr for layered Solid elements For layered membrane elements SHELL181 SHELL281 SHELL208 and SHELL209 with KEYOPT 1 1 the record contains temperatures for each layer at each corner node Therefore the number of items in this record is NL nodstr For beam elements the contents and number of data i
252. d of information is stored in this record e i integer e dp double precision ie cmp complex e e nrec tells how many records of this description are found here e e lrec tells how long the records are how many items are stored e S c recid type nrec lrec contents i 1 100 standard ANSYS file header see binhed for e details of header contents Qu we i 1 40 CMS FILE HEADER e c fun45 negn nirfm nnorm ncstm e 0 0 0 0 0 e 0 0 0 0 0 e 0 0 0 0 0 e 0 0 0 0 0 e 0 0 0 0 0 c ptrIRFS ptrNORS ptrCSTS O ptrIRFL c ptrNORL ptrCSTL 0 0 0 e each item in header is described below oc fun45 unit number e neqn number of equation in BCS ic nirfm number of inertia relief modes c nnorm number of normal modes e ncstm number of constraint modes c 0 available in file e 0 NA in file rel ptrIRFS ptrIRFL pointer to inertia relief modes c ptrNORS ptrNORL pointer to normal modes c ptrCSTS ptrCSTL pointer to constraint modes e c 0 position not used e i 1 neqn BCS to ANS mapping 1BCStoANS i i 1 neqn e e NOR dp nnorm neqn Normal Modes e e IRF dp nirfm neqn Inertia Relief Modes e c GST dp ncstm neqn Constraint Modes 1 9 Description of the Full Stiffness Mass File This section explains the contents of the full file jobname full 1 9 1 Standard ANSYS File Header
253. d rdfull120 Use the userprog command line option when writing your own customized program naming the routine userprog F The resulting executable will be named userprog e120 When userprog is used no files are copied from ansys_inc v120 ansys customize misc to your working directory The procedure file is named userprog120 These files will be loaded onto your system only if you performed a custom installation and chose to install the customization tools 2 1 2 Characteristics of ANSYS Binary Files Before accessing ANSYS binary files you need to know certain file characteristics 1 An ANSYS binary file is a direct access unformatted file You read or write a record by specifying as a number what location to read or write 2 Before the ANSYS program actually writes data to a file on a disk it uses buffers to store data in memory until those buffers become full A block number designates these buffers Most access routines use this block number 3 By default ANSYS files are external files The standardized external format the files use enables you to transport them across different computer systems 4 n addition to file names ANSYS uses file numbers to identify the files File handles and other inform ation are associated with the file numbers 5 Some binary files contain data values that point to the start of certain data for example the start of the data steps index table record Both the ANSYS program and external
254. d value of ecvigqr is based on e setting of key a 7 6 6 ecvget Function Getting an Element Face Convection deck ecvget function ecvget elem iface value C primary function get an element face convection in raw form c Notice This file contains ANSYS Confidential information c input arguments c elem int sc in element number c iface int sc in face number 1 6 c output arguments ol ecvget int func out status of element c 1 element has no convections heat c fluxes e 0 this element face has no amp convections heat fluxes e gt 0 number of values defined c value dp ar out the element convections NOTE Two values at each node of an element face if loading is a convection the first first value is the film coefficient and the second value is the bulk temperature If loading is a heat flux the first value is the heat flux and the second value is a large number 2 100 Q0Q0n0n0n0nnon 7 6 7 ecvput Subroutine Storing an Element Face Convection deck ecvput subroutine ecvput ielem iface nval value C primary function store an element face convection c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout c input arguments c variable typ siz intent description c ielem int sc in element number c iface int sc in face number 1 6 c nval int sc in
255. data to be defined Valid labels are LOC read in system origin ANG read in rotation angles and PRM read in system parameters NCSY The coordinate system reference number CSYTYP The coordinate system type 0 1 2 or 3 VALI VAL2 VAL3 Values to be read f Type is LOC values are the system origin in global Cartesian coordinates f Type is ANG values are the rotation angles in degrees Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 1 of ANSYS Inc and its subsidiaries and affiliates 8 Chapter 3 The CDWRITE CDB File Format f Type is PRM values are the first and second parameters of the system 3 2 15 M Command The M command defines a master degree of freedom The command format in Jobname CDB is M R5 0 NODE D1ab NODE The node number Dlab The DOF label 3 2 16 MPDATA Command The MPDATA command defines a material property data table You repeat the command until all properties are defined The command format in Jobname CDB is MPDATA R5 0 LENGTH Lab MAT STLOC VALI VAL2 VAL3 LENGTH The total number of temperatures in the table Lab The material property label See the MP command description in Command Reference for valid labels MAT The material reference number STLOC The starting location in the table for the next three property values VAL1 VAL2 VAL3 Property values assigned to three locations
256. densities defined in model c output arguments amp ecdiqr int func out the returned value of ecdiqr is based on c setting of key 7 7 58 ecdget Function Getting an Element Current Density deck ecdget function ecdget ielem value C primary function get calculated element current densities c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c output arguments c ecdget int func out status of element e 0 element has no current densities e gt 0 number of calculated element e current densities value dp ar out calculated element current densities NOTE current densities are in the order X X ZA a a 7 7 59 ecdput Subroutine Storing an Element s Current Densities deck ecdput subroutine ecdput ielem nval value c primary function store calculated element current densities c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c nval int sc in the total number of values c value dp ar nval in calculated element current densities Cc output arguments none amp NOTE current densities are in the order c Xy X2 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 80 of ANSYS Inc and its subsidiaries and affiliates 7 7 62 enlget Function Getting
257. design optimization done with a user customized version For information about the kopusr variable and the userop subroutine see the next section 6 10 2 Subroutine userop Defining a Custom Optimization Subroutine Instead of creating your custom design optimization subroutine from scratch you can simply tailor the userop subroutine available on your ANSYS distribution medium Defined within this subroutine are a number of variables to which you assign the values you want Below is a listing of the header information foruserop which includes the inputs and outputs and an example user optimization deck userop USERSDISTRIB subroutine userop iott nterm maxparm optvar primary purpose user supplied optimization routine accessed with optype user other input comes from the opuser command copyright c 2008 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information KEKE KKK ck ck ck ck ck ck ck kk ck ck ck ck ck ck ck ck ck ck ck ck ck ck KKK ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck KKK KE KEKE KEKE KKK KKK ckocko ko ko ko ko ko ko ko ko ko kv incoming arguments iott ansys output unit x nterm looping control parameter passed back to routine opterm this variable should be set x as follows i nterm 0 if optimization looping should stop x nterm 1 if optimization looping should continue maxparm maximum number of parameters first dimens
258. deu par teo od Re EUREN 305 A 1 4 Setting the ANSYS EXTERNAL PATH Environment Variable eese 306 Alb Using External COmMmmMaNdS aasdes cep trame rrr efe abe erbe Regent Dese t ms dito pedit 306 A 1 6 Checking External Command Status a ceo p rores a v ea Geop ta a E red suas PER e 306 A 1 7 Resetting External Commands isse dpi neni e erase aa d HERR Sega bera pana P Cola 306 B Creating External Commands in Windows eese enne eene enne nnne enne 309 B 1 Tasks iti Creating an External Command sce stri tti rer RP PER T hab vd ie ch ae 309 B 1 1 Creating Compatible COdYB causer roh erani eate dur n cce rd ir Gov PURGE dera 309 B 1 2 Creating a New Project 2 erre repentina ne rana a na Re Ra ek HL a ai 310 B 1 3 Creating an External Definition File eeeeseeeeeeeeeeeee eene eene nne enne 310 Bil 4 Creating a Shared EIDEaEV oap ariii a Ca ae o a o gm Bas a s 310 B 15 Creating an External Table File sides eara eda ha E E D T Ver rib Eh EUER MN NEA Na 311 B 1 6 Setting the ANSYS EXTERNAL PATH Environment Variable ccccccccssssstteeceeeeeeeeeees 311 B 1 7 Using External Commands qt pr Wr hbnr YR MERO RE ER Ee DER RN oa Vas 312 B 1 8 Checking External Command Status eese eene eene nennen 312 B 1 9 Resetting External Commands oos iur phan RR VRI cil eH LbNC ORA EC EREP S Ape CYRK Y GARD V EPRg A 312 C User Material UserMat Subr
259. drostatatic but not hydrodynamic effects ex dp sc in Young s Modulus pois dp sc in Poisson s ratio sflex dp ar 6 inout input flexibility factors axial bending about element z bending about element y twist y shear z shear twten dp sc inout twist tension factor output arguments sflex dp ar 6 inout output flexibility factors axial bending about element z bending about element y twist y shear z shear twten dp sc inout twist tension factor Q00000000000000n000Q 6 3 9 Subroutine usflex Computes the flexibility factor for PIPE16 PIPE17 PIPE18 and PIPE60 deck usflex USERSDISTRIB subroutine usflex etype elem rvrm kff prs ex flexi flexo primary function to re compute the flexibility factor for pipel6 pipel7 pipel8 and pipe60 this is accessed by inputting the flexibility factor as any negative number secondary functions none Notice This file contains ANSYS Confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc typz int dp log chr dcp siz sc ar n intent in out inout input arguments variable typ siz intent description etype int sc in pipe element type 16 17 18 or 60 elem int sc in element number rvrm dp ar in real constants kff int sc in keyopt for flexibility factor not used for pipel6 or pipel7 prs dp ar 5 in pressures ex dp sc in young s Modulus flexi dp sc inou
260. ds to the c nodal equivalence table 32 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 5 2 MODE File Format Q qaqaaqaaqaa anaana qgqaaqaaaa qaqaaqaaa qaaqaaqaaagqaa qa qaaqaagqaagagqagaagqaaaa RES LOD IRHS LPM STF MAS DMP dp nresi nmrow dp nmrow dp nmrow dp nmrow dp nmrow nmrow dp nmrow nmrow dp nmrow nmrow for each spectrum nspect recor For SPRS it is written by redpcl F lanpcl F subpcl F For MPRS and PSD it is written by writeSpecInModeFile F SPL ELM ERS dp 1 nmode nresi dp 1 nmode nresi dp 1 nmode nresi dp 1 613 dp 1 20 int 1 15 P pt pt p above pointe int 1 2 nItems int 1 nelm int nItems nelm psi i j i 1 nmrow residual vectors Load vector This record is present only if extopt 0 or 1 i i 1 nmrow Imaginary Load vector This record is present only if extopt 6 Lumped mass vector This record is present only if lumpms 1 and nmatrix 0 It is a vector containing the mass at each node in the system mass i i 1 nmrow Reduced stiffness matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx gt 0 Row order is the same as the DOF order stored at position ptrRDF ak i j 1 1 nmrow Reduced mass matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx gt
261. dva entries are the modal e displacements For the last six entries c 1 Time for these displacements el 2 Load step number e 3 Substep number e 4 Cumulative iteration number c 5 Scale factor zero if the analysis uses c the reduced method e 6 numdeflvs number of scale factors e SSS dp 1 ndva Calculated modal velocities e dp 1 ndva Calculated modal accelerations 1 4 Description of the Reduced Complex Displacement File This section explains the content of the reduced complex displacement file jobname rfrq 1 4 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 10 1 4 2 RFRQ File Format comdeck fdrfrq C copyright c 2008 SAS IP Inc All rights reserved C ansys inc c WOo3ee description of reduced complex displacement file wxxx character 8 RFRONM 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 6 of ANSYS Inc and its subsidiaries and affiliates 1 4 2 RFRQ File Format c Cc c co co co Q qa qaaaa qaaqaagaagagqaaagqaa Q Q qQaaqaqagqagnqagagqagagqagaagaagaagqaagqaaaaa parameter RFRONM rfrq i LONGINT rfrgfpL rfrqfp integer rfrqbk rfrqut common fdrfrq rfrqfpL rfrqbk rfrqut equivalence rfrqfp rfrqfpL write harmcl harmin harmwr write hrfrcl hrfreq read harstr xxKKKAKXX co
262. e 1 6 delete impedance on this face Q output arguments none Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 254 of ANSYS Inc and its subsidiaries and affiliates 7 6 34 esfput Subroutine Storing Element Surface Stress Data 7 6 32 esfiqr Function Getting Information About Element Surface Stress Data deck esfiqr function esfigqr ielem key c primary function get information about element surface stress data c Notice This file contains ANSYS Confidential information g input arguments G ielem int sc in element number or zero see below o key int sc in key as to the information needed e return info about surface stress e ielem 0 return number of surface stresses on this e element rec length e 0 return maximum number of surface stresses e on any element max rec length c DB NUMDEFINED return the number of surface stresses e defined in model c output arguments c esfiqr int func out the returned value of esfiqgr is based on c setting of key 7 6 33 esfget Function Getting Element Surface Stress Data deck esfget function esfget ielem value C primary function get element surface stress data c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number c output arguments e esfget int func out status of el
263. e gt 0 number of data items on selected element type ielx int ar out element type data see elccmt for description of data Q Qoo Qc c mpg etyget lt ell17 edgcntfl1 edgcntsz edgrde edgrecc edgmul get elem type 7 3 6 etyput Subroutine Storing Element Type Data deck etyput subroutine etyput itype n ielx C primary function store element type data c Notice This file contains ANSYS Confidential information ae input arguments c itype int sc in element type number for operation c n int sc in length of data vector to store c ielx int ar in element type data see elccmt for c description c output arguments none c 2007 nov 5 c mpg etyput lt etymod etydef dirasmdft dasupd dasdft update elem type active 7 3 7 echrtr Subroutine Getting Information About Element Characteristics deck subroutine echrtr iott elcdn ielc kerr es primary function collect all element characteristics based on c ityp jtyp and keyopts Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description iott int sc in printout file ielc int ar IELCSZ inout input element characteristics in positions 1 to 20 itype jstif keyopts etc output arguments elcdn chr sc out element descriptive name as character string ielc int ar IELCSZ inout
264. e UserMat Creating Your Own Material Model 6 4 1 4 UserMat Variables 6 4 1 5 Table TB Commands for UserMat 6 4 1 6 Material Constitutive Integration with UserMat 6 4 1 7 UserMat Restrictions 6 4 1 8 Accessing Material and Element Data for UserMat 6 4 1 9 Utility Functions for UserMat For a UserMat subroutine example see Appendix C p 313 6 4 1 1 UserMat Overview The UserMat subroutine defines the material stress strain relationship of a material and applies to any ANSYS analysis procedure involving mechanical behavior The subroutine supports current technology ele ments only and does not apply to legacy elements The subroutine is called at every material integration point of the elements during the solution phase ANSYS passes in stresses strains and state variable values at the beginning of the time increment and strain incre ment at the current increment then updates the stresses and state variables to the appropriate values at the end of the time increment Input values and the number of state variables if used for UserMat are specified via the TB command For more information see Table TB Commands for UserMat p 161 Further Reading ANSYS recommends the following resource to help you understand the ANSYS implementation of user defined materials Hughes Thomas J R and James Winget Finite Rotation Effects in Numerical Integration of Rate Constitutive Equations Arising in Large Deformation Analysis
265. e assumed to be Fortran some extensions are allowed and C files are assumed to be ANSI C For more information on Fortran compilers please refer to the ANSYS Installation Guide specific to your operationg system When relinking on UNIX or Linux systems you can choose to link a distributed version of ANSYS as well If you choose to link a distributed version the executable ansyscustdis e120 must reside in the same directory path on all systems However you need to link it on only one system you can then copy the ex ecutable to the other systems The Installation and Configuration Guide specific to your operating system lists the compilers you will need to use UPFs ANSYS Inc UNIX Linux Installation Guide ANSYS Inc Windows Installation Guide Creating a Shared Library You can also set up UPFs on some UNIX and Linux systems through a shared library as an alternative to creating a custom ANSYS executable All Fortran F C c and C cpp files that you want to include in your shared library should reside in your working directory To compile all F c and cpp routines issue the following command ansys inc v120 ansys customize user ANSUSERSHARED If the compile was successful you will be asked if a shared file is to be created Choose Yes to create a shared library named 1ibansuser so or s1 To use this library set the ANS USER PATH environment variable to point to the working directory where the 1ibansuser
266. e bottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 stresses for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LS item of ETABLE command Q0000000000000000000000010Q 7 7 16 ensdel Subroutine Deleting an Element s Nodal Stresses deck ensdel subroutine ensdel ielem C primary function delete element nodal stresses c Notice This file contains ANSYS Confidential information c input arguments o ielem int sc in element number e 0 delete for all defined elements G output arguments none 7 7 17 engiqr Function Getting Information About an Element s Energies deck engiqr function engiqr ielem key C primary function get information about element energies c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed c 1 return info about element energies e ielem 0 return number of element energies on c this element rec length e 0 return maximum number of element e energies on any element c max rec length c DB NUMDEFINED return the number of element energie
267. e change dsig dp ar ncomp out stress change rsig dp ar ncomp out stress relaxation cm dp ar ncomp ncomp out total material matrix kerr int sc out error key argument of convenience cml dp ar ncomp ncomp none no value used only to avoid simplify logic due to variable array sizes mA OG Eoo doo ooo oo Moo G A nl O O O i a a Oe Oa a G a O ONE O mn 0 Be 6 5 9 Subroutine usrsurf116 Modifying SURF151 and SURF152 Film Coeffi cients and Bulk Temperatures deck usrsurf116 USERSDISTRIB subroutine usrsurf116 elem ielc center jdim kaxis time nr u x omeg ndat temvel hc tb key c primary function change element convection surface info for surf151 and or surf152 based on information from fluid116 It is called by e1151 and e1152 in order to activate this user programmable feature the user must have used fluid116 with keyopt 2 1 Further surf151 and or surf152 must have keyopt 5 1 include extra node Finally for this routine to do anything key 1 and or key 2 must be reset in this routine to a nonzero number There is no usrcal control over this routine Q0000n0n0n0n0n0nnnon Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 184 of ANSYS Inc and its subsidiaries and affiliates 6 5 9 Subroutine usrsurf116 Modifying SURF151 and SURF152 Film Coefficients and Bulk Temperatures Qo0nQ0n0n0n000nn0nn
268. e control ldstep isubst ieqitr timval keyEleErr keyEleCnv int sc inout int sc in int sc in int sc in int sc in int sc inout current load step number current substep number current equilibium iteration number current time value key to indicate if there is any element formulation error like negative Jacobian The error could be caused by too large incremental step illegal model 0 no error preset value before calling 1 some error happens ANSYS will decide to stop the analysis or cutback the substep bi section based on other user input and information at higher level key to flag if this element satisfies the user defined element convergence criterion 1 yes the criterion is satisfied or don t have any criterion at all it is preset value before calling 0 no the element doesn t satisfy element convergence criterion If this is the case the iteration will not converge even when both force and displacement converge end of 7 variable group eStiff dp ar nUsrDof nUsrDof inout eMass dp ar nUsrDof nUsrDof inout eDamp dp ar nUsrDof nUsrDof inout damping matrix eSStiff dp ar nUsrDof nUsrDof inout stress stiffness matrix keyMtx 4 requested i stiffness matrix keyMtx 1 7 mass matrix keyMtx 2 keyMtx 3 f 1 1 1 1 1 1 fExt dp ar nUsrDof out applied f vector keyMtx 5 fInt dp ar nUsrDof out internal force vector keyMtx 6 c
269. e right upper corner of the image gt AP The Text Color directive which sets the color of displayed text gt is the command character AP is a parameter value specifying the color SMEKLKBAJANSYS 5 3 The first of several Text directives is the command character MEKLKB are the coordin ates for the text AJ is the number of charac ters in the string and ANSYS 5 3 is the text string itself SMEKLEFALNOV 15 1996 A second Text directive defining the position and length of the string NOV 15 1996 SMEKKOJAI10 01 40 A third Text directive defining the position and length of the string 10 01 40 4 2 2 1 Parameter Types for Graphics File Directives The descriptions of graphics file directives in the next section include discussions of the parameter or para meters for each directive There are five types of parameters Parameter Parameter Attributes Valid Parameter Values Type Int 1 byte base 16 letters Athrough O through 15 P Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 89 Chapter 4 ANSYS Graphics File Format Parameter Parameter Attributes Valid Parameter Values 2 bytes base 16 letters A through P 3 bytes base 16 letters A through P 0 through 255 0 through 65535 6 bytes base 16 letters A 0 through 4095 mapped to coordinate space of through P 1 0 to 1 67
270. e svpidx Writing the Saved Variable Element Index to a File 135 6 2 6 Subroutine mreuse Determining Which Element Matrices Can Be Reused 135 6 2 7 Subroutine subrd Reading Element Load Data for a Substructure Generation Run 136 6 2 8 Subroutine subwrt Writing an Element Load Vector to a File for a Substructure Generation MU E LITE P 137 6 2 9 Subroutine rvrget Fetching Real Constants for an Element eee 137 6 2 10 Subroutine propev Evaluating a Group of Material Properties ssessseees 138 6 2 11 Subroutine propel Evaluating One Material Property sssesesssesssessseessssssssseeeeessssssseeee 139 6 2 12 Subroutine pstev1 Evaluating Material Properties for 1 D Elements 139 6 2 13 Subroutine tbuser Retrieving User Table Data eeeeeseeeeeeeeennennns 139 6 2 14 Subroutine plast1 Updating an Element s Plastic History sssccccceceeseesenteeeeeeeees 140 6 2 15 Subroutine plast3 Updating an Element s Plastic History 4 or 6 components 140 6 2 16 Subroutine creep1 Updating an Element s Creep History eeeeeeeeeeenene 141 6 2 17 Subroutine creep3 Updating an Element s Creep History 3 D Elements 142 6 2 18 Subroutine swell1 Updating an Element s Swelling History eene 142 6 2 19 Sub
271. each item in header is described below funl2 unit number resu file is 12 maxn maximum node number of the model nnod the actual number of nodes used in the solution phase resmax the maximum number of data sets allowed on the file defaults to 1000 minimum allowed is 10 numdof number of DOFs per node maxe maximum element number of the finite element model nelm number of finite elements kan analysis type nsets number of data sets on the file ptrend pointer to the end of the file see ptrEnd8 in 23 24 ptrDSI pointer to the data steps index table ptrTIM pointer to the table of time values for a load step ptrLSP pointer to the table of load step substep and cumulative iteration numbers ptrELM pointer to the element equivalence table ptrNOD pointer to the nodal equivalence table ptrGEO pointer to the beginning of geometry information ptrCYC pointer to the table of cyc sym nodal diameters at each load step CMSflg CMS results flag O non cms gt 0 cms csEls Cyclic sym eles in master sector units unit system used PA E EER SQ CY Qa QE oa Das Qc Q3 5492 0 292 0 492 299 c Qa Q2 OE Qa Qr oe Qe ox Qe 6 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format qQaaqaaqagangqagagqagagqagaagaagaagaagaagaagqaagaaaaaa qagaaqaa
272. ealOld ImagOld c ResRdFix int sc out Number of returned values 0 or 4 2 3 13 ResRdForc Retrieving Applied Nodal Loads Solution deck ResRdForc function ResRdForc node idof value c primary function Retrieve an applied force value c object library ResRd c input arguments c node int sc in External node number c idof int sc in Internal dof number C output arguments c value dp ar 4 in Real Imag RealOld ImagOld c ResRdForc int sc out Number of returned values 0 or 4 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 69 Chapter 2 Accessing Binary Data Files 2 3 14 ResRdEstr Retrieving Element Solutions deck ResRdEstr function ResRdEstr iStr Str c primary function Get an element s results object library ResRd a c input arguments c iStr int sc in element record number 1 25 C output arguments ResRdEstr int sc out Number of element values Str dp ar nStr out element values 70 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Chapter 3 The CDWRITE CDB File Format This chapter discusses how to write a coded database file Jobname CDB that can be used to export a model from ANSYS into another application The Job
273. ecid tells the identifier for this record Not all records will have ro identifiers they are only indicated for those records whose e record pointers are stored in the second file header el type tells what kind of information is stored in this record i integer C dp double precision c cmp complex nrec tells how many records of this description are found here e lrec tells how long the records are how many items are stored c recid type nrec lrec contents QU deme i 1 100 standard ANSYS file header see binhed for Cc details of header contents Gy aS i 1 40 RDSP FILE HEADER e fun10 nmrow nmatrx nmode numdof a maxn wfmax lenbac ngaps ncumit c kan nres ndva naload DSPfmt e 0 0 modlstp 0 0 C ptrDOF ptrDNC ptrSTF ptrMAS ptrDMP e ptrFRQ ptrDSP ptrSTFh ptrMASh ptrDMPh e ptrFROh ptrDSPh ptrDVA ptrDVAh 0 0 Oy 0 Oy 0 each item in header is described below Cc funlO unit number rdsp file is 10 c nmrow number of rows columns in matrices c nmatrx number of reduced matrices on the e file c nmode number of modes extracted during modal analysis or nmrow if reduced e method c numdof number of dofs per node c maxn maximum node number e wfmax maximum wavefront c lenbac number of nodes ngaps number of gaps ncumit total number of iterations done during analysis e kan analysis type e 5 for reduced transient analysis Cc nres
274. eck swelll subroutine swelll option elem intpt mat kstartL epswel epel e x fluen dfluen tem dtem usvr primary function to update the swelling history for 1 d elements used by LINK1 LINK8 BEAM23 and BEAM24 Notice This file contains ANSYS Confidential information input arguments 142 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 2 20 Function elLenPsvrBuf Determining additional ESAV Record for Plasticity c option int sc in swelling option c elem int sc in element number label c intpt int sc in element integration point number c mat int sc in material reference number o kstartL intL sc in virtual starting address of the data table co epswel dp sc inout swell strain at previous substep e epel dp sc inout elastic strain o e dp sc in elastic young S MODULUS e fluen dp sc in fluence at the end of this substep dfluen dp sc in fluence increment over this substep e tem dp sc in temperature at the end of this substep o dtem dp sc in temperature increment over this substep e usvr dp ar inout user defined state variables for usersw C output arguments e epel dp sc inout elastic strain adjusted for swelling inc o epswel dp sc inout updated swelling strain e usvr dp ar inout updated user defi
275. ector i e processing geometry c this routine also differs from vnorm in that an error message is called c if the vector length is zero c Notice This file contains ANSYS Confidential information c input arguments c iel int sc inout element number c v dp ar 3 inout vector to be normalized c output arguments c iel int sc inout if 0 vector has zero length c v dp ar 3 inout normalized vector 8 3 22 vnorm Subroutine Normalizing a Vector to Unit Length deck vnorm subroutine vnorm v n C primary function normalize a vector to unit length c Notice This file contains ANSYS Confidential information 296 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates a a a a 8 4 1 maxv Subroutine Multiplying a Vector by a Matrix input arguments v dp ar n inout vector v n int sc inout dimension length of vector v output arguments V dp ar n inout normalized vector v n int sc inout n 0 if error in operation 8 3 23 ndgxyz Function Getting the X Y Z Vector for a Node deck ndgxyz function ndgxyz node xyz C primary function get x y z vector for a node c Notice This file contains ANSYS Confidential information qgqaqaqaqaa Q a a input arguments node int sc in node number for operation output arguments ndgxy
276. ed Set deck cpsel subroutine cpsel ncpi ksel Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 231 Chapter 7 Accessing the ANSYS Database kkk kkk kkk Ov 296 209 GY KO Ji OO Oy Oi Je 20 primary function select or delete a coupled set secondary functions none Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout input arguments variable typ siz intent description ncpi int sc in coupled set number ksel int sc in select delete flag 0 delete coupled set 1 select coupled set output arguments none 7 4 5 ceinqr Function Getting Information About a Constraint Equation Set deck c KKK c KKK Q0Q0n0n0n0n0n0nQo0nQonQoaoQoaoaoaooooonononon a a ceingr function ceingr nce key primary function get information about a constraint equation set Notice This file contains ANSYS Confidential information input arguments nce int sc in constraint equation number key int sc in inquiry key should be zero for key 11 DB_NUMDEFINED DB_NUMSELECTED DB_MAXDEFINED and DB_MAXRECLENG DB_SELECTED return select status ceingr 1 equation is selected 0 equation is undefined 1 equation is unselected DB_NUMDEFINED return number of defined contraint equations
277. ed material properties highest material property number defined Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 225 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database e DB MAXRECLENG 15 maximum record length dp words c 2 return length dp words c 3 return number of temp values e 11 return void percent integer c output arguments el mpingr int func out returned value of mpingr is based on e setting of key 7 3 10 mpget Function Getting a Material Property Table deck mpget function mpget mat iprop temp prop C primary function get a material property table c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout c input arguments c variable typ siz intent description c mat int sc in material number c iprop int sc in property reference number c MP command labels c EX l1 EY 2 EZ 3 NUXY 4 NUYZ 5 NUXZ 6 GXY 7 GYZ 8 c GXZ 9 ALPX 10 ALPY 11 ALPZ 12 DENS 13 MU 14 DAMP 15 KXX 16 G KYY 17 KZZ 18 RSVX 19 RSVY 20 RSVZ 21 C 22 HF 23 VISC 24 c EMIS 25 ENTH 26 LSST 27 PRXY 28 PRYZ 29 PRXZ 30 MURX 31 MURY 32 c MURZ 33 PERX 34 PERY 35 PERZ 36 MGXX 37 MGYY 38 MGZZ 39 EGXX 40 c EGYY 41 EGZZ 42 SBKX 43 SBKY 44 SBKZ 45 SONC 46 SLI
278. ed on the element edge length Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 7 of ANSYS Inc and its subsidiaries and affiliates 5 Chapter 3 The CDWRITE CDB File Format ADPASS The one pass or two pass adaptivity option IREFLG The uniform refinement level flag ADPENE Adaptive mesh flag for starting adaptivity when approaching positive ADPENE or penetrating negative ADPENE the tooling surface ADPTH Absolute shell thickness level below which adaptivity should begin MAXEL The maximum number of elements at which adaptivity will be terminated NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 6 EDCGEN Command The EDCGEN command is used to define a contact definition for explicit dynamics The command format in Jobname CDB is EDCGEN R5 3 Option Cont Targ Lkey FS FD DC VC VDC V1 V2 V3 V4 BTIME DTIME BOXID1 BOXID2 Option The label identifying the contact behavior Cont The contact surface identified by component name part ID or part assembly ID Targ The target surface identified by component name part ID or part assembly ID Lkey A key identifying the meaning of Cont and Targ component part or part assembly FS The static friction coefficient FD The dynamic friction coefficient DC The exponential decay coefficie
279. edences c Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number for inquire should be zero for key DB NUMDEFINED DB MAXDEFINED or DB MAXRECLENG iface int sc in face number for inquire 0 6 face number is needed for key 5 for other values of key iface has different meaning see below key int sc in key as to the information needed 1 return impedence mask for element 5 return number of impedences for this element face DB NUMDEFINED DB MAXDEFINED return value is based on setting of iface NOTE both DB NUMDEFINED and DB MAXDEFINED produce the same functionality iface 0 return number of surface loads defined in model 1 6 return number of pressure loads defined for this element rec length NOTE only 1 6 is valid but this routine simply checks that iface is in the range The actual value of iface does not matter in this case DB MAXRECLENG return the maximum number of element impedences defined for any element max rec length 33033030 Oe sO Ge 303 3038 163 13 Os 03 03 203 03 503 303 SO SO sO Oe EO Oe Ge 5G c output arguments c eimiqr int func out the returned value of eimigr is based on Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 253 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database e setting of ke
280. eeeecesesesenteseeeees 8 3 Vector FUNGU ONS ep 8 3 1 vdot Function Computing the Dot Product of Two Vectors essssessssssessesresrsereessssressses 8 3 2 vidot Function Computing the Dot Product of Two Vectors with Increments 8 3 3 vsum Function Summing Vector Components eseseeeeeeeeeeeeneeene nennen nnne 8 3 4 vmax Function Retrieving the Maximum Vector Value at a Given Location 8 3 5 lastv Function Retrieving the Position of the Last Nonzero Term in a Double Precision VeCtOE E TAA ees sae ere toii better b n ec ip e Oed 8 3 6 izero Function Setting an Integer Vector to Zero ee eee eeeessseeeeceeeeesesssnaceeeeeeeeeesesnaaeeees 8 3 7 imove Function Assigning Equal Values to Two Integer Vectors seeeeeeee 8 3 8 vzero Subroutine Initializing a Vector to Zero eene 8 3 9 vmove Subroutine Moving One Vector into Another sessssssssessssssssssssessssreessssresssssresssee 8 3 10 vimove Subroutine Moving One Vector into Another Incrementally 8 3 11 vinit Subroutine Assigning a Scalar Constant to a Vector eeeeeeeeene 8 3 12 viinit Subroutine Assigning a Scalar Constant to a Vector Incrementally 8 3 13 vapb Subroutine Setting a Vector to Sum of Two Vectors eeeeeeeeeeeen 8 3 14 vapb1 Subroutine Combining Two Vectors in One
281. eep energy density C MatRotGlb dp ar 3 3 The rotation matrix from global e to material coordinate system kkxkxkxkxkxkxkxkkkkkxkxkkkkkkkkkkkkkkkkkkkkkkkxkkkkkkkkkkkxkkkkkkkkkkxkxkkkkkkkkkkxkxxkx k c 6 1 3 Creating a New Element by Directly Accessing the ANSYS Database The next few pages describe the user subroutines and supporting subroutines you use to create new elements Using these subroutines you can create new element types add them to the ANSYS element library and use them as regular elements You can create up to six independent element types names USER100 USER105 For demonstration purposes example copies of the subroutines for MASS21 the structural mass element and LINKS the 3 D spar element are included on the ANSYS distribution medium as ue1100 and ue1101 respectively 6 1 3 1 User Subroutines Subroutines uec100 through uec105 describe the element characteristics Subroutine elccmt on the distribution medium describes the input for these subroutines in detail You can use subroutines uex100 through uex105 to override default logic Subroutines uec100 through uec105 define parameters such as 2 D or 3 D geometry Degree of freedom set 128 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 3 Creating a New Element by Directly Accessing the ANSYS Database Symmetric or unsymmetric m
282. elastic material property interface com com element 1 solid185 defined via ANSYS standard MP command com element 2 solid185 defined using ansys elastic material interface com element 3 shell181 defined using ansys elastic material interface com prep7 esize l1 et 1 185 et 2 181 mp ex 1 210e6 mp nuxy 1 0 3 tb elastic 2 1 2 user user defined elastic material interface SOLID185 element mat 2 block 1 1 vmesh 1 mat 1 block l l vmesh SHELL181 element sectype 1 shell secdata 0 100000 1 secdata 0 100000 2 rect 1 1 secn 1l mat 2 type 2 amesh 1 elist all all nsel s loc x d all ux nsel s loc y d all uy nsel s loc z d all uz solu nsel s loc x 1 d all ux 0 05 alls solve fini postl set 1 pres s pres epel fini 6 4 5 Subroutine UserPL Writing Your Own Plasticity Laws ANSYS recommends using current technology elements and the UserMat subroutine for defining your own material model However if you are using a legacy element type and wish to define a plasticity or viscoplas Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidentialinformation of ANSYS Inc and its subsidiaries and affiliates 171 Chapter 6 UPF Subroutines and Functions ticity material model the UserPL subroutine is applicable to the following legacy elements LINK1 LINK8 PIPE20 BEAM23 BEAM24 PLANE42 SOLID45 PIPE60 SOLID62 SOLID65 PLANE82 S
283. ematfpL c AGORENOCUNGOUR COMMON variable descriptions Asso co ematfpL file position on file emat co ematbk block number for file emat co ematut file unit for file emat c See fddesc for documentation of how binary files are stored c c KKKKKKKKKK file format KKKKKKKKKK g recid tells the identifier for this record Not all records will have e identifiers they are only indicated for those records whose c record pointers are stored in the second file header c type tells what kind of information is stored in this record e i integer fel dp double precision c cmp complex 34 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 6 2 EMAT File Format qaaqaqaagqaagqagaagqaa Q Q qQaaqaqaqaaqaagqagangqagaagaagaaagaagaagaaangnaaanaaaanaadgnqaagnaadgnaaaanaadnqaana qaaqaagaagnqaagqaa nrec tells how many records of this description are found here lrec tells how long the records are recid type nrec lrec i 1 100 m i 1 40 contents how many items are stored standard ANSYS file header see binhed for details of header contents EMAT FILE HEADER fun02 maxn kygst kygrf nume numdof lenu lenbac 0 0 nodref lumpm kygm kycd kygss kygaf 0 0 0 0 ptrElmh ptrFSTh ptrLSTh ptrBITh ptrEHDh numCE maxLeng ptrCEl ptrCEh ptrIDXh ptrDOF ptr
284. ement e 0 element undefined e gt 0 number of values returned e value dp ar out element surface stress data 7 6 34 esfput Subroutine Storing Element Surface Stress Data deck esfput subroutine esfput ielem nval value C primary function store surface stresses for an element c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number e nval int sc in the total number of values e 19 number of stress faces G There is a max of 2 stress faces io value dp ar nval in the values G output arguments none Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 255 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database 7 6 35 esfdel Subroutine Deleting an Element s Surface Stress Data deck esfdel subroutine esfdel ielem C primary function delete element surface stress data c Notice This file contains ANSYS Confidential information amp input arguments e ielem int sc in element number amp 0 delete for all defined elements output arguments none 7 6 36 efsdel Subroutine Deleting a Flagged Surface on an Element deck efsdel subroutine efsdel ielem iface C primary function delete a flagged surface on an element c Notice This file contains ANSYS Confidential information e input a
285. ent For finite deformation problems the plastic strains have been rotated to account for rigid body motion before they are passed in Elastic work It is used for output purposes only and does not affect the solution Plastic work It is used for output purposes only and does not affect the solution 160 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 4 1 Subroutine UserMat Creating Your Own Material Model UserMat Output Arguments These values must be updated in the subroutine code Integer variable as key for loading bisection cut control 0 No bisect cut default 1 Bisect cut Set keycut 1 when UserMat experiences convergence difficulty when solving constitutive equation integration The bisect cut factor is determined by ANSYS solution control Strain component at an out of plane direction for the plane stress state This value is required when the thickness change is taken into account in plane stress or shell elements Transver shear stiffness Tsstif 1 GXZ Tsstif 2 GYZ dsdePl ncomp ncomp OAc AE Double precision array containing the material Jacobian matrix J Jm Here the values represent the stress strain increments respectively The dsdePl i j value denotes the change in the i th stress component at the end of the time increment caused by an change
286. ent coding ANSYS code type 1 This is an output call the substep is converged and you can print save element results 0 All other cases Key indicating whether any Element coding ANSYS code element output should appear OUTPR com in the print file mand 0 No 1 Yes Output file number The Fortran outputfile ANSYS code number All informa tion written in the specified file appears in the ANSYS output file keyHisUpd Key to update history depend Element coding ANSYS code ent variables 1 The substep converged ready to update history de pendent variables such as equivalent plastic strain 0 Solution not yet con verged cannot update history dependent variables The following variables are for debug timing and convergence control purposes only You can usually ignore them Current load step number Output ANSYS code Debug isubst Current substep number Output ANSYS code ieqitr Current iteration number Output ANSYS code timval Current time Output ANSYS code keyEleErr 1 0 Formulation error key Element coding ANSYS code 0 No error preset value 1 Error occurred in element formulation possibly due to Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 120 of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API excessive
287. ent stress state 11 The order of components for the material Jacobian matrix is as follows 3 D stress state Link element stress state 6 4 1 3 The UserMat API Following is the interface for the UserMat subroutine deck usermat USERSDISTRIB subroutine usermat amp matId elemId kDomIntPt kLayer kSectPt amp ldstep isubst keycut 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 58 of ANSYS Inc and its subsidiaries and affiliates 6 4 1 Subroutine UserMat Creating Your Own Material Model m mmm SM KS KL INTEGER amp amp amp amp nDirect nShear ncomp nStatev nProp Time dTime Temp dTemp stress statev dsdePl sedEl sedPl epseq Strain dStrain epsPl prop coords tsstif epsZZz varl var2 var3 var4 var5 var6 var7 var8 matlId elemId kDomIntPt kLayer kSectPt ldstep isubst keycut nDirect nShear ncomp nStatev nProp DOUBLE PRECISION Time dTime Temp dTemp sedEl sedPl epseq epsZZ DOUBLE PRECISION m mmm KM KS KL stress ncomp statev nStatev dsdePl ncomp ncomp Strain ncomp dStrain ncomp epsPl ncomp prop nProp coords 3 defGrad t 3 3 defGrad 3 3 tsstif 2 6 4 1 4 UserMat Variables The UserMat subroutine uses the following Input Input Output and Output variables Do not change them in the subrout
288. er c dim parm32 type d1 d2 d3 cNamel cName2 cName3 c dim parm32 type d1 cNamel c dim parm32 type d1 d2 d3 d4 d5 cNamel cName2 cName3 cName4 cName5 c Notice This file contains ANSYS Confidential information c input arguments c cName chr 32 sc in the name of the parameter to create el labl4 chr 4 sc in TABL or ARRA or CHAR or STRI e nDim int sc in Dimension of array c nxyz int ar nDim in the dimensions of the array c cLabels chr 32 ar nDim in Names for the directions in table C output arguments none 6 12 2 Function parevl Finding and Evaluating a Parameter deck parevl subroutine parevl ParName nDim subc lv1l dpValue chValue kerr primary function find and evaluate a parameter Notice This file contains ANSYS Confidential information input arguments ParName chr PARMSIZE sc in the name of the parameter must be upper case left justified nDim int sc in the number of subscripts 0 scaler subc dp ar in values for the subscripts if any lvl int sc in 0 1 no error output 2 report error 1 set kerr flag with no anserr call output arguments dpValue dp sc out the value of the parameter may be a packed character 8 chValue ch 128 sc out character output kerr int sc out error flag 0 ok 1l output is packed O ok l error 2 error but TINY is used 2 output is string in chValue mpg parevl dpValueFunct
289. eration Loads seeeees 148 6 2 33 Subroutine prinst Computing principal stress and stress intensity ssssssse 149 6 3 Subroutines for Modifying and Monitoring Existing Elements eene 149 6 3 1 Subroutine userou Storing User Supplied Element Output ceeescceeeeseeesentreeeeeees 150 6 3 2 Subroutine useran Modifying Orientation of Material Properties eessssssse 151 6 3 3 Subroutine userrc Performing User Operations on COMBIN7 and COMBIN37 Paramet QNEM 151 6 3 4 Subroutine UEIMatx Accessing Element Matrices and Load Vectors 152 6 3 5 Subroutine UTHICK Getting User defined Initial Thickness ccceeessececeeeeeeeeeesneneeees 152 6 3 6 Subroutine UsrFictive Providing User defined Fictive Temperature Relationship 153 6 3 7 Subroutine Us Surf Str Captures surface stresses ccccccccccccccececeeeceeeeeeeeeeeseeeseseeeeeeeess 153 6 3 8 Subroutine uflex Computes flexibility factors for PIPE288 and PIPE289 154 6 3 9 Subroutine usflex Computes the flexibility factor for PIPE16 PIPE17 PIPE18 and PIP EGO ERREUR ELT E 155 6 3 10 Subroutine UsrShift Calculates pseudotime time increment esee 155 vi Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential inf
290. es and affiliates 237 Chapter 7 Accessing the ANSYS Database 7 5 13 nhgiqr Function Getting Information About Nodal Heat Generations deck nhgiqr function nhgigr node key c primary function get information about nodal heat generations c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout amp input arguments c variable typ siz intent description node int sc in node number c should be 0 for key 2 c key int sc in key for operation e 1 return whether node has a heat generation rate amp defined amp nhgiqr 0 no heat generation defined for node c heat generation is defined for node c 2 return total number of nodal heat generation c rates defined in model c output arguments c nhgiqr int func out the returned value of nhgigr is based on c setting of key 7 5 14 nhgget Function Getting a Nodal Heat Generation deck nhgget function nhgget node hg C primary function get specified nodal heat generation in raw form c Notice This file contains ANSYS Confidential information e typ int dp log chr dcp siz sc ar n func intent in out inout e input arguments c variable typ siz intent description c node int sc in node number c output arguments e nhgget int func out heat generation status of node 0 nodal heat generation undefined amp 1
291. es and affiliates 5 5 Programming in Languages Other than Fortran considers the use of UPFs a nonstandard use of the program one that the ANSYS Quality Assurance verification testing program does not cover Therefore you are responsible for verifying that the results produced are accurate and that your customizations do not adversely affect unchanged areas of the ANSYS program Although the flexibility that UPFs offer can be highly attractive UPF usage is a complicated process that can introduce errors Consider what you want your customizations to accomplish You may be able to customize ANSYS more easily and safely with macros than with UPFs For shared memory ANSYS all user programmable features are supported except for common block variables in Fortran and external variables in C or C You should avoid overwriting the values of these variables by multiple cores at the same time For Distributed ANSYS all user programmable features are supported except for global often in common block variables in Fortran and global often external variables in C or C You should avoid overwriting the values of these variables they should have the same values across all cores used in the distributed solution For other guidelines for nonstandard uses of the ANSYS program see the Advanced Analysis Techniques Guide 5 3 Planning Your UPFs UPFs can range from a simple element output routine for customized output to a complex user op
292. es for each corner of element key int ar 2 out key if to use this logic key 1 0 no new film coefficient key 1 1 define new film coefficient key 2 0 no new bulk temperature key 2 1 define new bulk temperature if key 2 1 the adiabatic wall temperature logic is not used this routine is called during each substep of each load step it is called for each equilibrium iteration it is called once per element it is called only during the heat flow load vector formulation stage and not during the heat flow evaluation stage the call to get the standard ansys input convection surfaces is made just before entering this routine so this information is available to be modified if desired This routine may be thought of as a specialized version of usercv Indeed e1151 and e1152 also call usercv Either or both rarely could be used velocity dependent film coefficients and bulk temperatures can be computed by using the velocities and other information from fluidl16 Details of this procedure are SURF151 or SURF152 are pasted onto the actual solid model flow rate is input to or is computed by FLUID116 with KEYOPT 2 1 flow rate may be a function of time the user defines nodes on the FLUID116 network to be the same nodes as the extra nodes of SURF151 or SURF152 If more than one FLUID116 element is attached to one of these nodes the velocities are averaged Release 12 0 2009 SAS
293. es the reduced method and nbcdsp gt 0 see c record at ptrDOF These numbers are the el positions in the previous record of dofs with e a nodal constraint These are nodal c constraints only on nodes that also are 28 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 4 2 RFRQ File Format Q qgqaaqaagqaaaa Q Qo0onQnonn qgqaaqaaqaa qaaqagaaagqaagnqaagqaaaa anaa qaaaa qa qaqaaqaaa qQaaqagaaagnqaagnqaagaaaa STF MAS DMP FRO kk kk DSP dp dp dp dp nmrow nmrow varies nmrow nmrow varies nmrow masters na i i 1 nbcdsp Reduced stiffness matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx 0 and analysis is not using mode superposition method Row order is the same as the DOF order in record at ptrDOF ak i j i 1 nmrow Reduced mass matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx gt 1 and analysis is not using mode superposition method Row order is the same as the DOF order in record at ptrDOF am i j i 1 nmrow Reduced damping matrix or mode shapes If the analysis uses the reduced method each record will be nmrow items in length The reduced damping matrix is present only if nmatrx 2 There will be nmrow records of this type stored here Row
294. eserved C ansys inc c XX Descocse CSSCLIPELON Of SuUbDStruCLure Matrix Ell6 JNEeeoxes character 8 SUBNM parameter SUBNM sub v LONGINT subfpL lenSubL integer subbk subut Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 38 of ANSYS Inc and its subsidiaries and affiliates 1 7 2 SUB File Format c c co co co co Q aa qaaaa Q qQaaqagqagagnqagagqagagqagaaaa qaaqagqagagqagagqagagqaaaa Q qgqaaqaaqaaa common fdsub subfpL lenSubL subbk subut write matout read xx common variable descriptions x xx x subfpL file position on file sub subbk block number for file sub subut file unit for file sub lenSubL length of sub file saved for slvdta F See fddesc for documentation of how binary files are stored KKKKKKKKKK file format KKKKKKKKKK recid tells the identifier for this record Not all records will have identifiers they are only indicated for those records whose record pointers are stored in the second file header type tells what kind of information is stored in this record i integer dp double precision cmp complex nrec tells how many records of this description are found here lrec tells how long the records are how many items are stored recid type nrec lrec contents Soe i 1 100 standard ANSYS file header see binhed for details of header contents HED i 1 60 SUB FILE HEADER FULL
295. esponding Dis Corresponding placement Label Force Label UX FX UY FY UZ FZ MX MY MZ 3 2 Coded Database File Commands In the coded database file Jobname CDB most ANSYS commands have the same format they have elsewhere See the Command Reference for command specific information However the format for some commands differs slightly in the Jobname CDB file The format for these commands is described below The CDWRITE command has an UNBLOCKED and a BLOCKED option The UNBLOCKED option will write all data out in command format the default BLOCKED option will write certain data items in a fixed format especially those which could potentially contain large amounts of data such as nodal data 72 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 3 2 2 CP Command 3 2 1 CE Command The CE command defines the constant term in a constraint equation The command format in Jobname CDB is CE R5 0 Type LENGTH NCE CONST Type The type of data to be defined DEFI is the valid label LENGTH The total number of variable terms in the constraint equation NCE The constraint equation reference number CONST The constant term of the equation Another version of the CE command defines the variable terms in a constraint equation You must issue this
296. esponds to the connectivity defined in the element description Fluxes can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes See item rxtrap in the solution header for the setting The number of items in this record is nodstr 3 N where N can be 1 2 or 3 depending on the coupled field conditions NOTE nodstr is defined in the element type description record Element nodal coupled field forces This record lists the forces at each node in the rder X Y Z For most elements the number f items in this record is nodfor 3 owever for the PLANE53 element the umber of items in this record is either odfor 3 or nodstr 3 See the description f KEYOPT 7 for PLANE53 in the ANSYS oso 5 m00 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 19 Chapter 1 Format of Binary Data Files Q Q EMN dp 1 varies p DE s Oe c ECD dp 1 3 qa ENL dp 1 varies Qc Qe coo CY QA IQ OS GQ x qe oq OS QE orae Qu QE E C Qe oos c EHC dp 1 1 ei EPT dp 1 varies eom Oa a Daa E Da Ma A Pan lL ed E DL ome each item Elements Reference NOTE nodfor and nodstr are defined in the element type description record NOTE nodstr is defined in the element type description record Element nonsummable miscellaneous data The
297. esseeeeeesneeeeeees 266 7 7 27 eelput Subroutine Storing an Element s Nodal Elastic Strains cccccecceesssetteeeeeeees 267 7 7 28 eeldel Subroutine Deleting an Element s Nodal Elastic Strains cessssseeeceeeeeeeeeee 268 7 7 29 epliqr Function Getting Information About an Element s Nodal Plastic Strains 268 7 7 30 eplget Function Getting an Element s Nodal Plastic Strains esses 268 7 7 31 eplput Subroutine Storing an Element s Nodal Plastic Strains essessessssss 269 7 7 32 epldel Subroutine Deleting an Element s Nodal Plastic Strains cessesestceeeeeeeeeees 270 7 7 33 ecriqr Function Getting Information About an Element s Nodal Creep Strains 270 7 7 34 ecrget Function Getting an Element s Nodal Creep Strains ssscsccccccesssessnteeeeeeees 270 7 7 35 ecrput Subroutine Storing an Element s Nodal Creep Strains eeeessssss 271 7 7 36 ecrdel Subroutine Deleting an Element s Nodal Creep Strains eeeeesessssss 272 7 7 37 ethiqr Function Getting Information About an Element s Nodal Thermal Strains 272 7 7 38 ethget Function Getting an Element s Nodal Thermal Stresses ccceecessessstteeeeeeeees 272 7 7 39 ethput Subroutine Storing an Element s Nodal Thermal Stresses eesssssss 273 7 7 40 ethdel Subroutine Deleting an E
298. esssnaseeeeceseseeesnnaaeeeeeseess 5 S B oragr sre irae 5 1 2 2 Standard ANSYS File Header sese nn nennen eese nenne 5 1 2 3 Results File Forrnat 5 o nete te cete enint xe Ie eae cnr ee e aee eet eee Pete eio euet 5 1 3 Description of the Reduced Displacement File essen 22 1 3 1 Standard ANSYS File Header ccccccccccessssssncecceeeeeeseesnneceececeeeeessnaeeeeeeeeseeeesnnaaeeeeeeeens 22 1 3 2 RDSP File FOkfnat atten ree reete etes re keen eate eget eee deu ve vule re teet edu E e eor pe 22 1 4 Description of the Reduced Complex Displacement File eene 26 1 4 1 Standard ANSYS File Header cccccccccccessssssnnceccececeseeesnneeceeeeceeeseseenaeeeeecesseeeesnnnaeeeeeseess 26 1 4 2 RFRQ File Format 1 e ete te eg er tape ee ERU DR a ERANT ure L Ee ee RUNE ER CUR aie 26 1 5 Description of the Modal Results File cccessscccccccceessessnceeeeeeeseseeenaeeeeeecceseeeeenaaeeeeeeeeeseeees 30 1 5 1 Standard ANSYS File Header cccccccccessssesteeeceeceeeeseesnneeeeececeeseessnaeeeeeceeseeeesnnaaeeeeeseess 30 1 5 2 MODE FileFormat s ies teoria eee hae ert rae egere tees dee ipee iE 30 1 6 Description of the Element Matrices File ccssccccccccessssssnneeeeecceseesessneeeeeeecesseessnaseeeeeeeeeseeses 34 1 6 1 Standard ANSYS File Header niecne eiiiai a e i aia aS 34 16 2 EMAT File Format craes iea eer E A Ea A eE a eE a
299. essure exist c 0 no pressure c 1 yes pressure 6 2 31 Subroutine cnvget Defining Current Convection Loads deck cnvget subroutine cnvget iel ielc nr u nfac ndat beghc begtb x hc tb endhc endtb iexist amp primary function define the current convection loads c Notice This file contains ANSYS Confidential information input arguments c iel int sc in element number c ielc int ar IELCSZ in array of element type characteristics c nr int sc in dimension of u temperature vector e u dp ar nr in most current temperatures c nfac int sc in number of convection faces c ndat int sc in number of convection values c beghc dp ar ndat in hcoef at the beginning of load step c begtb dp ar ndat in tbulk at the beginning of load step c output arguments e hc dp ar ndat out hcoef at this substep tb dp ar ndat out tbulk at this substep c endhc dp ar ndat in hcoef at the end of this load step c endtb dp ar ndat in tbulk at the end of this load step c iexist int sc out flag if convection exist e 0 no convection 1 constant convection with time c does not require new element matrix amp 2 changing convection with time c or deleted convection amp requires new element matrix 6 2 32 Subroutine hgnget Defining Current Heat Generation Loads deck hgnget Release 12 0 2009 SAS IP Inc All rights reserved Contains propriet
300. et 238 nhgiqr 238 nhgput 238 nlget function 144 nminfo subroutine 133 nmisc record storing data in 144 nodal coordinate system transformation debugging 111 Nodal current density deleting 241 getting 241 getting information about 240 storing 241 nodal data conversion to fixed format data blocks 111 Nodal fluence deleting 240 Nodal fluences getting 239 getting information about 239 storing 240 Nodal heat generation deleting 239 getting 238 getting information 238 storing 238 Nodal load deleting at a node 236 storing at a node 236 Nodal loading routines 233 Nodal loads getting information about 235 Nodal magnetic virtual displacement getting 242 getting information about 241 nodal orientation matrix adjusting 132 nodal reaction force values getting 200 Nodal results getting from the database 258 getting information about 257 Nodal temperature storing 242 Node information routines 218 Nodes defining 82 getting a nodal point 219 getting information about a node 218 getting the next node number 216 getting the nodal solution for a node of an element 220 getting the number of the next defined node 216 getting the number of the previous selected node 216 getting the xyz rotation coordinates vector for a node 220 getting XYZ vector for 297 routines for selecting and retrieving 216 selecting unselecting deleting or inverting a node 217 storing a node 220 storing XYZ vector for
301. eting a Nodal Fluence deck nfudel subroutine nfudel node output arguments none c primary function delete node fluences c Notice This file contains ANSYS Confidential information e typz int dp log chr dcp siz sc ar n func intent in out inout ic e input arguments c variable typ siz intent description c node int sc in node number e ic c 7 5 21 ndciqr Function Getting Information About Nodal Current Densities deck ndciqr function ndciqr node key C primary function get information about nodel current densities c Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n func intent in out inout amp input arguments c variable typ siz intent description c node int sc in node number should be zero for key 2 c key int sc in key for operation 1 return nodal current status amp ndciqr 0 no current density defined for this node c 1 node has a current density defined amp 2 total number of nodal current densities defined e on model e output arguments c ndciqr int func out the returned value of ndcigr is based on e setting of key 24 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 0 of ANSYS Inc and its subsidiaries and affiliates 7 5 25 nvdiqr Function Getting Information About Nodal Magnetic Virtual Displa
302. f Binary Data Files c e e e e e e e e e e e e e el e e e e e EMS dp 1 varies fe e e ie el e ENF dp 1 varies e e e e el e e e e e e e e e ENS dp 1 varies ooo moore oxomoomex EE S EE gt EE Peal ooo ptrEMN pointer to misc non sum values ptrECD pointer to element current densities ptrENL pointer to nodal nonlinear data ptrEHC pointer to calculated heat generations ptrEPT pointer to element temperatures ptrESF pointer to element surface stresses ptrETB pointer to ETABLE items postl only ptrECT pointer to contact data ptrEXY pointer to integration point locations ptrEBA pointer to back stresses ptrESV pointer to state variables ptrMNL pointer to material nonlinear record Note If ptrXXX is negative then all ptrXXX items are zero and are not on the file Element summable miscellaneous data The contents and number of data items is element dependent For a list of what s available see the SMISC item in the description of the ETABLE command in the ANSYS Commands Reference Element nodal forces This record contains the forces at each node in the same DOF order as the DOF number reference table For static damping and inertia forces a set of forces will be repeated as appropriate Number of data items stored in this record can be calculated as follows nodfor NDOF M where NDOF is the number of DOFs node for this element
303. f DSPfmt 0 these are physical displacements If DSPftm 0 these are the nmode modal coordinates Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 25 Chapter 1 Format of Binary Data Files e For the last six entries c 1 Time for these displacements c 2 Load step number e 3 Substep number e 4 Cumulative iteration number c 5 Scale factor zero if the analysis uses c the reduced method c 6 numdeflvs number of scale factors e c Note If upon reading of this record there c is less than nmrow 5 items in the record e then only a selected set of nodes were eG output Another record follows integer less c than lenbac long which contains the list of c nodes for which DOF solutions are available Cc eee i 1 numdeflvs lvscal table scale factor IDs e ilvscID i i 1 numdeflvs Go Sse i 1 numdeflvs lvscal table scale factor values e dlvscVal i i 1 numdeflvs Cc dp 1 ngaps Gap restoring forces The order of these e forces corresponds to the node position order e given in record at ptrDNC This record is e present only if ngaps O0 e fgaps i i 1 ngaps c The next 3 records are kept for possible restart using mode superposition c method They are overwritten upon restarting They are written once last c loadstep c DVA dp 1 ndvat6 Calculated modal displacements ei The first n
304. f additional state variables per integration point maximum number of integration points of an element to be used with this routine 14 is the maximum nstv on nsvr command cannot exceed 840 type sze description dp ar 6 6 dp ar 6 12 dp sc dp ar 6 dp ar 6 dp sc dp ar 6 dp ar 6 dp ar 6 dp sc dp sc int sc xd dp sc dp ar 6 dp sc d dp ar 6 2nd derivative of the yield function part of deff temporary variable plastic strain increment derivative of the yield function normal plastic multiplier shifted strain initial shift strain center of the yield surf shift strain center of the yield surface tangent modulus stress total strain plastic tangent modulus stress plastic strain ncomp squared ncomp ncomp equivalent von mises trial stress trial stress yield stress temporary vector 6 4 6 Subroutine usersw Writing Your Own Swelling Laws deck usersw USERSDISTRIB subroutine usersw option elem intpt mat proptb ncomp epswel x epel e nuxy fluen dfluen tem dtem toffst timvll timvnc usvr qgqaqaQqaqaqaqaa primary function secondary function copyright c this allow users to write their own swelling laws logic is accessed with c72 10 demonstrate the use of user written swelling laws 2008 SAS IP Inc All rights reserved Release 12 0 2009 SAS IP Inc All right
305. faclen conac fluidt visc watbas watcur watwav xyzup tr accel puvel u zass forl ZSC ZSc2 forl ZSC zsc2 pdyn holdwv Q000000000000000000000000000000000001 0n input arguments int sc in int sc in int sc in int sc in int sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp sc in dp ar in dp ar in dp ar in dp ar 3 2 in dp ar 3 3 in dp ar 3 in int sc in dp ar nr 5 in dp ar nr nr in dp ar 12 inout dp ar nr inout dp ar nr inout output arguments dp ar 12 inout dp ar nr inout dp ar nr inout dp ar 2 out dp ar 60 out matrix size key for reduced matrices cable option keyopt for hydrodynamic printout keyopt for surface treatment unfinished surface flag buoyancy coefficient real constant outside diameter of pipe outside diameter of insulation area of displaced water length of element water density wetted fraction of pipe added mass per unit length fluid temperature viscosity water basic table water current table water wave table updated coordinates local to global transformation matrix acceleration vector index for velocities in u matrix displacements and velocities mass matrix force vector in element coordinates real load vector for frequency domain complex load vector for frequency domain force vector in element coordinates
306. ffiliates 207 Chapter 6 UPF Subroutines and Functions 6 11 Memory Management Subroutines ANSYS provides UPF subroutines you can use for memory management 6 11 1 Using the Memory Management Subroutines ANSYS uses a dynamic memory manager that overlays the system malloc and free functions and provides a mechanism for accessing the memory from Fortran as well as c and c Since the UPF subroutines are provided in Fortran we will be discussing the Fortran access subroutines You may certainly use the system malloc and free functions or for Fortran the allocate system function However you may end up competing with ANSYS for memory and for large problems there may be insuf ficient system memory to perform the function Dynamic memory is done through Cray style pointers where a dynamically allocated array is defined via the construct pointer piArray Array integer Array and memory space for the array is allocated by assigning the pointer in this case piArray to the allocated memory space piArray fAnsMemAlloc size To use the ANSYS memory manager in a UPF follow these steps 1 1 Define the dynamically allocated arrays pointer piArray Array pdData Data integer Array double precision Data 2 Initialize the pointers as follows piArray PTRFTNNULL pdData PTRFTNNULL 3 Allocate space for an array or arrays as follows For integer numbers piArray fAnsMemAlloc ileng MEM INT
307. file set HOLD Filename TimeInterval Timeout Filename The eight character name of a message file If the named file exists the ANSYS program reads a command from the file and then deletes the file TimeInterval The length of time in seconds that ANSYS waits before trying to read the message file again Timeout The maximum length of time in seconds that ANSYS can wait between attempts to read the file Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 21 of ANSYS Inc and its subsidiaries and affiliates 3 214 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database This chapter describes how you can retrieve information in the ANSYS database or store information in the database by linking subroutines you create into the ANSYS program You can use the database access routines with any of the user programmable features For example you can create your own ANSYS commands and use them to execute database access routines or have a database access routine call a user defined command Inputs and Outputs for Database Access Routines The descriptions of the database access routines or functions within this chapter describe both the input arguments and output arguments Argument information includes the argument s type size
308. file subroutine These variables are accessible via the PRESOL and PRNSOL Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 121 Chapter 6 UPF Subroutines and Functions commands in the standard way and can also be plotted if you specify a KeyShape value via the USRELEM com mand nRsltVar Thenumber of resultdatatobe Specifying the sizeof USRELEM saved in the result file as non RsltVar command summable miscellaneous vari ables The result data saved in the Postprocessing UserElem result file as non summable subroutine miscellaneous variables The data is accessible via the PLESOL command only but only one value for an element each time nElEng Number of energies Solution UserE Fixed at 3 subrouti elEner Element energy vector Output UserElem gy gy elEnergy 1 Strain en subroutine ergy elEnergy 2 Plastic en ergy elEnergy 3 Creep en ergy deck UserElem USERSDISTRIB subroutine UserElem elld matId keyMtx lumpm nDim nNodes Nodes nIntPnts nUsrDof kEStress keyAnsMat keySym nKeyOpt KeyOpt temper temperB tRef kTherm nPress Press kPress nReal RealConst nSaveVars saveVars xRef xCur TotValDofs IncValDofs ItrValDofs VelValDofs AccValDofs kfstps nlgeom nrkey outkey elPrint iott keyHisUpd ldstep is
309. fines h also for symbolic assembly jrb integer MODEHDLEN parameter MODEHDLEN 60 LONGINT modefpL modefp integer modebk modeut common fdmode modefpL modebk modeut equivalence modefp modefpL c Xi UU COMMON variable dSsCEIDLiIORS se sees eee e co modefpL file position on file mode co modebk block number for file mode co modeut file unit for file mode c See fddesc for documentation of how binary files are stored c c KKKKKKKKKK file format KKKKKKKKKK e recid tells the identifier for this record Not all records will have e identifiers they are only indicated for those records whose c record pointers are stored in the second file header 30 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 5 2 MODE File Format e type tells what kind of information is stored in this record ro i integer C dp double precision c cmp complex nrec tells how many records of this description are found here e lrec tells how long the records are how many items are stored c recid type nrec lrec contents seo i 1 100 Standard ANSYS file header see binhed for e details of header contents Qu m i 1 60 MODE FILE HEADER r c fun09 nmrow nmatrx nmode numdof e maxn wfmax lenbac 0 nontp e lumpms extopt SvCode kan ldstep e numitr expbeg expend nspect nSPdat e ptrRDF ptrFRQ 0
310. for the degrees of freedom You use these labels when en tering boundary conditions or ANSYS uses the labels when writing the Jobname cdb file You can change the labels to reflect the degrees of freedom of the other program by issuing the command DFLAB If you are customizing the DOF labels DFLAB must be the first command you enter within the ANSYS program You may want to include the command in your START ANSfile You can use DFLAB only at the Begin processing level DFLAB assigns or reassigns the displacement and force labels in the ANSYS DOF list For example degree of number 1 is predefined to have a displacement label of UX and a force label of FX but you can assign new labels to this DOF using by issuing DFLAB Changing predefined labels generates a warning message The format for the DFLAB command is Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 71 Chapter 3 The CDWRITE CDB File Format DFLAB NDOF LabD LabF NDOF ANSYS degree of freedom number 1 to 32 LabD Displacement degree of freedom label to be assigned up to four characters LabF Force label to be assigned up to four characters You can also use DFLAB to assign labels to spare degree of freedom numbers Spare displacement and force labels are from 13 to 18 and from 27 to 32 All other DOF numbers are predefined as follows Corr
311. formation 6 5 6 Subroutine userfd Computing the Complex Load Vector for Frequency Domain Logic 6 5 7 Function userpe Calculating Rotation Caused by Internal Pressure 6 5 8 Subroutine UsrViscEl Performs Viscoelastic Computation 6 5 9 Subroutine usrsurf1 16 Modifying SURF151 and SURF152 Film Coefficients and Bulk Temperatures 6 5 10 Subroutine User1 16Cond Computing the conductance coefficient for FLUID116 6 5 11 Subroutine User1 16Hf Computing the film coefficient for FLUID116 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accelerations 6 5 1 Subroutine usrefl Changing Scalar Fields to User Defined Values deck usrefl USERSDISTRIB subroutine usrefl key iel ielc nnod nodes time defalt nd dat 178 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 5 2 Subroutine userpr Changing Element Pressure Information variable dat Q0000000000000n00n0n0nn0nnnoooaoaoaoaoaoooaoaoaoaoaoaoaoaoaoaooooooononononon primary function copyright c EEK ANS Sip LN Zu D heat generation etc secondary functions none output arguments typ siz intent dp ar nd inout 2008 SAS IP change the scalar fields temperatures fluences to what user desires in order to activate this user programmable feature the user must enter the usrcal command this ro
312. formation About Element Pressure Convection 243 7 6 2 eprget Function Getting an Element Face Pressure ccccccccessesssnsececeeeeeseessneeeeeeeeess 243 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates IX Programmer s Manual for Mechanical APDL 7 N 7 6 3 eprput Subroutine Storing an Element Face Pressure ccsessscccceeeeseeeesneeeeeeeeeeseeees 7 6 4 eprdel Subroutine Deleting an Element Pressure Convection cccccccccesssssteeeeeeeeeeees 7 6 5 ecviqr Function Getting Information About Element Convections ssccccceceeeeeeeee 7 6 6 ecvget Function Getting an Element Face Convection eeeeeeeeeeneeneee 7 6 7 ecvput Subroutine Storing an Element Face Convection ceceesssscceeeceeseessnneeeeeeees 7 6 8 ecvdel Subroutine Deleting a Convection on an Element cccccccccccesssessstteeeeeeeeeseees 7 6 9 etpiqr Function Getting Information About Element Temperatures ccesessseeeeeeees 7 6 10 etpget Function Getting an Element Temperature essen nnn 7 6 11 etpput Subroutine Storing an Element Temperature csesscccceceeeseesssteeceeeeeeeeees 7 6 12 etpdel Subroutine Deleting an Element Temperature ccssccecccceeeeeessseneceeeeeeeeeees 7 6 13 ehgiqr Functi
313. frmin knlmg int sc in nonlinear magnetic curve exists in this element 0 no 1 yes kconve int sc in key indicating existence of convections in this element 0 1 no 2 or more yes must be input as i if not used as is changed in this routine for analyzer 35 3017 3030 303 301 303 803 303 303 303 103 203 1030 0303 20303103303 203 3 939 209 12 2302 Y 56 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 135 Chapter 6 UPF Subroutines and Functions e i 0 must be used in calling routine e if kpheno 1 e kpheno int se in key for type of phenomenon level of check e 0 structural like old sfrmln 1s 3n 3s fl1 c 1 thermal like old sfrmlc 1t 2t 3t c 2 electrical magnetic like some of old Cc sfrmpo c 3 general like old sfrmoo le kprop int sc in key indicating which material properties e in the prop vector that need to be je checked see below c nprop int sc in number of properties eG prop dp ar nprop in current mat props c propo dp ar nprop inout previous material properties le krvro int sc in c 0 real constants are used by this element and the old c values rvro have been saved or the element does not eG use real constants Any change of real constants e causes all matrices to be reformed e 1 real constants are used by this element
314. g Large Data Files More Rapidly G9 1 provides temporary programmer debugging 5 14 2 3 General Debug Format Issue the command using this format DEBUG HI H2 2H4 H5 y A9 H1 1 provides file header record information 2 provides input line character 3 provides input line decoded H2 1 provides element reordering and element checking debugging 2 provides meshing debugging H4 1 provides nodal coordinate system transformation debugging 2 provides displacement updating debugging H5 1 provides pre element debugging element characteristics debugging and element field load debugging H9 1 print the progress of the resume or save to isolate location of failure 99 resume only the command log information for subsequent LGWRITE command 5 15 Other Useful Commands Two other ANSYS commands NSVR and UCMD can help you implement UPFs Neither command has an equivalent GUI path Use the NSVR command to define the number of extra variables that need to be saved for user programmable element options such as user plasticity Issue the UCMD command to make a user routine into a custom command For more information see De fining Your Own Commands p 194 5 16 Generating Output You can generate output controlled by the OUTPUT command by using the Fortran write statement The output unit for this statement is usually called IOTT IOTT may be defined with the function wrinqr See the disc
315. g the ANSYS Database the largest failure criteria The second layer is not present if failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPPL item of ETABLE command Qr ON JO Ove Qc OQ 7 7 32 epldel Subroutine Deleting an Element s Nodal Plastic Strains deck epldel subroutine epldel ielem C primary function delete element plastic strains c Notice This file contains ANSYS Confidential information a input arguments e ielem int sc in element number a 0 delete for all defined elements c output arguments none 7 7 33 ecriqr Function Getting Information About an Element s Nodal Creep Strains deck ecriqr function ecrigr ielem key C primary function get information about element nodal creep strains c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed c 1 return info about creep strains e ielem 0 return number of nodal creep strains e on this element Cc record length e 0 return maximum number of nodal creep c strains on any element e max record length e DB NUMDEFINED return the number of nodal creep str
316. h 4 ar nDOF out Labels for DOFs Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 68 of ANSYS Inc and its subsidiaries and affiliates 2 3 13 ResRdForc Retrieving Applied Nodal Loads Solution e ResRdSolBegin int sc out 0 requested solution set found C 1 not found 2 3 10 ResRdDisp Retrieving Nodal Solution deck ResRdDisp function ResRdDisp node Disp c primary function Retrieve a nodal displacement c object library ResRd c input arguments c node int sc in Node number C output arguments none c Disp dp ar nDOF out Displacements c ResRdDisp int sc out Number of displacements 2 3 11 ResRdRfor Retrieving Reaction Solution deck ResRdRfor function ResRdRfor node idof value c primary function Retrieve a reaction force c object library ResRd c input arguments c node int sc in External node number c idof int sc in Internal dof number C output arguments c value dp sc in Value of reaction force c ResRdRfor int sc out Number of returned values 0 or 1 2 3 12 ResRdFix Retrieving Applied Nodal Constraints deck ResRdFix function ResRdFix node idof value c primary function Retrieve a constraint value c object library ResRd c input arguments c node int sc in External node number o idof int sc in Internal dof number C output arguments c value dp ar 4 in Real Imag R
317. h may be needed to ensure incompressibility In any case if the material exhibits nearly incompressible behavior use a finite tangent bulk modulus 6 4 1 8 Accessing Material and Element Data for UserMat Following is the interface for accessing the ANSYS material and element data get ElmData inquire elemId kIntg nvect vect c argument list CHARACTER 4 inquire INTEGER elemId kIntg nvect DOUBLE PRECISION vect nvect c definition c inquire query argument string see variables c elemIid element number c kIntg gauss intg number e nvect number of vector to be inquired c vect vector to be inquired get ElmData Input Arguments inquire String variable containing a query argument elemld Integer variable containing the element number kDomlntPt Integer variable containing the material integration point number nvect Integer variable containing number of variable to be retrieved Variable array containing the retrieved variables Valid inquire Argument Variables Element coordinate system ESYS Initial stress Reference temperature 6 4 1 9 Utility Functions for UserMat The following functions are available for use with UserMat ANSYS provides them for your convenience Utility Functions for UserMat vzero a n lnitializes array a to zero The value n is the array dimension vmult a b n Multiplies vector a by constant c and outputs b a c
318. haracter strings Items 15 16 The Jobname in integer form two four character strings Items 17 18 The ANSYS product name in integer form two four character strings Item 19 The ANSYS special version label in integer form one four character string Items 20 22 Items 23 25 The user name in integer form three four character strings The machine identifier in integer form three four character strings Item 26 The system record size Item 27 The maximum file length Item 28 The maximum record number Items 31 38 The Jobname eight four character strings Items 41 60 The main analysis title in integer form 20 four character strings Items 61 80 Item 95 The first subtitle in integer form 20 four character strings The split point of the file Items 97 98 LONGINT of the maximum file length Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format 1 2 Description of the Results File The next few pages describe the format of the ANSYS results file In the following tables records with a record ID containing an asterisk are those you can read and store into the ANSYS database via the LDREAD command Note The pointers in the solution data headers are relative not absolute pointers For example the 12th item in the s
319. he command TRACK 8 5 14 2 Debugging Elements and Solutions The DEBUG command generates debugging at various points in the output You can specify one of three formats for DEBUG solution debug format element debug format and general debug format 5 14 2 1 Solution Debug Format Issue the command using this format DEBUG 1 F1 F2 F3 F4 F5 F6 F7 F8 F9 F1 1 provides basic solution control debugging F2 1 provides transient debugging using Newmark constants 2 provides transient debugging using velocities and accelerations F3 1 provides element matrix debugging and prints matrix load vectors before going into solve 2 provides element matrix debugging with load vectors only before going into solve 3 provides element matrix debugging with matrix diagonals and load vectors before going into solve F4 1 provides auto time stepping debugging F5 1 provides multifield debugging Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 1 of ANSYS Inc and its subsidiaries and affiliates 09 Chapter 5 Using User Programmable Features UPFs F6 1 provides arc length debugging F7 1 provides basic Newton Raphson debugging 2 provides Newton Raphson debugging and prints out of balance forces or incremental displacement or each DOF 3 provides Newton Raphson debugging and prints applied loads and n r restoring force for each DOF F8 1 2 provides di
320. he command OUTEQ ON can be used to output results from all equilibrium iterations The command NERR 1 causes errors to be reported as before but 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 08 of ANSYS Inc and its subsidiaries and affiliates 5 14 2 Debugging Elements and Solutions the run continues anyway normally terminating with either a system abort or b incorrect answers The NERR 1 command is intended for program debugging and may generate erroneous results You should remove this statement before generating solutions for production use 5 14 1 Tracking the Path of Program Logic The TRACK command issues a message when the program logic enters and leaves some of the higher level subroutines Subroutines TrackBegin and TrackEnd see Chapter 8 Subroutines for Users Conveni ence p 285 set up the TRACK command Then issue the command using the format below TRACK MonLevel PrintLevel SumLevel MonLevel The level for timing monitoring PrintLevel The level for enter exit printout SumLevel The level at which the timing sum is output Each of these arguments can be any value between 0 and 9 default is 0 You can use the TRACK command to identify which section of code is causing the program to abort For example to flag up to eight levels of subroutines to determine when the program logic enters and leaves them you would issue t
321. he command format in Jobname CDB is SFE ELEM LKEY Lab KEY R5 0 ELEM The element number LKEY The load key associated with this surface load Lab A label indicating the type of surface load Valid labels are PRES pressure CONV convection HFLU heat flux IMPD impedance SEL substructure load vector SELV S E load vectors CHRG charge density KEY A value key If it is 1 the values are real film coefficient if convection If it is 2 values are imaginary bulk temperature if convection Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 86 of ANSYS Inc and its subsidiaries and affiliates Chapter 4 ANSYS Graphics File Format Graphics written to a file SHOW lt fi1ename gt are written in an ASCII coded format This chapter provides information on the graphics file content and format You can use the DISPLAY program to read and plot this file The following topics are discussed in this chapter 4 1 Pixmap Format for Graphic Display Files 4 2 Neutral Graphics File Format 4 3 Decoding a Graphics File an Example 4 1 Pixmap Format for Graphic Display Files The ANSYS graphics display is KPX pixels high by KPX 1 33 pixels wide KPX is the resolution specified by the GFILE SIZE command where SIZE is the pixel resolution or by choosing menu path Utility Menu gt PlotCtrls gt Redirect Plots gt To File Default res
322. he following table lists some of the more commonly used ANSYS include files and the definitions they contain Include File Description acel Contains accelerations and angular velocities cm inc ansys Defines general ANSYS parameters You must include this def inc common to retrieve the parameter values of MEM INTEGER MEM DOUBLE MEM COMPLEX or MEM REAL cmopt inc Contains optimization variables Defines parameters for element characteristics Defines element characteristics comments only Contains element specific information Defines pointers for the element data array Defines the element degree of freedom pointers Element type data Used by all routines and functions in the ANSYS program Defines output control information cm inc soptcm inc Contains solution options and keys stack inc Defines stack storage You must include this common in any routines that access stack space step Contains load step information Defines storage of user defined variables 5 8 Linking User Routines After you make your changes to the user routines supplied on your ANSYS distribution medium you can either Link your routines into shared libraries as discussed starting in Appendix A p 303 Compile and link your custom routines into the ANSYS program itself This is discussed for UNIX systems in Compiling and Linking UPFs on UNIX Linux Systems p 104 and for Wi
323. he library LIB option of the MPREAD and MPWRITE com mands When you issue MPWRITE with the LIB option the command inserts MATL in lieu of the specified material number as these commands are written to the material library file When ANSYS reads a material library file written in this format it interprets MATL to mean the currently active material Do not use the MATL string outside the scope of the MPREAD command 6 4 1 Subroutine UserMat Creating Your Own Material Model The UserMat subroutine allows you to write your own material constitutive equations within a general material framework using current technology elements UserMat is a tool for advanced users Expertise in material constitutive modeling and software programming is necessary Developing a custom material constitutive model requires validation and testing ANSYS strongly recommends testing both single elements and multiple elements with various loading conditions to ensure correct results UserMat supports shared memory and distributed parallel processing however you are responsible for ensuring that your code can use parallel processing The following UserMat topics are available 6 4 1 1 UserMat Overview 6 4 1 2 Stress Strain and Material Jacobian Matrix 6 4 1 3 The UserMat API 156 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 4 1 Subroutin
324. he user subroutines used to create new elements using the database access method described in Creating a New Element by Directly Accessing the ANSYS Database p 128 6 2 1 Subroutine nminfo Returning Element Reference Names deck nminfo subroutine nminfo ielc rname c primary function set element reference names c secondary functions none e c Notice This file contains ANSYS Confidential information e c input arguments c variable typ siz intent description c ielc int ar inout element characteristic vector c rname chr sc in 8 character reference name od C output arguments c variable typ siz intent description c ielc int ar inout element characteristic vector with c element name encoded e 6 2 2 Subroutine svgidx Fetching the Index for Saved Variables deck svgidx subroutine svgidx locsvr svindx C primary function get the index for saved variables c Notice This file contains ANSYS Confidential information c input arguments c locsvr LONGINT sc in pointer to location of index C output arguments c svindx int ar 20 out the 20 word index of svr variables e 1 2 starting loc of this eles svr sets c 3 length of eles svr sets Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 133 Chapter 6 UPF Subroutines and Functions 0 10
325. hese or any other arguments will have a direc c impact on the solution possibly giving meaningless results The normal ae usage of this routine is simply monitor what is happening 6 3 5 Subroutine UTHICK Getting User defined Initial Thickness deck uthick USERSDISTRIB SUBROUTINE uthick elemId elemType matId realld numDomIntPts curCoords thickness eccerccececceeccecceceetcececcceccecceccecceceecccececeeceeccecceccececrce amp c primary function get the user defined thickness amp c copyright c 2008 SAS IP Inc All rights reserved Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 152 of ANSYS Inc and its subsidiaries and affiliates Q000000000000000000Qn 6 3 7 Subroutine Us Surf Str Captures surface stresses Xxx cansySs UNG input arguments Variable type sz i o description elemId int sc i element number elemType int sc i element TYPE 181 etc matId int sc i material number realld int sc i real constant set number numDomIntPts int sc i number of integration points curCoords dp ar 3 numDomIntPts i current coordinates output arguments thickness dp ar 3 numDomIntPts o thickness at the integration points CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC c C parameters c 6 3 6 Subroutine UsrFictive Providing User defined Fictive Temperature Relationship deck Usr
326. hgdel Subroutine Deleting a Nodal Heat Generation ccssccscccecceesssssneeeeeeeeeeees 239 7 5 17 nfuiqr Function Getting Information About Nodal Fluences eee 239 7 5 18 nfuget Function Getting a Nodal Fluence 0 eeeeeseseeccceceeeesessnneeeeeececeeeeesnaeeeeeeeeesees 239 7 5 19 nfuput Subroutine Storing a Nodal Fluence ccceeeesccccccceeseeesnnececececeseesssnaneeeeeeens 240 7 5 20 nfudel Subroutine Deleting a Nodal Fluence sese 240 7 5 21 ndciqr Function Getting Information About Nodal Current Densities 240 7 5 22 ndcget Function Getting a Nodal Current Density eene 241 7 5 23 ndcput Subroutine Storing a Nodal Current Density eene 241 7 5 24 ndcdel Subroutine Deleting a Nodal Current Density cccscccccccceeseesstteeeeeeeeseeeeees 241 7 5 25 nvdiqr Function Getting Information About Nodal Magnetic Virtual Displacements 241 7 5 26 nvdget Function Getting a Nodal Magnetic Virtual Displacement 242 7 5 27 nvdput Subroutine Storing a Nodal Virtual Displacement essen 242 7 5 28 nvddel Subroutine Deleting a Nodal Virtual Displacement sees 242 7 6 Element Loading Routines essen hrr Een R EFE EUR IAEA OR EXU WORST EHE deren FR VES ERE RES ERE ERA NY 243 7 6 1 epriqr Function Getting In
327. hr dcp siz sc ar n intent in out inout c input arguments e a dp ar nd inout matrix to have its lower triangular part e copied to its upper triangular part c nd int sc in number of rows of the a matrix c n int sc in size of matrix to be processed C output arguments e a dp ar nd inout matrix that has its lower triangular part e copied to its upper triangular part e 8 4 9 mctac Subroutine Transposing a symmetric matrix deck mctac 300 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 8 4 11 symeqn Subroutine Solving Simultaneous Linear Equations subroutine mctac a na c nc nold nnew c function do a c transpose a c where a is symmetric c Notice This file contains ANSYS Confidential information c input arguments co a dp ar na na inout matrix to be pre and post multiplied G part operated on must be o square nold x nold and symmetric c na int sc in first dimension of the a matrix amp amp dp ar nc nnew in matrix to pre and post multiply a by Cc part used may be rectangular nold x nnew nc int sc in first dimension of the c matrix c nold int sc in size of part of A matrix that is c to be processed input size maximum 64 c nnew int sc in size of part of A matrix that ol results from this operation output size c maximum
328. i i i i a i vvv i v i KKKKKKKKKK a a x x yes i kopusr 0 i i ls i all KKKKKKKKKK i 2 i i i i i i i no i i i i i i i i vvv vvv i v v i KKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKK i S ansys userop i optimization x optimization i x call userop x i KKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKK it i i i i i i I i i MUTO ed os es ed E UR 3 i i vvv i v i Gag i KKKKKKKKKKKKKKKK zs 206 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 10 3 Structuring Your Input yes a exit oS terminate i nterm 0 8 looping G T KKKKKKKKKKKKKKKK 3 Gag i i i i no i i nterm 1 3 vvv 3 v B ck ck ck ck ck ck ck ok ock ck ck ck ck ck ck ck ck kk ck ck kk kk kk sA i move optimization results to new gt gt gt i 2d into parameter vector x analysis ck ck ck ck ck ck ck ck ck ck ck ck ckckck ck ck ck ck ck ck kk kk kk sample input for user optimization des minimize y x1 2 x2 2 DURI 22s subject to TS zk 10 III 1 lt x2 10 bid SSS g xl x2 gt 1 batch list use batch mode x1 5 initial value for dv xl x2 5 initial value for dv x2 prep7 enter prep y Xl xl x2 x2 define function y g x1 x2 define function g finish finish prep opt enter opt
329. iables per integration point nintp int maximum number of integration points of an element to be used with this routine 14 is the maximum note nuval x nintp nstv on nsvr command cannot exceed 840 internal variables variable type sze description con dp sc temporary variable del dp ar 6 creep strain increments epet dp sc equivalent elastic strain before creep ept dp ar 6 total strain eptot dp sc equivalent total strain elastic creep sigen dp sc equivalent stress before creep temabs dp sc temperature on the absolute scale Chor GT G SONG O Gr Gi Sb Y cQ JOG O QE G Qe OG OQ 6 4 4 Subroutine user tbelastic Defining Material Linear Elastic Properties Subroutine user tbelastic provides an interface for defining your own material linear elastic properties TB ELASTIC The following topics are available 6 4 4 1 Overview of the user tbelastic Subroutine 6 4 4 2 Data Types Supported by user tbelastic 6 4 4 3 Table TB Command for user tbelastic 6 4 4 4 User Interface for user tbelastic 6 4 4 5 The user tbelastic API 6 4 4 6 Usage Example for user tbelastic 6 4 4 1 Overview of the user tbelastic Subroutine The user tbelastic subroutine can define material linear elastic properties as a function of temperature or coordinates The subroutine is called at the material integration points of elements for which the definition of material elastic properties i
330. ial information of ANSYS Inc and its subsidiaries and affiliates Programmer s Manual for Mechanical APDL 7 7 14 ensget Function Getting an Element s Nodal Stresses essecccessseeeeeesseeeeessseeeeees 262 7 7 15 ensput Subroutine Storing Nodal Stresses at an Element sssseeeees 262 7 7 16 ensdel Subroutine Deleting an Element s Nodal Stresses sesseeeeeeee 263 7 7 17 engiqr Function Getting Information About an Element s Energies 263 7 7 18 engget Function Getting an Element s Energies csscceeessececeessneeeeeesseeeeessaeeeeeses 264 7 7 19 engput Subroutine Storing an Element s Energies and Volume esses 264 7 7 20 engdel Subroutine Deleting an Element s Energies esseeccesssneeeeessneeeeessseeeeeeeeaes 264 7 7 21 egriqr Function Getting Information About an Element s Nodal Gradients 265 7 7 22 egrget Function Getting an Element s Nodal Gradients eee 265 7 7 23 egrput Subroutine Storing an Element s Nodal Gradients eese 265 7 7 24 egrdel Subroutine Deleting an Element s Nodal Gradients cccccccccssesssttteeeeeeeees 266 7 7 25 eeliqr Function Getting Information About an Element s Nodal Elastic Strains 266 7 7 26 eelget Function Getting an Element s Nodal Elastic Strains eee eeeeee
331. idiaries and affiliates C 4 USERMAT F List File for This Example c amp Strain ncomp dStrain ncomp amp epsPl ncomp prop nProp amp coords 3 amp defGrad t 3 3 defGrad 3 3 amp tsstif 2 CRAKKKKKKK KKK KKK x x User defined part KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK temporary variables for solution purpose 35 j threeOv2qEl oneOv3G qEl10v3G conl con2 fratio C parameters e INTEGER NEWTON mcomp DOUBLE PRECISION HALF THIRD ONE TWO SMALL ONEHALF amp ZERO TWOTHIRD ONEDMO2 ONEDMO5 sqTiny PARAMETER ZERO 0 d0 amp HALF 0 5d0 amp THIRD 1 d0 3 d0 amp ONE 1 d0 amp TWO 2 d0 amp SMALL 1 d 08 amp sqTiny 1 d 20 amp ONEDMO2 1 d 02 amp ONEDMO5 1 d 05 amp ONEHALF 1 5d0 amp TWOTHIRD 2 0d0 3 0d0 amp NEWTON 10 amp mcomp 6 amp e local variables a e sigElp dp ar 6 1 trial stress e dsdeEl dp ar 6 6 1 elastic moduli e sigDev dp ar 6 1 deviatoric stress tensor c dfds dp ar 6 1 derivative of the yield function e JM dp ar 6 6 1 2D matrix for a 4 order tensor Cc pEl dp sc L5 hydrostatic pressure stress Cc qEl dp sc iu von mises stress e pleq t dp sc rl equivalent plastic strain at Cc beginnig of time increment e pleq dp sc rl equivalent plastic strain at end e of time increment e dpleq dp sc rl incremental equivalent plastic strain e cpleq dp sc rl correction
332. if filein ErrorMessageProbe this is the CPU 4 that originally generated the error level of error same as lngerr 0 no label used for u i pop ups l1 no label used for u i pop ups timed as a note message l note 2 warning 3 error 4 fatal 3 error w tech supp note 4 fatal w tech supp note see lngerr F for text of tech supp note error message to display use keywords of i g c for formating same as lngerr vector of data to display contains both integer and double precision data same as lngerr if filein ErrorMessageProbe dperr contains the unpacked message and lIngstrng and cherr are ignored vector of character data to display max length of character data is 32 characters 8 2 7 intrp Subroutine Doing Single Interpolation deck intrp subroutine intrp klog kppx kstpz xval ax ay yval nmax kyoff typ int dp log chr dcp input arguments variable typ siz intent klog int sc in kppx int sc in kstpz int sc in NOTE Q000000000000000000000000000000000 0n primary function subroutine for single interpolation if double interpolation is needed see intrpt Notice This file contains ANSYS Confidential information siz sc ar n func intent in out inout description interpolation type 0 use linear interpolation 1 use log log interpolation note there is no option yet for lin log or log lin X value end of table signal 0 a repeated
333. iffening matrix if nmatrx gt 3 gs i j i 1 nmrow 000000000 a LOD dp nvect nmrow This record contains the load vectors i i 1 nmrow Q 1 8 Description of the Component Mode Synthesis Matrices CMS File This section explains the contents of the CMS matrices file jobname cms 1 8 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 8 1 8 2 CMS File Format comdeck fdcms C description of cms component modal synthesis transformation file character 8 CMSNM parameter CMSNM cms LONGINT cmsfpL cmsfp integer cmsbk cmsut common fdcms cmsfpL cmsbk cmsut equivalence cmsfp cmsfpL C common variable desciption co cmsfp file position on file mode co cmsbk block number for file mode co cmsut file unit for file mode C See fddesc for documentation of how binary files are stored G G file format Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 4 of ANSYS Inc and its subsidiaries and affiliates 3 Chapter 1 Format of Binary Data Files c recid tells the identifier for this record Not all records will have e identifiers they are only indicated for those records whose c record pointers are stored in the second file header e el type tells what kin
334. igqr node key c primary function get information about nodal mag virtual disps c Notice This file contains ANSYS Confidential information c typz int dp log chr dcp siz sc ar n func intent in out inout Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 241 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database oe input arguments c variable typ siz intent description c node int sc in node number Cc should be zero for key 2 c key int sc in key for operation c 1 return magnetic virtual displacement status c nvdiqr 0 no mag virt disps defined for this node el 1 node has mag virt disps defined c 2 return total number of nodal magnetic virtual c displacements defined on model c output arguments c nvdiqr int func out the returned value of nvdiqr is based on e setting of key 7 5 26 nvdget Function Getting a Nodal Magnetic Virtual Displacement deck nvdget function nvdget node virtd C primary function get specified nodal magnetic virtual displacement c Notice This file contains ANSYS Confidential information e input arguments c node int sc in node number c output arguments c nvdget int func out virtual disp status of node G 0 node has no magnetic virtual c displacement c 1 node has a magnetic virtual c displacement c virtd dp
335. ilable in all your ANSYS sessions include the UCMD commands in your start up file START ANS You also can use UCMD to remove a custom command To do so simply use a blank value for Cmd as shown below UCMD 1 This command removes the PARB command To list all user defined command names issue the command UCMD STAT 6 7 1 Function user01 deck user01 user function userO1Q C primary function user routine number 01 c copyright c 2006 SAS IP Inc All rights reserved ansys inc c Notice This file contains ANSYS Confidential information c RR HK RK I IK kk CkCk kk Ck kk Ck kk Ck Ck Kk Ck CK A kk Ck Ck kk Ck Ck kk kk kk kk e Kk KC kk e k ke k k C this is a user routine that may be used by users to include their 194 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 9 of ANSYS Inc and its subsidiaries and affiliates 6 7 2 Function user02 Demonstrates Offsetting Selected Nodes Q0000000n a a a qgqaqaQqaqaqaqaa c special coding accesss to this routine is by the command usrl usrl may be changed by the user using the command ucmd the user may then use this routine to call his her special routines ansys routines to access information in the ansys database may be found in the ansys programmer s manual available from ansys inc see user02 for a simple example usage routines user03 t
336. ile The external table file ans ext tb1 can reside in any directory but you must specify that directory in the ANSYS EXTERNAL PATH environment variable The file contains an entry for each shared library function you wish ANSYS to access There is no limit to the number of entries The file entries have the fol lowing format C shared library path projname dll cm name function name where C shared library path projname d11 is the path to the directory that contains the shared library file Remotely mounted file systems are not recommended cm name ls the command used to invoke the function within ANSYS The command name must begin with a tilde and the first four characters of each command name must be unique function name ls the name of the function that is referenced by the specified command name This must be unique within the first four characters if multiple external commands are specified For example the following entry references the C home mydir mylibs myobject dl1 shared library and the myob ject function and specifies myobj as the related command C home mydir mylibs myobject dll myobj myobject ANSYS also makes use of external commands and places its own shared libraries and the associated external table file in the C Program Files Ansys Inc V120 lib plat form directory where platform is the directory specific to your computing platform such as Intel ANSYS loads external commands in the following
337. ile p 93 and the following graphics file BBAAA2AQOAAAAAAPPPLPOS 60AA amp 62APSMEKLKBAJANSYS 5 3SMEKLEFALNOV 16 1996SMEK KOJAI15 57 07SMEKKIMAMPLOT NO LSMEKKDAATELEMENTSSMEKJNEAIELEM NUM2 BOAAAAAALPOLPOS amp 60AB PP EBBBHBBHKOGBBHKOGKOGBBHKOGSFPPFPPAB1SAILAILABI L HCAILAB2SLHCLHCABASAILLHCAB32A0AAAAAAPPPLPO AAAAAA LPOAAA LPOLPO AAAL PO AAAAAA ABSABLLKBAB1 APSMEKJBLAGZV 1 MEKILPAJDIST 0 55 MEKIGCAIXF 1 5SMEKIAGAIYF 0 5SMEKHKKAPCENTROID HIDDENSABOABOCA ANSYS 5 3 Ex ample Graphics File The decoded plot directives are BBAAA Start Plot ERASE raster mode 2A Text Size Default OAAAAAAPPPLPO Window 0 0 4095 3070 amp 60AA Area Color Black amp 62AP Text Color White SMEKLKBAJANSYS 5 3 Text 3146 2977 ANSYS 5 3 MEKLEFALNOV 16 1996 Text 3146 2885 NOV 15 1996 MEKKOJAI15 57 07 Text 3146 2793 15 57 07 MEKKIMAMPLOT NO 1 Text 3146 2700 PLOT NO 1 MEKKDAAIELEMENTS Text 3146 2608 ELEMENTS MEKJNEAIELEM NUM Text 3146 2516 ELEM NUM 2B Text Size Small OAAAAAALPOLPO Window 0 0 3070 3070 amp 460AB Area Color Cyan PP Normal 255 EBBBHBBHKOGBBHKOGKOGBBHKOG Polygon 279 279 2790 279 2790 2790 279 2790 SFPPFPPAB1 Text 1535 1535 1 SAILAILABl Text 139 139 1 SLHCAILAB2 Text 2930 139 2 LHCLHCAB4 Text 2930 2930 4 94 Release 12 0 6 2009 5AS i are Contains proprietary and confidential information 4 3 2 Example Graphi
338. inc c output arguments G forget int func out status of constraint c 0 no loading on this node for this DOF e 4 this node has a loading for this DOF c value dp ar 4 out e value 1 2 real imag values of present settings c value 3 4 real imag values of previous settings Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 235 Chapter 7 Accessing the ANSYS Database 7 5 7 forput Subroutine Storing a Nodal Load at a Node deck forput subroutine forput node idf value c primary function store a nodal load at a node c Notice This file contains ANSYS Confidential information ae input arguments c node int sc in node number c idf int sc in reference number for the DOF 1 32 c FX l FY 2 FZ 3 MX 4 MY 5 MZ 6 CSGX 7 CSGY 8 c CSGZ 9 VFX 10 VFY 11 VFZ 12 e FLOW 19 HEAT 20 AMPS 21 FLUX 22 NPKE 23 NPDS 24 c CURT 25 VLTG 26 missing entries are spares c value dp ar 2 in real imag values of force c output arguments none 7 5 8 fordel Subroutine Deleting a Nodal Load at a Node deck fordel subroutine fordel node idf primary function delete a nodal load at a node C secondary functions none a c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func
339. ine Obtaining Information from the Errors Common qQaaqaagqaaagqaagqagqaaaa l keyerr 2 errfil 3 numnot 4 numwrn 5 numerr 6 numfat 7 maxmsg 8 lvlerr 92mxpcmd 10 nercmd 11 nertim 12 nomore 13 eropen 14 ikserr 15 kystat 16 mxr4r5 17 mshkey 19 opterr 20 flowrn 21 errhpi 22 noreport 23 pdserr 24 mxpcmdw 25 kystop 26 icloads 27 ifkey below definitions copied from errcom 7 92 for user information BAERS IOV STUN OL ori eed ese dave epe Cane es Ce dm ue ave Ie see ansysdef for parameter definitions M keyerr master error flag ER ERRORF LAG errfil errors file unit number ER ERRORFILE numnot total number of notes displayed ER NUMNOTE numwrn total number of warnings displayed ER NUMWARNING numerr total number of errors displayed ER NUMERROR numfat total number of fatals displayed ER NUMFATAL maxmsg max allowed number of displayed messages before abort ER MAXMESSAGE lvlerr used basicly in solution from cnvr command ER ERRORLEVEL l do not set keyerr for notes errors warnings 2 2same as 1 but do not display message either mxpcmd maximum number of messages allowed per command ER MAXCOMMAND nercmd number of messages displayed for any one command ER NUMCOMMAND nertim key as to how message cleared from u i pop up ER UICLEAR as per rsg pft 5 1 92 only for info calls l2message is timed before removal O message needs pick or keyboard before removal l mes
340. ine code UserMat Input Arguments matld Integer variable containing the material ID number elemld Integer variable containing the element number kDomIntPt Integer variable containing the material integration point number kLayer Integer variable containing the layer number kSectPt Integer variable containing section point number Idstep Integer variable containing load step number isubst Integer variable containing substep number nDirect Number of direct components of the stress or strain vector at material point nShear Number of shear components of the stress or strain vector at material point engineering components Total number of the stress or strain components at material point nDirect nShear Number of state variables specified by the NPTS value in the TB STATE command Number of material constants specified by the NPTS value in the TB USER command Temp Double precision variable contains the current temperature dTemp Double precision variable contains the current temperature increment Time Double precision variable contains the total time at the beginning of the time increment dTime Double precision variable contains the current time increment Strain Double precision array contains the total strains at the beginning of the time increment Array size is ncomp Release 12 0 2009 SAS IP Inc All rights reserved Co
341. ing UPFs on Windows Systems The procedure for compiling and linking UPFs on Windows Systems allows you to link the ANSYS Shared Memory Parallel SMP executable as well as the Distributed versions of ANSYS executables As mentioned previously the source files for the user routines reside in subdirectory Program Files Ansys Inc V120 ansys customize user Note If you intend to modify any of the user routines make a duplicate copy of the Program Files Ansys Inc V120 ansys customize user directory to preserve the original files for later use if necessary If you modify any of the user routines move them to the folder s they are linking in By default those folders are ANSYS SMP Program Files Ansys Inc V120 ansys custom user lt platform gt Distributed ANSYS HPMPI version Program Files Ansys Inc V120 ansys cus tomNuserN platform NDANSYSHPMPI Distributed ANSYS MSMPI Winx64 only Program Files Ansys IncNVi20NansysNcus tomNuserN platform NDANSYSMSMPI Where platform is a directory that uniquely identifies the hardware platform version Intel for 32 bit Windows Winx64 for 64 bit Windows If you modify any of these subroutines select the Relink ANSYS option from the ANS ADMIN120 utility to link these changes into the ANSYS program This procedure will ask which versions you intend to relink and then compiles all Fortran files files ending with F and all C files files ending with c
342. ing of key 7 7 26 eelget Function Getting an Element s Nodal Elastic Strains deck eelget function eelget ielem value C primary function get element nodal elastic strains c Notice This file contains ANSYS Confidential information Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 266 of ANSYS Inc and its subsidiaries and affiliates 7 7 27 eelput Subroutine Storing an Element s Nodal Elastic Strains qa qgqaqaqaqaa Q00000000000000000000000000Q input arguments ielem int sc in output arguments eelget int func out value dp ar out NOTE element number status of element 0 element undefined gt 0 number of nodal elastic strains returned element nodal elastic strains Strains at each corner node in the order XX WoW KY Vz XI For solid elements strains at each corner node For shell elements strains at each corner node first top durface then bottom For layered elements w KEYOPT 8 0 strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node first the bottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 s
343. ing the values of these variables at start of the time increment They must be updated in this subroutine to their values at the end of time increment if any of these internal State variables are associated with the creep behavior output arguments delcr dp sc o incremental creep strain dcrda dp ar o output array dcrda 1 derivitive of incremental creep strain to effective stress dcrda 2 derivitive of incremental creep Strain to creep strain local variables cl c2 c3 c4 dp sc 1 temporary variables as creep constants conl dp sc 1 temporary variable t dp sc 1 temporary variable KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK parameters OOOO Oe IOs oemo Oe Oh QAI ooo Oe GE MO2 HO Oe E EA IO Qe Ol Oe E Os QO 22 6 Gl MOA GOs G2 O2 Or Qe QQ iO Oe Ol G2 E Os Qi Oe oo Qh ORG ooo ooo 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 66 of ANSYS Inc and its subsidiaries and affiliates 6 4 3 Subroutines UserCreep and UserCr Defining Viscoplastic Creep Material Behavior 6 4 3 2 Creep Subroutine UserCr In contrast to the UserCreep subroutine for the UserCr subroutine you need to specify the creep strain tensor A detailed explanation of this subroutine follows deck usercr USERSDISTRIB subroutine usercr elem intpt mat ncomp kfirst kfsteq e posn d x proptb timval timi
344. input arguments c ielem int sc in element number c n int sc in the number of values to store value dp ar n in element fluences c output arguments none c NOTE If a value is not defined a very c small number should be used 2 100 7 6 20 efudel Subroutine Deleting an Element Fluence deck efudel subroutine efudel ielem C primary function delete element fluences c Notice This file contains ANSYS Confidential information 250 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 6 23 edcput Subroutine Storing an Element Current Density c variable typ siz intent description a ielem int sc in element number c output arguments none 7 6 21 edciqr Function Getting Information About Element Current Densities deck edciqr function edciqr ielem key C primary function get information about element current densities c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number or zero see below c key int sc in key as to the information needed c 1 or DB MAXRECLENG return element densities info e for ielem 0 number of current densities for this G element rec length e 0 maximum number of current densities e defined for any element o max rec length c DB NUMDEFINED
345. intpt mat kstartL ncomp tem dtem prop d ktform dens flu dflu epel eppl statev usvr epeq plwork kplst int sc in plasticity option int sc in element number label int sc in element integration point number int sc in material reference number intL sc in virtual starting address of the data table int sc in number of stress strain components 4 or 6 dp sc in temperature at the end of this substep dp sc in temperature increment over this substep dp ar 9 in material property array ex ey ez gxy gyz gxz uxy uyZz uxz dp ar ncomp ncomp in elastic stress strain matrix int sc in request key for tangent matrix formation dp sc in material density dp sc in fluence at the end of this substep dp sc in fluence increment over this substep dp ar ncomp inout modified total strain trial strain dp ar ncomp inout plastic strain at previous substep dp ar ncomp 6 inout state variables at previous substep dp ar inout user defined state variables for pluser dp sc inout effective plastic strain at prev substep dp sc inout accumulated plastic work at prev substep int sc in plane stress key form dtt if kplst 1 output arguments epel eppl statev usvr epeq plwork sigepl sigrat dt dtt dp ar ncomp inout elastic strain dp ar ncomp inout updated plastic strain dp ar ncomp 6 inout updated state variables
346. ion write element load vect to file for substructure generation run c secondary functions none Notice This file contains ANSYS Confidential information Q input arguments iel int sc in element number nvect int sc in number of load vectors current load step number key int sc in type of load vect temperature fluences heat generation rates current densities end pressures pressures film coefficients bulk temperatures extra displacement shapes thermal strains eptho in e142 thermal flux as in e155 initial strains epino in e101 magnetic virtual displacements calculated source field hsn in e196 20 element load vector 30 copy do not scale tempev in e142 Il Q wo 0 N OOOO OOOO OOOO OOOO 0 0 0 0 O O O O I Il co o 015 CO N nd int sc in number of vect items vect dp ar nd in array of load data ref dp sc in reference value for zero load a output arguments none 6 2 9 Subroutine rvrget Fetching Real Constants for an Element deck rvrget subroutine rvrget iel ireal ielc nrvr rvr C primary function get the real constants for an element Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 137 Chapter 6 UPF Subroutines and Functions On 00 a CQ c typ int dp log chr dcp siz sc ar n func intent in out inou
347. ion on optvar optvar optimization variables see documentation in cmopt inc x ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck KKK KERR ck ck ck ck ck ck KEKE KEK ck ck ck ck ook ck KEKE KEKE kk ck KKK KEKE KEKE ko ko ko ko ko ko ko ko kv simplified flowchart of how user optimization interfaces with ansys Kckckckckckckckckck ck ckckckckck kk Q0000000200000008n0000000000000000n0n0 nnn x start KAKKKKKKKKKKKKKKKKK 3 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 2 of ANSYS Inc and its subsidiaries and affiliates 05 Chapter 6 UPF Subroutines and Functions VVV V kCckckckck ck ck ck ck ck ck ck ck ck ck ck kk kk kk AX analysis file setup PREP7 SOLUTION POST1 FINISH ok kk K K ke Kok ko k k k ke kk k k k i i i i VVV V okckckck ck ck ck ck ck ck ck ck kk opt module opt commands OPEXE ok ck kk oko ke ke eK KO i i i i VVV V ckckck ck ck ck ck ck ck ck ck kk kc kk ansys analysis CQ Qe QE Qa QE IO Qa QE Q2 iQ Qo iQ Qo QE IO 0E E IQ QE Qe OE Ds gt 202 2 E Q2 10 Q2 Qr H2 10 45 7 Q3 7 Q5 99 7 Q5 0X 202 Q5 70 Qo QE Qo 200 72 0 102 07 2 Q2 2 Q3 09 Q2 0 Qe QC Qe QE Qe Qr s A use setup file i KKKKKKKKKKKKKKKKKK
348. ions on file nmrow number of rows in matrices nmatrx number of matrices on file kan analysis type wfmax maximum wavefront lenbac number of nodes numdof number of dofs per node jegtrmL jcgtrmH number of coefficients lumpm lumped mass key 0 default matrix type 1 lumped jcegeqn number of jcg equations jegtrm pre 8 1 this is the number of coefficients in sparse jcg storage otherwise this value must be 0 and jcgtrmL jcgtermH must be used keyuns unsymmetric key 0 no unsymmetric matrices on file 1 there is at least one unsymmetric matrix on file extopt mode extraction method 0 reduced lumped 3 unsymmetric Lanczos 4 damped Lanczos 6 block Lanczos keyse superelement key set if at least one superelement Sclstf scale factor for matrices nxrows the maximum rank for this solution ptrlIDX1 pointer to the matrix row indices ptrlIDXh high part of row index pointer ncefull Number of constraint equations on the full file ncetrm Total number of terms in the constraint equations ptrEND1 Low part of 64 bit end of file ptr ptrENDh High part of 64 bit end of file ptr 0 position not used Quom i J numdof Degrees of freedom per node c DOF reference numbers are c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 Cc AZ 9 VX 10 VY 11 VZ 12 13 18 are spares c TO KKK PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 c EMF 25
349. iption of the Element Matrices File 1 7 Description of the Substructure Matrices File 1 8 Description of the Component Mode Synthesis Matrices CMS File 1 9 Description of the Full Stiffness Mass File 1 1 Understanding ANSYS Binary Files ANSYS written binary files include the following The following results files in which the ANSYS program stores the results of solving finite element analysis problems Jobname RST A structural or coupled field analysis Jobname RTH A thermal analysis Jobname RMG A magnetic analysis Jobname RFL A FLOTRAN analysis The Jobname MODE file storing data related to a modal analysis The Jobname RDSP file storing data related to a reduced or mode superposition transient analysis The Jobname RFRQ file storing data related to a reduced or mode superposition harmonic analysis The Jobname EMAT file storing data related to element matrices The Jobname SUB file storing data related to substructure matrices S The Jobname FULL file storing the full stiffness mass matrix The files listed above cover almost all users needs although there are others For more information see the Basic Analysis Guide 1 1 1 Conventions Used to Describe Binary Files In the information describing the binary file formats Record ID is the identifier for this record Not all records will have identifiers they re indicated only for records whose record pointers are stored in
350. irst the bottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are each then Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 273 Chapter 7 Accessing the ANSYS Database not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPTH item of ETABLE command OY JO Qo Ava 7 7 40 ethdel Subroutine Deleting an Element s Thermal Initial and Swelling Strains deck ethdel subroutine ethdel ielem c primary function delete element thermal initial and e swelling strains c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number e 0 delete for all defined elements e output arguments none 7 7 41 euliqr Function Getting Information About an Element s Euler Angles deck euliqr function euligr ielem key C primary function get information about element euler angles c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the inform
351. is the DOF reference number bit 11 PDBR in mask Reaction forces The force values are ordered according to the DOF order shown above in the DOF number reference table bit 11 PDBR in mask Master DOF list This index is calculated as N 1 numdof DOF where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number bit 4 in mask Boundary condition index table bit 23 PDBBC in mask numdis ptrDIX ptrDIS numfor ptrFIX ptrFOR format 0 0 0 0 0 0 0 0 0 0 0 t 13 SO 0 C O CDO 0 0 RE RU Eur RO Re Ret is described below number of nodal constraints pointer to the table of nodes having nodal constraints pointer to nodal constraint values number of nodal input force loadings pointer to the table of nodes having nodal forces pointer to nodal force values key 0 or 1 denoting which format is used for DIX FIX data see below numdis ptrDIX ptrDIS numfor ptrFIX ptrFOR format positions 7 40 are unused if format Nodal constraint DOF This index is calculated as N 32 DOF where N is the node number and DOF is the DOF reference number Values are in the same order as the DOF number reference table f format numbers 1 Nodal constraint node H if format does not exist if format 1 g
352. ize 90 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 4 2 2 Graphics File Directives Graphics Directive Command Character Parameters Parameter Types Marker Size Anno Size 3 size Defines the size of the node marker 0 the smallest size 15 the largest size Annotation text size 1000 int Pixmap Style 1 Do not include background pixels Font Control 1 Small font Text Justifica 0 Right justified 1 Left justified x y Defines a point at coordinates x y Xy x y Moves to coordinates x y Xy xy Draws a line to coordinates x y Xy x y Sets coordinates for where text will display nchar Defines the number of displayed characters string Defines the text string itself Xy Long String inorm This value divided by 255 is cos where is the viewing direction and the surface normal of subsequent polygons Long n Defines the number of polygon vertices kedge Defines whether the polygon edge is displayed 0 do not display edge 1 display it xy1 xyn Defines coordinates for the polygon Int Int Xy Xy End Plot no parameters no parameters none Pixmap kpx Defines the pixel resolution x1 y1 Sets coordinates for the lower left corner of the z buffer
353. k TrackEnd subroutine TrackEnd sub32 c function mark end of track ansys call c Notice This file contains ANSYS Confidential information c input arguments c sub32 char sc in name of subroutine being left e 32 characters max C output arguments none 8 2 6 erhandler Subroutine Displaying ANSYS Errors deck erhandler subroutine erhandler filein msgid msglvl lngstrng dperr cherr C primary function Display ANSYS error messages c Notice This file contains ANSYS Confidential information c input arguments c filein ch 40 sc in Filename used for character portion of e message ID this is the file name of the file which contains the source for this e routine e c if ErrorMessageProbe then error was e generated on another processor distributed c ANSYS In that case dperr contains the 288 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 8 2 7 intrp Subroutine Doing Single Interpolation msgid int sc in msglvl int sc in lngstrng ch sc in dperr dp ar in Q000000000000000000000000000010n cherr ch ar in message already made ASCII and expanded Numeric portion of the message ID 1 9999 unique for each erhandler call in the FILE Recommend using a sequence similar to format conventions i e 5000 5010 5020
354. kt dp sc in tangential penalty stiffness c an initial guess is provided but c the user must pick a suitable e value that allows minimal tangential c Slip during sticking without e adversely affecting the convergence e a possible choice could be kt mu kn c elen dp sc in length of contact element c kstat int sc inout contact status e 1 SEE c a r sliding C 3 open contact near c 4 open contact far c timval dp sc in current time value c timinc dp sc in time increment over this substep c tcont dp sc in contact surface temperature c from temperature DOF or temperature load Cc ttarg dp sc in target surface temperature el only from temperature DOF c toffst dp sc in temperature offset from absolute zero c dslip dp ar ncomp in slip increment current substep c slip dp ar ncomp inout accumulated slip previous substep c pres dp sc in normal pressure force current substep c 0 compression c 0 tension c tau dp ar ncomp inout frictional stress previous substep c usvr dp ar nuval nintp inout additional state variables from 176 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 4 9 Subroutine userfric Writing Your Own Friction Laws QOo0Q0n0nQ0nQ0nQ0nQonQoaonoaooaQaooaoaoaonoaoaoaoaonoaoanoaonoaononoaoaoanoanoaoanoanonoanonoaoanonoan
355. l information copyright c 2008 SAS IP Inc All rights reserved xc ansys in Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 153 Chapter 6 UPF Subroutines and Functions a input arguments variable typ siz intent description elem int sc in element number face int sc in face number area dp sc in face area or length temp dp sc in face temperature pressure dp sc in face pressure ep dp ar 4 in face strains stress dp ar 11 in face stresses output arguments none 6 3 8 Subroutine uflex Computes flexibility factors for PIPE288 and PIPE289 deck uflex USERSDISTRIB Q00n000n0n0n0nnQoanQoanoaoaoaoanoaoaoaoaoaoaoaoaoaoaoooonononon KKK KKK KKK subroutine uflex elemId pressInt pressExt ex pois sflex twten primary function to re compute the flexibility factors for pipe288 and pipe289 this is accessed by inputting the axial flexibility factor as 10 secondary functions none Notice This file contains ANSYS Confidential information copyright c 2008 SAS IP Inc All rights reserved ansys inc typz int dp log chr dcp siz sc ar n intent in out inout input arguments elemId int sc in element number pressInt dp ar 2 in internal pressures at end nodes pressExt dp ar 2 in external pressures at end nodes Pressures include hydrostatatic
356. l information 112 of ANSYS Inc and its subsidiaries and affiliates Chapter 6 UPF Subroutines and Functions This chapter describes the various subroutines functions and commands that allow you to customize the ANSYS program for your specific purpose The first portion of each subroutine or function consisting of comment lines is shown in most cases User subroutines that can be modified have the term USERDISTRIB in the first line of the subroutine For example the first line of the userop subroutine looks like this deck userop USERDISTRIB User subroutines that do not have USERDISTRIB in the first line cannot be modified and must be used as they are The following UPF topics are available 6 1 Creating a New Element 6 2 Supporting Subroutines for Element Creation 6 3 Subroutines for Modifying and Monitoring Existing Elements 6 4 Subroutines for Customizing Material Behavior 6 5 Subroutines for Customizing Loads 6 6 Running ANSYS as a Subroutine 6 7 Defining Your Own Commands 6 8 Supporting Subroutines 6 9 Access at the Beginning and End of Various Operations 6 10 Creating Your Own Optimization Subroutine 6 11 Memory Management Subroutines 6 12 Parameter Processing Subroutines 6 13 Miscellaneous Useful Functions 6 1 Creating a New Element ANSYS offers two tools for creating a user defined element The user defined element API Direct access to the ANSYS database and files ANSYS recommends the user
357. l not be able to access your command Therefore it is a good practice to check the ANSYS external table file to make sure you have no external command name conflicts Do not modify the ansys inc vi120 ansys lib plat Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 305 Appendix A Creating External Commands in UNIX form gt ans_ext tbl file You can also use the DEBUG command to verify that no external command name conflicts exist Note The shared library must be consistent with the computer type and OS level on which ANSYS will be executed A 1 4 Setting the ANSYS EXTERNAL PATH Environment Variable Before launching ANSYS you must first set the ANSYS EXTERNAL PATH to point to the directory containing the external table file For convenience if you distribute your new functionality to other users they should set their login or cshrc files so that it is persistent from session to session For example the following sets the environment variable to point to the home mydir directory setenv ANSYS EXTERNAL PATH home mydir A 1 5 Using External Commands To call an external command enter it as you would any other ANSYS command You can also call external commands through either an APDL macro or UIDL script Note Avoid recursive external commands that is avoid situations where an external command calls a
358. latform libbin so on UNIX systems Libbin sl on HP systems 2 1 1 Access Routines to Results Substructure and Matrix Files Demonstration programs that use the BINLIB library for reading and writing ANSYS results substructure and matrix files are included on the installation media e ResRdDemo e ResWrDemo e rdsubs e wrtsub rdfull bintst On Windows Systems The FORTRAN source for these programs is located in Program Files Ansys Inc V120 ANSYS cus tom misc lt platform gt and the files are named ResRdDemo F ResWrDemo F rdsubs F wrtsub F and rdfull F To link these demonstration programs use the Program Files Ansys IncNV120NANSYSNcus tomWniscN platform Nrdrwrt bat procedure file and specify the program that you want to build on the command line Valid command line options are ResRdDemo ResWrDemo rdsubs wrtsub rdfull and userprog For example to build the program to read a results file type Program Files Ansys Inc V120 ANSYS custom misc lt platform gt rdrwrt ResRdDemo Appropriate files will then be copied from Program Files Ansys IncNV120NANSYSNcus tom misc lt platform gt to your working directory compiled and linked The resulting executable will also be placed in your current working directory Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 53 Chapter 2
359. lculate standard deviation of X coordinates y coordinates amp z coordinates get number of currently selected nodes numnp ndinqr 0 DB NUMSELECTED istat 1 if numnp le 0 go to 999 allocate memory for x y amp z coordinates of nodes pdXnodeL fAnsMemAlloc numnp MEM_DOUBLE XCoords pdYnodeL fAnsMemAlloc numnp MEM DOUBLE YCoords pdZnodeL fAnsMemAlloc numnp MEM DOUBLE ZCoords loop through all selected nodes i l node 0 xmean 0 0d0 ymean 0 0d0 zmean 0 0d0 node ndnext node if node gt 0 then get xyz coordinates ksel ndgxyz node xyz 1 store this node s xyz coordinates Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 197 Chapter 6 UPF Subroutines and Functions Xnode i xyz 1 Ynode i xyz 2 Znode i xyz 3 el while we re looping accumulate sums to calculate means xmean xmean xyz 1 ymean ymean xyz 2 zmean zmean xyz 3 c increment index i i 1 e loop back up for next selected node goto 10 endif c node 0 at the end of node list c calculate mean of xyz coordinates xmean xmean numnp ymean ymean numnp zmean zmean numnp ol calculate standard deviation for xyz coordinates sodx 0 sody 0 sodz 0 do i 1 numnp sodx sodx Xnode i xmean 2 sody sody Ynode i ymean 2 sodz sodz Znode i
360. lemId kIntg nvect vect solution dependent variables Strains at gauss intg point ion it overides ansys database Usually write user defined state variables query argument string element number gauss intg number number of vector to be inquired vector to be inquired stress vector Total strain vector EPEL EPPL EPCR EPTH plastic strain vector creep strain vector thermal strain vector Initial stress vector accumulated equivalent plastic strain accumulated equivalent creep strain State variables define by tb state Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 321 22 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 3 of ANSYS Inc and its subsidiaries and affiliates Index Symbols 3 D line elements 290 3 D nodal coordinates 146 A Abbreviations file access routines 55 acelcm inc file 102 activating UPFs 107 ANSYS customized version of 104 executing command from a user subroutine 212 linking optimization program to 204 UPFs to 103 parameters 102 running as a subroutine 193 standard file header 57 start up accessing program logic at 203 stopping 290 tailoring with UPFs 99 UPFs for 99 ansyscust file 105 ansysdef inc file 102 arc length debugging 109 auto time stepping debugging 109 AUX2 command
361. lement Face Heat Flux Surface Informa tion deck userfx USERSDISTRIB OOO OOOO OOOO OOOO OOOO OOOO OOOO O O O O O O OOO OO subroutine userfx ielc elem time nr u ndat dat primary function change element face heat flux surface info copyright c 2008 SAS IP Inc All rights reserved ansys inc in order to activate this user programmable feature the user must enter the usrcal userfx command this routine is called during each substep of each load step it is called for each equilibrium iteration it is called once per element it is called only during the heat flow load vector formulation stage and not during the heat flow evaluation stage the call to get the standard ansys input heat flux surfaces is made just before entering this routine so this information is available to be modified if desired input arguments variable typ siz intent description ielc int ar IELCSZ in array of element type characteristics elem int sc in element number for operation time dp sc in time of current substep nr int sc in number of nodal temperatures of the element u dp ar nr in vector of most recent values of the temperatures ndat int sc imn number of data points per element for example for solid70 ndat 24 6 4 where 6 faces per element 4 corners per face dat dp ar ndat inout fluxes has input values for each corner of each face output arguments
362. lement Virtual Displacement sese 7 6 28 eimiqr Function Getting Information About Element Impedances sssse 7 6 29 eimget Function Getting an Element Face Impedance ccessssscececeeeeeesessneeeeeeeeees 7 6 30 eimput Subroutine Storing an Element Impedance sseeeennn 7 6 31 eimdel Subroutine Deleting an Element Impedance eceessssceceeeeeeeesesnnneeeeeeeeees 7 6 32 esfiqr Function Getting Information About Element Surface Stress Data 7 6 33 esfget Function Getting Element Surface Stress Data ceessssscccceeeceessessnseeeeeeees 7 6 34 esfput Subroutine Storing Element Surface Stress Data c scccccccesssessntteeeeeeeeeseees 7 6 35 esfdel Subroutine Deleting an Element s Surface Stress Data seeeesessesss 7 6 36 efsdel Subroutine Deleting a Flagged Surface on an Element ssssss 7 6 37 efsget function Getting Element Face Flagged Surfaces sseeeeee 7 6 38 efsiqr function Getting Information About Flagged Surfaces eeeeesssess 7 6 39 efsput Subroutine Storing an Element Face Flagged Surface eessss Results Information Routines ccceccsseccccscccescccccccnsscecsscceescceusececsesessuceceecesecseuseceusesensucss 7 7 1 dspiqr Function Getting Information About
363. lement s Thermal Initial and Swelling Strains 274 7 7 41 euliqr Function Getting Information About an Element s Euler Angles 274 7 7 42 eulget Function Getting an Element s Nodal Euler Angles eene 274 7 7 43 eulput Subroutine Storing an Element s Euler Angles 275 7 7 44 euldel Subroutine Deleting an Element s Euler Angles cccsesssseccceeeeeesesnneeeeeeeeees 275 7 7 45 efxiqr Function Getting Information About Element Fluxes sese 276 7 7 46 efxget Function Getting an Element Flux cccssccccccceseseesnneeeecceeessessneeeeeeeeeseeeeees 276 7 7 47 efxput Subroutine Storing an Element s Fluxes ssccccccceesseesenteeceeeeeeeseesnneeeeeeeeess 276 7 7 48 efxdel Subroutine Deleting Element Fluxes ssccccccccessssssneeeceeceseseesnneeeeeeeeseseeees 277 7 7 49 elfiqr Function Getting Information About Element Local Forces sssssss 277 7 7 50 elfget Function Getting an Element Local Force cc sscccccceeesesessnececeeecessesseneeeeeeeess 277 7 7 51 elfput Subroutine Storing an Element s Local Forces esses 278 7 7 52 elfdel Subroutine Deleting Element Local Forces cccccccccsssssstecceceeeeesssssneeeeeeeseeeees 278 7 7 53 emniqr Function Getting Information About Element Miscellaneous Non summable bri
364. lement type 223 getting information about element characteristics 224 getting the number of the next defined element 218 getting the number of the next element 217 getting the number of the previous selected element 217 routines for selecting and retrieving 216 selecting unselecting deleting or inverting an ele ment 218 selecting unselecting deleting or inverting an ele ment type 225 storing an element 222 storing element type data 224 elements 99 accessing information 132 changing face charge density surface information 182 convection surface information 180 heat flux surface information 181 changing pressure information 179 debugging 110 evaluating material properties 138 finding coordinates 202 load vectors 137 matrix debugging 110 modifying 149 monitoring 149 non summable miscellaneous data writing to results file 145 overriding characteristic defaults 130 parameters 102 particle velocities and accelerations 326 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Index due to waves and current 187 returning reference names 133 rotation vectors computing 146 rotational pseudovector updating 147 storing user supplied output 150 subroutines 102 for element characteristics 128 for element creation 133 transformation matrix computing 146 types 128 updating 3
365. lements This table equates the order number used to the actual element number Order i i 1 nume First element at a DOF table This record signifies the first element encountered at a particular DOF First i i 1 lenu Last element at a DOF table This record signifies the last element encountered at a particular DOF Last i i 1 1lenu Bits set at a DOF table This record has bits for constraints forces etc DofBits i i 1 lenu added at 10 0 Element index table This record specifies the file location for the beginning of the data for each element index i i 1 nume Low part of pointer index i i 1 nume High part of pointer The records at the end of the file store element information and get written as a set for each element nume sets of these records will appear on the file at this point ptrEHD indicates the beginning of the element data If substructure matrices are written to the EMAT file they are written in a different format than is shown here This alternate format is not documented at this time EHD 10 as it is likely to change in the future Element matrix header stkey mkey dkey sskey akey nrkey ikey 0 0 nmrow each item in header is described below Stkey stiffness matrix key 0 matrix not present matrix present mkey mass matrix key 0 matirx not present matrix present dkey damping matrix key 0 matrix not present matrix present S
366. lly need to be changed may be printed out here to study where nr is the number of degrees of freedom in the by nr ment its functional size is 6 1 3 7 Subroutine userac Accessing Element Information This subroutine is provided for demonstration purposes 132 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 2 2 Subroutine svgidx Fetching the Index for Saved Variables deck userac USERSDISTRIB subroutine userac elem output arguments none C primary function To demonstrate user access of element information C Given the element number all information about the element is avaiable C Starting with elmdat one can get the element type real constant number c the material number the element coordinate system number as well as C the node numbers Then one can get more information about any or all C of these things The below demonstrates getting the element type and C real constants o c copyright c 2006 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information ux c input arguments c variable typ siz intent description c elem int sc in element number as amp amp es g 6 2 Supporting Subroutines for Element Creation The subroutines described on the next few pages support t
367. lu kplst sig hsig int sc in creep option output arguments epel epcrp statev usvr sig hsig int sc in element number label int sc in element integration point number int sc in material reference number intL sc in virtual starting address of the data table int sc in number of stress strain components 4 or 6 dp ar ncomp inout elastic strain dp sc in elastic young S MODULUS dp sc in poisson S RATIO dp ar ncomp ncomp in elastic stress strain matrix dp ar ncomp inout creep strain at previous substep dp ar ncomp 5 2 inout state variables at previous substep dp ar inout user defined state variables for usercr dp sc in temperature at the end of this substep dp sc in temperature increment over this substep dp sc in fluence at the end of this substep dp sc in fluence increment over this substep int sc in plane stress plane strain key dp ar ncomp inout stresses not used in input dp ar 1 inout hydrostatic stress not used in input dp ar ncomp inout elastic strain adjusted for creep increment dp ar ncomp inout updated creep strain dp ar ncomp 5 2 inout updated state variables dp ar inout updated user defined state variables dp ar ncomp inout stresses redefined if c13 0 dp sc inout hydrostatic stress redefined if c13 gt 0 6 2 18 Subroutine swell1 Updating an Element s Swelling History d
368. m prop c primary function to evaluate material properites for 1 d elements c c Notice This file contains ANSYS Confidential information e c input arguments c elem int sc in element number for anserr c matin int sc in material reference number c if negative no required properties c tem dp sc in temperature for evaluation e C output arguments c prop dp ar 5 out material properties ex nuxy gxy alpx dens e 6 2 13 Subroutine tbuser Retrieving User Table Data deck tbuser subroutine tbuser mat numitm tbprop C primary function return the tb data for the user table c Notice This file contains ANSYS Confidential information c input arguments Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 139 Chapter 6 UPF Subroutines and Functions c mat e numitm aa tbprop int sc in int sc in output arguments dp ar numitm out material property number the number of data items requested array of tb data 6 2 14 Subroutine plast1 Updating an Element s Plastic History deck plastl subroutine plastl x X option elem intpt mat kstartL tem dtem e ktform dens flu dflu epel eppl statev usvr epeq plwork sigepl sigrat et C primary function Cc Cc C secondary functions to update the plastic history for 1 component
369. m surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are not appropriate For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface then the top surface For beam elements record is element depenent item of ETABLE command each then the contents of this See LEPTH 7 7 39 ethput Subroutine Storing an Element s Nodal Thermal Stresses deck ethput subroutine ethput eG primary function amp also the c Notice This file contains ANS G input arguments c ielem int sc in c nval int sc in o c value dp ar nval in c output arguments none c NOTE o G o o e o amp o e o e o o o o c e ielem nval value store nodal thermal strains at an element volumetric swelling strain YS Confidential information element number the total number of values 6 nnod nface the strain values Strains at each corner node in the order X Y Z XY YZ XZ epswel For solid elements strains at corner node For shell elements strains at each corner node first top durface bottom For layered elements w KEYOPT 8 0 strains for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Strains for second layer at each corner node f
370. mat list of nodes on line 3x i4 elseif lab2 eq AR then nareas ndarea num ktype lista 1 write iott 2130 nareas 2130 format number of nodes on area i4 write iott 2135 lista i i 1 nareas 2135 format list of nodes on area 3x i4 else write iott 2150 2150 format Only KP LN or AR are acceptable on user written x gnsme command endif user04 0 return end 6 7 5 Functions user05 through user10 The source code for user subroutines user05 user06 user07 user08 user09 and user10 is identical to function user01 shown above 6 8 Supporting Subroutines The following routines may be used for general applications 6 8 1 Function GetRForce Getting Nodal Reaction Force values deck GetRForce function GetRForce Node Label Value c primary function Get the K u F at a node from the rfsum vector e warning This routine is called after the elements e are formed but before solution Therefore c F is from the current iteration but e u is from the previous iteration At convergence e this difference will have little effect e The computations are done immediately after the c call to UElMatx 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 00 of ANSYS Inc and its subsidiaries and affiliates 6 8 2 Function GetStackDisp Getting Current Displacement Values e Use the RFSUM command to ask for the summation
371. ment has no pressures e 0 this element face has no pressures Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 243 Chapter 7 Accessing the ANSYS Database e gt 0 number of values defined e value dp ar out the element pressures real imag at each e face 7 6 3 eprput Subroutine Storing an Element Face Pressure deck eprput subroutine eprput ielem iface nval value C primary function Store an element face pressure c Notice This file contains ANSYS Confidential information ae input arguments c ielem int sc in element number for operation c iface int sc in face number 1 68 c nval int sc in number of values to put c value dp ar nval in the element pressures real imag at each e face c output arguments none 7 6 4 eprdel Subroutine Deleting an Element Pressure Convection deck eprdel subroutine eprdel ielem iface C primary function delete a pressure convection on an element c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c iface int sc in face number o 0 delete all pressures on this c element c 1 6 delete pressure on this face output arguments none 7 6 5 ecviqr Function Getting Information About Element Convections deck ecvi
372. ments o ielem int sc in element number c output arguments c enlget int func out status of element e 0 nonlinear tables undefined e gt 0 number of nonlinear tables defined c value dp ar n out the element nonlinear tables NOTE Nonlinear data at each node are in the order SEPL SRAT HPRES EPEQ PSV PLWK and 4 spares For beam elements the contents and number of information is element nananana Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 281 Chapter 7 Accessing the ANSYS Database c dependent See NLIN on ETABLE e command 7 7 63 enlput Subroutine Storing an Element s Nonlinear Tables deck enlput subroutine enlput ielem n temp C primary function store element nonlinear tables c Notice This file contains ANSYS Confidential information ae input arguments c ielem int sc in element number c n int sc in number of element nonlinear table values c temp dp ar 6 in element nonlinear table etc output arguments none NOTE Nonlinear data at each node are in the order SEPL SRAT HPRES EPEQ PSV PLWK and 4 spares For beam elements the contents and number of information is element dependent See NLIN on ETABLE command qgqaqaqaqaaqaaa 7 7 64 enldel Subroutine Deleting Element Nonlinear Tables deck enldel subroutine enldel ielem
373. mmon variable descriptions x co resufpL file position on file resu Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 5 Chapter 1 Format of Binary Data Files co resubk block number for file resu usually 6 co resuut file unit for file resu 0 if not open FUN12 co resuLong 0 old 32 bit integer form 1 64 bit form 8 1 ol See fddesc for documentation of how binary files are stored Cc ckckckck ck ck kk file format ckckckck ck ck kk c recid tells the identifier for this record Not all records will have c identifiers they are only indicated for those records whose c record pointers are stored in a header c type tells what kind of information is stored in this record c i integer e dp double precision c cmp complex c nrec tells how many records of this description are found here e lrec tells how long the records are how many items are stored c recid type nrec lrec contents Quo mee i t 100 standard ANSYS file header see binhed for ol details of header contents ed a A 40 RST FILE HEADER e funl2 maxn nnod resmax numdof c maxe nelm kan nsets ptrend c ptrDSI ptrTIM ptrLSP ptrELM ptrNOD c ptrGEO ptrCYC CMSflg csEls units e nSector csCord ptrEnd8 ptrEnd8 fsiflag e pmeth noffst eoffst nTrans ptrTRAN c kLong csNds cpxrst extopt nlgeom C AvailData mmass 0 0 0 e
374. mmon variable descriptions x xx x rfrgfpL file position on file rfrq rfrqbk block number for file rfrq rfrqut file unit for file rfrq See fddesc for documentation of how binary files are stored KKKKKKKKKK file format KKKKKKKKKK recid tells the identifier for this record Not all records will have identifiers they are only indicated for those records whose record pointers are stored in the second file header type tells what kind of information is stored in this record i integer dp double precision cmp complex nrec tells how many records of this description are found here lrec tells how long the records are how many items are stored recid type nrec lrec contents mE E 1 100 standard ANSYS file header see binhed for details of header contents c i 1 40 RFRO FILE HEADER fun10 nmrow nmatrx nmode numdof maxn wfmax lenbac 0 ncumit kan 0 nmUsed nvect DSPfmt minmod 0 modlstp 0 0 ptrDOF ptrDNC ptrSTF ptrMAS ptrDMP ptrFRQ ptrDSP ptrSTFh ptrMASh ptrDMPh ptrFROh ptrDSPh 0 0 0 0 0 0 0 0 each item in header is described below funlO unit number rfrq file is 10 nmrow number of rows columns in matrices nmatrx number of reduced matrices on file nmode number of modes extracted during modal analysis or nmrow if reduced method numdof number of dofs per node maxn maximum node number wfmax maximum wavefront lenbac number of nodes ncumit
375. modal Cc ldstep load step number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 31 Chapter 1 Format of Binary Data Files CQ QE a Qa xx xoa Qe oa Qc oa QE X Qc Qa 0 42 7 293 2492 Q Qa Qa x oa Qc cz Qc oa Qs A numitr expbeg expend nspect nSPdat ptrRDF ptrFRO ptrSHP ptrLOD ptrSTF ptrMAS ptrDMP ptrLPM ptrsPl ptrIRHSl h PowerDyn ptrRES ptrRESh modlstp nresi KeyStress ptrELD ptrELDh 0 total number of cumulative iterations done during analysis Does not apply if extopt 3 or 4 beginning of the frequency range of interest end of the frequency range of interest number of spectra if 6 the 6 default unit spectra number of data items per spectrum pointer to reduced degree of freedom set used in model pointer to the frequencies pointer to the mode shapes eigenvectors pointer to the pointer to the matrix pointer to the pointer to the matrix if extopt 7 pointer to the modal damping matrix pointer to the diagonal mass vector pointer to the the spectrum data pointer to imaginary part of RHS vector PowerDynamics key 0 non PowerDynamics method 1 PowerDynamics method pointer to residual vectors multiple load step key number of residual vectors in file key set if mode stresses on file pointer to element records position not u
376. mple of user hyperelastic routine This example uses Arruda hyperelasticity model which is the same ANSYS TB BOYCE input arguments prophy dp ar i material property array nprophy int so i of material constants invar dp ar 3 invariants output arguments Q Q iQ Q9 Q9 cQ cQ cQ QA OQQA QTO uq uq qoe cqQcuo incomp log sc i fully incompressible or compressible potential dp sc value of potential pinvDer dp ar 10 der of potential wrt il i2 j 1 der of potential wrt il 2 der of potential wrt i2 3 der of potential wrt ilil 4 der of potential wrt ili2 5 der of potential wrt i2i2 6 der of potential wrt i1j 7 der of potential wrt i2j 8 der of potential wrt j 9 der of potential wrt jj ck ck ck ck ck ck ck ck ck ck ck ck kk ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck KKK ck ck ck ck ck ck ck KKK KEKE KEKE KEK KKK KKK KEKE KEK KKK KKK ck ck ko ko ko ko ko parameters 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 64 of ANSYS Inc and its subsidiaries and affiliates 6 4 3 Subroutines UserCreep and UserCr Defining Viscoplastic Creep Material Behavior 6 4 3 Subroutines UserCreep and UserCr Defining Viscoplastic Creep Mater ial Behavior ANSYS provides two subroutines to allow you to specify your own creep equations to define the time de pendent viscoplastic creep behavior of materials UserCreep and UserCr Use the subroutine
377. mum x e 8 2 8 tranx3 Subroutine Processing Geometry for 3 D Line Elements deck tranx3 subroutine tranx3 nnod xyz nx tr C primary function geometric processor for 3 d line elements output arguments tr dp ar 3 3 in transformation matrix c with or without a 3rd node e c Notice This file contains ANSYS Confidential information a c input arguments e nnod int sc in number of nodes 2 or 3 c XYZ dp ar nx in coordinates x y z down c nx int sc in row dimension of xyz array a e a a 8 2 9 systop Subroutine Stopping an ANSYS Program Run deck systop subroutine systop icode C primary function Stop an ansys run C secondary functions pass an error code to the system c c Notice This file contains ANSYS Confidential information c c input arguments c icode int sc in stop error code 0 lt icode lt 127 c 0 normal exit c 1 stack overflow error e 2 stack level overflow c 3 stack pop below zero e 4 names do not match in stkpxp e 5 command line argument error e 6 unused was accounting file error c 7 licensing failure 8 indicated error or end of run e 1 error in user routine c 2 macro stop command re 3 job already running 4 untrapped xox error e 5 anserr fatal error e 6 possible full disk c 7 possible corrupted or missing file c 8 Error in VM routines corrupt db amp 21 unauthorized
378. n nonlinear element variables npsvr int sc in number of plasticity element variables psvr dp ar npsvr in plasticity element variables ncsvr int sc in number of creep element variables CSVI dp ar ncsvr in creep element variables nusvr int sc in number of user supplied element variables nstv on the nsvr command usvr dp ar nusvr in user supplied element variables nnode int sc in number of nodes nodes int ar nnode in node numbers XYZ dp ar 6 nnode in nodal coordinates and rotations virgin vol dp sc in element volume or area if 2 d leng dp sc in element length beams spars etc time dp sc in current time timinc dp sc in current sub step time increment nutot int sc in length of dof solution vector utot utot dp ar nutot in solution vector 150 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates qgqaqgqaQqQqaqaqaqaqaaqaaa 6 3 3 Subroutine userrc Performing User Operations on COMBIN7 and COMBIN37 Parameters maxdat int sc in size of user output array 3 x nnode output arguments variable typ siz intent description numdat int sc out number of user output items in array udbdat maximum size of numdat is ielc NMNMUP which is usually three times the number of nodes udbdat dp ar maxdat out user output items to be placed at the end of the nmisc reco
379. n to evaluate one material property if multiple material properties are to be evaluated use propev secondary functions to ensure that certain required props are present qgqaaqa Notice This file contains ANSYS Confidential information Q input arguments iel int sc in element number mtr int sc in material number icon int sc in key for which specific value is requested negative if property is required MP command labels EX 1 EY 2 EZ 3 NUXY 4 NUYZ 5 NUXZ 6 GXY 7 GYZ 8 GXZ 9 ALPX 10 ALPY 11 ALPZ 12 DENS 13 MU 14 DAMP 15 KXX 16 KYY 17 KZZ 18 RSVX 19 RSVY 20 RSVZ 21 C 22 HF 23 VISC 24 EMIS 25 ENTH 26 LSST 27 PRXY 28 PRYZ 29 PRXZ 30 MURX 31 MURY 32 MURZ 33 PERX 34 PERY 35 PERZ 36 MGXX 37 MGYY 38 MGZZ 39 EGXX 40 EGYY 41 EGZZ 42 SBKX 43 SBKY 44 SBKZ 45 SONC 46 SLIM 47 ELIM 48 USR1 49 USR2 50 USR3 51 USR4 51 FLUI 53 ORTH 54 CABL 55 RIGI 56 HGLS 57 BM 4 58 QRAT 59 REFT 60 CTEX 61 CTEY 62 CTEZ 63 THSX 64 THSY 65 THSZ 66 DMPR 67 LSSM 68 69 79 ze 72 73 74 75 76 77 78 79 80 see mpinit for uncommented code Q0Q0n00000n0n0n0n0noQonononnon c tem dp sc in temperature at which to evaluate material C output arguments c propl dp sc out value of material property 6 2 12 Subroutine pstev1 Evaluating Material Properties for 1 D Elements deck pstevl subroutine pstevl elem matin te
380. n the number of element misc non summed e data items defined in model c output arguments e emniqr int func out the returned value of emnigr is based on Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 278 of ANSYS Inc and its subsidiaries and affiliates 7 7 56 emndel Subroutine Deleting an Element s Miscellaneous Non summable Data s setting of key 7 7 54 emnget Function Getting an Element s Miscellaneous Non summable Data deck emnget function emnget ielem value C primary function get misc non summable data c Notice This file contains ANSYS Confidential information g input arguments a ielem int sc in element number c output arguments ie emnget int func out status of element G 0 no non summed misc data at this ei element G gt 0 number of data items returned ic value dp ar out element misc non summed data NOTE the contents of this record is element e dependent See NMISC on ETABLE command a 7 7 55 emnput Subroutine Storing an Element s Miscellaneous Non summable Data deck emnput subroutine emnput ielem nval value C primary function store misc non summable data for an element c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c nval int sc in the total number of values c value dp ar nval in
381. n to invoke this function char cmdsend COM COMMAND SENT FROM EXTERNAL COMMAND char querystr NODE NUM MAX char strrtn 32 int i itype double dblrtn Send a simple command to be executed i cAnsSendCommand cmdsend Perform a simple query i cAnsGetValue querystr amp dblrtn strrtn amp itype Display the value retrieved cAns printf Max Node Number g n dblrtn return i A 1 2 Creating a Shared Library Once you have written the source code for your functions you can create a Makefile using the gen_share utility to build a shared library The utility creates the Makefile in the current directory The Makefile incor porates all the interdependencies of the C source files it encounters in that current directory The gen_share utility is meant to setup the basic build The user may need to make modifications to the Makefile depending on the situation The gen_share utility has the following syntax gen share h 64 shared object name where h Produces command help 64 Configures the Makefile to use the mips4 option for IRIX64 shared object name Is the name that will be given to the shared library As gen share is executing you may see one or more No match messages This is normal The script is searching for c and F file types in the current directory and returns this message if it cannot locate any files matching one of those types To create
382. name cdb file contains model data in terms of ANSYS input commands The following topics are discussed 3 1 Using the CDWRITE Command 3 2 Coded Database File Commands 3 1 Using the CDWRITE Command To export a model from the ANSYS program to another application use menu path Main Menu Prepro cessor gt Archive Model Write or the CDWRITE command within the general preprocessor PREP7 This produces a coded database file called Jobname cdb You specify the jobname using Utility Menu File Change Jobname or the FILNAME command If you supply no jobname the ANSYS program uses the default name file The Jobname cdb file contains selected geometry nodes and elements load items and other model data in terms of ANSYS input commands For a complete list of data in the file see the CDWRITE description in the Command Reference You can convert this information to a format compatible with the program into which you are importing it The next few pages describe special considerations and commands you may need to do this conversion Note Files created by the CDWRITE command have the active coordinate system set to Cartesian CSYS 0 ANSYS may create parameters in the CDWRITE file that start with an underscore usually an z Such parameters are for ANSYS internal use and pass information to the ANSYS GUI 3 1 1 Customizing Degree of Freedom Labels the DFLAB Command The ANSYS program uses a set of default labels
383. nary Data Files e TRAN dp nTran 25 Substructure transformation vectors c GEO i 1 40 Geometry data header was 20 in 32 bit vers O maxety maxrl ndnod nelm maxcsy ptrETY ptrREL ptrNOD ptrCSY ptrEID 0 0 0 0 ptrMAS csysiz elmsiz etysiz rlsiz ptrETYL ptrRELL ptrCSYL ptrNODL ptrEIDL ptrMASL 0 0 0 0 0 0 0 0 ooo oo ome each item in header is described below Q 0 position not used maxety the maximum element type reference ber in the model he maximum real constant reference ber in the model he number of defined nodes in the Isi 3 maxrl si 3 ndnod O Q 0 rn he number of defined elements in he model he maximum coordinate system reference number in the model ptrETY pointer to the element type index table ptrREL pointer to the real constant index table ptrNOD pointer to the nodal point locations ptrCSY pointer to the local coordinate system index table ptrEID pointer to the element index nelm Chek cb HO ck Se ck EX ct maxcsy table ptrMAS pointer to the diagonal mass matrix csysiz the number of items describing a local coordinate system usually 24 elmsiz the maximum number of nodes that a defined element may have etysiz the number of items describing an element type IELCSZ from echprm inc rlsiz the maximum number of items defining a real constant 0 if no real constants are defined ptrETYPL 64 bit pointer t
384. nc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 165 Chapter 6 UPF Subroutines and Functions gal 10 01 1998 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKK KKK KKKK KKK KKK KKK kk Sk kk Sk Sk Sk Sk kk ko ko ko ko ko ko ko ko kc k ok input arguments impflg anm sc pE Explicit implicit integration flag currently not used ldstep in ysG ri Current load step isubst LH SC ri Current sub step matId in sc ri number of material index elemId in sc 75 Element number kDInPt in 86 ri Material integration point kLayer in sc 75 Layer number kSecPt in ysG ri Section point nstatv LH ri Number of state variables nprop in sc ri size of mat properties array prop dp ar i mat properties array This array is passed all the creep constants defined by command TBDATA associated with TB CREEP do not use prop 13 as it is used elsewhere at temperature temp time Current time dt ime Current time increment temp Current temperature dtemp Current temperature increment toffst dp sc i temperature offset from absolute zero seqv dp sc i equivalent effective stress creqv dp gs 4 X equivalent effective creep strain pres dp 59 4X hydrostatic pressure stress Sxx SyyctSzz 3 input output arguments input desc output desc Ustatev dp ar i o user defined iinternal state variables at time t t dt This array will be passed in contain
385. nc and its subsidiaries and affiliates 0 Chapter 5 Using User Programmable Features UPFs Enter the full pathname to the custom executable in the ANSYS Custom Exe field Do not include the custom argument When run from the command prompt if no path is specified after the custom argument the ansys120 script searches the current working directory for the custom ANSYS executable ansyscust e120 by default on UNIX or ansys exe on Windows If the custom ANSYS executable resides in a separate directory or has a name other than ansyscust e120 on UNIX you can specify a different path and filename after the custom argument Caution If you are running on a Windows system and you create a custom ANSYS executable the executable must be named ansys exe This requirement is due to shared library usage On UNIX you can also run your custom executable via command line ansys120 custom pathname ansyscust e120 5 13 Verifying Your Routines After compiling and linking your new user routine test and verify it using whatever procedures you think are adequate Remember verifying that your customized version of the ANSYS program works properly is your responsibility Make certain that your custom version of the ANSYS program performs correctly for the combinations of elements analysis types materials boundary conditions and so on that you plan to use Confirm that the logic you introduced is correct and does not produce any
386. nc tem dtem toffst fluen dfluen epel epcrp x statev usvr delcr amp C primary function allow users to write their own creep laws e this logic is accessed with c6 100 C secondary function demonstrate the use of user written creep laws e c Notice This file contains ANSYS Confidential information e e ic copyright c 2006 SAS IP Inc All rights reserved c ansys inc e c input arguments G variable type sze intent description e ic elem int sc in element number label c intpt int sc in element integration point number e mat int sc in material reference number el ncomp int sc in no of stress strain components 1 4 or 6 c l 3X e 4 x y Z Xy c 6 x y Z Xy YZ XZ rel kfirst int sc in 1 if first time through 0 otherwise e useful for initializing state variables c to a non zero value o kfsteq int sc in 1 if first equilibrium iteration of a G substep 0 otherwise e e c e dp sc in elastic young S MODULUS c posn dp sc in poisson S RATIO c d dp ar ncomp ncomp in elastic stress strain matrix el proptb dp ar 72 in material properties input on tb commands Ge do not use proptb 13 as it is used elsewhere el timval dp sc in current time value c timinc dp sc in time increment over this substep G tem dp sc in temperature at the end of this substep rel dtem dp sc in temperature increment over this substep G toffs
387. nd linking a custom version of ANSYS the preferred method is to design and program your custom routine in Fortran Although you can use languages other than Fortran in each case Fortran must provide the interface to the rest of the ANSYS program If you do use a language other than Fortran such as the C programming language your code may require a Fortran shell Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 101 Chapter 5 Using User Programmable Features UPFs You need to take care when calling Fortran subroutines from C subroutines You must use the symbol asso ciated with the Fortran subroutine when invoking the subroutine from a C function This symbol typically differs slightly from the Fortran subroutine name and is extremely system dependent On many UNIX systems you build this symbol name by taking the Fortran subroutine name converting it to lower case and appending an underscore For example the symbol name for the Fortran subroutine HeapInquire would be heapinquire_ You would have to use the symbol heapinquire in the invoking C function to avoid an unsatisfied external reference when the program is linked Keep in mind that the instance described above is just an example Compilers from different vendors may construct the symbols differently Please consult the manuals for your specific compiler for information on
388. ndows systems in Compiling and Linking UPFs on Windows Systems p 105 You may need superuser or root privileges to run the procedure that does the linking Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 103 Chapter 5 Using User Programmable Features UPFs 5 9 Compiling and Linking UPFs on UNIX Linux Systems As mentioned previously the source files for the user routines reside in subdirectory ansys_inc v120 an sys customize user lf you modify any of these subroutines select the Relink ANSYS option from ANS ADMINT120 utility to link these changes When you run a user linked version of the ANSYS program the ANSYS output will include the following NOTE This ANSYS version was linked by Licensee The Relink ANSYS option compiles all Fortran files files ending with F and all C files files ending with c in the current working directory The procedure then loads all object files files ending with o along with the default ANSYS objects and libraries in ansys inc vi120 ansys customize user plat form For Distributed ANSYS the location is ansys inc v120 ansys customize user plat form dis native where platform is replaced by the folder representative of your operating system The new executable file created will be named ansyscust e120 and will reside in the working directory Fortran files ar
389. ned state variables 6 2 19 Subroutine swell3 Updating an Element s Swelling History 3 D Ele ments deck swell3 subroutine swell3 option elem intpt mat kstartL ncomp epswel x epel e nuxy fluen dfluen tem dtem usvr C primary function to update the swelling history for 3 d elements c used by PLANEO2 PLANE13 PIPE20 PLANE42 SHELL43 SOLID45 c SHELL51 PIPE60 SOLID62 PLANE82 SHELL91 SOLID92 c SHELL93 SOLID95 SHELL143 SOLID191 c Notice This file contains ANSYS Confidential information c input arguments ie option int sopin swelling option a elem int sc in element number label e intpt int sc in element integration point number e mat int sc in material reference number e kstartL intL sc in virtual starting address of the data table e ncomp int sc in number of stress strain components 4 or 6 os epswel dp sc inout swell strain at previous substep o epel dp ar ncomp inout elastic strain c e dp sc in elastic young S MODULUS o nuxy dp sc in poisson S RATIO Ge fluen dp sc in fluence at the end of this substep G dfluen dp sc in fluence increment over this substep o tem dp sc in temperature at the end of this substep G dtem dp sc in temperature increment over this substep o usvr dp ar inout user defined state variables for usersw C output arguments G epel dp ar ncomp inout elastic strain adjusted for swelling inc epswel dp
390. nes kcomp strain components ep per deck egen function egen kcomp ep posn c primary function combines strain components to give an overall strain c used in creep and plasticity calculations c secondary functions none ie formulation of overall value is by e e 1 2 2 2 1 2 2 2 c ep ep ep ep ep ep ep ep ep e yA 2 1 2 2 3 3 1 2 4 5 6 ae a a Ea a Fa I I POO PN PE OR a c 1 posn c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n intent in out inout c input arguments c variable typ siz intent description c kcomp int sc in number of components of strain e ep dp ar 6 in the strain components c posn dp sc in poisson s ratio a output arguments c egen dp func out the combined strain value 6 5 Subroutines for Customizing Loads This section describes user subroutines that you can use to modify or monitor existing ANSYS element loading Activate these subroutines by issuing the USRCAL command or by selecting an equivalent menu path 6 5 1 Subroutine usrefl Changing Scalar Fields to User Defined Values 6 5 2 Subroutine userpr Changing Element Pressure Information 6 5 3 Subroutine usercv Changing Element Face Convection Surface Information 6 5 4 Subroutine userfx Changing Element Face Heat Flux Surface Information 6 5 5 Subroutine userch Changing Element Face Charge Density Surface In
391. ng 260 getting 259 getting information about 259 storing 259 Element nodal creep strain deleting 272 getting 270 getting information about 270 storing 271 Element nodal elastic strain deleting 268 getting 266 getting information about 266 storing 267 Element nodal force getting 260 getting information about 260 storing 261 Element nodal forces deleting 261 Element nodal gradients deleting 266 getting 265 getting information about 265 storing 265 Element nodal plastic strain deleting 270 getting 268 getting information about 268 storing 269 Element nodal stress deleting 263 getting 262 getting information about 261 storing 262 Element nodal thermal strain getting information about 272 Element nodal thermal stress getting 272 storing 273 Element nonlinear tables deleting 282 getting 281 getting information about 281 storing 282 Element pressure convection deleting 244 getting informatin about 243 Element surface stress data deleting 256 getting 255 getting information about 255 storing 255 Element temperature deleting 247 getting 247 getting information about 246 storing 247 Element thermal initial and swelling strain deleting 274 Element virtual displacement getting 252 getting information about 252 storing 253 Elements defining 81 example of element attribute routines 230 getting information about an element 221 getting information about an e
392. noaonoaonoanoaooaonoaoanoaononoonononn Q qaaqaqaagagqaagqaana ENG dp ncomp 11 for ENS record 7 for EEL record 7 for EPL record 7 for ECR record 8 for ETH record 10 for ENL record NL number of layers in layered elements For solid elements or layered solid elements with KEYOPT 8 0 the record contains Stresses at each corner node and the number of items in this record is nodstr ncomp For shell elements or layered shell elements with KEYOPT 8 0 the record contains Stresses at each corner node first at the bottom shell surface then the top surface and the number of items in this record is 2 nodstr ncomp For layered elements SHELL91 SHELL99 SOLID46 and SOLID191 with KEYOPT 8 0 if failure criteria were used the record contains additional stresses at each corner nodes first the bottom surface then the top surface of the layer with the largest failure criteria Therefore the total number of items is 4 nodstr ncomp for SHELL91 and SHELL99 and 2 nodstr ncomp for SOLID46 and SOLID191 For layered elements with KEYOPT 8 stresses for each layer are at each 1 corner node first at the bottom surface then at the top surface and the number of items in this record is NL 2 nodstr ncomp for layered shells and NL nodstr ncomp for layered solid elements For layered shell elements with KEYOPT 8 2 the record contains stresses for each layer at each corner node first at
393. noaoooaooaoaoaonoaooaoaonoaoanoaonoaonoaoaoaoaoanoaoanoaonoanooaoanonoaoanoaonoanonoaoaonoaoanoanonoaononoonoqaononononononnon copyright c 2008 SAS IP Inc All rights reserved Ex anmsys Gmo Notice This file contains ANSYS Confidential information input arguments variable typ siz intent description elem int sc in element number for operation ielc int ar IELCSZ in array of element type characteristics center dp ar 3 in coordinates of center of surface element jdim int sc in dimensionality key 1 2d 2 axisymmetric 3 3d kaxis int sc in axis of rotation keyopt 3 for e1152 see getvl116 for definition time dp sc in time of current substep nr int sc in number of nodal temperatures of the element u dp ar nr in vector of most recent values of the temperatures omeg dp sc in spin real constant may be from table ndat int se in number of data points per element he dp ar ndat inout film coefficients has input values for each corner of element tb dp ar ndat inout bulk temperature has input values for each corner of element output arguments variable typ siz intent description temvel dp sc out user defined bulk temperature in excess of fluid node temperature hc dp ar ndat inout film coefficients defines input values for each corner of element tb dp ar ndat inout bulk temperature includes any modification defines input valu
394. nodfor is the number of nodes per element having nodal forces defined in element type description record and M may be 1 2 or 3 For a static analysis M 1 only For a transient analysis M can be 1 2 or 3 Element nodal component stresses This record contains the stresses at each corner node in the order SX SY SZ SXY SYZ SXZ S1 S2 S3 SI SIGE Nodal order corresponds to the connectivity defined in the element description Stresses can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes If an element is nonlinear integration point values always will be written See item rxtrap in the solution header for the setting An element is considered nonlinear when either plastic creep or swelling strains are present Definition of common terms referred here and in subsequent EEL EPL ECR ETH ENL EUL and EPT sections nodstr number of nodes per element having stresses strains etc For higher order elements nodstr equals to the number of corner nodes e g for 20 noded SOLID186 nodstr 8 nodfor number of nodes per element having nodal forces etc ncomp number of solution items per node Oo Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format Q0Q00n00000nn0nnnoaooaooaoaoaonoaooaoaooaoaoaonoaoooaooaoa
395. nother external command A 1 6 Checking External Command Status You can check what shared libraries are currently accessible by entering the DEBUG command in the command input window The following figure shows an example of DEBUG command output External Command Mappings Command Library Function Accessed ee Ee ee kaotata X o ocwo o o o o wWwo oc oWo o excmd home mydir mycode mycommand so excmd YES In this example the output lists the command the related shared library the function and if the command has been accessed A 1 7 Resetting External Commands You can Close all shared libraries Free memory associated with external commands by issuing the RESET command The command issues the following message to confirm that the reset operation was complete RESET was processed The external command buffers have been cleared Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 306 of ANSYS Inc and its subsidiaries and affiliates A 1 7 Resetting External Commands Note The CLEAR command also closes resets all external command shared libraries Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 307 of ANSYS Inc and its subsidiaries and affiliates Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 308 of ANSYS
396. nqgr O characters max 50 E return whether file exists Sysigr 1 file exists 0 file does not exist lt 0 error occured O return whether file is open Sysigr 1 file is open 0 file is closed lt 0 error occured N return unit number of file sysigr gt 0 unit number for file 0 file not assigned to a unit lt 0 error occured the returned value of sysiqr is based on setting of ingr 2 1 7 Function biniqr8 Retrieving System Dependent Parameters deck biniqr8 function binigqr8 nblk key C primary function Brem Br cue c Notice This file contains ANSYS Confidential get data about a block i o buffer This routine is intended to be used in standalone programs This routine should not be linked into the ANSYS program information c input arguments e nblk int sc in the block number for the inquiry e or zero see below c key int sc in key for information requested a nblk 0 return information about system file c key 1 return system block size c 2 return number of integers per dp a 3 return filename length G 5 return integers per LONG c nblk 0 return information about this block e key 1 return fortran unit number a 2 return number of blocks in file c 3 return length of page 32 bit words c 4 return open status e 0 file close le 1 file open e 5 return file format a 0 internal format c 1 e
397. ns c NOTE If a value is not defined it will c be a very small number 2 100 7 6 15 ehgput Subroutine Storing an Element Heat Generation deck ehgput subroutine ehgput ielem n qgen c primary function store element heat generations c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number o n int sc in number of element heat generation values Ge qgen dp ar n in element heat generations c output arguments none e NOTE If a value is not defined a very c small number should be used 2 100 7 6 16 ehgdel Subroutine Deleting an Element Heat Generation deck ehgdel subroutine ehgdel ielem C primary function delete element heat generations c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout e input arguments c variable typ siz intent description ielem int sc in element number c output arguments c none 7 6 17 efuiqr Function Getting Information About Element Fluences deck efuiqr function efuigr ielem key C primary function get information about element fluences c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed Release 12 0 2009 SAS IP Inc All right
398. ns index table This record contains pointers to each element solution The order of the elements is the same as the order in the element equivalence table bit 12 PDBE in mask dp 1 6 numRotCmp Angular velocities 3 and angular accelerations 3 of components dp 1 3 nContours Crack ID Contour ID TipNode J Integral values The solution information for each individual element is stored starting at this point in the file The next 23 records on the file are repeated as a group nelm times once for each element Item nelm is defined in the file header i 1 25 Individual element index table ptrEMS ptrENF ptrENS ptrENG ptrEGR ptrEEL ptrEPL ptrECR ptrETH ptrEUL ptrEFX ptrELF ptrEMN ptrECD ptrENL ptrEHC ptrEPT ptrESF O ptrETB ptrECT ptrEXY ptrEBA ptrESV ptrMNL Relative to ptrESL for 64 bit version each item is described below ptrEMS pointer to misc data ptrENF pointer to nodal forces ptrENS pointer to nodal stresses ptrENG pointer to volume and energies ptrEGR pointer to nodal gradients ptrEEL pointer to elastic strains ptrEPL pointer to plastic strains ptrECR pointer to creep strains ptrETH pointer to thermal strains ptrEUL pointer to euler angles ptrEFX pointer to nodal fluxes ptrELF pointer to local forces Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 15 Chapter 1 Format o
399. nstitutive integration is necessary for the various stress states such as general 3 D plane stress and beam with or without shear stress components To ensure overall numerical stability verify that the integration scheme implemented in the subroutine is stable ANSYS always uses the full Newton Raphson scheme for the global solution to achieve a better convergence rate The material Jacobian matrix dsdePI i j must be consistent with the material constitutive integration scheme for a better convergence rate of the overall Newton Raphson scheme 6 4 1 7 UserMat Restrictions The following restrictions apply to the UserMat subroutine The subroutine supports current technology elements only and is not applicable to legacy elements For more information see Legacy vs Current Element Technologies in the Element Reference Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 162 of ANSYS Inc and its subsidiaries and affiliates 6 4 1 Subroutine UserMat Creating Your Own Material Model The state variables defined via the TB STATE command are supported only by full graphics in the POST postprocessor Because POST1 does not switch to full graphics automatically you must issue a GRA FULL command to do so The subroutine is not intended for modeling incompressible elastic materials such as hyperelastic ma terials A special treatment such as a penalty approac
400. nt VC The coefficient of viscous friction VDC The viscous damping coefficient in percent of critical damping V1 V2 V3 V4 Additional input for some contact types See EDCGEN in the Command Reference for more information BTIME The birth time for which conatct definition will become active DTIME The death time for which conatct definition will become inactive 7 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 6 of ANSYS Inc and its subsidiaries and affiliates 3 2 8 EDDRELAX Command BOXID1 Contact volume as defined using EDBOX BOXID2 Target volume as defined using EDBOX NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3 2 7 EDCURVE Command The EDCURVE command is used to define a curve for an explicit dynamics analysis The command format in Jobname CDB is EDCURVE R5 3 0ption LCID Length 0 0 Parl Par2 Option The EDCURVE command option The only valid option is ADD LCID The curve ID Length The number of data values for the abcissa array Pari and the ordinate array Par2 Parl The abcissa values repeat Length number of times Par2 The ordinate values repeat Length number of times NOTE This command is also listed in the Command Reference The format listed here contians information specific to the CDREAD CDWRITE file 3
401. ntage of UPFs if you are licensed for any of the following products e ANSYS Multiphysics ANSYS Mechanical ANSYS Structural ANSYS Emag Low Frequency ANSYS Emag High Frequency e ANSYS PrepPost Other versions of the ANSYS program do not support UPFs For more information about C and Fortran compilers see the ANSYS Inc installation guide specific to your operating system ANSYS Inc UNIX Linux Installation Guide ANSYS Inc Windows Installation Guide 5 1 What Are UPFs User programmable features are ANSYS capabilities you can use to write your own routines Using UPFs you can tailor the ANSYS program to your organization s needs For instance you may need to define a new material behavior a special element or a modified failure criterion for composites You can even write your own design optimization algorithm that calls the entire ANSYS program as a subroutine UPFs provide the following capabilities To read information into or fetch information from the ANSYS database you can create subroutines and either link them into the ANSYS program or use them in the external command feature see Ap pendix A p 303 for more information about external commands If you link these subroutines into ANSYS you are limited to 10 database access commands Such commands created through either method operate at all levels of ANSYS operation including the begin preprocessor general postpro cessor time history postprocesso
402. ntain element solution data qgqaqaqaa Q user programmable functions may not be used in parallel processing c Notice This file contains ANSYS Confidential information c copyright c 2008 SAS IP Inc All rights reserved c ansys inc input arguments elem int sc in element label number ielc int ar IELCSZ in array of element type characteristics IELCSZ array size defined in echprm elmdat int ar EL DIM in array of element data eomask int sc in bit pattern for element output Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 130 of ANSYS Inc and its subsidiaries and affiliates 6 1 3 Creating a New Element by Directly Accessing the ANSYS Database c see outpom G nodes int ar nnod in array of element node numbers c nnod number of nodes 1 in this case c locsvrL int sc in location of the saved variables c on file esav for this element g kelreq int ar 10 in matrix and load vector form requests e indices for kelreq are given with output c arguments below o kelfil int ar 10 in keys indicating incoming matrices and e load vectors indices for kelfil are the e same as given for kelreq with output c arguments below o nr int sc in matrix and load vector size o XYZ dp ar 6 nnod in nodal coordinates orig and rotation angle a u dp ar nr 5 in element nodal solu
403. ntains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 159 Chapter 6 UPF Subroutines and Functions Thermal strains defined via MP ALPHA and temperature load if any are subtracted from the total strains therefore the strains passed to UserMat are the mechanical strains only For large deformation problems NLGEOM ON the strain components are updated to account for rigid body rotation before they are passed to UserMat and are approximately the logarithmic strains Double precision array contains current strain increments Array size is ncomp As with the Strain array this value contains the mechanical strain increments only Thermal strain incre ments if any are subtracted from the total strains increments Double precision array contains the material constants defined via TB USER and TBDATA commands Array size is nProp Array prop contains the material constants at current tem perature point coords Double precision array contains the current coordinates of the material integration points Array size is 3 defGrad_t Double precision matrix contains deformation gradient at the beginning of the time incre ment The matrix size is 3 x 3 The matrix components DefGrad t j are equivalent to deform ation gradient F at the beginning of the time increment Double precision matrix contains current deformation gradient The matrix size is 3 x 3 The matrix
404. ntermDl h number of terms in Damping matrix ptrDOFl h pointer to DOF info ptrRHSl h pointer to RHS F ngMaxNZ maximum number of nodes per nodal block in nodal graph structure C5 Qr 2E CY Q0 E E Q2 TE LOQUO QE IQ HOD Q9 Q9 25 25 c Q0 2270 02 0X 27 0 QZ QE 2X 1 9 0 492 205 25 c Qo 0 QE o2 QE ox ll Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates A Co 1 9 2 FULL File Format Qo0Q0n0nQnQ0nQonQonQoaonQoaooaoaooaoaoaoaoaonoaooaoaooanonoaonoaooanoaonoaonoononn qgqaaqaaqaa qa Q qaaaa Q QonQn ptrNGPHl h pointer to vectors needed for nodal graph structure minKdiag minimum absolute stiffness matrix diagonal term maxKdiag maximum absolute stiffness matrix diagonal term minMdiag minimum absolute mass matrix diagonal term maxMdiag maximum absolute mass matrix diagonal term minDdiag minimum absolute damping matrix diagonal term maxDdiag maximum absolute damping matrix diagonal term ngTerml h total number of nonzeroes in nodal graph expanded graph based value no BC applied ngTermCl h total num ber of nonzeroes in nodal graph ptrDiagKl h ptrDiagMl h compressed graph based value pointer to stiffness matrix DIAGONAL vector NOTE this is a copy of the diagonal values stored in the full matrix pointer to mass matrix DIAGONAL
405. nts nShear int sc in of shear components ncomp int sc in nDirect nShear nstatev int sc 1 Number of state variables nProp int sc 1 Number of material ocnstants Temp dp sc in temperature at beginning of Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 315 Appendix C User Material UserMat Subroutine Example dTemp dp sc in Time dp sc in dTime dp sc in Strain dp ar ncomp i dStrain dp ar ncomp i prop dp ar nprop i coords dp ar 3 1i defGrad_t dp ar 3 3 i defGrad dp ar 3 3 1i input output arguments stress dp ar nTesn io statev dp ar nstatev io sedEl dp sc io sedPl dp sc io epseq dp sc io var dp sc io output arguments dsdePl dp ar ncomp ncomp KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK C Qa QE Q3 Qc KOS 0 42 0 Q2 05 2492 Qr Oe Qe QR Cx Oe QE Qa Qc Oe QE QR Qh 0 795 9s 0 009 Q Ux Oe 0 QR IO Os OL Q2 2 Qr 2 Q3 0 OR 4G UO Q9 ose Ok TA c CRE KKK KKK KK KK KKK KK KKK KKK KK KK KK KK KK KK rio time increment temperature increment current time current time increment Strain at beginning of time increment Strain increment Material constants defined by TB USER current coordinates Deformation gradient at time t Deformation gradient at time t dt stress statev elastic work plastic work
406. nts ecran ret e Yan RE XY de ei XR S bia Ek AVES HR ER Dr eu XE n aqaa xa 55 ZA AC AbbreviatlOhs eres heise rore aere ro ees hee eg erae eere eee a 9o ORE EE yoke pee nh eaae a gode ge 55 2 1 5 binini Initializing Buffered Binary I O Systems eese eene eene 55 2 1 6 Function sysiqr Retrieving the Status Of a File ceescccccccceeessessnnececceceeseeeesneeeeeeeeeeeees 55 2 1 7 Function biniqr8 Retrieving System Dependent Parameters sese 56 2 1 8 Function binset Opening a Blocked Binary File or Initializing Paging Space 57 2 1 9 Subroutine bintfo Defining Data for a Standard ANSYS File Header 57 2 1 10 Subroutine binhed Writing the Standard ANSYS File Header ssesssssese 58 2 1 11 Subroutine binrd8 Reading Data from a Buffered File ccssessecccccesseessnteeeeeeeeeeeees 59 2 1 12 Subroutine binwrt8 Writing Data to a Buffered File sessseeeseeeeeene 59 2 1 13 Subroutine exinc4 Decoding an Integer String into a Character String 60 2 1 14 Subroutine inexc4 Coding a Character String into an Integer String 60 2 1 15 Subroutine binclo Closing or Deleting a Blocked Binary File esse 61 2 1 16 Subroutine largelntGet Converting Two Integers into a Pointer
407. nts of this record is element o dependent See SMISC on ETABLE command 7 7 7 emsput Subroutine Storing an Element s Miscellaneous Summable Data deck emsput subroutine emsput ielem nval value C primary function store misc summable data for an element c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 2 of ANSYS Inc and its subsidiaries and affiliates 59 Chapter 7 Accessing the ANSYS Database c nval int sc in number of values to be stored c value dp ar nval in the misc summed data values c output arguements none e NOTE the contents of this record is element e dependent See SMISC on ETABLE command 7 7 8 emsdel Subroutine Deleting an Element s Miscellaneous Summable Data deck emsdel subroutine emsdel ielem C primary function delete element misc summable data c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number e 0 delete data for all defined elements c output arguments none 7 7 9 enfiqr Function Getting Information About Element Nodal Forces deck enfiqr function enfigqr ielem key c primary function get information about element nodal forces c Notice This file contains ANSYS Confidential information
408. number of residual vectors used c modlstp multiple load step key ndva length of DVA Cc naload number of available load vectors Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 23 Chapter 1 Format of Binary Data Files xo OR OL OR IO Oe OO 1G Os Ge 2 1A iO E e OX lt C Quies fe qa Qu Qe oai C Qa cQ xq os oe Qc Quo suo CY QE IO os Qon Qu Qe oe DOF DSPfmt O physical disps ne 0 modal coords ptrDOF pointer to degree of freedom set ptrDNC pointer to nodal constraints ptrSTF pointer to the reduced stiffness ptrMAS pointer to the reduced mass matrix ptrDMP pointer to the reduced damping matrix or mode shapes ptrFRQ pointer to the frequencies ptrDSP pointer to the calculated displacements ptrSTFh High part of reduced stiffness ptr ptrMASh High part of reduced mass ptr ptrDMPh High part of reduced damping ptr ptrFROh High part of frequency ptr ptrDSPh High part of displacement ptr ptrDVA pointer to modal disp velo and acc ptrDVAh High part of modal disp velo and acc 0 position not used 3 1 numdof Degrees of freedom per node UX 1 UY 2 AZ 9 VX 10 KKKKKKKKKKKKKKKK EMF 25 CURR 26 curdof i i 1 numdof dof reference numbers are UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 VY S11 VA S12 C 13 18 are
409. o TYPE ptrRELL 64 bit pointer to REAL ptrCSYL 64 bit pointer to CSYS ptrNODL 64 bit pointer to NODES ptrEIDL 64 bit pointer to ELEMENTS CY Qa QE X Qo Qa 0 423 7 Q5 0 293 Qr Q8 70 QS HQ Q2 OX Qe Qc Qr QS 6 9 95 Q5 295 9 9 ETY i 1 maxety The element types index table This record contains record pointers for each element type description Relative to ptrETYPL for 64 bit version qaaaa rix i numety etysiz Element type description Each of these records is pointed to by a record pointer given in the record labeled ETY See routines echprm and elccmt for a complete description of the items stored here CQ Qe opio These items are typically stored into the IELC array and are used to determine the element type characteristics at runtime The following items are typically of interest Item 1 element type reference number Item 2 element routine number C 02 OZ ooo Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 8 of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format qQagaaQqaaqaaqagqagagqagagqagaaaaa qaqaaa qaaaqaaaqaaqa qaaqaagaaagqaaagaqaa qaqaaqaaa Q qQaaqagaagagqagagqagaagqaaaa qaaaa aa REL CSY NOD NOD dp dp dp dp numrl numcsy ndnod maxrl varies maxcsy CSySiz 7 ndnod Items 3 14 element type option keys keyopts Item 34 DOF node for
410. o be accumulated onto c only the lower triangular matrix is done e Note this routine is usually followed by matsym e to do the complete matrix e 8 4 7 matba Subroutine Updating Matrix Value via Transposition Multiplic ations and Addition deck matba subroutine matba a b c na nb nc n1 n2 work con c primary function does con at b a and sums the result e c Notice This file contains ANSYS Confidential information c input arguments e a dp ar na in matrix a e b dp ar nb in matrix b must be square e and maximum dimension is 13 13 e o dp ar nc inout matrix c see output e na int sc in number of rows in matrix a e nb int sc in number of rows in matrix b G nc int sc in number of rows in matrix c e nl int sc in number of rows in matrix c to fill s n2 int sc in number of columns in matrix c to fill e con dp sc in multiplier on product added to sum C output arguments e s dp ar nc inout c c con at b a e work dp ar n2 out at b this byproduct is occasionally useful c mpg C C con At BA A na B nb C nc C minor nl n2 e See matbabd for block diagonal e 8 4 8 matsym Subroutine Filling the Upper Triangle from the Lower Triangle deck matsym subroutine matsym a nd n c primary function fill upper triangle from lower triangle c Notice This file contains ANSYS Confidential information c typ int dp log c
411. o userl0 are also available NCKCKCKCKCkCkCkCKCkCkCkCkCkCk kk Ck AA IARI IAA IA IAA k k k k kk ko ek kk input arguments none output arguments user01 int sc out result code should be zero which is ignored for now KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Functions for accessing data on the command line integer function intinfun iField gets an integer from field iField double precision function dpinfun iField gets double precision character 4 ch4infun iField gets upper case 4 characters character 8 ch8infun iField gets mixed case 8 characters character 32 ch32infun iField gets mixed case 32 characters kk ck ke ck KKK KKK KKK KKK KKK KKK KKK KEKE KKK KKK KEKK KKK KKK ck ck ok ck ckock ko ko ko ko ko Sk ko ko ko KK include impcom inc include ansysdef inc external wringr integer wrinqr integer user01 iott iott wringr 2 USER S CODE IS INSERTED HERE write iott 2000 2000 format CALL TO ANSYS INC DUMMY USEROl1 do not return this result code in a real user routine user01 654321 instead return a zero ose user01 0 return end 6 7 2 Function user02 Demonstrates Offsetting Selected Nodes deck user02 user qa function user02 s primary function user routine number 02 This demonstration offsets selected nodes with the command usr2 dx dy dz copyright c 2006 SAS IP Inc All rights reserve
412. oading 1 Has thermal loading cMat O Material Jacobian 1 Forming stiffness Material sub routine MatProp O Material data for elementformu Forming mass matrix Material sub lation Handling transverse routine shear Output Stress O Cauchy stress 1 Forming geometric Material sub stiffness routine Calculating internal forces 126 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API Strain Total strain components 7 Output Material sub routine StressTh StrainTh Total thermal stress compon ents 7 Total thermal strain compon ents 7 Output Calculating thermal loading Output Material sub routine Material sub routine StrainPl Total plastic strain components 7 Output StrainCr Total creep strain components 7 Output StressBk Back stress components 7 Output StrainSw Swelling strain Not yet supported Energy density 1 Elastic energy density 2 Plastic energy density 3 Creep energy density Rotation matrix from global Cartesian to ro tated element coordin ate system Rotation matrix Used only for solid ele ments when nlgeom on 1 All tensor component values in the subroutine are in the global Cartesian coordinate system for
413. oanoaonoanonoaoanonoaoanononoanononoaonoaononoanononononon kupdhis int sc in output arguments variable type sze intent previous equilibrium iteration saved if the nsvr command is used key to indicate if history dependent variables user defined need to be updated after the substep has converged 1 update converged 0 do not update not converged description kstat int sc inout updated contact status slip dp ar ncomp inout updated accumulated slip tau dp ar ncomp inout updated frictional stress dt dp ar 5 5 out material tangent modulus rows and columns of dt matrix are associated to row frictional stress in direction 1 row 2 frictional stress in direction 2 row 3 normal pressure row 4 blank row 5 blank col sliding in direction 1 col 2 sliding in direction 2 col 3 normal gap col 4 blank col 5 blank relevant components to be filled in are dt 1 1 d taul d slip1 dt 1 2 d taul d slip2 dt 1 3 d taul d normal gap dt 2 1 d tau2 d slip1 dt 2 2 d tau2 d slip2 dt 2 3 d tau2 d normal gap dt 3 3 d pres d normal gap dt 3 3 set to kn internally usvr dp ar nuval nintp inout updated additional state variables For example mu value and absolute accumated slip could be output as follows usvr l intpt mu usvr 2 intpt abs acc slip in dirl usvr 3 intpt abs acc slip in dirz Use NSVR command to size usvr array and set nuval to same value as n
414. ocity gradient component velocity component velocity component velocity component position component position component position component analysis type old viscosity absolute temperature reference temperature Absolute also pressure reference pressure input coefficients Species mass fractions defined number of species time Temperature offset for absolute scale description new viscosity 6 4 9 Subroutine userfric Writing Your Own Friction Laws This subroutine is applicable to the following contact elements CONTA171 CONTA172 CONTA173 CONTA174 CONTA175 CONTA176 CONTA177 and CONTA178 deck userfric subroutine userfric USERSDISTRIB elem mat intpt nkeyopt keyopt nrl rlconst x ncomp npropu uprop kfirst kfsteg kn kt elen kstat timval x timinc tcont ttarg toffst dslip slip pres tau dt usvr x fdiss elener kupdhis c c primary function c Allow users to write their own friction laws This logic is accessed with tb fric with tbopt user Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 175 Chapter 6 UPF Subroutines and Functions a The below demonstration logic is the same as using e tb fric for isotropic Coulomb friction G Other friction laws may require more general e definition of friction forces C secondary function demonstrate the use of user
415. od or Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 29 Chapter 1 Format of Binary Data Files c 5 numdeflvs zero c cvs i i 1 nmrow freq delf c itime itter ncumit 0 0 0 0 0 0 c fscale 0 0 e Note If upon reading of this record there el is less than nmrow 5 items in the record e then only a selected set of nodes were output Another record follows integer less c than lenbac long which contains the list of c nodes for which DOF solutions are available Cc i 1 numdeflvs lvscal table scale factor IDs e ilvscID i i 1 numdeflvs i 1 numdeflvs lvscal table scale factor values c divscVal i i 1 numdeflvs e 1 5 Description of the Modal Results File This section explains the content of the modal results file jobname mode 1 5 1 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 9 1 5 2 MODE File Format comdeck fdmode copyright c 2008 SAS IP Inc All rights reserved C ansys inc a c ARAARAALAS d scrypEION Of modal result file AES SOOOEA C mpg fdmode modspc romstr lire freq mode lire nb mode mode file desc character 8 MODENM parameter MODENM mode n c NOTE if this variable is changed in the future it should be c EER updated in spde
416. odal order is the same order given above in the nodal equivalence table If a DOF for a node isn t valid a value of 2 0 100 is used Note 1 Sumdof numdof nfldof Note 2 If upon reading of this record there is less than nnod Sumdof items in the record then only a selected set of nodes were output Another record follows integer less than nnod long which contains the list of nodes for which DOF solutions are available bit 10 PDBN in mask The velocity solution for each node in the nodal coordinate system The description for the DOF solution above also applies here ANSYS transient bit 27 PDVEL in mask Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 13 Chapter 1 Format of Binary Data Files ASL dp 1 nnod numadof CX Qu os lt Q RF i 1l nrf eoo oe dp 1 nrf Qe Oa MST i 1 nmast Qu Qc oe eoe BC i 1 40 CY HS Qr x Qc ados 4G Q LPEE r pomo Q DIX i 1 numdis Qu Ox e 2x93 1 numdis CY Qa oos DIS dp 1 4 numdis Os iQ ou each item The acceleration solution for each node in the nodal coordinate system The description for the DOF solution above also applies here ANSYS transient bit 28 PDACC in mask Reaction force DOFs This index is calculated as N 1 numdof DOF where N is the position number of the node in the nodal equivalence table and DOF
417. of first data word return void percent integer return location of next record return master node for this eqn this is currently only used by solution DB object the returned value of cpingr is based on setting of key 7 4 2 cpget Function Getting a Coupled Set deck cpget function cpget ncp iegn C primary function get a coupled set c Notice This file contains ANSYS Confidential information c input arguments c ncp int sc in coupled set number e C output arguments c cpget int func out number of nodes in list c ieqn int ar cpget 2 out coupled set info e ieqn 1 cpget list of coupled nodes G iegn cpget 1 set degree of freedom e ieqn cpget 2 number of nodes in list c copy of return value 7 4 3 cpput Subroutine Storing a Coupled Set deck cpput subroutine cpput ncp n ieqn C primary function store a coupling set c Notice This file contains ANSYS Confidential information c input arguments c ncp int sc in coupled set number c n int sc in number of nodes in coupled set c ieqn int ar n 2 in info for storage e ieqn 1 n list of coupled nodes c ieqn n 1 degree of freedom label for set c ieqn n 2 is inout iegqn n 2 number of nodes in coupled set c copy of n C output arguments c ieqn n42 int sc inout number of nodes in coupled set another copy of n 7 4 4 cpsel Subroutine Selecting or Deleting a Coupl
418. of incremental e equivalent plastic strain e sigy t dp sc rl yield stress at beginnig of time increments c sigy dp sc 71 yield stress at end of time increment Cc young dp sc ik Young s modulus e posn dp sc py Poiss s ratio e sigyO dp sc 2 15 initial yield stress e dsigdep dp sc pals plastic slope e twoG dp sc eek two time of shear moduli e threeG dp sc rly three time of shear moduli c funcf dp sc 7 1 nonlinear function to be solved e for dpleq e dFdep dp sc rl derivative of nonlinear function e over dpleq ro ro s DOUBLE PRECISION sigElp mcomp dsdeEl mcomp mcomp G mcomp amp sigDev mcomp JM mcomp mcomp dfds mcomp DOUBLE PRECISION var0 varl var2 var3 var4 var5 amp var6 vary var8 DATA G 1 0D0 1 0D0 1 0D0 0 0D0 0 0D0 0 0D0 INTEGER d DOUBLE PRECISION pEl qEl pleq t sigy t sigy Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 317 Appendix C User Material UserMat Subroutine Example cpleq dpleq pleq young posn sigyO dsigdep elastl elast2 twoG threeG oneOv3G qEl10v3G threeOv2qEl amp funcf dFdep fratio conl con2 CRE KKK KKK KKK KKK KK KKK KK KK Ck KK KKK KK KK KK KK kk Ck KK KK KKK KK KK k ck KK KKK kck KK KKK KK KK KKK OM m om c keycut 0 dsigdep ZERO pleq t statev 1 pleq pleq_t C get
419. of integration point 4 5 not used For line elements aoao ado aaa oo aga aa aa oa aaaaaeda a 1 3 coordinates of integration point along line member axis 4 5 offsets in element y and z directions output arguments nprop in sc p0 Number of constants 2 isotropic elasticity 9 orthotropic elasticity 21 anisotropic elasticity prop dp ari o Material elastic constants stiffness local variables KKKKKKKKKKKKKKKKKKKKKKKKKK kk kk Sk kk kk kk Sk kk kk kk Sk kk Sk kk kk kk kk kk ko ko ko ko ko ko ko ko k ck k kc k kk parameters GG A o7 QC cO GO 6 4 4 6 Usage Example for user tbelastic In this example three elements in parallel are subjected to uniaxial tension Element 1 is a SOLID185 element defined via the ANSYS MP command with linear isotropic elasticity Element 2 is a SOLID185 element defined via the user defined elastic material properties interface Element 3 is a SHELL181 element defined via the user defined elastic material properties interface Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 170 of ANSYS Inc and its subsidiaries and affiliates 6 4 5 Subroutine UserPL Writing Your Own Plasticity Laws Solid elements are a unit cubic with a 1 mm edge The shell element is a unit square with a 1 mm edge The Young s modulus is 210E6 MPa and the Poisson s ratio is 0 3 Example ANSYS Input batch com com example for user
420. of the j th strain component By default ANSYS assumes that the element stiffness matrix is symmetric therefore you must provide a symmetric material Jacobian matrix even if it is unsymmetric If your material requires an unsymmetric material Jacobian matrix an element key option KEYOPT 5 1 is available for current technology plane and solid elements to define the unsymmetric stiffness matrix 6 4 1 5 Table TB Commands for UserMat When creating your own material model first define the material by specifying input values for the UserMat subroutine TB USER It is also necessary to specify the number of state variables used if applicable TB STATE Following is more information about defining your material and specifying the number of state variables used For detailed information about the TB command and arguments see the Command Reference TB USER Command Issue the TB command using the following syntax TB USER MAT NTEMP S NP TS where MAT User material ID number NTEMPS Number of temperature points NPTS Number of material constants at a given temperature point Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 161 Chapter 6 UPF Subroutines and Functions The material properties at an intermediate temperature point are interpolated and passed to the UserMat subroutine Define temperatures and mate
421. olution data header will be relative to a position in the Data Set Index ptrESL DSI ptrESL This section explains the contents of the results file that is those files with the following extensions rfl brfl rmg brmg rst brst arth brth lnn 1 2 1 Nomenclature A load case contains the results for an instance in an analysis A load case is defined by a load step number and a substep number A load case is also categorized by a cumulative iteration number and time or fre quency values A load case is identified by all three methods in the results file The results file does not have to contain all the load cases of an analysis A data set is used in this chapter to designate a load case For a complex analysis there will be two data sets for each load case The first data set contain the real solution and the second contains the imaginary solution 1 2 2 Standard ANSYS File Header See The Standard Header for ANSYS Binary Files p 4 for a description of this set File number Item 1 is 12 1 2 3 Results File Format comdeck fdresu C copyright c 2008 SAS IP Inc All rights reserved C ansys inc c description of results file x x Cc used for the following files c rfl brfl c rmg brmg c rst brst c rth brth c Lnn 1xx LONGINT resufpL integer resubk resuut resuLong resuSpare 3 common fdresu resufpL resubk resuut resuLong resuSpare c co
422. olution is 800 IX1 IY1 is the lower left corner of the z buffer image IX2 IY2 is the upper right corner of the z buffer image The image should be mapped to the hardcopy device accordingly The following graphic illustrates the items described above Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 7 of ANSYS Inc and its subsidiaries and affiliates 8 Chapter 4 ANSYS Graphics File Format Figure 4 1 Display Format for Z buffered Graphics 0 KPX ANSYS 5 3 DATE IXIY2 TIME IX1 1Y1 0 0 KPX 1 33 0 4 2 Neutral Graphics File Format The neutral graphics file is an 80 byte ASCII coded file with fixed length records It contains plot directives representing the image of a display as formed in ANSYS encoded onto a host independent printable character set Most ANSYS users will not need to know the format of the graphics file However in rare cases you may want to edit your graphics file or as a programmer you may need to know the file format to write a program that reads it Although the file is ASCII coded it can be difficult to interpret This section gives details about the file format 4 2 1 Characters the Graphics File Uses The host independent printable character set consists of the ASCII characters listed below e Numerals 0 1 2 3 4 5 6 7 8 and 9 Uppercase alphabetic characters A through Z The following characters lt
423. omputed by inputting the velocity as the input film coefficient or bulk temperature or by inputting the velocity as a function of location in space this routine could then compute the effective film coefficient input arguments variable typ siz intent description elem int sc in element number for operation ielc int ar IELCSZ in array of element type characteristics time dp sc in time of current substep 180 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 5 4 Subroutine userfx Changing Element Face Heat Flux Surface Information Q000000000000000000000001 0n nr int sc in number of nodal temperatures of the element u dp ar nr in vector of most recent values of the temperatures ndat int sc in number of data points per element for example for solid70 ndat 24 6 4 where 6 faces per element 4 corners per face hc dp ar ndat inout film coefficients has input values for each corner of each face tb dp ar ndat inout bulk temperature has input values for each corner of each face output arguments variable typ siz intent description hc dp ar ndat inout film coefficients defines input values for each corner of each face tb dp ar ndat inout bulk temperature defines input values for each corner of each face 6 5 4 Subroutine userfx Changing E
424. on Getting Information About Element Heat Generation 7 6 14 ehgget Function Getting an Element Heat Generation eee ee eeseeeceessneeeeeesneeeeeeees 7 6 15 ehgput Subroutine Storing an Element Heat Generation cccccccccesesssstteeeeeeeeeeees 7 6 16 ehgdel Subroutine Deleting an Element Heat Generation c sscccccceceeseessnteeeeeeeees 7 6 17 efuigr Function Getting Information About Element Fluences eeeessss 7 6 18 efuget Function Getting an Element Fluence sssssssesesssssssssrereessssssseereeesssssseerereeesse 7 6 19 efuput Subroutine Storing an Element Fluence sssssssessssssssseresssssssssereeessssssserereessssse 7 6 20 efudel Subroutine Deleting an Element Fluence sssssssesssssssssesesersesssssssrreeresssssseereesss 7 6 21 edciqr Function Getting Information About Element Current Densities 7 6 22 edcget Function Getting Element Current Densities eeeeeeeseeeeeennee 7 6 23 edcput Subroutine Storing an Element Current Density ccesssscccceecesseeseneeeeeeeees 7 6 24 edcdel Subroutine Deleting an Element Current Density esses 7 6 25 evdiqr Function Getting Information About Element Virtual Displacements 7 6 26 evdget Function Getting an Element Virtual Displacement eene 7 6 27 evdput Subroutine Storing an E
425. on pass lenbac number of nodes defining substructure during the generation pass nnod number of unique nodes in the substructure having DOFs and which define this substructure during the use pass Also the number of nodes having master DOFs kunsym unsymmetric matrix key 0 symmetric unsymmetric kstf stiffness matrix present key 0 matrix is not on file matrix is on file kmass mass matrix present key 0 matrix is not on file matrix is on file 1 Lumped mass vestor Sparse only kdamp damping matrix present key 0 matrix is not on file matrix is on file kss stress stiffening matrx present 0 matrix is not on file matrix is on file nvect number of load vectors at least 1 is required nWorkL H BCS workspace length only for bacsub nTermL H Number of terms in sparse matrix lenUl length of intermediate transformation vector sesort DOF set sort key 0 numbers are not sorted 1 numbers are sorted in ascending order lenlst maximum length of DOF set for this substructure maxn numdof ptrLod pointer to the start of the load vectors see also ptrLodh ntrans transformed key 0 substructure has not been transformed gt 0 substructure copied from another substructure via either SESSYM or SETRAN ptrMtxL H pointer to the start of the substructure matrices iDiagL for sparse matrices ptrXFM pointer to the substructure t
426. only as an aid to users Qc Q Qo OQ Qo 0 O 0 OQ O QC 0 0 Qo Qe 0 Qc oO 0 E t Note The bintrd routine and the bintwr routine described below are not part of binlib a This chapter includes it only to aid you You can find the source for this routine on the ANSYS distri bution media 2 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 6 of ANSYS Inc and its subsidiaries and affiliates 2 2 4 Program wrtsub Demonstrates Writing an ANSYS Substructure File Both subroutines require the following common COMMON BINTCM IOUT INTPDP LENFNM RECLNG Iout is the output unit number Intpdp is the number of integers per double precision word Lenfnmis the number of characters in the filename Recingis the system record length 2 2 3 Subroutine bintwr Demonstrates Copying Binary File Contents deck bintwr Q000000000n00n000000000000000n0n0nQ subroutine bintwr pname nname primary function bin file copy utility Notice This file contains ANSYS Confidential information ansys r copyright c 2008 EEK ansys Ino typ int dp log chr dcp siz sc ar n intent in out inout input arguments variable typ siz intent description pname chr sc in name of binary file which is to be copied output arguments variable typ siz intent description nname chr sc out name of new binary file which is a copy of pname common variables
427. onstraint a 0 no constraint on this node e for this DOF a 4 this node has a constraint e defined for this DOF c 4 this node has a pseudo support e defined for this DOF c value dp ar 4 out constraint values c value 1 2 real imag values of present settings c value 3 4 real imag values of previous settings 7 5 3 disput Subroutine Storing a Constraint at a Node deck disput subroutine disput Go primary function node idf value store a constraint at a node c Notice This file contains ANSYS Confidential information amp input arguments c node int sc in node number c idf int sc in reference number of DOF 1 32 c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 c AZ 9 VX 10 VY 11 VZ 12 e PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 c EMF 25 CURR 26 missing entries are spares c value dp ar 2 in real imag values for constraint G output arguments none 234 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 5 6 forget Function Getting a Constraint from the Database 7 5 4 disdel Subroutine Deleting a Constraint at a Node deck disdel subroutine disdel node idf c primary function delete a constraint at a node c Notice This file contains ANSYS Confidential information c input arguments
428. onstrates Dumping a Binary File and Copying It for Comparison Purposes The bintst program dumps a binary file with the name file rst to the screen It then takes that file copies it to a new file fi le2 rst and dumps the new file to the screen for comparison purposes 2 2 1 1 Common Variables Type Size Intent Description int sc comm The output unit number int sc comm The number of integers per double precision word int sc comm The number of characters in the filename int sc comm The system record length Note The bintst program is not part of the binlib a library It is included here only to aid you 2 2 2 Subroutine bintrd Demonstrates Printing a Dump of File Contents deck bintrd subroutine bintrd pname primary function bin file dump utility Notice This file contains ANSYS Confidential information ansys r copyright c 2008 ansys inc typ int dp log chr dcp siz sc ar n intent in out inout input arguments variable typ siz intent description pname chr sc in name of binary file which is to be dumped to the screen output arguments none common variables iout int sc comm output unit number intpdp int sc comm number of integers per double precision word lenfnm int sc comm number of characters in the filename reclng int sc comm system record length NOTE bintrd is not part of binlib a it is included
429. ontains strains in the order X Y 2 XY YZ XZ EQV Plastic strains are always values at the integration points moved to the nodes For beam elements see item LEPPL in the Output Data section for the particular element in the ANSYS Elements Reference NOTE See ENS record section for more details on record content and length C Qa Qe x ac exo eoo ECR dp 1 varies Element nodal component creep strains This record contains strains in the order X Y Z2 XY YZ XZ EQV Creep strains are always values at the integration points moved to the nodes For beam elements see item LEPCR in the Output Data section for the particular element in the ANSYS Elements Reference NOTE See ENS record section for more details on record content and length Oe OL OR 52 oom oemoemexe G ETH dp 1 varies Element nodal component thermal strains Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 18 of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format qQaaqaaqaaaqaanqagagqagqaaagaaaaaa qa Q000000000000000n0nnonon qQaaqaagaagnqagnqagqagqaaaaa qa qaaqaaqaaaqaa EUL EFX ELF dp dp dp varies varies varies This record contains strains in the order X Y Z XY YZ XZ EQV plus the element swelling strain Thermal strains can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes If
430. opriate For layered elements w KEYOPT 8 1 stresses for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LS item of ETABLE command QQ0n000n0n0nQonQoaoaoaoaoaoaoaoaoaoaooononononon 7 7 15 ensput Subroutine Storing Nodal Stresses at an Element deck ensput subroutine ensput ielem nval value C primary function Store nodal stresses at an element c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c nval int sc in the total number of values amp 6 nnod nface value dp ar nval in the stress values c output arguments none o NOTE Stresses at each corner node in the order c 3X Xo Zi XY X2 X4 Sl S252 83 5 SIL 8E 262 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 6 of ANSYS Inc and its subsidiaries and affiliates 7 7 17 engiqr Function Getting Information About an Element s Energies For solid elements stresses at each corner node For shell elements stresses at each corner node first top durface then bottom For layered elements w KEYOPT 8 0 stresses for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Stresses for second layer at each corner node first th
431. or is ordered in the element with the same topology as that in the stand ard element library Refer to that element for details kPress Key indicating whether a Element coding ANSYS code pressure load exists 1 Calculate the pressure load 0 No pressure load calcula tion nReal Number of real constants Element coding USRELEM command RealConst The list of real constants Element coding R command 118 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API Can pass material properties section lay er information ele ment material con trol and any element data nSaveVars The number of variables saved in the esav file for the ele ment Element coding The size of saveVars USRELEM command saveVars The data saved in the esav file ANSYS saves the data after exiting the UserElem sub routine and retrieves it imme diately before entering UserElem again It should include kinematic related vari ables only when the ANSYS material subroutine is called otherwise it should include both kinematic and material data History dependent vari ables can only be saved up dated when the substep is converged keyHisUpd 1 Element coding UserElem subroutine xCur Initial coordinates of the ele ment nodes Values in global
432. ored in the second file header e type tells what kind of information is stored in this record ro i integer c dp double precision c cmp complex e nrec tells how many records of this description are found here e lrec tells how long the records are how many items are stored c recid type nrec lrec contents GL e E 1 100 standard ANSYS file header see binhed for e details of header contents Qu Vom i 1 60 FULL FILE HEADER a e fun04 negn nmrow nmatrx kan c wfmax lenbac numdof jcgtrmL jcgtrmH e lumpm jcgeqn jcgtrm keyuns extopt C keyse sclstf nxrows ptrIDXl ptrIDXh c ncefull ncetrm ptrENDl ptrENDh 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ro 0 0 0 0 0 0 0 0 0 0 a 0 0 0 0 0 c NOTE If fun04 gt 0 then the file was created with frontal assembly Cc If fun04 0 then the file was created with symbolic assembly see below C for its format o BIG cn tu rere A ct cor ne uscite frontal assembled file 2 4 222s Se See Sse eae each item in header is described below Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 45 Chapter 1 Format of Binary Data Files CY Q2 HQ Qe iQ IQ QI OG QE QS QE QU QE Qa Q0 o2 Qc Q2 10 2023 1c 223 0 Q2 07 25 07 292 c 29 92 cQ Oc zx QC fun04 unit number full file is 4 negn number of equat
433. ormation of ANSYS Inc and its subsidiaries and affiliates Programmer s Manual for Mechanical APDL 6 4 Subroutines for Customizing Material Behavior eessecceesssceeeeessneeeeessaeeceessaeeeeeessaeeeeessaees 156 6 4 1 Subroutine UserMat Creating Your Own Material Model 156 64411 UserMat OVervVIeW 1 creare eerte ene nne eee eee pe nate coenae suene NEETA TANER 157 6 4 1 2 Stress Strain and Material Jacobian Matrix essssssseeseeeeeeeeeeeennn 157 6 4 1 3 The UserMat API i eiecit eerte eee ooa ono koe eoe Ea ee eoe e one EU voee enun 158 6 4 1 4 UserMat Variables esses eene nennen eene nnne nnne eene nnn nnns 159 6 4 1 5 Table TB Commands for UserMat essen eene nennen nennen 161 6 4 1 6 Material Constitutive Integration with UserMat eee 162 6 4 1 7 UserMat Restrictions ccccccssesscccesesscccseeseccesessecceseeseccesessscceseasecensussesenseasesenees 162 6 4 1 8 Accessing Material and Element Data for UserMat seeeeeeeeeee 163 6 4 1 9 Utility Functions fot UserMat ire corner rera r biker eir Fn pia repa genie terea 163 6 4 2 Subroutine UserHyper Writing Your Own Hyperelasticity Laws eene 164 6 4 3 Subroutines UserCreep and UserCr Defining Viscoplastic Creep Material Behavior 165 6 4 3 1 Creep Subroutine UserCreep sessssssssseeeeeeee eene esee eene 165 6 4 3 2 Cree
434. orresponds to the connectivity defined in the element description If this isa coupled field analysis the data is stored in the following order as available fluid thermal TEMP electric VOLT and magnetic AZ Gradients can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes See item rxtrap in the Solution header for the setting The number of items in this record is nodstr 3 N where N can be 1 2 3 or 4 depending on the coupled field conditions Moore omoes oxemocemox ooo Q NOTE nodstr is defined in the element type description record Q EEL dp 1 varies Element nodal component elastic strains This record contains strains in the order X Y Z XY YZ XZ EQV Elastic strains can be can be nodal values extrapolated from the integration points or values at the integration points moved to the nodes If an element is nonlinear integration point values always will be written See item rxtrap in the solution header for the setting An element is considered nonlinear when either plastic creep or swelling strains are present For beam elements see item LEPEL in the description in the Output Data section for the particular element in the ANSYS Elements Reference NOTE See ENS record section for more details on record content and length Qu OS oa R Qc Qa Qc Qa Qe Ox Qc e o6 2s A EPL dp 1 varies Element nodal component plastic strains This record c
435. ottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are For layered elements w KEYOPT 8 1 strains for each layer at each corner node first at the bottom surface For beam elements the contents of this record is element depenent 7 7 28 eeldel Subroutine Deleting an Element s Nodal Elastic Strains deck eeldel subroutine eeldel ielem c primary function delete element elastic strains c Notice This file contains ANSYS Confidential information ae input arguments c ielem int sin element number a 0 delete for all defined elements G output arguments none 7 7 29 epliqr Function Getting Information About an Element s Nodal Plastic Strains deck epliqr function epligqr ielem key c primary function get information about element nodal plastic strains c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed c 1 return info about plastic strains c ielem 0 return number of nodal plastic strains e on this element c record length c 0 return maximum number of nodal plastic c strains on any element c max record length e DB NUMDEFINED return the number of nodal plastic strains e defined in model c output arguments
436. outine 134 swell1 subroutine 142 swell3 subroutine 143 swelling laws 173 symeqn subroutine 301 sysiqr function 55 system dependencies 101 systop subroutine 290 T table data retrieving 139 tbuser subroutine 139 temperature loads defining 147 Temperature table defining 82 tmpget subroutine 147 TrackBegin subroutine 109 288 TrackEnd subroutine 109 288 tran subroutine 301 transient debugging 109 Transposing a matrix 299 tranx3 subroutine 290 trrot subroutine 146 U UAnBeg subroutine 203 UAnFin subroutine 203 uec100 subroutine 128 129 uel100 subroutine 128 130 uel101 subroutine 102 UEIMatx subroutine 152 uep100 subroutine 128 131 uex100 subroutine 128 130 UltBeg subroutine 203 UltFin subroutine 203 ULdBeg subroutine 203 ULdFin subroutine 203 UNDO command 212 UNIX systems compiling and linking UPFs on 104 Fortran programming on 101 UPFs see user programmable functions UPFs user programmable features UPFs 99 activating 107 and loads 99 and material properties 99 before you begin using 100 capabilities of 99 compiling and linking on UNIX systems 104 on Windows systems 105 considerations for using 100 debugging 108 definition of 99 development strategy 102 include files 102 linking subroutines to user routines 103 planning 101 running your executable 107 understanding 101 verifying your routines 108 user subroutines for creating new elements 113 128
437. outine Example cccccesssscccccceeesseeesneeeeeececesesessnaaeeceeceeseeeesnaeeeeeees 313 C 1 UserMat Example Description cccccccssssssnnccccecceeseessneceeecceceseeennneeeececcesseeeenaeeeeeeeeeeeeeenaaes 313 C 2 UserMat Example Input Datan consiente aia eii E EE AE E A ES 313 C 3 UserMat Example POST26 Output Results cccsscccccccessesesnneeeeeceecessesssaceceeeeeseeeesnneeeeeeeeess 314 C 4 USERMAT F List File for This Example esses eene enne nnne nns 315 C 5 Accessing Solution and Material Data ccccssssscccccccesseeesnneeeeeeeceeseeesnaeeceeeeeseeeeenneeeeeeeeess 320 lo ss c r r M M amine 323 List of Figures 4 1 Display Format for Z buffered Graphics dieser ento Rr erre venne erbe on Rd OE kae des re pape ya as 88 4 2 Example Display of a Graphics File usce taceoepeptu eie vocem eccle pedir prd ceder Cela eta semp li taa and 93 List of Tables 6 ANSYS Exit CodeS E M came dacauva tans Ea Aa E DEA ar tan immer apea ma Ea ahaa 193 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information w of ANSYS Inc and its subsidiaries and affiliates XIII A Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information XIV of ANSYS Inc and its subsidiaries and affiliates Preface About the Programmer s Manual for ANSYS The Programmer s
438. p S specified forces x y z record nodal temperatures nodal heat generations calculated displacements the returned value of ndingr is based on setting of key 7 2 2 getnod Function Getting a Nodal Point deck getnod subroutine getnod node v kerr kcrot Go primary function get a nodal point c Notice This file contains ANSYS Confidential information c input arguments c node int sc in node number c kerr int sc inout message flag Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 219 Chapter 7 Accessing the ANSYS Database c 0 print no message if node is unselected oe or undefined c print message if node is undefined c 7 2 print message if node is undefined e or unselected c kcrot int sc in output coordinates in this coordinate system c if kcrot is negative output theta and c phi coordinates in radians C output arguments c v dp ar 6 out Coordinates first 3 values and rotation c angles last 3 values c kerr int sc inout select status e 0 node is selected e 1 node is not defined e node is unselected 7 2 3 putnod Function Storing a Node deck putnod subroutine putnod node vctn kcrot c primary function store a node C secondary functions display node if in immediate mode c Notice This file
439. p Subroutine UserCr 0 s eeir ea E AAR E E ETETE TE 167 6 4 4 Subroutine user_tbelastic Defining Material Linear Elastic Properties 168 6 4 4 1 Overview of the user tbelastic Subroutine eee 168 6 4 4 2 Data Types Supported by user tbelastic ccccccccccccessesssneeeeeeeceeeeeessneeeeeeeeeeeees 168 6 4 4 3 Table TB Command for user tbelastic eeeeeeeee nenne 169 6 4 4 4 User Interface for user tbelastic csse eene nennen nen 169 6 4 4 5 The ser tbelastic APIs ed e edel reete ee te Fees coodddes ses eae ERUNT ER Se e Es 170 6 4 4 6 Usage Example for user tbelastic ssssssssssssssseseeeeeeeeee eene nennen 170 6 4 5 Subroutine UserPL Writing Your Own Plasticity Laws c ccccccccessessstseceeeeeeseessnneeees 171 6 4 6 Subroutine usersw Writing Your Own Swelling Laws een 173 6 4 7 Subroutine userck Checking User Defined Material Data eene 174 6 4 8 Subroutine UserVisLaw Defining Viscosity Laws sccccccccesseessnsececeeeeseeessneeeeeeeeess 174 6 4 9 Subroutine userfric Writing Your Own Friction Laws ccccccccesssessetteeeeceesesesssneeeeeees 175 6 4 10 Supporting Function Egem a n i ae a e nennen nennen nennt nnne nnne nn nennen nn 178 6 5 Subroutines for Customizing Loads uie co cratere et bentes eh EET REO UU CEYRE AR FRE ELS METUS 178 6 5 1 Subrou
440. ply vl C output arguments amp v2 dp ar n out vector v2 8 3 19 vmult1 Subroutine Multiplying a Vector by a Constant deck vmultl Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 295 Chapter 8 Subroutines for Users Convenience subroutine vmultl vl n const c primary function multiply a vector by a constant c Notice This file contains ANSYS Confidential information c input arguments c v1 dp ar n inout vector vl e n int sc in length of vector n c const dp sc in constant to multiply vl C output arguments c v1 dp ar n inout vector vl e 8 3 20 vcross Subroutine Defining a Vector via a Cross Product deck vcross subroutine vcross a b c c primary function calculate c a xb c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n intent in out inout c input arguments c a dp ar 3 in first vector to be cross multiplied c b dp ar 3 in second vector to be cross multiplied C output arguments c c dp ar 3 out resulting vector a a 8 3 21 vnorme Subroutine Normalizing a Three Component Vector deck vnorme subroutine vnorme iel v c primary function normalize a vector to unit length c this routine is to be called only from the elements it is only c for a three component v
441. primary function USERSD STRIB ielc elem time ndat dat change element pressure information nc All rights reserved programmable feature c copyright c 2008 SAS IP c ansys inc c in order to activate this user o the user must enter the usrcal qgqaqaqaa pressures are used it is called once per element the call to get the standard ansys input pressures is made just before entering this routine l userpr command this routine is called at each substep of each load step for which it is called for each equilibrium iteration Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 179 of ANSYS Inc and its subsidiaries and affiliates Chapter 6 UPF Subroutines and Functions OOO OR OG Ava QY JON 2090 0 00 Quy voco input arguments variable typ siz intent description ielc int ar IELCSZ in array of element type characteristics elem int sc in element number for operation time dp sc in time of current substep ndat int sc in number of pressure items for this element dat dp ar ndat 2 inout the element pressure vector has input values for each corner of each face output arguments variable typ siz intent description dat dp ar ndat 2 inout the element pressure vector defines input values for each corner of each face dat 1 ndat 1 real pressures dat 1 ndat 2 complex pressures surf
442. primary function demonstrates use of binary access routines c secondary function read an ANSYS substructure file c Notice This file contains ANSYS Confidential information amp C copyright c 2008 SAS IP Inc All rights reserved C ansys inc c ck ck ck ck ck ck ck ck ck ck ck ok kk kk ck kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk ke kk kk kk kk ko ko ko k ck kck ck kckckck C Reads a substructure file To be used as base for 3rd party C development of routines for reading ANSYS substructure files c This demonstration program can handle up to m Qe MAXNODE Nodes and MAXDOF DOFs c ck ck ck ck kk kk kk kk kk kk kk kk kk kk kk ke kk kk ke kk kk kk kk kk kk kk kk kk kk ko ko ko ko ko ko ko ko ko k ck kckckckock 2 2 6 Program rdfull Demonstrates Reading and Reformatting the FULL File Program rdfull demonstrates how to read and reformat the FULL file ANSYS writes the full file if the PSOLVE ELFORM PSOLVE ELPREP PSOLVE TRIANG sequence is used You can also use the WRFULL command If you want to use the free stiffness and mass matrices make sure that there are no constraints on your model deck rdfull program rdfull primary function demonstrates use of binary access routines secondary function Read and reformat full file copyright c 2008 SAS IP Inc All rights reserved ansys inc NOTICE A new assembly process termed symbolic assembly has replaced the old assem
443. ptrSHP ptrLOD Cc ptrSTF ptrMAS ptrDMP 0 0 C ptrLPM ptrSPl ptrSHPh ptrLODh ptrSTFh e ptrMASh ptrDMPh ptrLPMh ptrSPlh ptrIRHSl e ptrIRHSh PowerDyn ptrRES ptrRESh 0 c KeyStress ptrELD ptrELDh 0 0 e modlstp nresi 0 0 0 z 0 0 0 0 each item in header is described below c fun09 unit number mode file is 9 c nmrow number of rows columns in matrices C maxn numdof If extopt 0 nmrow is the number of rows in the e reduced matrices and the number of C master degrees of freedom Cc nmatrx number of reduced matrices on the e file applies only if extopt 0 c nmode number of modes extracted c numdof number of dof per node Cc maxn maximum node number If extopt 3 c or 4 the actual number of nodes is e referenced C wfmax maximum wavefront Does not apply if extopt 3 or 4 c lenbac number of nodes e 0 position not used c nontp number of equations on the LN22 e file Does not apply if extopt c 0 C lumpms lumped mass key C 0 default matrix type Cc 1 lumped e Does not apply if extopt 3 or e 4 c extopt mode extraction method 0 reduced e 3 unsymmetric Lanczos c 4 damped Lanczos 6 block Lanczos Cc 7 QR damped e 8 SuperNode 9 PCG Lanczos c SvCode Solver assembly code e 0 Frontal assembly SV ANSYS e 1 Symbolic assembly SV CASI e kan analysis type c 1 buckling 2
444. qEl compute derivative of the yield function DO i 1 ncomp dfds i threeOv2qEl sigDev i END DO oneOv3G ONE threeG qElOv3G qEl oneOv3G initial guess of incremental equivalent plastic strain dpleq qEl sigy oneOv3G pleq pleq_t dpleq Newton Raphosn procedure for return mapping iteration DO i 1 NEWTON sigy sigy0 dsigdep pleq funcf qElOv3G dpleq sigy oneOv3G dFdep ONE dsigdep oneOv3G cpleq funcf dFdep dpleq dpleq cpleq avoid negative equivalent plastic strain dpleq max dpleq sqTiny pleq pleq_t dpleq fratio funcf qElOv3G check covergence IF abs fratio LT ONEDM05 AND abs cpleq LT ONEDMO2 dpleq OR abs fratio LT ONEDMO5 AND abs dpleq LE sqTiny GO TO 100 END DO Uncovergence set keycut to 1 for bisect cut keycut 1 GO TO 990 CONTINUE update stresses conl twoG dpleq DO i 1 noomp stress i sigElp i conl dfds i END DO update plastic strains DO i nDirect epsPl i epsPl i dfds i dpleq END DO DO i nDirect 1 ncomp epsPl i epsPl i TWO dfds i dpleq END DO epseq pleq Update state variables statev 1 pleq Update plastic work sedPl sedPl HALF sigy_t sigy dpleq Material Jcobian matrix IF qEl LT sqgTiny THEN conl ZERO ELSE conl threeG dpleq qEl Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential inform
445. qaagqagqaaaa qaqagqaagagnqagagqagaagqaaa qaqaaqaaa qaqaaa qa NOD ELM DSI TIM LSP CYC 0 user defined units 1 SI MKS 2 CSG 3 U S Customary using feet 4 U S Customary using inches 6 MPA 7 uMKS nSector number of sectors for cyclic sym csCord Cyclic symmetry coordinate system ptrEnd8 23 24 64 bit file length fsiflag FSI analyis flag pmeth p method analyis flag noffst node offset used in writing file eoffst elem offset used in writing file nTrans number of SE transformation vects ptrTRAN pointer to SE transformation vects kLong 1 64 bit integer form csNds Cyclic sym nds in master sector cpxrst complex results flag 0 no 1l yes extopt mode extraction option nlgeom NLGEOM key AvailData bits indicating available data any where on the file see resucm inc mmass number of missing mass resp present BE 1 numdof Degrees of freedom per node DOF reference numbers are UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 AZ 9 VX 10 VY 11 VZ 12 13 15 are spares WARP 16 HPEX 17 HDSP 18 PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 EMF 25 CURR 26 SP01 27 SP02 28 SP03 29 SP04 30 SP05 31 SP06 32 TBOT 33 TE2 34 TE3 35 TE4 36 TE5 37 TE6 38 TE7 39 TE8 40 TE9 41 TE10 42 TE11 43 TE12 44 TE13 45 TE14 46 TE15 47 TE16 48 TE17 49 TE18 50 TE19 51 TE20 52 TE21 53 TE22 54 TE23 55 TE24 56 TE25 57
446. qr function ecvigr ielem iface key C primary function get information about element convections c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number for inquire c should be zero for key DB NUMDEFINED or c DB MAXRECLENG c iface int sc in face number for inquire 0 6 face number is needed for key 5 for c other values of key iface has different e meaning see below e key int sc in key as to the information needed e 1 return convection mask for element e 5 return number of convections for this e element face c DB_NUMDEFINED e DB_MAXDEFINED return value is based on setting of iface c NOTE both DB NUMDEFINED and 244 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 6 7 ecvput Subroutine Storing an Element Face Convection DB_MAXDEFINED produce the same functionality iface 0 return number of surface loads defined rec length 1 6 return number of convection loads defined for this element NOTE only 1 6 is valid but this routine simply checks that iface is in the range The actual value of iface does not matter in this case DB MAXRECLENG return the maximum number of convections on any element max rec length 00000000000 0Q Q output arguments ecviqr int func out the returne
447. r and solution levels For more information about accessing the ANSYS database see Chapter 7 Accessing the ANSYS Database p 215 ANSYS provides a set of routines you can use to specify various types of loads including BF or BFE loads pressures convections heat fluxes and charge densities These routines are described under Subroutines for Customizing Loads p 178 Another group of UPFs enables you to modify and monitor existing elements For details see Subroutines for Modifying and Monitoring Existing Elements p 149 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 99 Chapter 5 Using User Programmable Features UPFs Another set of UPF routines enables you to define the following material properties plasticity creep swelling law viscoplasticity hyperelasticity and layered element failure criteria To see inputs and outputs for these routines see Subroutines for Customizing Material Behavior p 156 Several sets of UPFs enable you to define new elements and to adjust the nodal orientation matrix See Creating a New Element p 113 for more information You can customize UPF userop to create a custom design optimization routine For more information see Creating Your Own Optimization Subroutine p 204 You can call the ANSYS program as a subroutine in a program you have written To learn how see
448. r or zero see below c key int sc in key as to the information needed c 1 return info about element local forces c ielem 0 return number of local forces on this c element c record length c 0 return maximum number of local forces c on any element c max record length el DB NUMDEFINED return the number of element local forces c defined in model c output arguments c elfigqr int func out the returned value of elfiqgr is based on e setting of key 7 7 50 elfget Function Getting an Element Local Force deck elfget function elfget ielem value C primary function get element local nodal forces c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number c output arguments c elfget int func out status of element e 0 element has no local nodal forces e gt 0 number of nodal forces returned o value dp ar out element local nodal forces Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 277 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database c mpg elfget pagend paberrwb edgzzx panavg papres paterr get ele nd frc F 7 7 51 elfput Subroutine Storing an Element s Local Forces deck elfput subroutine elfput ielem nval value C primary function Store element local nodal forces c No
449. r DOFs This results in K x2 F where K G K11 G G K12 K21 G F G 1 2 G K11 g K21 g complex version of F decomposed into we assume G and g could be complex denoted as g g gx G Kll g G K11 M11 g gx G Kll1l g Mll gx Ml1 g Kll gx K21 g K21 M21 g gx is always real K21 g M21 gx K21 gx M21 g Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 51 52 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Chapter 2 Accessing Binary Data Files This chapter explains the routines you need to read write or modify an ANSYS binary file This collection of routines called BINLIB resides on your ANSYS distribution media The following topics are discussed in this chapter 2 1 Accessing ANSYS Binary Files 2 2 Demonstration Routines 2 3 Results File Access Routines 2 1 Accessing ANSYS Binary Files The BINLIB library is in the dynamic link library Program Files Ansys IncNV120NANSYSNcus tom misc lt plat form gt binlib dl1l1 on Windows systems where platform is a directory that uniquely identifies the hardware platform version or the shared library ansys_inc v120 ansys cus tomize misc p
450. r defined constants G specified in TB SHIFT nTerms USER C output arguments c dxi dp sc out pseudotime increment e dxihalf dp sc out pseudotime increment over the upper half span QUNCKCKCKCkCk kk Ck Ck Ck kk Ck Ck KKK kk Ck Kk kk Ck KC Sk KC KKK KKK KKK KKK kckckckckckckckckckck kc KKK KKK KK KKK KKK KK KKK 6 4 Subroutines for Customizing Material Behavior This section describes the following subroutines that you can use to modify or monitor material behavior 6 4 1 Subroutine UserMat Creating Your Own Material Model 6 4 2 Subroutine UserHyper Writing Your Own Hyperelasticity Laws 6 4 3 Subroutines UserCreep and UserCr Defining Viscoplastic Creep Material Behavior 6 4 4 Subroutine user tbelastic Defining Material Linear Elastic Properties 6 4 5 Subroutine UserPL Writing Your Own Plasticity Laws 6 4 6 Subroutine usersw Writing Your Own Swelling Laws 6 4 7 Subroutine userck Checking User Defined Material Data 6 4 8 Subroutine UserVisLaw Defining Viscosity Laws 6 4 9 Subroutine userfric Writing Your Own Friction Laws 6 4 10 Supporting Function egen Using the MATL String If you write a material behavior subroutine using the MPDATA MPDELE TB or TBDELE command be aware that when the string MATL appears in the MAT field of the command the command interprets the string to mean the currently active material as defined via the MAT VAT command The _MATL string is used in conjunction with t
451. r pointer include lt windows h gt include cAnsInterface h include CAnsQuery h extfnc int extfnc uecmd char uecmd Purpose Demonstrate C API entry function for an external command Parameters uecmd The ANSYS external command string Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 309 Appendix B Creating External Commands in Windows Return Value The return value is ignored by the calling function ann a ve aoa End Function Description int extfnc char uecmd Note uecmd is the entire command given to invoke this function char cmdsend COM COMMAND SENT FROM EXTERNAL COMMAND char querystr NODE NUM MAX char strrtn 32 int i itype double dblrtn Send a simple command to be executed i cAnsSendCommand cmdsend Perform a simple query i cAnsGetValue querystr amp dblrtn strrtn amp itype Display the value retrieved cAns_printf Max Node Number g n dblrtn return i B 1 2 Creating a New Project To build and link your code you will first need to create a project in the Microsoft Developer Studio After launching Developer Studio press Ctr1 N or choose New from the FILE menu In the New window click on the Projects tab Select Win 32 Dynamic Link Library and specify your project name and di
452. ransformations ptrHED pointer to the SUB file header namel first four characters of the substructure file name in integer form name2 second four characters of the substructure file name in integer form name3 third four characters of the substructure file name in integer form name4 fourth four characters of the substructure file name in integer form ptrDOF pointer to the DOF node list ptrDST pointer to the local DOF set ptrBAC pointer to the nodes comprising the substructure Cz c 2E CY QR YOU Qa QC Qa Qc 22 Qe Q3 1c 3 07 2493 X Q2 E Q2 SQ IX 22 CE 2 OQ HO Qo Qr QS o 7 Q3 7 Q5 99 7 Q5 7X 202 Qr Q5 70 Qo QE Qo 200 702 01 12 07 2 2 8 Q8 0 Q2 cQ c Qi Qc oa Qs A Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Aa o 1 7 2 SUB File Format qQaaqaqaqagnqangagqagagqagaagaagaaagaadgqaagaagnaaagnaaaagnaadgnqaagnqaagaaaanaadgqagnqaaagnaaaanaadnqnaana qaqaaqaaa qa qaaqagqaaganqagagqagagqaaaa Note XFM If ntrans gt 0 dp ptrTIT pointer to the title ptrNOD pointer to the unique nodes defining the substructure ptrXYZ pointer to the coordinates of the unique nodes ptrEDG pointer to the substructure edges ptrGDF pointer to the global DOF set ptrCG pointer to the element mass information thsubs thermal key 0 structural 1 thermal ptrPOS
453. rd 6 3 2 Subroutine useran Modifying Orientation of Material Properties deck useran USERSDISTRIB Q0000000000000000000000000000Q subroutine useran vn vref elem thick xyzctr bsangl user written routine to modify orientation of material properties and stresses ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ck ko ko kckockockckck ck applicable to shell43 63 91 93 99 solid46 64 191 accessed by keyopt copyright c 2006 SAS IP Inc All rights reserved ansys inc Notice This file contains ANSYS Confidential information warning do not change any arguments other than bsangl if you do your results are probably wrong input do not change vn vector normal to element vref unit vector orienting element essentially edge i j elem element number thick total thickness of element at this point see note below xyzctr location of element centroid or integration point output bsangl output from this subroutine it represents the angle s between vref and the desired orientation it may have the default orientation coming in to useran This will be combined with the angles derived from the ESYS command use 1 angle for 2 d elements and shells use 3 angles for 3 d solids 6 3 3 Subroutine userrc Performing User Operations on COMBIN7 and COMBIN37 Parameters deck userrc USERSDISTRIB subroutine userrc elem ireal type nusvr usvr parm parmld x Gl cG2 03 04 G0014
454. reals defined on a line Format1 Data descriptor defining the format of the first line For the RLBLOCK command this is always 2i8 6g16 9 The first i8 is the set number the second i8 is the number of values in this set followed by up to 6 real constant values Format2 Data descriptors defining the format of the subsequent lines as needed this is always 7916 9 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 84 of ANSYS Inc and its subsidiaries and affiliates 3 2 23 SFBEAM Command The real constant sets follow with each set starting with Format1 and followed by one or more Format2 s as needed 3 2 22 SECBLOCK Command The SECBLOCK command retrieves all mesh data for a user defined beam section as a block of data You repeat the command for each beam section that you want to read The command format is SECBLOCK Formatl Format2 Format3 Format The First Line section The first value is the number of nodes and the second is the number of cells Format2 The Cells Section The first 9 values are the cell connectivity nodes The 10th last value is the material ID MAT Format3 The Nodes Section This section contains as many lines as there are nodes In this example there are 27 nodes so a total of 27 lines would appear in this section Each node line contains the node s boundary flag the Y coordinate of the node and the Z coordinate of the node
455. rectory n the Workspace frame click on the File View tab Right click on the sub category projname files and press F or select Add Files to Project Choose your source and definition files ansys 1ib cAnsInterface h and any other necessary header files The import library file ansys 1ib is in Program Files Ansys Inc V120 ANSYS custom 1ib platform and the header file cAnsysInterface hisin Program Files Ansys Inc V120 ANSYS customize include B 1 3 Creating an External Definition File For each external function you must declare it in the external definition file The naming convention for this file is the name of your project with the def extension it must be located in your project directory This file consists of the word EXPORTS on the first line and the name s of the functions to be exported on each successive line For the example function above EXPORTS extfunc B 1 4 Creating a Shared Library Once all of the necessary files have been incorporated into your project simply compile Ctr1 F7 and build F7 the project In your project directory Developer Studio will create a Debug directory and will place the library in that directory projname d11 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 310 of ANSYS Inc and its subsidiaries and affiliates B 1 6 Setting the ANSYS_EXTERNAL_PATH Environment Variable B 1 5 Creating an External Table F
456. rence numbers are UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 NX 11 VZ 12 13 18 are spares eee eee PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 KKKKKKKKK 27 32 are spares KKKKKKKKKKKKKKKKKKKKKKKKK nmrow This record contains degrees of freedom for this substructure of the unique nodes as used with this substructure in ascending order This index is calculated as N 1 numdof DOF where N is the node number and DOF is the DOF reference number given above lsort i i 1 nmrow nmrow This record stores the positions of the local DOF set in relation to the generated DOF set lposit i i 1 nmrow nmrow DOF set of the model as defined during the generation pass This index is calculated as N 1 NUMDOF DOF where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above lorig i i 1 nmrow lenbac This group describes nodes that defined the substructure during the generation pass of the analysis Nodal data is stored in arrays equal to the number of used or referenced nodes This table equates the number used for storage to the actual node number Back i i 1 lenbac 20 Substructure title converted to integers see inexc4 nnod This record describes unique nodes defining the substructure for the use pass of the analysis These are also the nodes having master degrees of freedom node i i 1 nnod 6 This record describes the
457. rguments c ielem int sc in element number c iface int sc in face number e 0 all flagged surfaces e 1 6 this flagged surface G output arguments none 7 6 37 efsget function Getting Element Face Flagged Surfaces deck efsget function efsget ielem iface value C primary function get element face flagged surfaces c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c iface int sc in face number 1 6 c output arguments c efsget int func out status of element amp no values for this element c 0 zero flagged surfaces defined amp gt 0 number of values defined e value dp ar out the element flagged surfaces 7 6 38 efsiqr function Getting Information About Flagged Surfaces deck efsiqr function efsiqr ielem iface key c primary function get information about flagged surfaces c Notice This file contains ANSYS Confidential information a input arguments Cc ielem int sc in element number for inquire Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 256 of ANSYS Inc and its subsidiaries and affiliates Q0000000000000000000000000Q qa iface key 7 7 1 dspiqr Function Getting Information About Nodal Results should be zero for key DB_NUMDEFINED DB_MAXDEFINED or DB_MAXRECLENG in
458. rial constants via TBTEMP and TBDATA commands respectively Example 6 1 Defining the Material for UserMat Define material 1 as a user material with two temperatures and four data points at each temperature point tb user 1 2 4 tbtemp 1 0 first temp tbdata 1 19e5 0 3 1e3 100 Four mat constants for one temp tbtemp 2 0 Second temp tbdata 1 21e5 0 3 2e3 100 Four mat constants for two temps TB STATE Command If you intend to use state variables with the UserMat subroutine it is necessary to first specify the number of state variables Issue the TB command using the following syntax TB STATE MAT NPTS where MAT User material ID number NPTS Number of state variables that you intend to use The command defines only the number of state variables and must always be associated with a user mater ial ID No temperatures or data are associated with the command By default ANSYS initializes state variables to zero at the beginning of an analysis Use the TBDATA command to initialize your own values for state variables Example 6 2 Defining the Number of State Variables for UserMat th state 1 8 Define material 1 with eight state variables tbdata l cl c2 C3 C4 cC5 Cc6 C7 G8 Initialize the eight state variables 6 4 1 6 Material Constitutive Integration with UserMat The UserMat subroutine supports current technology elements with all key options However a different material co
459. ription c node int sc in node number c should be zero for key 2 c key int sc in key for operation c 1 return status e nfuigr 0 node does not have a fluence constraint e node has a fluence constraint e 2 return total number of nodal fluences defined on o model c output arguments c nfuiqr int func out the returned value of nfuigr is based on e setting of key 7 5 18 nfuget Function Getting a Nodal Fluence deck nfuget function nfuget node fluen C primary function get specified nodal fluence c Notice This file contains ANSYS Confidential information c input arguments c node int sc in node number c output arguments c nfuget int func out fluence status of node e 0 node has no fluence constraint e node has a fluence constaint G fluen dp ar 2 out the nodal fluences new old Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 239 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database 7 5 19 nfuput Subroutine Storing a Nodal Fluence deck nfuput subroutine nfuput node fluen C primary function store nodal fluence c Notice This file contains ANSYS Confidential information amp input arguments c node int sc in node number c fluen dp sc in nodal fluence output arguments none 7 5 20 nfudel Subroutine Del
460. routine Transposing a matrix esses eene 8 4 6 maat Subroutine Changing a Matrix Value via Addition Multiplication and Transposi uen rc E atveasedocmeies 8 4 7 matba Subroutine Updating Matrix Value via Transposition Multiplications and Addi Hnc M EM MR xii Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Programmer s Manual for Mechanical APDL 8 4 8 matsym Subroutine Filling the Upper Triangle from the Lower Triangle 300 8 4 9 mctac Subroutine Transposing a symmetric matrix eeeeeeeeeeeeeen 300 8 4 10 tran Subroutine Transposing a matrix ccesscccccccecsesssssneeeeeeceeessessnneeeseseeeseeenenaeess 301 8 4 11 symeqn Subroutine Solving Simultaneous Linear Equations cccccccesesesesseeeeeeees 301 A Creating External Commands in UNIX cccccccccccesssssssncceeeeccesseesnaeeeeecceseeecsnanaceeeeceeseesesnaeeeeeeeeeeeees 303 A1 Tasks in Creating an External Command oos e to e Re RED YR P ELE PP VOTRE HART 303 AJ Creating Compatible Codes aue nrc taxed Ead a at pedea vlde aep aub b ad oda 303 202 Creating a Shape d Ei rafy a iota a ao adea patet na dade tantiim Mri i brad 304 A T3 Creating an External Table File sies ctierter cet tr epu dett eee eig
461. routine ResRdEnd These routines are contained in the file ResRd F See the demonstration routine ResRdDemo F on the distribution medium for an example of the usage of these routines The memory allocation scheme is described in Memory Management Routines in the Guide to ANSYS User Programmable Features The following sections describe the data reading routines See the file ResRd F and its corresponding include deck ResRd inc for listings of the corresponding Begin End routines 2 3 2 ResRdBegin Opening the File and Retrieving Global Information deck ResRdBegin function ResRdBegin Nunit Lunit Fname ncFname Title JobName x Units NumDOF DOF UserCode x MaxNode NumNode MaxElem NumElem x MaxResultSet NumResultSet c primary function Open result file and return global information c object library ResRd c input arguments e Nunit int sc in Fortran Unit number for file ANSYS uses 12 c Lunit int sc in Current print output unit usually 6 lt STDOUT gt c Fname ch ncFname sc in The name with extension for the file ncFname int sc in Number of characters in Fname C output arguments Title ch 80 ar 2 out Title and First subtitle JobName ch 32 sc out Jobname from file Units int sc out 0 unknown 1 SI 2 CSG e 3 U S Customary foot e 4 U S Customary inch c 6 MPA NumDOF int sc out Number of DOF per node DOF int ar out The DOF
462. routine swell3 Updating an Element s Swelling History 3 D Elements 143 6 2 20 Function elLenPsvrBuf Determining additional ESAV Record for Plasticity 143 6 2 21 Function nlget Retrieving Material Nonlinear Property Information 144 6 2 22 Subroutine usereo Storing Data in the nmisc Record ssesesssssssssssersessssseereeeesssssssseeee 144 6 2 23 Subroutine eldwrtL Writing Element Data to a File seeeeeee 145 6 2 24 Subroutine eldwrnL Writing Element Nonsummable Miscellaneous Data to the Results Jp A 145 6 2 25 Subroutine trrot Computing the Rotation Vector scccccccccesssesssnteeceecesesessnneeeeeees 146 6 2 26 Subroutine rottr Computing the Transformation Matrix eene 146 6 2 27 Subroutine xyzup3 Updating an Element s 3 D Nodal Coordinates 146 6 2 28 Subroutine updrot Updating the Rotation Pseudovector esssssssseserssssssereressrsssssseeee 147 6 2 29 Subroutine tmpget Defining Current Temperature Loads sccccccceeeeessseteeeeeeeees 147 6 2 30 Subroutine prsget Defining Current Pressure Loads sse 148 6 2 31 Subroutine cnvget Defining Current Convection Loads eeeenee 148 6 2 32 Subroutine hgnget Defining Current Heat Gen
463. routines and Functions Explanation Explanation Accounting File Error Unable to Open X11 Server Auth File Verification Error Quit Signal Error in ANSYS or End of run Failure to Get Signal User Routine Error System dependent Error Macro STOP Command 6 7 Defining Your Own Commands ANSYS Inc supplies a set of user subroutines named user01 through user10 which you can use to define custom ANSYS commands To do so follow these steps 1 Insert the code for the functions you want to perform into subroutine user01 or user02 etc 2 Link the subroutine into the ANSYS program 3 Issue the ANSYS command UCMD to define a name for a custom command that calls and executes your subroutine Use the command format shown below UCMD Cmd SRNUM Cmd The name for your new command It can contain any number of characters but only the first four are significant The name you specify can not conflict with the name of any ANSYS command or the names of any other commands or macros SRNUM The number of the subroutine your command should call that is a value between 01 and 10 For example suppose that you create and link in a user subroutine for a parabolic distribution of pressure and you name that subroutine user01 Issuing the command shown below creates a new command PARB that when issued calls your parabolic pressure distribution subroutine UCMD PARB 1 To make these custom command subroutines ava
464. rs variables how to create macro programs using APDL how to use APDL for simple user interaction how to encrypt an APDL macro and how to debug an APDL macro Note The Programmer s Manual for ANSYS is offered solely as an aid and does not undergo the same rigorous verification as the ANSYS product documentation set Therefore the Programmer s Manual for ANSYS is not considered to be part of the formal program specification as stated in your license agreement Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates XV Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information XVI of ANSYS Inc and its subsidiaries and affiliates Part Guide to Interfacing with ANSYS Chapter 1 Format of Binary Data Files The ANSYS program writes several binary files to store data during an analysis These files are named Job name ext where Jobname is the name of the analysis that caused the file to be generated and ext is an extension indicating the type of data in the file The following Binary Data File topics are available in this chapter 1 1 Understanding ANSYS Binary Files 1 2 Description of the Results File 1 3 Description of the Reduced Displacement File 1 4 Description of the Reduced Complex Displacement File 1 5 Description of the Modal Results File 1 6 Descr
465. rtVelAccSetup USERDISTRIB parallel subroutine userPartVelAccSetup secId secIdCurr secIdWave kch nsize nsizec nsizew dWork dWorkC dWorkw rkd wvmax C primary function set up and checking of user wave and current theory C secondary functions none X XXX c Notice This file contains ANSYS Confidential information c e c input arguments c secld int sc in ocean basic data id c secIdCurr int sc in ocean current data id c secIdWave int sc in ocean wave data id c kch int sc in key for checking or defaulting not used by PIPE288 G nsize int sc in size of ocean basic data c nsizec int sc in size of ocean current data c nsizew int sc in size of ocean wave data c dWork dp ar inout ocean basic data c dWorkC dp ar inout ocean current data c dWorkW dp ar inout ocean wave data e C output arguments c dWork dp ar inout ocean basic data c dWorkC dp ar inout ocean current data G dWorkW dp ar inout ocean wave data G rkd dp sc out value of k d G wvmax dp sc out total amplitude include impcom inc include ansysdef inc include acelcm inc include sectionsize inc include soptcm inc Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 189 Chapter 6 UPF Subroutines and Functions
466. s Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number Should be 0 for key 11 DB NUMDEFINED DB MAXDEFINED and DB MAXRECLENG key int sc in information flag DB SELECTED return status etpiqr 0 element has no temperatures element has temperatures defined DB NUMDEFINED return number of temperatures defined for this element rec length DB MAXDEFINED return number of temperatures defined in model DB MAXRECLENG return maximum number of temperatures defined for any element max rec length 2 return length dp words 3 return layer number for cross reference files return number of entities 4 return address of first data word 5 return length dp words 6 return compressed record number 11 return void percent integer 16 return location of next record this increments the next record count 18 return type of file etpiqr 0 integer double precision 2 real 3 4 complex character 8 246 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 000000000 Q0 Q 7 6 12 etpdel Subroutine Deleting an Element Temperature 7 index 19 return virtual type of file etpiqr 0 fixed length 4 4 form indexed variable length layer data 2 xref
467. s e defined in model ic output arguments c engiqr int func out the returned value of engigr is based on c setting of key Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 263 Chapter 7 Accessing the ANSYS Database 7 7 18 engget Function Getting an Element s Energies deck engget function engget ielem value c primary function get element energies c Notice This file contains ANSYS Confidential information amp input arguments c ielem int sc in element number c output arguments c engget int func out status of element c 0 element undefined amp 11 energies returned c value dp ar 6 out e value 1 volume of element amp 2 strain energy 3 dissipation energy c 4 kinetic energy e 5 plastic energy c 6 creep energy c 7 stabilization energy c 8 spares e 9 thermal energy c 10 11 spares 7 7 19 engput Subroutine Storing an Element s Energies and Volume deck engput subroutine engput ielem nval value C primary function store volume and energies for an element c Notice This file contains ANSYS Confidential information a input arguments c ielem int sc in element number nval int sc in the total number of values to be stored e Must be 11 c value dp ar 6 in volume and
468. s ielc int sc on Element type number none ar IELCSZ out Element characteristics ResRdType int sc out number of words read 2 3 5 ResRdReal Retrieving Real Constants deck ResRdReal function ResRdReal iReal Rcon c primary function Read real constant record c object library ResRd c c c c c input arguments iReal int sc in Real set number output arguments none Rcon dp ar ResRdReal out Real Constants ResRdReal int sc out Number of real constants in set 2 3 6 ResRdCsys Retrieving Coordinate Systems deck ResRdCsys function ResRdCsys iCsys Csys c a primary function input arguments Read a coordinate system record object library ResRd iCsys int sc in Coordinate system number output arguments Csys dp ar ResRdCsys out Coordinate system description ResRdCsys int sc out Number of values output arguments Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 67 Chapter 2 Accessing Binary Data Files 2 3 7 ResRdNode Retrieving Nodal Coordinates deck ResRdNode function ResRdNode iNode xyzang c primary function Get a node c object library ResRd c input arguments c iNode int sc in node sequence number C 1 to nXYZnode C output arguments xyzang dp ar 6 out x y z thxy thyz thzx for node c ResRd
469. s a user option The material properties defined are based on the material co ordinate system of the elements Element Support You can use the subroutine with most current technology elements including the following LINK180 BEAM188 BEAM189 PLANE182 PLANE183 SOLID185 SOLID186 SOLID187 SOLSH190 SHELL181 SHELL208 SHELL209 REINF264 REINF265 SHELL281 SOLID272 SOLID273 SOLID285 PIPE288 PIPE289 and ELBOW290 Material Model Support You can use the subroutine with most ANSYS nonlinear material models including the following BISO BKIN MISO KINH NLSIO PLASTIC CHABOCHE CAST IRON CREEP EDP Drucker Prager model SMA shape memory alloy PRONY and GURSON For more information about these material models see the documentation for the TB command in the Command Reference 6 4 4 2 Data Types Supported by user tbelastic The user tbelastic subroutine can define the following types of material property data Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 168 of ANSYS Inc and its subsidiaries and affiliates 6 4 4 Subroutine user_tbelastic Defining Material Linear Elastic Properties Isotropic elasticity with two constants Define the Young s modulus EX and Poisson s ratio NUXY material constants General orthotropic elasticity with nine constants Define the normal modulus shear modulus and minor Poisson s ratios The order is as follo
470. s and Functions rel IncStrain dp ar nTens strain for the current substep step when C nlgeom on e total strain when nlgeom off c defGO dp ar 3x3 deformation gradient tensor at the end c of last incremental step e c input output arguments input desc output desc c rel defG dp ar 3x3 deformation gradient tensor at current G time updated for thichness change in c plane stress when nlgeom on e kTherm int sc flag for thermal loading rel input as e 0 if temp tref e 1 if temp ne tref c gets reset to 0 G if ALPX ALPY and ALPZ 0 e c output arguments c G cMat nTens nTens material Jacobian matrix G MatProp dp ar 5 commonly used materail properties c MatProp 1 Gxz shear modulus c MatProp 2 Gyz shear modulus c MatProp 3 Gxy shear modulus c MatProp 4 density e MatProp 5 nuxy Gc Stress dp ar nTens total stress C Strain dp ar nTens total strain c StressTh dp ar nTens thermal stress c StrainTh dp ar nTens thermal strain C StrainPl dp ar nTens plastic strain c StrainCr dp ar nTens creep strain c StressBk dp ar nTens back stress for kinematic hardening e StrainSw dp sc isotropic swelling strain c swelling capability not available yet c EnergyD dp ar 3 energy density c EnergyD 1 elastic energy density c EnergyD 2 plastic energy density c EnergyD 3 cr
471. s and temper tions atures disable default solution settings SOLCONTROL OFF Perform postpro Postprocessing occurs normally as with any other element cessing Only total strain or equivalent quantities such as thermal gradient and stress or equivalent quantities such as thermal flux are saved as regular result quantities Other variables are saved as nonsummable miscellaneous variables in the results file Note Steps 2 and 3 specify data for the ANSYS user defined element API All other steps represent standard ANSYS features Recommendations and Restrictions The following recommendations and restrictions apply to user defined element USER300 Verify that your input data for the USRELEM and USRDOF commands are consistent with the values used in the UserElem F code For example if the number of dimensions ND IM specified via the USRELEM command is 2 do not change the number of dimensions specified in the UserElem F subroutine from 2 A runtime error or incorrect results can occur if the values do not match ANSYS may activate default solution settings automatically according to the USER300 element s DOFs but the default solution control settings may not be optimal for your element If any convergence diffi culty occurs try disabling the default solution settings SOLCONTROL OFF The USER300 element does not support ANSYS section SECxxx commands For composite beams and layered shells you mu
472. s at an element c Notice This file contains ANSYS Confidential information c input arguments c ielem int sc in element number c nval int sc in the total number of values e NOTE There may be a maximum of 3 sets of e nodal forces in the record static c forces inertia forces and damping forces c value dp ar nval in nodal force results c output arguments none 7 7 12 enfdel Subroutine Deleting an Element s Nodal Forces deck enfdel subroutine enfdel ielem C primary function delete element nodal forces data c Notice This file contains ANSYS Confidential information c input arguments G ielem int sc in element number c 0 delete for all defined elements c output arguments none 7 7 13 ensiqr Function Getting Information About an Element s Nodal Stresses deck ensiqr function ensigqr ielem key c primary function get information about element nodal stresses c Notice This file contains ANSYS Confidential information e input arguments G ielem int sc in element number or zero see below key int sc in key as to the information needed e 1 return info about element nodal stresses ad ielem 0 return number of element nodal e stresses for this element G record length e 0 return maximum number of element o nodal stresses on any element e max record length B DB NUMDEFINED return total number of element e nodal
473. s defining the format For CMBLOCK this is always 8i10 The items contained in this component are written at 10 items per line Additional lines are repeated as needed until all NumItems are defined If one of the items is less than zero then the entities from the item previous to this one inclusive are part of the component 3 2 4 EBLOCK Command The EBLOCK command defines a block of elements The command syntax is EBLOCK NUM_NODES Solkey Format NUM_NODES The number of nodes to be read in the first line of an element definition Solkey The solid model key The element is part of a solid model if the keyword SOLID appears here When Solkey SOLID Field 8 the element shape flag may be left at zero and Field 9 is the number of nodes defining this element Format Data descriptors defining the format The format of the element block is as follows for the SOLID format Field 1 The material number Field 2 The element type number Field 3 The real constant number Field 4 The section ID attribute beam section number Field 5 The element coordinate system number Field 6 The birth death flag 74 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 3 2 5 EDCADAPT Command Field 7 The solid model reference number Field 8 The element shape flag Field 9 The number of
474. s in the first 3 columns and the constant term is in the fourth column Solution is in fourth column example 2 Invert a 3x3 matrix i symeqn a 1 1 3 3 3 calling routine has a dimensioned as a 3 6 input matrix was input in first 3 columns output matrix in ouput in last 3 columns 302 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates Appendix A Creating External Commands in UNIX External commands allow you to add your own customized extensions to ANSYS without relinking the pro gram You can create custom routines in C that access any of the ANSYS API functions link them into shared libraries using the supplied utilities and execute the routines via the external command feature within ANSYS In addition ANSYS provides special commands that list all available external commands and allow you to reset all currently referenced external commands External command capability is supported on all UNIX platforms Refer to your ANSYS Inc UNIX Linux Install ation Guide for currently supported compilers the following instructions assume the presence of compatible compilers and linkers A 1 Tasks in Creating an External Command To create a functional external command you will need to complete the following general steps Create compilable source code Create a shared library This is facilitated by the gen share
475. s per node UserCode int sc out Code for this application MaxNode int sc out Maximum node number used e NumNode int sc out Number of nodes attached to elements MaxElem int sc out Maximum element number used NumElem int sc out Number of elements used c MaxResultSet int sc out Maximum number of result sets usually 1000 NumResultSet int sc out Number of result sets on file c ResRdBegin int sc out 0 successful other error in file open Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 66 of ANSYS Inc and its subsidiaries and affiliates 2 3 6 ResRdCsys Retrieving Coordinate Systems 2 3 3 ResRdGeomBegin Retrieving Global Geometry Information deck ResRdGeomBegin subroutine ResRdGeomBegin MaxType MaxReal MaxCsys nXYZ c primary function Read Geometry Header Record c object library ResRd c c c Cc Cc c input arguments output arguments MaxType int MaxReal int MaxCsys int nXYZ int none Sc out Maximum element type Sc out Maximum real constant set number sc out Maximum coordinate system number Sc out number of nodes with coordinates 2 3 4 ResRdType Retrieving Element Types deck ResRdType function ResRdType itype ielc c primary function Read an element type record c object library ResRd c c qa input arguments itype int output argument
476. s record matches the previous record The nmrow l entry will be zero 24 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 3 2 RDSP File Format qgqaaqaaqaaaa qaaqaaaaqaaa Q qgqaaqaaqaa qagqaaqaaqaa qaaqaqaaagqagnqaagqaaaa anaa Q qgqaaqaagqaaaa qa qgqaaqaagqaaa DNC STF MAS DMP FRO KKK kk kk DSP dp dp dp dp lorig i i 1 nmrow nbcdsp 1 nbcdsp This record is present only if the analysis uses the reduced method and nbcdsp gt 0 see record at ptrDOF These numbers are the positions in the previous record of dofs with a nodal constraint These are nodal constraints only on nodes that also are masters na i i 1 nbcdsp nmrow nmrow Reduced stiffness matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx gt 0 and analysis is not using mode superposition method Row order is the same as the DOF order in record at ptrDOF ak i j i 1 nmrow nmrow nmrow Reduced mass matrix Each row of the matrix is stored as a record The matrix is present only if nmatrx 1 and analysis is not using mode superposition method Row order is the same as the DOF order in record at ptrDOF am i j i 1 nmrow varies varies Reduced damping matrix or mode shapes If the analysis uses the reduced method each record will be nmrow items in
477. s reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 173 Chapter 6 UPF Subroutines and Functions Y OG 20 20 209 26 20310 209 26 JO Gy JOG 0X Gy Jey 2G OY HOG 209 Y Oey 20 0X OGG Ov Gi 20 20 inp ou ansys inc Notice This file contains ANSYS Confidential information ut arguments option int sc in swelling option elem int sc in element number label intpt int sc in element integration point number mat int sc in material reference number proptb dp ar in nonlinear material table tb commands ncomp int sc in number of strain components 1 4 or 6 truss or beam elements 4 2 d solids and pipe elements 6 3 d solids and most shells epswel dp sc inout total accumulated swelling strain before this substep epel dp ar ncomp inout elastic strain e dp sc in elastic modulus nuxy dp sc in poisson S RATIO fluen dp sc in total fluence bf or bfe commands dfluen dp sc in increment in fluence for this substep tem dp sc in temperature bf or bfe commands dtem dp sc in increment in temperature for this substep toffst dp sc in offset of temperature scale from absolute zero toffst command timvll dp sc in time at the end of this substep timvnc dp sc in the increment of time this substep usvr dp ar inout user defined state variables optional tput arguments epswel dp sc inout
478. s reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 249 Chapter 7 Accessing the ANSYS Database G 1 or DB MAXRECLENG return element fluences info c for ielem 0 return number of fluences for this element record length e 0 return maximum number of fluences e defined for any element e max rec length e DB NUMDEFINED c DB MAXDEFINED return number of defined fluences e in model e NOTE both DB NUMDEFINED and DB MAXDEFINED e produce the same functionality c output arguments c efuiqr int func out the returned value of efuigr is based on e setting of key 7 6 18 efuget Function Getting an Element Fluence deck efuget function efuget ielem value C primary function get element fluences c Notice This file contains ANSYS Confidential information a input arguments c ielem int sc in element number c output arguments o efuget int func out status of element a 0 element has no fluences defined a gt 0 number of element fluences defined Cc value dp ar out element fluences Q NOTE If a value is not defined it will be a very small number 2 100 Q 7 6 19 efuput Subroutine Storing an Element Fluence deck efuput subroutine efuput ielem n value C primary function store element fluences c Notice This file contains ANSYS Confidential information ei
479. s the next record count pointer to start of index return type of file elmiqr 0 integer double precision 2 real 3 complex 4 character 8 7 index 19 return virtual type of file elmiqr 0 fixed length 4 4 form indexed variable length layer data 2 xref data tables 3 bitmap data for 32 data item packed records 4 data tables three dimensional arrays material number etc see elmcmx see elmcmx with elmilg and 1 instead of 101 int sc out the returned value of elmiqr is based on setting of key mpg elmiqr lt elll7 edgrde edgrecc edgmul elem inquire 7 3 2 elmget Function Getting an Element s Attributes and Nodes deck elmget function elmget C primary function ielem elmdat nodes get element attributes and nodes c Notice This file contains ANSYS Confidential information C mpg magnetic usage to be checked 7 3 3 elmput Subroutine Storing an Element deck elmput subroutine elmput ielem elmdat nnod nodes C primary function store element attributes and node numbers C secondary functions set current element pointer to this element c Notice This file contains ANSYS Confidential information c NOTICE The user is also responsible for defining the centroid for the amp element using the elmpct subroutine Calling the elmput amp subroutine will NULL the element centroid pre
480. sage stays up untill replaced by another message nomore display any more messages ER NOMOREMSG O display messages l display discontinue message and stop displaying eropen Oz errors file is closed ER FILEOPEN l errors file is opened ikserr 0 if interactive do not set keyerr ER INTERERROR l if interactive set keyerr used by mesher and tessalation kystat flag to bypass keyopt tests in the elcxx routines ER KEYOPTTEST associated with status panel info inquiries 0 do not bypass keyopt tests perform all keyopt tests also flag to bypass setting of STATUS upon resume mxr4r5 mixed rev4 rev5 input logic do if go if go ER MIXEDREV used in chkmix called from rdmac rev5 found do fi then endif 2 rev4 found go xxx if Xxx 3 warning printed do not issue any more mshkey cpu intensive meshing etc this will cause ER MESHING nertim 11 to be set to 1 for notes 1 for warnings and 0 for errors checking of this key is done in anserr O not meshing or cpu intensive l yes meshing or cpu intensive syerro systop error code read by anserr if set 18 opterr 0 no error in main ansys during opt looping ER OPTLOOPING an error has happened in main ansys during opt looping flowrn flag used by floqa as to list floqga ans 20 O list floga ans floga ans has been listed do not list again noreport used in GUI for turning off errors due to strsub calls 22 O process errors as usual
481. sc out the nodal virtual displacement value 7 5 27 nvdput Subroutine Storing a Nodal Virtual Displacement deck nvdput subroutine nvdput node virtd C primary function store nodal virtual displacement c Notice This file contains ANSYS Confidential information amp input arguments c node int sc in node number c virtd dp sc in nodal virtual displacement output arguments none 7 5 28 nvddel Subroutine Deleting a Nodal Virtual Displacement deck nvddel subroutine nvddel node C primary function delete nodal virtual displacements c Notice This file contains ANSYS Confidential information e typ int dp log chr dcp siz sc ar n func intent in out inout ic e input arguments c variable typ siz intent description c node int sc in node number 242 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 7 6 2 eprget Function Getting an Element Face Pressure e c output arguments c none 7 6 Element Loading Routines 7 6 1 epriqr Function Getting Information About Element Pressure Convec tion deck epriqgr function epriqr ielem iface key C primary function get information about element pressure convection c Notice This file contains ANSYS Confidential information input arguments ielem int sc in element number sho
482. se 200 6 8 2 Function GetStackDisp Getting Current Displacement Values sse 201 6 8 3 Subroutine ElResultStrt Getting Load Data from Analysis Results eeessss 202 6 8 4 Subroutine ElResultGet Getting Results Values at Selected Points 202 6 8 5 Subroutine Ellnterp Finding Element Coordinates cssssscccccceeeseesssenecceeeeeeseesennaees 202 6 9 Access at the Beginning and End of Various Operations esee 203 6 10 Creating Your Own Optimization Subroutine eeeeeeeeeeeeeeeeeee eee eene nennen nennen 204 6 10 1 Linking a Custom Optimization Program to ANSYS esssccceessseeeeesneeceessaeeesessnaeeeees 204 6 10 2 Subroutine userop Defining a Custom Optimization Subroutine ssseessss 205 6 10 3 Str cturing Your Input 3 eget tette eere tg ostevedeccdsucde dunsecoceusvseds 207 6 11 Memory Management Subroutines i5 esce ose reser tar YER PY kia PRAE ERN DEIN SER VERE REA R Y XNR ERST 208 6 11 1 Using the Memory Management Subroutines eeeeeeeeeeeeeeeeeeen eene 208 6 11 2 Function fAnsMemAlloc Allocating Space and Returning a Pointer ssss 209 6 11 3 Subroutine fAnsMemFree Deallocating Space sssssccccccesseesentneceeeeecesseessneeeeeeeees 209 6 12 Parameter Processirg Subroutines cocco eroe poe dpt le utor ie op rd VEDO pd ae 210 6 12 1
483. sed these are load vectors reduced stiffness reduced mass matrix reduced damping e i 1 numdof Degrees of freedom per node c DOF reference numbers are c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 Cc AZ 9 VX 10 VY 11 VZ 12 13 18 are spares c JO kk PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 Cc EMF 25 CURR 26 KKKKKKKKK 27 32 are spares KKKKKKKKKKKKKKKKKKKKKKKKK e curdof i i 1 numdof CG Qe i J lenbac Nodal equivalence table c This table equates the number used for e Storage to the actual node number c Back i i 1 lenbac c RDF i J nmrow Reduced set of degrees of freedom used e This record is present only if extopt 0 c The DOFs are calculated as N 1 NUMDOF DOF c where N is position number of the node in c the nodal equivalence table and DOF is the Cc DOF reference number given above c 1 i i 1 nmrow if nmatrx gt 0 c FRQ dp 1 nmode snresi Frequencies eigenvalues Frequencies are c complex if extopt 3 or 4 Numbers stored are e the squares of the natural circular c frequencies w 2 where w radians time c You can obtain the natural frequencies f e in cycles time using the equation f w 2pi c freq i i 1 nmode c SHP dp nmode nmrow Mode shapes eigenvectors Mode shapes are c complex if extopt 3 or 4 If extopt 0 the e mode shape order corresponds to the DOF list c stored at position ptrRDF If extopt does c not equal 0 the order correspon
484. served Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 123 Chapter 6 UPF Subroutines and Functions C2 Tar Ps gt ae Das gt ae Das gt ME PR E AA E E 2d gt a EE E 02 2492 0 292 5 92 cQ gt Q2 Q2 1C Qa Qr Qa Qe Qo Qc 209 0 202 07 292 0 192 Qc Qe 1 Q2 X02 QE Q2 Qc Ode E a 209 0E 292 0 02 5 2 Qs TA kfstps nlgeom nrkey outkey elPrint 3ott int sc in int sc in int sc in int sc in int sc in int sc in keyHisUpd int sc in accelerations normally not needed key for the first iteration of first substep of the first load step 1 yes 0 no large deformation key from nlgeom command 0 NLGEOM OFF 1 NLGEOM ON key to indicate a newton raphson incremental procedure 0 No 1 Yes key to indicate if any element output is to be placed on the print file or the result file 0 No 1 Yes key to indicate if any element output is to be placed on the print file 0 No 1 Yes print output file unit number key to indicate if history dependent variables need to be updated like equivalent plastic strain back stress etc since the iteration is already converged 0 not converged don t need to update history dependent variables 1 yes converged need to update history dependent variables The following 7 variable group can usually be ignored The variables are used for debug timing and convergenc
485. shared library resides Use one of the following commands depending on the UNIX shell you are using setenv ANS USER PATH workingdirectory or export ANS_USER_PATH workingdirectory When you run a user linked version of the ANSYS program the ANSYS output will echo the value of ANS_USER_PATH and will include the following NOTE This ANSYS version was linked by Licensee 104 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 0 of ANSYS Inc and its subsidiaries and affiliates 5 10 Compiling and Linking UPFs on Windows Systems To return to the original version of ANSYS unset the ANS_USER_PATH environment variable ANSYS recommends using the ANSUSERSHARED script as a template to try compilers that are not supported by ANSYS Inc such as the GNU compilers To do so edit the ANSUSERSHARED script making changes to the appropriate platform logic Note that if you do use compilers other than those listed in the ANSYS Install ation and Configuration Guide specific to your operating system you will need to debug i e find missing libraries unsatisfied externals etc them yourself ANSYS Inc does not provide assistance for customers using unsupported compilers or if the resulting objects are not compatible with the ANSYS executable s as distributed Note This shared library method is not available on Windows or IBM platforms 5 10 Compiling and Link
486. size n Intent of variable is one of the following in input only Out output only inout both an input and an output variable 2 1 5 binini Initializing Buffered Binary I O Systems deck binini subroutine binini iott c primary function initialize buffered binary i o system c This routine is intended to be used in standalone programs c This routine should not be linked into the ANSYS program c Notice This file contains ANSYS Confidential information c input arguments c iott int sc in output unit number for error output C output arguments none 2 1 6 Function sysiqr Retrieving the Status of a File deck sysiqr function sysigr nunit fname lname_in ingr_in C primary function do a file system inquire system dependent c Notice This file contains ANSYS Confidential information Q input arguments variable typ siz intent description Q Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 55 Chapter 2 Accessing Binary Data Files c nunit int sc in e fname chr sc in lname_in int sc in e ingr in chr sc in Gc e e e C e e e C e e e C output arguments c sysiqr int func out e fortran unit number name of file length of file name character key for information requested used only for i
487. skey stress stiffening matrix key 0 matrix not present matrix present akey applied load vector key 0 vector not used vector used nrkey newton raphson restoring load vector key for nonlinear analyses 0 vector not used vector used ikey imaginary load vector key for complex analyses 0 vector not used vector used 0 position not used 0 position not used nmrow numbers columns in matrices If the number is negative the matrices will be written in lower triangular form Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 37 Chapter 1 Format of Binary Data Files i 1 nmrow DOF index table This record specifies the DOF locations of this element matrix in relation to the global matrix The index is calculated as N 1 NUMDOF DOF where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above Qr Oe Oa a dp varies varies Element matrices This record is repeated for each stiffness mass damping and stress stiffening matrix If the matrix is diagonal the length of the records will be nmrow If the matrix is unsymmetric the length of the records will be nmrow nmrow If the matrix is symmetric only the lower triangular terms are written and the length of the records will be nmrow nmrow 1 2
488. solid elements and in the co rotated element Cartesian coordinate system for link beam and shell elements deck ElemGetMat subroutine ElemGetMat elId matId nDim nTens nDirect intPnt xCurIP TemperIP TemperIPB kTherm IncStrain defG0 defG CMat MatProp Stress Strain StressTh StrainTh StrainPl StrainCr StressBk StrainSw EnergyD MatRotGlb m mmm m sm QUKCKCKCkCkCKCk kk Ck k kk kkk kk KC kk k k k k k k k k k k k k k k ck ck KK KKK KKK k k k k k k k k k k kc k k k k k k k k k ck KK KK c C Primary function call ANSYS material routines to obtain material c data for USER300 elements c Notice This file contains ANSYS Confidential information e c input arguments c c ellId int sc element number c matId int sc material number of this element c nDim int sc number of dimensions of the problem c 2 2D c 3 3D c nTens intse number of stress strain components c nDirect int sc number of stress strain direct G components c intPnt int sc current integration point number e xCurIP dp ar 3 coordinates of integration point c TemperIP dp sc integration point temperatures at c current time c TemperIPB dp sc integration point temperatures at c the end of last incremetal step Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 127 Chapter 6 UPF Subroutine
489. splacement vector debugging with displacement pointers 2 provides displacement vector debugging with incremental displacement 3 provides displacement vector debugging with contact database F9 1 provides temporary programmer debugging 5 14 2 2 Element Debug Format Issue the command using this format DEBUG 3 G1 G2 G3 G4 G5 G6 G7 G8 GI G1 1 provides basic element pass debugging G2 1 provides element displacement and coordinate debugging G3 1 provides element matrix debugging and prints matrix load vectors after the element routines 2 provides element matrix debugging with load vectors only after the element routines 3 provides element matrix debugging with matrix diagonals and load vectors after the element routines G4 1 provides element load information debugging G5 1 provides element real constant debugging G6 1 provides element saved variable debugging G7 1 provides element material property debugging with linear material properties 2 provides element material property debugging with nonlinear properties G8 1 2 provides element nonlinear debugging with plasticity 2 provides element nonlinear debugging with large deformation 3 provides element nonlinear debugging with contact database Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 110 of ANSYS Inc and its subsidiaries and affiliates 5 17 Readin
490. st input element data via real constants and code the UserElem F subroutine accordingly 6 1 2 1 Subroutine UserElem Writing Your Own Elements The UserElem subroutine provides an interface to ANSYS code above the element level UserElem supports shared memory and distributed parallel processing however you are responsible for ensuring that your code can use parallel processing The subroutine passes all data needed to create a user defined element and returns all data and results from the element to update the ANSYS database and files With this API you can create virtually any element type without having to access ANSYS database and files directly Two examples are included in this subroutine a 4 node quadrilateral 2 D element and 20 node brick structural element both for geometric linear analysis Key options KEYOPT settings switch the elements The following table shows the input and output arguments and their definition and usage Some argument names such as those pertaining to element matrices and load vectors are common to structural analyses however you can specify argument values appropriate to analyses in other engineering disciplines 116 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API Input I or Output O Definition Purpose
491. stresses defined in model c output arguments ic ensiqr int func out the returned value of ensigr is based on Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 261 Chapter 7 Accessing the ANSYS Database e setting of key 7 7 14 ensget Function Getting an Element s Nodal Stresses deck ensget function ensget ielem value C primary function get element nodal stresses c Notice This file contains ANSYS Confidential information ae input arguments c ielem int sc in element number c output arguments c ensget int func out status of element e 0 element undefined G gt 0 number of nodal stresses e returned o value dp ar out element nodal stresses NOTE Stresses at each corner node in the order X Y Z XY YZ XZ S1 S2 S3 SI SE For solid elements stresses at each corner node For shell elements stresses at each corner node first top durface then bottom For layered elements w KEYOPT 8 20 stresses for first layer at each corner node first at the bottom surface of the bottom layer then the top surface of the top layer Stresses for second layer at each corner node first the bottom surface then the top surface for the layer with the largest failure criteria The second layer is not present if failure criteria were not used or are not appr
492. substep After a load step After solution At the end of an ANSYS run Subroutines USSBeg UTC Beg UIt Fin and USSF in default to reading a command macro file from the current working directory whose name is subroutine mac that is ussfin mac is read by USSFin F No user action to relink the ANSYS program is required for the command macro to be read except that the calling subroutine must be activated by the USRCAL command The design of the command reading ability of these subroutines is limited to APDL parameter setting commands GET SET a value etc and testing for general ANSYS commands is limited Commands which are known to work include DIM STATUS Commands which require another line MSG VWRITE are not allowed Other commands which are known to not work are the solution loading commands D F SFE and so on If these capabilties are required the user will need to create a Fortran subroutine and link this subroutine into ANSYS as described in Chapter 5 Using User Programmable Features UPFs p 99 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 203 Chapter 6 UPF Subroutines and Functions While parameter substitution into commands is not permitted USSBeg and so on were designed to be used in conjunction with dynamic tables and parameter substitution from the user subrou
493. sults Information Routines 7 7 1 dspiqr Function Getting Information About Nodal Results deck dspiqr function dspigr node key C primary function get information about nodal results c Notice This file contains ANSYS Confidential information qgqaqaQqaQqaqaqaa input arguments node key int sc in node number gt 0 return result mask at this node 0 return number of calculated displacements in model int sc in key as to the information needed At this time key should always 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 267 of ANSYS Inc and its subsidiaries and affiliates Chapter 7 Accessing the ANSYS Database c output arguments c dspiqr int func out the returned value of dspigr is based on e setting of key 7 7 2 dspget Function Getting a Nodal Result from the Database deck dspget function dspget node ndf idf value C primary function get a nodal result from the data base c Notice This file contains ANSYS Confidential information e input arguments c node int sc in node number c ndf int sc in number of results requested c idf int ary ndf in reference number for the DOF 1 32 c UX 1l UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY c AZ 9 VX 10 VY 11 VZ 12 c PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 o EMF 25 CURR 26 SP01 27 SP02 28 SP
494. t effective in plane flexibility factor flexo dp sc inout effective out of plane flexibility factor not used for pipel6 or pipel7 output arguments variable typ siz intent description flexi dp sc inout effective in plane flexibility factor flexo dp sc inout effective out of plane flexibility factor not used for pipel6 or pipel 7 OO OOOO OO OOO OOO OO CO CO OO OOO OOOO COO FO OO 6 3 10 Subroutine UsrShift Calculates pseudotime time increment deck USERSDISTRIB subroutine UsrShift dxi dxihalf timinc amp temp dtemp toffst propsh nTerms CER KKKKKKKKKKKKKKKKKKKKK KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK kkk g calculate pseudotime time increment according to a user specified shift function Notice This file contains ANSYS Confidential information ananaa Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 155 Chapter 6 UPF Subroutines and Functions c input arguments c timinc dp sc in time increment c temp dp sc in current temperature t_ntl c dtemp dp sc in temperature increment t ntl tn G toffst dp sc in temperature offset to absolute zero c specified by TOFFST command c propsh dp ar in Constants for shift function e User s input using TB SHIFT USER c nTerms int ar in number of use
495. t Nodal constraint DOF Values are in the same order as the DOF number reference table Nodal constraints This record contains present and previous values real and imaginary of the nodal constraints at each DOF 14 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format qgqaaqaaqaaaqaaaqa anaana aa Q qaqaaqaaa Q qgqaaqaaqaa Q qaqaaa Q Q qaaqaaqaagqagqaaaa FIX FOR TRE OND OEL ESL RCM DMI i T numfor f format Nodal input force DOFs his index is calculated as N 32 DOF here N is the node number and DOF is he DOF reference number Values are in he same order as the DOF number reference able tott HH if format 1 gt Nodal input force node numbers i 1 numfor if format does not exist if format 1 gt Nodal input force DOF Values are in the same order as the DOF number reference table dp 4 numfor Nodal forces This record contains present and previous values real and imaginary of the nodal input force loadings at each DOF dp 28 nnod Two displacement result sets for transient solution in FLOTRAN bit 24 PDTRFL in mask i nnod Ordered node list This record exists for a load case file only a nelm Ordered element list This record exists for a load case file only a 2 nelm Element solutio
496. t dp sc in temperature offset from absolute zero c fluen dp sc in fluence at the end of this substep G dfluen dp sc in fluence increment over this substep e el epel dp ar ncomp inout elastic strain c epcrp dp ar ncomp inout creep strain from previous substep c statev dp ar ncomp 5 2 inout state variables from previous ic converged substep This variable is for e explicit creep only and refers to a different internal variable than that el defined by TB stat which is used by c implicit creep usercreep and usermat c usvr dp ar nuval nintp inout additional state variables from previous equilibrium iteration saved c if the nsvr command is used e e c output arguments c variable type sze intent description e el epel dp ar ncomp inout elastic strain adjusted for creep increment G epcrp dp ar ncomp inout updated creep strain c statev dp ar ncomp 5 2 inout updated state variables G usvr dp ar nuval nintp inout updated additional state variables Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 167 Chapter 6 UPF Subroutines and Functions delcr dp sc out equivalent creep strain increment used for creep ratio calculation fortran parameters to be defined by the user variable type description nuval int number of additional state var
497. t sc in face number for inquire 0 6 face number is needed for key 5 for other values of key iface has different meaning see below int sc in key as to the information needed 1 return flagged surfaces mask for element 5 return number of flagged surfaces for this element face DB NUMDEFINED DB MAXDEFINED return value is based on setting of iface NOTE both DB NUMDEFINED and DB MAXDEFINED produce the same functionality iface 0 return total number of pressures convections etc defined in model 1 6 return number of flagged surfaces defined for this element rec length NOTE only 1 6 is valid but this routine simply checks that iface is in the range The actual value of iface does not matter in this case DB MAXRECLENG return maximum number of flagged surfaces for any element max rec length output arguments efsiqr int func out the returned value of efsigqr is based on setting of key 7 6 39 efsput Subroutine Storing an Element Face Flagged Surface deck efsput subroutine efsput ielem iface nval value C primary function Store an element face flagged surface c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number c iface int sc in face number 1 6 c nval int sc in number of values to put c value dp ar nval in the element flagged surface values G output arguments none 7 7 Re
498. t variable typ siz intent description iel int sein element number ireal int sc in real constant set number ielc int ar in elment type characteristics output arguments nrvr int sc out number of real variables rvr dp ar out element real constants mpg magnetic element usage iel 6 2 10 Subroutine propev Evaluating a Group of Material Properties deck propev c qgqaqaaqa qa Q Q Q0Q0n0n0n0n0nQn0nQonQonQoaoaoaoaooaooonononon subroutine propev iel mtr lp tem prop n primary function to evaluate a group of material properties propev is used to pass two or more material property numbers thru the lp array to determine which temperature dependent material properties are to be evaluated thus the 3 propel calls call propel elem mat 1 tem e 1 call propel elem mat 10 tem alpha call propel elem mat 13 tem dens should be combined as integer 1p 3 data lp 1 10 13 call propev elem mat lp 1 tem prop 1 3 Notice This file contains ANSYS Confidential information input arguments iel int sc in element number mtr int sc in material number input quantity mat mat comma lp int ar n in keys for which specific value is requested each group must be in ascending order ex ey ez etc if negative a required property if zero leave prop term unchanged gt ME command labels EX 1 EY 2 EZ 3 NUXY 4 NUYZ 5 NUXZ
499. t an element c Notice This file contains ANSYS Confidential information Q00n0n0n0n0nn a input arguments ielei int sc in element number 0 all elements ksel int sc in type of operation to be performed 0 delete element 1 select element unselect element 2 invert select status for element output arguments none 7 2 Node Information Routines 7 2 1 ndinqr Function Getting Information About a Node The primary function of ndingr is getting information about a node This function also sets the current node pointer to this node Note Some of the database commands in the input file shown below are in the common block ansys def inc which must be included in the subroutine deck ndingr c kkk c KKK function ndingr node key primary function get information about a node secondary functions set current node pointer to this node c Notice This file contains ANSYS Confidential information Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 218 of ANSYS Inc and its subsidiaries and affiliates 7 2 2 getnod Function Getting a Nodal Point input arguments node int sc in key dp sc in DB_SELECTED ndingr 0 1 pi DB_NUMDEFINED DB_NUMSELECTE DB_MAXDEFINED DB_MAXRECLENG D node number Should be 0 for key 11 DB NUMDEFINED DB NUMSELECTED DB MAXDEFINED and DB M
500. t temperature at material integ ration point nprop 1 O Number of constants to be returned input or actually returned output as follows 2 isotropic elasticity 9 orthotropic elasticity 21 anisotropic elasticity Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 1 of ANSYS Inc and its subsidiaries and affiliates 69 Chapter 6 UPF Subroutines and Functions The value for this argument is ob tained via the TB ELASTIC command and is passed into the subroutine However you can redefine this value in the subroutine which then returns it The material elastic constants to be defined 6 4 4 5 The user_tbelastic API Following is the interface to the user_tbelastic subroutine deck user tbelastic USERSDISTRIB SUBROUTINE user tbelastic elemId matId coords temp amp nprop prop QUNCKCKCKCkCkCKCk kk CKCk Ck KK k Ck KC Ck Ck kk kk KC Sk kk Ck KC Ck Ck Ck ck Ck KKK KK ck kckckckckckckckckckckckckckckckckck ck KKK kk wee primary function user interface for elastic material constants KKKKKKKKKKKKKKKKKKKKKKKKKKKKK Sk Sk Sk kk kk Sk kk Sk kk kk Sk kk kk kk kk kk kk kk ko ko ko ko ko ko ko k ck k kc k ko input arguments elemId in sc pd Element number matId in sc pod Number of material index temp dp sc i Current temperature coords dp ar 5 i Coordinates at initial configuration For continuum elements 1 3 coordinates
501. t the components of vector v to const by increments output arguments v dp ar inc n out vector v e c Notice This file contains ANSYS Confidential information e c input arguments Cc inc int sc in increment first dimension of vector v c n int sc in length second dimension of vector v c const dp sc in constant to set components of vector v to e e a a 8 3 13 vapb Subroutine Setting a Vector to Sum of Two Vectors deck vapb subroutine vapb a b c n C primary function add vector a to vector b to get vector c c Notice This file contains ANSYS Confidential information c input arguments c a dp ar n in a vector c b dp ar n in b vector n int sc in length of vectors a b c c output arguments e dp ar n out c vector es a mpg C A B vector add 8 3 14 vapb1 Subroutine Combining Two Vectors in One deck vapbl subroutine vapbl a b n C primary function add vector b to vector a e and store in vector a e c mpg A A B vector add e 8 3 15 vapcb1 Subroutine Multiplying a Vector to a Constant deck vapcbl subroutine vapcbl a b n const C primary function multiply vector b to constant add to vector a o and store in vector a c C mpg A A c B vector semi linear combination c 294 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of
502. tains ANSYS Confidential information e input arguments c node int sc in node number for inquire Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 233 Chapter 7 Accessing the ANSYS Database e key int sc in c 1 c e e e e c output arguments c disiqr int func out e key as to the information needed return constraint mask DB MAXDEFINED DB NUMDEFINED return number of nodal constraints NOTE both DB MAXDEFINED and DB NUMDEFINED produce the same functionality the returned value of disigqr is based on setting of key 7 5 2 disget Function Getting a Constraint from the Database deck disget function disget C primary function inode idf value get a constraint from the data base in raw form c Notice This file contains ANSYS Confidential information a input arguments c variable typ siz intent description c inode int sc in node number negative value for no c partabeval c idf int sc in reference number for the DOF 1 32 c UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 c AZ 9 VX 10 VY 11 VZ 12 ie PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 c EMF 25 CURR 26 SP01 27 SP02 28 SP03 29 SP04 30 SP05 31 SP06 32 a missing entries are spares c output arguments c disget int func out status of c
503. teger wringr ndingr ndgxyz double precision dpinfun integer user02 iott maxnp i ksel double precision xyz 3 offset 3 xxx start Liming check Coeee call TrackBegin user02 maxnp ndingr 0 DB_MAXDEFINED get the desired offsets from the command line offset 1 dpinfun 2 offset 2 dpinfun 3 offset 3 dpinfun 4 do i 1 maxnp ksel ndgxyz i xyz 1 if ksel eq 1 then Xyz 1 xyz 1 offset 1 xyz 2 xyz 2 offset 2 xyz 3 xyz 3 offset 3 call ndpxyz i xyz 1 endif enddo write to output file iott wrinqr WR OUTPUT write iott 2000 2000 format NODE OFFSET COMPLETE 6 7 3 Function user03 Demonstrates Using ANSYS Memory write to GUI window call erhandler user02 3000 x 2 NODE OFFSET COMPLETE 0 0d0 required return value user02 0 end timing check call TrackEnd user02 return end deck user03 user function user03 C primary function user routine number 03 Gives example of c ANSYS Memory usage c copyright c 2006 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 96 of ANSYS Inc and its subsidiaries and affiliates 6 7 3 Function user03 Demonstrates Using ANSYS Memory Q aa
504. tem in header is described below fun04 negative of the unit number 4 neqn number of equations on file nmrow number of active DOF neqn BC nmatrx number of matrices on file kan analysis type wfmax maximum row size lenbac number of nodes numdof number of dofs per node ntermKl ntermKh number of terms in Stiffness matrix lumpm lumped mass key 0 default matrix type 1 lumped ntermK pre 8 1 this is the number of terms in Stiffness matrix otherwise this value must be 0 and ntermkKl ntermkKh must be used keyuns unsymmetric key 0 no unsymmetric matrices on file 1 there is at least one unsymmetric matrix on file extopt mode extraction method 0 reduced lumped unsymmetric Lanczos damped Lanczos block Lanczos QRdamped SuperNode 9 PCG Lanczos keyse superelement key set if at least one superelement sclstf maximum absolute stiffness matrix term ll o 050np nxrows the maximum rank for this solution ptrSTFl h pointer to Stiffness matrix ncefull number of CE CP equations ptrEND1 low part of 64 bit end of file ptr ptrENDh high part of 64 bit end of file ptr ptrIRHSl h pointer to imaginary RHS F ptrMAS1 h pointer to Mass matrix ptrDMPl h pointer to Damping matrix ptrCEl h pointer to Gt and g matrices nNodes number of internal Nodes considered by symbolic assembly ntermMl h number of terms in Mass matrix
505. temperatures ndat int sc in number of data points per element dat dp ar ndat inout fluxes output arguments variable typ siz intent description dat dp ar ndat inout fluxes the input argument dat may be used in one of three ways 1 they may be simply passed thru 2 they may be used as a flag e g if dat 2 3 0 use a certain set of logic 3 they may be completely ignored and instead redefined with new logic QQ cQ Q cQ cQ cQ cQ 9 cQ Q9 9qQ qq c9 qQ Q9 9 9 Q9 9 9 Q9 Q9 Q9 Q9 Q9 Q9 Q0 Q0 Q0 Q Q0 6 5 6 Subroutine userfd Computing the Complex Load Vector for Frequency Domain Logic deck userfd USERSDISTRIB subroutine userfd nr kcbrm kpfor ktrsur isur x Cb do doext aread alenv denswat faclen conac fluidt visc x watbas watcur watwav xyzup tr accel puvel u zass x forl zsc zsc2 pdyn holdwv C primary function compute complex load vector for frequency domain logic c for pipe59 C secondary functions none c accessed with keyopt 12 2 o c copyright c 2006 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 82 of ANSYS Inc and its subsidiaries and affiliates 6 5 7 Function userpe Calculating Rotation Caused by Internal Pressure nr kcbrm kpfor ktrsur isur cb do doext aread alenv denswat
506. tems in this record is element dependent See the description of item LBFE in the Output Data section for the particular element in the ANSYS Elements Reference NOTE See ENS record section for definition of terms NL nodstr and nodfor 1 nsurf 19 Element surface stresses The length of this record is nsurf 19 where nsurf is the number of surfaces that have surface stress information The stress information is simply repeated in the format shown below for each surface For 2d elements facenm area temp press eppar epper epz 0 0d0 spar sper sz 0 0d0 0 0d0 0 0d0 s1 s2 s3 sint seqv For 3d elements facenm area temp press epx epy epz epxy SX Sy SZ sxy 0 0d0 0 0d0 sl s2 s3 sint seqv For axisymmetric elements facenm area temp press eppar epper epz epsh spar sper sz 0 0d0 0 0d0 ssh sl 82 S3 sint seqv each item is described below facenm face number area face area temp face temperature press face pressure epx strain parallel to face epy strain parallel to face epz strain perpendicular to face epxy shear strain eppar strain parallel to face epper strain perpendicular to face epsh torsion shear strain Sx stress parallel to face sy stress parallel to face SZ stress perpendicular to face SXy shear stress Spar stress parallel to face sper stress perpendicular to face Release 12 0 2009 SA
507. ter 6 UPF Subroutines and Functions 4 2 D and ordered as x y z Xy 6 3 D and ordered as x y z Xy yZ XZ Number of direct component of stress strain tensors nDirect lt or nTens Specifying the data size UserElem subroutine Current integration point num ber Output Data handling UserE subrouti Coordinates of current integra tion point Values in global Cartesian co ordinate system Material calculation a UserElem subroutine TemperIP Integration point temperatures at the current time Evaluating temperat ure dependent materi al data UserElem subroutine TemperIPB Integration point temperatures Evaluating temperat UserElem at the end of the lastincrement ure dependent materi subroutine al step al data IncStrain Strain components 7 p 127 Material calculation UserElem Incremental strain of the cur subroutine rent substep when nlgeom on Total strain when nlgeom off defGO Deformation gradienttensorat Material updating UserElem the end of previous substep 7 subroutine defG 1 0 Total deformation gradient The component in UserElem tensor at the current time 1 thickness direction is subroutine updated by material subroutines for plane stress and shell ele ments kTherm 1 0 Thermal loading key Thermal load calcula UserElem tion subroutine 0 No thermal l
508. the e lement type description record Oe ooo ooo The items stored in each record mat type real secnum esys death solidm shape elnum 0 NODES CY 22 Qc 2Q each item is described below Q mat material reference number type element type number real real constant reference number Secnum section number esys element coordinate system death death flag 0 alive 1 dead solidm solid model reference shape coded shape key elnum element number NODES node numbers defining the element See the ANSYS Elements Reference for nodal order of an element C1 Qe QE ELI QR See E MO OE EL Oe a le MAS dp 1 nnod numdof Diagonal mass matrix c The solution information is stored starting at this point in the file c The remaining records on the file are repeated as a group nsets times c once for each data set Item nsets is defined in the file header c Each set of data is pointed to by a record pointer given in the record e labeled DSI el i 1 200 Solution data header was 100 in 32 bit pv3num nelm nnod mask itime iter ncumit nrf cs_LSC nmast ptrNSL ptrESL ptrRF ptrMST ptrBC rxtrap mode isym kcmplx numdof DOFS positions 51 70 title positions 71 90 stitlel dbmtim dbmdat dbfncl soltim soldat ptrOND ptrOEL nfldof ptrEXA ptrEXT 01 102 ptrEXA was in 99 03 104 ptrEXT was in 100 05 106 ptrNSL was in 11 07 108 ptrRF was in 13 09 110 ptrMST
509. the matrix Indicates positions and values of terms to be reduced The length of this record will vary actual length is returned from routine BINRD8 index i i 1 n for compressed rows Stiffness matrix If keyuns 0 this record will contain the non diagonal terms of this column the diagonal term itself followed by the normalized F term If keyuns 1 this record will contain the non diagonal terms of this column the diagonal term itself the non diagonal terms of this row followed by the normalized F term If lumpm 1 then the mass for this node is located after the F term The length of this record will vary actual length is returned from routine BINRD8 krow i i 1 n vload mass symmetric n 1 column diag n 1 row load dmass unsymmetric Mass matrix This record exists only if rmatrix gt 1 If keyuns 0 this record will contain the non diagonal terms of this column the diagonal term itself followed by the normalized F term If keyuns 1 this record will contain the non diagonal terms of this column the diagonal term itself followed by the non diagonal terms of this row The length of this record will vary actual length is returned from routine BINRD8 mrow i i 1 n symmetric n 1 column diag n 1 row unsymmetric If lumpms 1 this record contains one double array with diag values Damping matrix This record exists only if nmatrx 2 If keyuns 0 this record will contain
510. the non diagonal terms of this column the diagonal term itself followed by the normalized F term If keyuns 1 this record will contain the non diagonal terms of this column the diagonal term itself followed by the non diagonal terms of this row The length of this record will vary actual length is returned from routine BINRD8 cegn i i 1 n symmetric n 1 column diag n 1 row unsymmetric SSR tigre a Se ee cust ics symbolrc assembled ile Sses cols see eee Sees Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 47 Chapter 1 Format of Binary Data Files Qu Sa i 1 80 FULL FILE HEADER e e fun04 negn nmrow nmatrx kan e wfmax lenbac numdof ntermKl ntermkh e lumpm nmrow ntermk keyuns extopt e keyse sclstf nxrows ptrSTFl ptrSTFh e ncefull ntermMh ptrEND1 ptrENDh ptrIRHSIl e ptrIRHSh ptrMAS1 ptrMASh ptrDMPl ptrDMPh e ptrCEl ptrCEh nNodes ntermMl ntermDl o ptrDOFl ptrDOFh ptrRHSl ptrRHSh ntermDh c ngMaxNZ ptrNGPH1 ptrNGPHh minKdiag maxKdiag el minMdiag maxMdiag minDdiag maxDdiag ngTerml e ngTermh ngTermCl ngTermCh ptrDiagKl ptrDiagKh e ptrDiagMl ptrDiagMh ptrDiagCl ptrDiagCh ptrSclKl c ptrSclKh Glbneqn distKey ngTermFl ngTermFh e GlbnNodes GlbnVars GlbfACCE lcAcLen G1bfCE e 0 0 0 0 0 e 0 0 0 0 0 c each i
511. the element in nonlinear integration point data always will be written An element is considered nonlinear when either plastic creep or swelling strains are present See item rxtrap in the solution header for the setting For beam elements see item LEPTH in the description of the Output Data section for the particular element in the ANSYS Elements Reference NOTE See ENS record section for more details on record content and length Element Euler angles This record contains the Euler angles THXY THYZ THZX For lower order elements angles are at the centroid and the number of items in this record is 3 For higher order elements angles are at each corner node and the number of items in this record is nodstr 3 For layered shells higher order layered Solid elements and layered SOLSH190 and SOLID185 angles are at each corner node plus the layer orientation angle for each layer The number of items in this record is nodstr 3 NL For other lower order layered solid elements Euler angles are at the centroid plus the layer orientation angle for each layer Therefore the number of items in this record is 3 NL NOTE See ENS record section for definition of terms NL and nodstr Element nodal field fluxes This record contains the fluxes at each corner node in the order X Y Z If this is a coupled field analysis the flux data is Stored in the following order thermal electric magnetic Nodal order corr
512. the verical acceleration pdynam pdynam denswat accel 3 x eti wvhybl 0 rk de facdep rkd c cosh rk de facdep cosh rkd c compute particle velocities e LAAK VE radial velocity c yxyz 3 vertical velocity vr vr cs tpt eti vxyz 3 vxyz 3 ss etidot c compute particle accelerations 188 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accelerations e first compute derivatives of cs and ss ar ar tpt cs etidot axyz 3 axyz 3 tpt ss eti tpt enddo phead pdynam accel 3 denswat tothead phead xyzg 3 if tothead lt 0 0d0 then dperr 1 tothead dperr 2 xyzg 3 call erhandler userPartVelAcc 5000 2 x The ocean wave theory gives a negative water pressure head x G at vertical coordinate G under the wave crest This x may be because the input wave length is too small x dperr 1 endif e compute x and y components of radial velocity and acceleration VXyZz 1 vr cswav 1 vxyz 2 vr cswav 2 axyz 1 ar cswav 1 axyz 2 ar cswav 2 e adjust for currents here return end 6 5 12 1 Subroutine userPartVelAccSetup Initializing Data for Use by the user PartVelAcc Subroutine This subroutine initializes the data for the userPartVelAcc subroutine deck userPa
513. this command prompt window issue the drive letter and all the necessary cd commands to move to the directory where the customized files exist example C NProgram Files Ansys Inc V120 ansys custom user Type ANSCUST in this command window The process of creating the new user customized ANSYS version will begin After relinking the ANSYS executable the program can be executed by either of the following two methods 1 To execute the relinked version of the ANSYS program Click Start gt Programs gt ANSYS 12 0 gt Mechanical APDL Product Launcher n the launcher select the Customization Preferences tab then browse to the path which contains the relinked ansys exe Select other desired options then pick Run to execute the customized ansys exe To execute the relinked ansys exe from a Command Prompt window use one of the following commands Interactive ansys120 p product variable g custom path e Batch ansys120 b p product variable j jobname i lt input file o output file custom path where path indicates the full path to the relinked ansys exe Note The commands above are for the SMP version of ANSYS Consult the Distributed ANSYS manual for instructions on running Distributed ANSYS 106 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 5 12 Running Your Cus
514. this element type This is a bit mapping of the DOF node Item 61 number of nodes for this element type nodelm Item 63 number of nodes per element having nodal forces etc nodfor Item 94 number of nodes per element having nodal stresses etc nodstr This number is the number of corner nodes for higher ordered elements Real constants index table The record contains record pointers for each real constant set Relative to ptrRELL for 64 bit version Element real constant data These records contain real constant data used for the elements See the ANSYS Elements Reference manual for values for a specific element Each of these records is pointed to by a record pointer given in the record labeled REL The length of these records varies for each element type actual length is returned from routine BINRD8 Coordinate systems index table This record contains the record pointers for each coordinate system set The ANSYS program writes coordinate systems only if local coordinate systems were defined If a local System was defined the predefined global systems 1 to 2 also will be written The global Cartesian system 0 will never be written Relative to ptrCSYSL for 64 bit version Coordinate system description These records contain coordinate system data for each coordinate system defined Each of these records is pointed to by a record pointer given in the record labeled SYS The items s
515. tice This file contains ANSYS Confidential information ae input arguments c variable typ siz intent description c ielem int sc in element number c nval int sc in the total number of values e NOTE There may be a maximum of 3 sets of a nodal forces in the record static c forces inertia forces and damping forces c value dp ar nval in element local nodal forces c output arguments none 7 7 52 elfdel Subroutine Deleting Element Local Forces deck elfdel subroutine elfdel ielem C primary function delete element local forces c Notice This file contains ANSYS Confidential information amp input arguments ielem int sc in element number amp 0 delete for all defined elements GC output arguments none 7 7 53 emniqr Function Getting Information About Element Miscellaneous Non summable Data deck emniqr function emnigr ielem key c primary function get information about element misc non summable e data c Notice This file contains ANSYS Confidential information e input arguments cS ielem int sc in element number or zero see below e key int sc in key as to the information needed amp 1 return info about element misc non summed data e ielem 0 return number of data items on this e element e record length e 0 return maximum number of data items e on any element s max record length G DB NUMDEFINED retur
516. ties Program in UserMat No special programming has been set up Existing nonlinear mater ial properties All ANSYS standard structural materials are accessible via ElemGetMat Limited capability Accessible via plastx creepx and swellx Non structural material properties No special programming has been im plemented No special programming has been im plemented Number of different ele ment types allowed Effectively no limit Effectively no limit Element characteristic capability Inputthe basic 10 element characterist ics via the USRELEM and USRDOF commands All other characteristics default automatically Input all 140 element characteristics using uec100 Approximately 30 are normally used and the rest default un less required for special cases Applicable subroutines to be programmed UserElem ueci00 uell00 andrarely uex100 and uep100 Subroutines uec101 to uec105 are analogous Access to database in formation Generally through the interface Through subroutines such as tmpget prsget svgidx svrget svpidx svrput Access to file information Through the interface Through pointers and subroutines such as eldwrtL eldwrnL Special features Element convergence criteria Cutback control via element None Capabilities not included Control information unavailable for Birth and death Superelement stress pass Initi
517. timization Before you start programming ask yourself these questions Does the capability you want already exist in the ANSYS program Remember a capability may not be obvious at first especially to a novice ANSYS user Does your proposed subroutine fit into the ANSYS program architecture and specifications For example you can not program a user element that has more than 32 degrees of freedom per node Use your experience and judgment to answer these questions If you need help to do so consult your ANSYS Support Distributor If you can respond no to both questions then the user routine you are planning will be both useful and feasible 5 4 Studying the ANSYS User Routines Your ANSYS distribution medium contains the source codes for all user routines If you are running the ANSYS program under UNIX Linux the source code for the UPF routines resides in directory ansys inc vi20 ansys customize user f you are running the ANSYS program under Windows the source code for the UPF routines resides in directory Program Files Ansys IncNVi20NansysNcustomizeNuserN Most of the user routines have at least simple functionality so print out the routines of interest before you start programming All source routines are concatenated onto file user f or user for Delete the routines you do not want and make appropriate changes to the others 5 5 Programming in Languages Other than Fortran If you access UPFs by compiling a
518. tine As an example consider an ANSYS table defined as d5 f par1 If d5 contains values of displacement as a function of PAR1 then d5 may be used as a constraint as dim d5 table 10 1 1 PAR1 d5 1 250 1 25 solu d 5 ux d5 Modify the value of PAR1 in USSBeg MAC and the constraint on node 5 ux can then be modified in the middle of a load step The following is an example of a valid input that may be read by USSBeg UItBeg UItFin and USSFin COM SAMPLE ussfin mac a 5 b nx 1 get function is ok get c active solu Time cpu get is ok dim array 6 array parameters are ok array 1 array 2 array 3 array 4 array 5 array 6 vleng 3 vector operations are ok vfun array 4 copy array 1 stat stat array 1 array 1 nnode ndinqr 0 14 dim array nnode vget array 1 NODE 1 NSEL stat array 1 array 1 eof DOF WNP COM COMMANDS BELOW THIS LINE ARE KNOWN TO NOT WORK p 1 6 2000 commands DO NOT work G l u0y 1l msg note THIS IS A TEST MESSAGE vwrite array 1 b 10 4 6 10 Creating Your Own Optimization Subroutine One way to customize the ANSYS program for your site s specific needs is to substitute your own external optimization for the standard ANSYS optimization algorithm You can do so by linking a user subroutine within the ANSYS program You can find additional information on design optimization techniques and procedures in the
519. tine usersw Writing Your Own Swelling Laws epeq plwork variable epel eppl statev usvr epeq plwork sigepl sigrat depeq dt variable numinp nuval nintp note variable b c con deppl dfds dlamb ep epshfo epshft et n2 seqtr sigtr sigy vect Q0000000000n00000nn0n0n0n0n0n0nnonnoooaoaoaoaoaoaoaoaoaoaoaoaoaoaoaooaoaooaoooooooononononon fortran parameters dp sc inout dp sc inout output arguments previous equilibrium iteration saved if the nsvr command is used effective plastic strain from prev substep accumulated plastic work from prev substep type sze intent description dp ar ncomp inout elastic strain dp ar ncomp inout updated plastic strain dp ar ncomp 6 inout updated state variables dp ar nuval nintp inout updated additional state variables dp sc inout dp sc inout dp sc out dp sc out dp sc out updated effective plastic strain updated accumulated plastic work stress value on stress strain curve at epeq ratio of trial stress to yield stress increment in plastic strain equivalent used for auto time stepping time step is reduced if it exceeds 05 dp ar ncomp ncomp out material tangent modulus type int int int nuval x nintp internal variables to be defined by the user description number of data items in the user defined data table tbdat commands number o
520. tine usrefl Changing Scalar Fields to User Defined Values sessss 178 6 5 2 Subroutine userpr Changing Element Pressure Information ssessseccceeeeeseeessneeees 179 6 5 3 Subroutine usercv Changing Element Face Convection Surface Information 180 6 5 4 Subroutine userfx Changing Element Face Heat Flux Surface Information 181 6 5 5 Subroutine userch Changing Element Face Charge Density Surface Information 182 6 5 6 Subroutine userfd Computing the Complex Load Vector for Frequency Domain Logic 182 6 5 7 Function userpe Calculating Rotation Caused by Internal Pressure 183 6 5 8 Subroutine UsrViscEl Performs Viscoelastic Computation cceseeeccceeeeseessttteeeeeeeeess 184 6 5 9 Subroutine usrsurf116 Modifying SURF151 and SURF152 Film Coefficients and Bulk Tem peratures iones erento tert qe ge tr ode dance TRE Ss tow NER A ee ERIS erede e ERR RUN 184 6 5 10 Subroutine User116Cond Computing the conductance coefficient for FLUID1 16 186 6 5 11 Subroutine User116Hf Computing the film coefficient for FLUID116 186 6 5 12 Subroutine userPartVelAcc Computing Particle Velocities and Accelerations 187 6 5 12 1 Subroutine userPartVelAccSetup Initializing Data for Use by the userPartVelAcc STOUNE ITI I Tc 189 6 5 12 2 Subroutine userWavHt
521. ting 232 getting information about 232 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 323 Index storing 233 Constraints deleting at a node 235 getting from the database 234 235 getting information 233 storing at a node 234 258 Contact defining 76 convection loads defining 148 converting nodal data to fixed format data blocks 111 Coordinate system deleting a coordinate system 230 getting a coordinate system 229 getting information about a coordinate system 228 storing a coordinate system 229 Coordinate Systems defining 78 Coupled nodes defining 73 Coupled set getting a coupled set 231 getting information about 230 selecting or deleting 231 storing a coupled set 231 Coupling and constraint routines 230 CP 73 cpget 231 cpinqr 230 cpput 231 cpsel 231 creep1 subroutine 141 creep3 subroutine 142 csydel 230 csyget 229 csyiqr 228 csyput 229 CURVE defining 77 custom optimization subroutine 205 D debugging elements 110 solutions 109 decks 102 Degree of freedom labels customizing 71 Demonstration routines 61 DFLAB 71 disdel 235 disget 233 234 displacement and coordinate debugging 110 displacement values 201 displacement vector debugging 109 disput 234 DOF pointers 102 Double precision vectors 292 dptoch subroutine 285 dspdel 258 dspget 258
522. tion Run deck subrd subroutine subrd iel key nd vect ka primary function read element load data from file for substructure generation run C secondary functions none qa Notice This file contains ANSYS Confidential information a input arguments iel int sc in element number key int sc in type of load data 1 temperature fluences heat generation rates current densities end pressures needed for beams pipes ll oOo B WD 1 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 36 of ANSYS Inc and its subsidiaries and affiliates 6 2 9 Subroutine rvrget Fetching Real Constants for an Element pressures film coefficients bulk temperatures extra displacement shapes thermal strains eptho in e142 thermal flux as in e155 initial strains epino in e101 magnetic virtual displacements calculated source field hsn in el96 element load vector copy do not scale tempev in e142 first load step only nd int sc in number of data items ll Il WN Oooo0 JoU50Nm PO 0000000000000 ll output arguments vect dp ar nd out array of load data ka int sc out load activation key 0 no load for this data 1 load is active 00000 6 2 8 Subroutine subwrt Writing an Element Load Vector to a File for a Sub structure Generation Run deck subwrt subroutine subwrt iel nvect kkey nd vect ref C primary funct
523. tion values c output arguments cS kelout int ar 10 out keys indicating created matrices and e load vectors indices for kelout G are the same as for kelreq below a as well as kelin and kelout later ic Zs dp ar nr nr inout stiffness conductivity matrix kelreq 1 a zass dp ar nr nr inout mass matrix kelreq 2 e damp dp ar nr nr inout damping specific heat matrix kelreq 3 c gstif dp ar nr nr inout stress stiffness matrix kelreq 4 G ZSC dp ar nr out applied f vector kelreq 5 o zscnr dp ar nr out n r restoring f vector kelreq 6 G or imaginary f vector kelreq 7 e elvol dp sc out element volume o elmass dp sc out element mass c center dp ar 3 out centroid location G elener dp ar 5 out element energies c edindxL LONG ar 25 out element result data file indexes c lcerstL LONG sc inout position on result file cas 6 1 3 4 1 Subroutines uel101 through uel105 The input and output arguments for subroutines ue1101 ue1102 ue1103 ue1104 and ue1105 is identical to subroutine ue1100 listed above 6 1 3 5 Subroutine uep100 Printing Output for User Elements in POST1 via PRESOL ELEM deck uep100 USERSDISTRIB subroutine uep100 iott elem nodes mat kept tem x kemn fluen kems force kens sig keel epel x keth eptho epswel epino kenl sigepl sigrat hpres epeq X kepl eppl kecr epcrp G C primary function produce printed output for user100 g
524. tom Executable Note Output from a user linked version will contain the following statement This ANSYS version was linked by Licensee Note You will need all the compilers specified in the Installation and Configuration Guide specific to your operating system to use these user programmable features The user programmable features are loaded onto the system only if you perform a custom installation and choose to install the customization tools 5 11 Activating UPFs The ANSYS program activates many UPFs through a specific user action This can be through a command option or a user selection To activate user elements created using the method described in Creating a New Element via the User Defined Element API p 115 you need USRELEM and USRDOT commands as well as ET and TYPE commands To activate a user element created using the method described in Creating a New Element by Directly Accessing the ANSYS Database p 128 you must select it as one of the element types in a model using the ET command and then set the element attribute pointer using the TYPE command and define elements using the solid modeling or direct generation method To define user material described in Subroutine UserMat Creating Your Own Material Model p 156 Subroutine UserPL Writing Your Own Plasticity Laws p 171 Creep Subroutine UserCreep p 165 and Subroutine usersw Writing Your Own Swelling Laws p 173 you need to activate them with
525. tor in seconds LOTRAN film coefs volume for VOF for FLOTRAN analysis position not used Linear acceleration terms Angular velocity Angular acceleration Angular velocity about the center of gravity positions 23 25 Angular acceleration about the center of gravity positions 26 28 Center of gravity location if pmeth 1 positions 31 100 P convergence values if pmeth 0 positions 51 100 Load data position 53 Convergence key substep Header extension if ptrEXA ptrEXT if 1 converged then ptrEXA is unused positions 1 320 DOFs positions 33 64 current extra Flotran for this set current extra Flotran DOF labels for this set Extra Flotran DOF COND 4 ECON 5 EMD1 12 EMD2 13 PCOE 20 MACH 21 CMUV 28 VISC 2 LMD5 10 PTOT 18 TAUW 26 EVIS 3 LMD6 11 TIOT 19 SPHT 27 1 200 Header extension reference numbers are LMD1 6 EMD3 14 STRM 22 LMD3 8 EMD5 16 HF LM 24 LMD2 7 EMD4 15 HF LU 23 KKKKKKKKKKKKKKKKKKKKKKKKK 12 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 1 2 3 Results File Format Q0Q000000000000800n0n0n00n00n0008n0n n0nn0o0noqooaoaooaoanoaooaoonononononn qQaaqagqagagqagagqagagqagqaaaa qaaqaaa NSL VSL dp dp 1 nnod Sumdof 1 nnod numvdof positions 1 32 current D
526. tored in each record Items 1 9 are the transformation matrix Items 10 12 are the coordinate system origin XC YC ZC Items 13 14 are the coordinate system parameters PAR1 PAR2 Items 16 18 are the angles used to define the coordinate system Items 19 20 are theta and phi singularity keys Item 21 is the coordinate system type 07 1 2r er 3 Item 22 is the coordinate system reference number This group contains the node number and coordinates in the order Node X Y Z THXY THYZ THZX for each node 32 bit version 64 bit version Node X Y Z THXY THYZ THZX for each node Nodes are in node number order Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 9 Chapter 1 Format of Binary Data Files EID EM 1 nelm Element descriptions index table This record contains the record pointers for each element description LONGINT 2 nelm for 64 bit version relative to ptrEIDL The order of the elements is the same as the order in the element equivalence table CY cQ i a Quo m i nelm 10 nodelm Element descriptions Each of these records is pointed to by a record pointer given in the record labeled EID The length of these records varies for each element actual length is returned from routine BINRD8 nodelm shown here is the number of nodes for this element Its value is defined in
527. total accumulated swelling strain after this substep epel dp ar ncomp inout elastic strain adjusted for swelling increment usvr dp ar inout updated user defined state variables 6 4 7 Subroutine userck Checking User Defined Material Data none deck userck USERSDISTRIB subroutine userck curmat ntb tb c primary function check the user defined material data c input with the TB user command C secondary functions none ae c copyright c 2006 SAS IP Inc All rights reserved c ansys inc c Notice This file contains ANSYS Confidential information a c input arguments c curmat int sc in current material number c ntb int sc in dimension of tb c tb dp ar ntb in input table ae C output arguments a ae 6 4 8 Subroutine UserVisLaw Defining Viscosity Laws deck UserVisLaw X XX XXX subroutine UserVisLaw dudx dudy dudz dvdx dvdy dvdz dwdx dwdy dwdz U V W X Y Z kGeom Vis Temp Tref Pres Pref Cf MFrac DfNSpec Time VisNew toffst 174 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 4 9 Subroutine userfric Writing Your Own Friction Laws hj E 4 jyy oO variable dudx dudy dudz dvdx dvdy dvdz dwdx kGeom Vis Temp Tref Pres Pref Cf Mfrac DfNSpec Time toffst variable VisNew Q0000000000000000000000000000000
528. total number of iterations done during analysis kan analysis type 6 reduced harmonic nmUsed number of modes used in mode superposition nvect number of generated loads in mlv DSPfmt O physical disps ne 0 modal coords minmod smallest mode number used modlstp multiple load step key ptrDOF pointer to degree of freedom set Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 27 Chapter 1 Format of Binary Data Files o used in model e ptrDNC pointer to nodal constraints c ptrSTF pointer to the reduced stiffness e matrix c ptrMAS pointer to the reduced mass matrix c ptrDMP pointer to the reduced damping C matrix or mode shapes c ptrFRQ pointer to the frequencies Cc ptrDSP pointer to the calculated c displacements e ptrSTFh High part of STF pointer el ptrMASh High part of MAS pointer e ptrDMPh High part of DMP pointer el ptrFROh High part of FRQ pointer e ptrDSPh High part of DSP pointer c 0 position not used Qm i 1 numdof Degrees of freedom per node e curdof i i 1 numdof e dof reference numbers are e UX UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 c AZ VX 10 VY 11 VZ 12 13 18 are spares x c TO kk PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 c EMF 25 CURR 26 ckckckck ck ck kk 27 32 are spares Dk ck ck ck ck ck ck ck ck
529. trains for each layer at each corner node first at the bottom surface then the top surface For beam elements the contents of this record is element depenent See LEPEL item of ETABLE command 7 7 27 eelput Subroutine Storing an Element s Nodal Elastic Strains deck eelput subroutine eelput Go primary function ielem nval value store nodal elastic strains at an element c Notice This file contains ANSYS Confidential information c input arguments o ielem int sc in element number c nval int sc in the total number of values e 6 nnod nface ol value dp ar nval in nval strain values c output arguments none amp NOTE Strains at each corner node in the order c X Yy Z X Yzy XZ c For solid elements strains at each o corner node G For shell elements strains at each Ge corner node first top durface then c bottom Gc For layered elements w KEYOPT 8 0 c strains for first layer at each o corner node first at the bottom surface of the bottom layer then the c top surface of the top layer e Strains for second layer at each Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 267 Chapter 7 Accessing the ANSYS Database not appropriate the top surface 0 05006 OM 0900 Oa C 7G Ova item of ETABLE command corner node first the b
530. twav dp ar in water wav table G nw int sc in number of waves e c output arguments e eta dp sc out wave height initialized before entering c this routine G etadot dp sc out time derivative of wave height e include impcom inc include ansysdef inc include sectionsize inc external wvargu e integer ktyp nw iw in kwav kmf kpeak double precision wvargu x xyzg 3 doext depth watwav eta etadot X r con ao argu tpt iw ktyp depth depth c user programmable wave height like airy con DTORAD watwav 12 r cos con xyzg 1 sin con xyzg 2 kwav nint watwav 11 must be 10 or greater kwav kwav kmf nint watwav 15 kpeak nint watwav 13 etadot 0 0d0 do iw 1 nw in ptr Layer 4 iw 1 1 argu wvargu kpeak kmf watwav in r doext ao watwav in 0 5d0 eta eta ao cos argu tpt DPPI2 watwav in 1 etadot etadot ao tpt sin argu enddo return end Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 191 Chapter 6 UPF Subroutines and Functions 6 5 12 3 Subroutine wvhybl The wvhyb1 subroutine computes the ratio of two hyperbolic functions and is intended for use with wave loading It is a utility subroutine called by the userPartVelAcc subroutine deck wvhybl parallel function wvhybl kclass x y primary function to compute
531. ubroutines is done properly in your custom version Fortran Besides knowing how to write Fortran subroutines you must be sure that the level of the Fortran compiler is as least as high as the level mentioned in your ANSYS installation manual For more inform ation on Fortran compilers please refer to the ANSYS Installation Guide specific to your operating system You also need to know what to do should the computer abort the program due to an arithmetic error a file read error a memory access error and so on The mathematics of the phenomenon you are planning to include Important UPFs are not available or will behave unpredictably in certain data center environments or on some hardware configurations You should take special care when using UPFs on parallel systems It is a good practice to verify your coding with single processing by using the np 1 option before you run your analysis For additional information consult your ANSYS installation manual or your on site ANSYS system support person Carefully consider whether you wish to use UPFs especially if you are linking them into ANSYS rather than into a shared library for use as external commands When you add your own routines to ANSYS by either method you are creating a customized site dependent version of the program ANSYS Inc 100 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiari
532. ubst ieqitr timval keyEleErr keyEleCnv eStiff eMass eDamp eSStiff fExt fInt elVol elMass elCG nRsltBsc RsltBsc nRsltVar RsltVar nElEng elEnergy m m m m m mmm SM SM SM SM SI KH amp CER KKK Ck kk Ck ck kk kkk kkk kkk k k k KKK KK KKK KKK ck ck kckck ck kck ck k k k k k k k k k k k k k k k k k k KK KKK KKK G C Primary function General User Element Subroutine c Note c This routine is completed with an example see more details later c Notice This file contains ANSYS Confidential information c G PROGRAMMER SHOULD NOT CHANGE ANY PURE INPUT ARGUMENTS marked by in c elId int sc in element number c matId int sc in material number of this element e keyMtx int ar 10 in matrix and load vector form requests e 0 not requested 1 requested see below for more details lumpm int sc in mass matrix format Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 122 of ANSYS Inc and its subsidiaries and affiliates 6 1 2 Creating a New Element via the User Defined Element API qQaaqaqaagqangqagangqagaagaagaaagaaagqaaagaaanaaaanaagnqaagnaaanaaaanaadnqaadgnqaanaanaaanaaagnaadnqadqagdgaaagaagaadgnqaadgqaaagaaaanaagnaadgqadqaaaa nDim nNodes Nodes nintPnts nUsrDo kEStre keyAnsMat keySym f ss nKeyOpt KeyOpt temper temperB tRef kTherm nPress Press kPress nReal RealConst nSaveVars
533. uct c w At v if nr gt 0 c w w Atv if nr lt 0 8 4 4 matxv1 Subroutine Multiplying a Vector by a Full Transposed Matrix deck matxvl subroutine matxvl a v nr nc C primary function multiply vector by full transposed matrix 298 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 8 4 6 maat Subroutine Changing a Matrix Value via Addition Multiplication and Transposition c Notice This file contains ANSYS Confidential information c input arguments a a dp ar nr in matrix a c V dp ar nr inout vector v e nr int sc in number of rows in matrix un transposed is nc int sc in number of columns in matrix un transposed e nc limited to 60 C output arguments e v dp ar nc inout product stored in vector v c mpg A nr nc matrix transpose vector product e V A v max 60 nc 8 4 5 matxb Subroutine Transposing a matrix deck matxb subroutine matxb a b c na nb nc n1 n2 n3 eG primary function a t b oc t means transpose c Notice This file contains ANSYS Confidential information c input arguments Ge a dp ar na in matrix a e b dp ar nb in matrix b c na int sc in number of rows in matrix a c nb int sc in number of rows in matrix b c nc int sc in number of rows in matrix c
534. ul Commands isisisi eeii dp Cn ree pala ec bee Re E RR 111 5 16 Generating OULPUl rn ne trm e nera a eR ENESE EE ERE SEESE EEE EES Eea 111 5 17 Reading Large Data Files More Rapldly iusaer ios uos Y tert aate Eier ee Urine as de pede ipsia 111 6 UPF Subroutines and Functions ccccccccessssssnncceceecesesessnneeeeeceecesseessnaaeeeeeceseeeesnnaeeeeeeseseees 113 Gal amp reatitig a New Element rore Pho eo ole GRAM PEU P a le exe riv Op aa bn 113 6 1 1 Input and Output Abbreviations eeesssssssseseseeeeeeeeenne eene eene nennen nennen ener nennen 115 6 1 2 Creating a New Element via the User Defined Element API eene 115 6 1 2 1 Subroutine UserElem Writing Your Own Elements cccccccsssssstscseeeeeeeeseessanees 116 6 1 2 2 Subroutine ElemGetMat Calling the ANSYS Standard Structural Material Library 125 6 1 3 Creating a New Element by Directly Accessing the ANSYS Database ess 128 6 13 1 0 ser S HDEODICIM SS roscerseucd tuvidvrtve Nano EU era pH tdi dudo ode ulis ead uus eate ruota td 128 6 1 3 2 Subroutine uec100 Defining Characteristics of the usr100 Subroutine 129 6 1 3 2 1 Subroutines uec101 through uec105 eeeeeeeeeeeeeeeeeeeenenee nennen 129 6 1 3 3 Subroutine uex100 Overriding Element Characteristic Defaults 130 6 1 3 3 1 Subroutines uex101 through uex105
535. uld be zero for key DB NUMDEFINED or DB MAXRECLENG iface int sc in face number for inquire 0 6 face number is needed for key 5 for other values of key iface has different meaning see below key int sc in key as to the information needed 1 return pressure mask for element 5 return number of pressures for this element face DB NUMDEFINED DB MAXDEFINED return value is based on setting of iface NOTE both DB NUMDEFINED and DB MAXDEFINED produce the same functionality iface 0 return number of surface loads defined 1 6 return number of pressure loads defined for this element NOTE only 1 6 is valid but this routine simply checks that iface is in Q000000000000000000000000000Q the range The actual value of iface does not matter in this case DB MAXRECLENG return the maximum number of element pressures on any element max record length c output arguments c epriqr int func out the returned value of eprigr is based on e setting of key 7 6 2 eprget Function Getting an Element Face Pressure deck eprget function eprget elem iface value C primary function get an element face pressure c Notice This file contains ANSYS Confidential information ad input arguments a elem int sc in element number negative value for e no partabeval a iface int sc in face number 1 68 c output arguments iS eprget int func out status of element G 1 ele
536. ults 202 reading for a substructure generation run 136 load steps accessing program logic 203 containing information about 102 load vectors 130 accessing 152 Loads defining 78 loads 99 computing complex load vector 182 convection 148 customizing 178 debugging 110 heat generation 148 pressure 148 temperature 147 LOCAL 81 Local coordinate system defining 81 M M 82 maat subroutine 299 32 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information 8 of ANSYS Inc and its subsidiaries and affiliates Index Master degree of freedom defining 82 matba subroutine 300 material linear elastic properties defining 168 material properties 99 checking user defined data 174 customizing 156 debugging 110 modifying orientation of 151 nonlinear information 144 Material properties deleting a material property table 227 getting a material property table 226 getting information about a material property 225 storing a material property table 226 Material property data table defining 82 materials defining material linear elastic properties 168 user defined creating 156 matrix debugging 109 Matrix changing a matrix value 299 filling upper triangle from lower triangle 300 multiplying a vector by 297 multiplying a vector by full transposed 298 subroutines 297 transposing 299 transposing symmetric 300 value updating via transposition multiplic
537. umber of variables on NSVR commands Use userou F to save these values on NMISC record for output purposes fdiss dp sc out incremental frictional dissipation per unit area elener dp sc out incremental elastic stored energy fortran parameters variable type per unit area to be defined by the user nuval int nintp int note nuval x nintp internal variables variable type sze mu dp sc dtfac dp sc taulim dp sc taueq dp sc dirl dp sc dir2 dp sc dslipeq dp sc oldti dp sc oldt2 dp sc as description number of additional state variables per integration point maximum number of integration points of an element to be used with this routine 14 is the maximum nstv on nsvr command cannot exceed 840 description friction coefficient temporary variable limit frictional stress equivalent frictional stress Slip increment direction 1 Slip increment direction 2 equivalent slip increment frictional stress 1 from prev substep frictional stress 2 from prev substep Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 177 Chapter 6 UPF Subroutines and Functions c eldslip dp ar 2 elastic slip increment err dp ar 2 data array for diagnostic message a 6 4 10 Supporting Function egen The function egen kcomp ep nuxy function combi
538. ussion on the function wrinqr in Chapter 8 Subroutines for Users Convenience p 285 for more details 5 17 Reading Large Data Files More Rapidly When files containing ANSYS related data are large loading them into the ANSYS program or writing them out to an external file can be a slow process For example consider an ANSYS problem file which contains nearly 462 000 lines 150 000 of which contain nodal data and 97 383 of them containing data for elements Because many of the lines in this file are in command format the ANSYS program spends a lot of time reading it Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 111 Chapter 5 Using User Programmable Features UPFs You can shorten the time ANSYS takes to read such files by including two commands in your programs UPFs or macros EBLOCK and NBLOCK The NBLOCK command converts nodal data into fixed format data blocks which ANSYS can read more quickly than commands The EBLOCK command places element data into a fixed format block one line per element These commands also compress displacement constraint data to one line per constraint node See Chapter 3 The CDWRITE CDB File Format p 71 in the Guide to Interfacing with ANSYS for more information on the use of these commands Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidentia
539. utility and your system s make capability e Create an external table file ans ext t1 listing the various shared libraries functions and the related command Setan environment variable pointing to the directory that holds the external table file The following sections detail each of these tasks A 1 1 Creating Compatible Code You can create your functions using any of the API functions described in ansys inc vi20 ansys cus tomize include cAnsInterface h cAnsQuery h and cAnsPick h The following code segment demonstrates at a minimal level how to create functions that can be used as an entry point into a custom coded shared library The most important point in the following example it that the C program interface is an integer function that has one argument a char pointer include cAnsInterface h include CAnsQuery h extfnc int extfnc uecmd char uecmd Purpose Demonstrate C API entry function for an external command Parameters Input uecmd The ANSYS external command string Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 303 Appendix A Creating External Commands in UNIX Return Value The return value is ignored by the calling function SSS SS SS SSeS SSS End Function Description x int extfnc char uecmd Note uecmd is the entire command give
540. utine 184 USsBeg subroutine 203 USsFin subroutine 203 usvrcm inc file 102 UTHICK subroutine 152 V vamb subroutine 295 vamb1 subroutine 295 vapb subroutine 294 vapb1 subroutine 294 vapcb1 subroutine 294 variables defining additional 111 fetching the index for saved 133 optimization 102 writing saved element index 135 Variables retrieving characters from 285 vcross subroutine 296 vdot function 291 Vector functions 291 Vectors assigning equal values to two vectors 292 assigning scalar constants to 293 assigning scalar constants to incrementally 294 combining two in one 294 defining by a cross product 296 getting the difference of two 295 getting XYZ vector for a node 297 initializing to zero 292 moving one into another 293 moving one into another incrementally 293 multiplying a matrix by 298 multiplying by a full transposed matrix 298 multiplying one by a constant 295 multiplying to a constant 294 normalizing a three component vector 296 normalizing to unit length 296 setting integer vector to zero 292 setting one to be the sum of two vectors 294 storing XYZ vector for a node 297 subtracting one from another 295 velocity information 102 vidot function 291 viinit subroutine 294 vimove subroutine 293 vinit subroutine 293 viscoplastic creep material behavior 165 viscosity laws defining 174 vmax function 292 vmove subroutine 293 vmult subroutine 295 vmult1 su
541. utine is called at each substep of each load step for which element or nodal temperatures etc are used it is called for each equilibrium iteration the call to get the standard ansys input element or nodal values is made just before entering this routine Inc All rights reserved Notice This file contains ANSYS Confidential information typ int dp log chr dcp siz sc ar n intent in out inout input arguments variable typ siz intent description key int sc in type of data desired 1 temperatures 2 fluences 3 heat generation rates 4 moisture contents 5 magnetic virtual displacements iel int sc in element number ielc int ar IELCSZ in array of element type characteristics nnod int sc in number of nodes nodes int ar nnod in list of nodes time dp sc in time of current substep defalt dp sc in default value e g tunif nd int sc in size of dat array dat dp ar nd inout array of data as normally computed by element as selected by key description array of data passed back to element this data represents values at the end of the load step the input argument dat may be used in one of three ways 1 it may be simply passed thru it may be used as a flag e g if dat 1 3 0 use a certain set of logic it may be completely ignored and instead defined with new logic 6 5 2 Subroutine userpr Changing Element Pressure Information deck userpr subroutine userpr G
542. utine is rarely needed but if it is desired to see the effect of echdft you may print out the ielc array leaving uecl00 and print it out again entering this routine typz int dp log chr siz sc ar n intent in out inout input arguments variable typ siz intent description ielc int ar IELCSZ inout element characteristics kerr int sc inout error flag up to this point do not initialize to zero output arguments variable typ siz intent description ielc int ar IELCSZ inout element characteristics kerr int sc inout error flag set to 1 if error standard defaults are taken the final results are given with the debug accessed with debug 1 Y 209 063 203203 20906Y 20920 Ovi 208 2 2080 i GY JOG 09 0 JO iG 20 203 703 00Y 209 0 Oe 6 1 3 3 1 Subroutines uex101 through uex105 The source code for subroutines uex101 uex102 uex103 uex104 and uex105 is identical to the code for subroutine uex100 listed above 6 1 3 4 Subroutine uel100 Computing Element Matrices Load Vectors and Results deck uell100 USERSDISTRIB subroutine uell100 elem ielc elmdat eomask nodes locsvrL kelreqg x kelfil nr xyz u kelout zs zass damp gstif zsc zscnr elvol elmass x center elener edindxL lcerstL general lumped mass is demonstrated primary function 1 compute element matrices load vectors and results secondary functions 2 mai
543. val int sc in the total number of values e ndir nnod nscalr c value dp ar nval in the gradient values c Note If a coupled field a set of e gradients are stored in the following e order as appropriate fluid thermal c electric magnetic c output arguments none 7 7 24 egrdel Subroutine Deleting an Element s Nodal Gradients deck egrdel subroutine egrdel ielem C primary function delete element nodal gradients c Notice This file contains ANSYS Confidential information a input arguments ielem int sc in element number ae 0 delete for all defined elements G output arguments none 7 7 25 eeliqr Function Getting Information About an Element s Nodal Elastic Strains deck eeliqr function eeligqr ielem key C primary function get information about element nodal elastic strains c Notice This file contains ANSYS Confidential information e input arguments c ielem int sc in element number or zero see below c key int sc in key as to the information needed c 1 return info about elastic strains e ielem 0 return number of nodal elasic strains c on this element rec length c 0 return maximum number of nodal elastic c strains on any element e max rec length c DB NUMDEFINED return the number of nodal elastic strains e defined in model c output arguments c eeliqr int func out the returned value of eeligqr is based on e sett
544. variable ex z 10 3 2 l 2delete this parameter from the internal tables subc dp ar in values of subscripts subc is a double precision vector that contains the subscripts of cNameIn arg 1 There should be enough values defined to match nval arg 3 For example if was dimensioned as x 10 3 2 and you wanted to set x 5 1 1 123 0 then nval arg 3 should be set to 3 and subc should be set to 5 0 1 0 1 0 and value arg 5 should be 123 0 Another example is if y was dimensioned to as y 20 20 and you were setting y 5 8 987 then nval arg 3 should be set to 2 and subc should be set to 5 0 8 0 0 0 and value arg 5 should be 987 0 x Remember subroutine pardef is only storing a data value of cNameIn or cNameIn x y z The proper dimensions were set by a dim command Please note that although the values of subc should be double precision subroutine pardef uses the intrinsic nint nearest integer function to get and use the integer equivalent You should also note the nval arg 3 and subc arg 4 must fall within the range that was Set with a dim or set command or an error will occur valuein dp sc in the value for this parameter should be a packed character 8 if ctype 1 To pack a char into a dp variable use call chtodp ch8 dp To unpack a dp variable into a char use call dptoch dp ch8 Value is the data value that is to be stored for cName
545. variables e epeq dp sc inout updated effective plastic strain c plwork dp sc inout updated accumulated plastic work c sigepl dp sc out stress value on stress strain curve c sigrat dp sc out ratio of trial stress to yield stress c et dp sc out tangent modulus c internal variables c deppl dp sc equivalent plastic strain increment 6 2 15 Subroutine plast3 Updating an Element s Plastic History 4 or 6 com ponents deck plast3 subroutine plast3 option elem intpt mat kstartL ncomp tem dtem x prop d ktform dens flu dflu epel eppl statev usvr epeq plwork x sigepl sigrat dt kplst dtt cmel c primary function to update the plastic history for 4 or 6 components c used by PLANEO2 PLANE13 PIPE20 SHELL43 SHELL51 PIPE60 e SOLID62 SOLID65 SHELL91 SHELL93 SHELL143 SOLID191 c and by way of plast3creep PLANE42 SOLID45 PLANE82 SOLID92 SOLID95 140 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 2 16 Subroutine creep1 Updating an Element s Creep History C secondary functions to compute the material tangent matrix if requested c Notice This file contains ANSYS Confidential information Q00000000000000000000000n 00000000000 0Q qa 6 2 16 Subroutine creep1 Updating an Element s Creep History input arguments option elem
546. vector NOTE this is a copy of the diagonal V alues stored in the full matrix ptrDiagDl h pointer to damping matrix NOTE this is a copy of t DIAGONAL vector he diagonal values stored in the full matrix ptrSclKl h pointer to stiffness matrix diagonal scaling vector may contain all 1 0 s when not scaling Glbneqn global number of equations this will match neqn at position 2 unless we are writing distributed local FULL files in Distributed ANSYS distKey key denoting whether the FULL file is a single global FULL file 0 or multiple local FULL file ngTermFl h total number of nonzeroes in nodal graph as passed to the solver after BC applied 1 GlbnNodes non zero if across CE in distributed full file GlbnVars non zero if across CE in distributed full file GlbfAcCE total number of across CE lcAcLen number of acrossCE where slaves are in my domain GlbfCE total number of all the CE 0 position not used m i 1 numdof Degrees of freedom per node DOF reference numbers are UX 1 UY 2 UZ 3 ROTX 4 ROTY 5 ROTZ 6 AX 7 AY 8 AZ 9 VX 10 VY 11 VZ 12 13 18 are spares PRES 19 TEMP 20 VOLT 21 MAG 22 ENKE 23 ENDS 24 EMF 25 CURR 26 ckckckck ck ck kk 27 32 are spares KKEKEKKKKKKKKKKKKKKKK KKK KKK i lenbac Nodal equivalence table This table equates Stiffness Matrix STF EE 1 varies Say dp cmp 1 varies Load Vector RHS dp
547. viously defined input arguments ielem int sc in element number c elmdat int ar EL DIM in element attributes elmdat EL MAT material number c EL TYPE element type c EL REAL real constant number amp EL SECT section number e EL CSYS coordinate system number 222 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates qQaqgqaqaqagqagqaagqagaaqaaaaaa a 7 3 4 etyiqr Function Getting a Data Item About an Element Type 7 3 5 etyget Function Getting Information About an Element Type EL DEAD death flag bit 0 if clear alive if set dead EL SOLID solid model reference EL SHAPE 100 shape specific shape EL OBJOPTIONS reserved EL PEXCLUDE p element include flag bit 0 if clear include if set exclude For LSDYNA it means part ID in reqular ANSYS it is never part ID nnod int sc in number of nodes for this element nodes int ar in node numbers for this element output arguments none deck etyiqr function etyigr itype key C primary function get information about an element type c Notice This file contains ANSYS Confidential information c input arguments o itype int sc in element type number c Should be 0 for key 11 DB NUMDEFINED c DB NUMSELECTED DB MAXDEFINED and e DB MAXRECLENG Gc key int sc in
548. ware products and documentation may be used disclosed transferred or copied only in accordance with the terms and conditions of that software license agreement ANSYS Inc is certified to ISO 9001 2008 U S Government Rights For U S Government users except as specifically granted by the ANSYS Inc software license agreement the use du plication or disclosure by the United States Government is subject to restrictions stated in the ANSYS Inc software license agreement and FAR 12 212 for non DOD licenses Third Party Software See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software and third party software If you are unable to access the Legal Notice please contact ANSYS Inc Published in the U S A Table of Contents PretaGe sc LERRA XV l Guide to Interfacing with ANSYS eo o papa EORR RIO rn Eve Ed Pal Erbe dr eec el age t p Cg 1 1 Format of Binary Data Files e rro reper vp rrt id pr pea Ovens mpi eie leg es pe pun ra ev du 3 1 1 Understanding ANSYS Binary Files 4 oie rer irre ere th orn rtt na Fa Par ERR sis eR RR M Pan E VV OY FRE 3 1 1 1 Conventions Used to Describe Binary Files esccccsssescessesseecsessenceesesseeeeseesseseesenseneees 3 1 12 Ihe Standard Header for ANSYS Binary Files uii eer tvr tv ete rrr her o S Rn xen 4 1 2 Description of the Results File cccessssscccccecesseessnceeeceeceessessnaeeeeeeceess
549. written friction laws c in this routine e a update history variables ei b compute consistent tangent matrix ES c Notice This file contains ANSYS Confidential information c c c ansys r copyright c 2009 c xo ans yS unc e c input arguments c variable type sze intent description c c elem int sc in element number label c mat int sc in material reference number c intpt int sc in element integration point number c nkeyopt int sc in number of key options c keyopt int ar nkeyopt in array containing key options Cc keyopt 1 Select degree of freedom e keyopt 2 Contact algorithm e So on see ANSYS documentation c nrl int sc in number of real constants c rlconst dp ar nrl in array containing real constants e Elements CONTA171 to CONTA177 el rlconst 1 FKN C rlconst 2 FTOLN e So on see ANSYS documentation c Element CONTA178 c rlconst 1 FKN e rlconst 2 GAP e So on see ANSYS documentation c ncomp int sc in no of friction stress components 1 or 2 e npropu int sc in no of user defined friction properties c uprop dp ar npropu in user defined material properties c kfirst int sc in 1 if first time through 0 otherwise c useful for initializing state variables e to a non zero value c kfsteq int sc in 1 if first equilibrium iteration of a c substep 0 otherwise c kn dp sc in normal penalty stiffness c
550. ws EX EY EZ GXY GXZ GYZ NUXY NUXZ NUYZ All nine constants must be defined no default values are assigned Anisotropic elasticity with 21 constants Define the material elastic stiffness matrix The matrix consists of 21 constants and all must be defined 6 4 4 3 Table TB Command for user tbelastic Issue a TB command using the following syntax to access the user tbelastic subroutine interface TB ELASTIC mat npts USER The ELASTIC argument accesses the elastic material property data table For more information see the documentation for the TB command s ELASTIC option in the Command Reference The mat value represents the material number and the npts value is the number of material constants The USER argument accesses the interface to the user tbelastic subroutine 6 4 4 4 User Interface for user tbelastic The user tbelastic interface consists of six arguments as follows Four input arguments for the element number material number coordinate array and temperature One input output argument for the number of material constants One output argument consisting of the material constants array The syntax is as follows SUBROUTINE user tbelastic elemId matId coords temp nprop prop Argument Input I or Out Definition put O elemId Element number matId Material number coords Coordinates of material integration point at initial configuration geo metry temp Curren
551. x nset write out a svr data set for an element leng svr c Notice This file contains ANSYS Confidential information input arguments svindx int ar 20 inout nset int sc in the the index for svr for this element see svgidx set number in this index same as svrget structural svrs thermal electric fluid svrs magnetic svrs nonlinear svrs plasticity svrs creep svrs coupled svrs user svrs co G Ube CO 2o ES Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 6 2 6 Subroutine mreuse Determining Which Element Matrices Can Be Reused a 9 initial stress svrs c 2 42 82 45 92 95 only e 10 section data after FiberSIM conversion c shell181 only o 11 17 spares note that the first three ie items in svindx are not available io leng int sc in number of dp words in this set g svr dp ar leng in data in this set c output arguments e svindx int ar 10 2 inout updated index 6 2 5 Subroutine svpidx Writing the Saved Variable Element Index to a File deck svpidx subroutine svpidx locsvr svindx primary function write the svr element index onto file C secondary functions update the locsvr pointer to next element Q c Notice This file contains ANSYS Confidential information c input arguments G locsvr LONGINT sc inout
552. xternal format a 6 return read write status e 0 both read amp write o 1 read e 2 write le 7 return current position on file g 8 return maximum length of file e in words c 9 return starting word for this page e in buffer C output arguments c biniqr int func out the returned value of binigr is based on c setting of nblk and key 56 Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 2 1 9 Subroutine bintfo Defining Data for a Standard ANSYS File Header 2 1 8 Function binset Opening a Blocked Binary File or Initializing Paging Space deck binset function binset nblk nunit ikeyrw istart paglen npage x pname nchar kext Buffer4 c primary function initialize paging space for a blocked binary file io binset should be used to open a blocked file before binrd8 or binwrt8 are used binclo should e be used to close the file C This routine is intended to be used in standalone programs C This routine should not be linked into the ANSYS program c Notice This file contains ANSYS Confidential information input arguments nblk int sc in block number 1 to BIO MAXFILES max nunit int sc in fortran unit number for the file if 0 bit bucket ikeyrw int sc in read write flag 0 both read amp write 1 read 2 write 9 read only istart int s
553. y 7 5 10 ntpget Function Getting a Specified Nodal Temperature deck ntpget function ntpget node tmp C primary function get specified nodal heat generation in raw form c Notice This file contains ANSYS Confidential information e input arguments c node int sc in node number c output arguments c ntpget int func out heat generation status of node c 0 nodal heat generation undefined c 1 nodal heat generation is defined c tmp dp ar 2 out the nodal heat generation new old 7 5 11 ntpput Subroutine Storing a Nodal Temperature deck ntpput subroutine ntpput node temp C primary function store nodal temperature c Notice This file contains ANSYS Confidential information c input arguments c node int sc in node number c temp dp sc in nodal temperature c output arguments none 7 5 12 ntpdel Subroutine Deleting a Nodal Temperature deck ntpdel subroutine ntpdel node output arguments none C primary function delete node temperatures c Notice This file contains ANSYS Confidential information c typ int dp log chr dcp siz sc ar n func intent in out inout fa G input arguments c variable typ siz intent description o node int sc in node number o fo o Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiari
554. y 7 6 29 eimget Function Getting an Element Face Impedance deck eimget function eimget ielem iface value C primary function get an element face impedance c Notice This file contains ANSYS Confidential information ae input arguments c ielem int sc in element number c iface int sc in face number 1 6 c output arguments c eimget int func out status of element c element has no impedances c 0 this element face has no impedances c gt 0 number of values defined c value dp ar out the element impedances real imag 7 6 30 eimput Subroutine Storing an Element Impedance deck eimput subroutine eimput ielem iface nval value C primary function store an element face impedance c Notice This file contains ANSYS Confidential information ei input arguments c ielem int sc in element number c iface int sc in face number 1 6 c nval int sc in number of values to put c value dp ar nval in the element impedances real imag c output arguments none 7 6 31 eimdel Subroutine Deleting an Element Impedance deck eimdel subroutine eimdel ielem iface C primary function delete an impedance on a element c Notice This file contains ANSYS Confidential information e input arguments e ielem int sc in element number c iface int sc in face number e 0 delete all impedances on this g element
555. z int sc out status of node 0 node is undefined l node is unselected l node is selected XYZ dp ar 3 out vector containing x y z mpg ndgxyz lt elmngt elmnxt esurf edgcntae edgrde edgrdn biolp0 biolp2 biot biotlp get node xyz 8 3 24 ndpxyz Subroutine Storing X Y Z for a Node deck ndpxyz subroutine ndpxyz node xyz C primary function store x y z vector for a node c Notice This file contains ANSYS Confidential information c input arguments c node int sc in node number for operation c XYZ dp ar 3 in vector containing x y z c vector should be in global system a output arguments none 8 4 Matrix Subroutines 8 4 1 maxv Subroutine Multiplying a Vector by a Matrix deck maxv subroutine maxv a v w nr nc C primary function multiply a matrix by a vector c Notice This file contains ANSYS Confidential information 37307 t GE e E input arguments a dp ar nr in matrix a v dp ar in vector v nr int sc in number of rows in matrix a nc int sc in number of columns to multiply in matrix a Release 12 0 2009 SAS IP Inc All rights reserved Contains proprietary and confidential information of ANSYS Inc and its subsidiaries and affiliates 297 Chapter 8 Subroutines for Users Convenience c output arguments Cc w dp ar out product vector w c c mpg w Avi A nr nc matrix vector product

Download Pdf Manuals

image

Related Search

Related Contents

MANUEL D UTILISATION INDICATEURS POIDS  SYSTEM AIR CONDITIONER  The Grapher - Mind-Shop  DE-U501ZP1/ZP2  Minox DC 2122 User Guide  製品カタログ pdf(2.10MB)  DL-300 Charge Controller User Manual  HS200 Service Manual  Manual en Español  BOLETIN DE SERVICIO  

Copyright © All rights reserved.
Failed to retrieve file