ANSYS Help USER300

  • 1 概述
    • 1.1 单元描述
    • 1.2 输入数据
    • 1.3 假设与限制条件
  • 2 创建新单元
    • 2.1 输入和输出缩略词
    • 2.2 通过自定义单元API创建新单元
      • 2.2.1 建议和限制
      • 2.2.2 子程序 `UserElem`
      • 2.2.2 子程序 `ElemGetMat`
    • 2.2 直接访问程序数据库创建新单元
      • 2.2.1 用户子程序概述
      • 2.2.2 子程序 `uec100`
      • 2.2.3 子程序 `uex100`
      • 2.2.4 子程序 `uel100`
      • 2.2.5 子程序 `uep100`
      • 2.2.6 子程序 `usertr`
      • 2.2.7 子程序 `userac`
  • 参考文献

备注
文档仅为学习记录,如有错漏之处,烦请指正。
目前文章仅为ANSYS_Help文档翻译版本,尚有翻译不准确的问题出现,后续尽量更新应用实例。

1 概述

用户程序特性(UPFs)
向用户提供丰富的FORTRAN77用户程序开发子程序和函数,用户利用它们从开发程序源代码的级别上扩充ANSYS的功能。使用这些子程序和函数,编写用户功能的源代码程序,在与ANSYS版本要求匹配的FORTRAN或c++编译器上重新编译和连接,生成用户版本的ANSYS程序。另外,还提供了外部命令功能,允许用户创建ANSYS可以利用的共享库。

1.1 单元描述

Mechanical APDL提供了一种方便的方法来创建自定义的单元,命名为USER300,可以创建几乎任何单元类型。
UserElem子程序为Mechanical APDL在单元类型创建上提供了一个接口,可传递用户自定义单元创建时所需的所有数据,然后从自定义单元返回所有数据和结果,以更新数据库和文件。通过接口可以访问数据库和文件信息,所以很少需要了解Mechanical APDL数据库程序和文件结构。该接口还提供了获取Mechanical APDL材料定义程序的途径,允许自定义单元程序调用Mechanical APDL标准材料库中的子程序。

For detailed instructions, see Creating a New Element via the User-Defined Element API in the Guide to User-Programmable Features,详见本文第2节。

1.2 输入数据

使用 USRELEMUSRDOF 命令来输入基本的单元属性,所有其他的属性自动默认设置。
特殊功能包括单元收敛准则和通过单元进行二分控制。(Special features include element convergence criteria and cutback control via the element)
单元支持并行处理和分布式ANSYS求解。


基本命令 1) USRELEM

USRELEM, NNODES, NDIM, KeyShape, NREAL, NSAVEVARS, NRSLTVAR, KEYANSMAT, NINTPNTS, KESTRESS, KEYSYM

定义自定义单元 USER300的相关属性.
前处理模块 /PREP7Elements

标识符 描述 选项设置
NNODES 节点数量
NDIM 节点坐标系的维数 有效值为2或3
KeyShape 单元形状选择 ANYSHAPE– 默认无指定形状;POINT– 点;LINE– 直线;TRIAN– 三角形;QUAD– 四边形,可退化为三角形;TET– 四面体;BRICK– 砖形,可以退化为楔形、棱锥或四面体
NREAL 实常数的数量
NSAVEVARS 保存变量的数量(The number of saved variables)
NRSLTVAR 结果文件中变量保存的数量
KEYANSMAT 单元公式的控制参数 0– 在单元公式中创建自己的材料程序。实常数可用来输入材料属性,也可以通过MPMPDATA输入线性材料属性;1– 使用ANSYS标准材料程序或者USERMAT子程序创建结构材料数据。ANSYS材料属性必须通过标准方法输入,当形状设置为ANYSHAPE时,这设置无效。
NINTPNTS 积分点(integration points)的最大数量 KEYANSMAT= 1 时可用
KESTRESS 单元应力状态的设置,当 KEYANSMAT= 1 时可用 0– 平面应力单元;1– 轴对称单元;2– 平面应变单元;3– 3-D 实体单元;4– 3-D 实体壳单元;5– 广义平面应变单元;6– 梁单元;7– 杆/桁架单元;8– 3-D 壳单元;9– 轴对称壳单元
KEYSYM 定义单元刚度矩阵为对称或者非对称 0– 对称;1– 非对称

备注
USRELEM 命令用于定义自定义单元 USER300 的属性.
可以根据分析需要夹杂其他命令,将USRELEM命令作为以下通用命令普通顺序的一部分使用:
1)为 USER300 单元采用ET命令,接着需采用相关的TYPE命令
2)同时采用USRELEMUSRDOF命令(顺序不限)
3)采用USER300定义用户单元

实常数的数量NREAL可以表征几何量、材料、或者单元公式中的任何参数。

NSAVEVARS值为正时,ANSYS在 .esav 文件中存储指定的变量。

KEYANSMAT = 0时,保存材料公式和运动学公式的所有变量。
KEYANSMAT = 1时,保存运动学公式的所有变量(例如形变梯度张量),这种情况下,材料程序自动保存所有必要的材料数据。

保存在结果文件NRSLTVAR中的单元数据,只能作为不可求和的杂项数据(miscellaneous data)。ANSYS自动在 .rst 文件中存储结构单元的应力和总应变数据(对于热单元,存储例如热梯度和热通量这类等效变量);NRSLTVAR不需要包含应力和总应变数据。

To learn more about creating user-defined elements, see Creating a New Element in the Programmer’s Reference.


基本命令 2) USRDOF

USRDOF, Action, DOF1, DOF2, DOF3, DOF4, DOF5, DOF6, DOF7, DOF8, DOF9, DOF10

定义用户单元 USER300 的自由度
前处理模块 /PREP7Elements

标识符 描述 选项设置
Action 命令选项 DEFINE– 指定自由度(默认);LIST– 列出所有先前指定的自由度;DELETE– 删除所有先前指定的自由度
DOF1, DOF2, DOF3, . . . , DOF10 自由度序列

备注
USRDOF 命令用于定义自定义单元 USER300的自由度。

可以根据分析需要夹杂其他命令,将USRDOF命令作为以下通用命令普通顺序的一部分使用:
1)为USER300单元采用ET命令,接着需采用相关的TYPE命令
2)同时采用USRELEMUSRDOF命令(顺序不限)
3)采用USER300定义用户单元

每个USRDOF命令自由度序列最多可以定义10个自由度(DOF1至DOF10),可使用任何有效且合适的DOF (例如 UX, UY, UZ, ROTX, ROTY, ROTZ, AX, AY, AZ, VX, VY, VZ, PRES, WARP, TEMP, VOLT, MAG, EMF, 和CURR),若需定义额外的自由度,需要再次使用USRDOF命令。
自定义单元的最大自由度数量: 节点数量 ╳ 每个节点的自由度数 ≤ 480。

1.3 假设与限制条件

以下功能不适用于自定义单元:

编号 描述
1 Birth and death 单元生死
2 Superelement stress pass 超单元应力传递
3 Initial stress 初始应力
4 Section input 输入单元截面
5 Input of fluences
6 Swelling 膨胀

2 创建新单元

ANSYS Help Viewer-- Programmer’s Reference-- 2.1. Creating a New Element

有两种方式创建自定义单元。
1)自定义单元API(应用程序接口) ← 2.1.2.Creating a New Element via the User-Defined Element API
2)直接访问程序数据库和文件 ← 2.1.3. Creating a New Element by Directly Accessing the Program Database

ANSYS在大多数情况下推荐用户自定义单元API的方式。
直接访问方法通常只用于特殊目的,或者如果您已经使用了用该方法创建了预先存在的单元。

两种新建单元的差异见下表:

接口 User-defined element API Accessing program database and files directly
描述 提供更简单的界面,同时保留大部分用户单元的底层功能。很少需要了解数据库子例程和文件结构。 没有特殊接口。极少例外,如果一个单元的某功能存在,则单元存在。有效使用此接口所需的逻辑更复杂。
相对难度
版本间的预期兼容性
单元名称 USER300 USER100 - USER105
Demonstration logic included on your product distribution media 4节点四边形 和 20节点六面体 uel100(结构质量单元) 和 uel101(简化杆单元)
典型的线性材料访问子程序 getMatProp propev
新非线性材料属性 UserMatTh.中程序 无已有程序
现有非线性材料特性 所有标准的结构材料都可以通过ElemGetMat访问 能力有限。可通过plasx, creepxswellx获得
非结构性材料特性 No special programming has been implemented No special programming has been implemented
允许不同单元类型的数量 无限制 无限制
Element characteristic capability 通过USRELEMUSRDOF输入10个基本单元属性,其他属性自动默认 使用uec100输入全部140个单元属性。通常使用大约30个,除特殊情况,其余均默认
可编程的适用子程序 UserElem uec100, uel100, 很少 uex100uep100。子程序 uec101uec105 是类似的
访问数据库信息 一般通过接口 通过子程序 (例如 tmpget, prsget, svgidx, svrget, svpidx, svrput).
访问文件信息 通过接口 通过指针和子例程(如eldwrtLeldwrnL)
特点 单元收敛准则;通过单元进行二分控制?(Cutback control via element)
不支持的功能 以下功能不适用于自定义单元:1)单元生死;2)超单元应力传递;3)初始应力;4)截面属性输入;5)Input of fluences;6)膨胀 材料 TB 标识 PLASTIC, NLISO, AHYPER, HYPER, PRONY, SHIFT, ELASTIC, ANEL, SDAMP, SMA, CAST, EDP, 和 GURSON.

2.1 输入和输出缩略词

参数类型

标识 描述
int integer 整数
dp double-precision 双精度
log logical
chr character 字符
dcp double-precision complex 双精度复数

参数大小

标识 描述
sc scalar variable 标量
ar(n) array variable of length n 长度为n的数组变量
func functional return value 函数返回值

参数目标

标识 描述
in input argument 输入参数
out output argument 输出参数
inout both an input and an output argument 输入参数和输出参数

2.2 通过自定义单元API创建新单元

Creating a New Element via the User-Defined Element API
通过API创建新单元的一般步骤:
Steps 2 和 3为用户自定义的单元API设置数据,所有其他步骤表示标准特性。

标识 描述 解释
1 设置单元类型 采用 ETTYPE命令,单元名称必须为 USER300
2 根据指定的单元类型定义新单元 采用USRELEM,指定单元特征(如节点数量、维度数量、实常数数量等)
3 定义节点自由度数量 采用USRDOF,每个USRDOF可定义10个自由度,若定义额外的自由度,再次使用此命令。每个节点的自由度须一致,每个节点的自由度数量 ≤ 32,每个单元的自由度数量 ≤ 480
4 定义实常数 如果需要
5 创建有限元模型 采用下列方法的任一种:1)直接生成-- 由节点直接创建单元,采用如 E, EGEN, EN, ENGEN, 或 EMORE.(也可尝试使用CDREAD读取 .cdb文件) ,若创建单元不同于任一标准单元的拓扑,此方法为唯一方法 。2)网格命令-- 若单元与任一标准单元具有相同的拓扑,并且已经为标准单元设置了非ANYSHAPE的形状(USRELEMKeyShape 设置) ,此方法有效
6 施加边界条件和载荷 依据需求
7 求解设置 若单元具有多个物理场的自由度(位移和温度)
8 后处理 后处理与任一单元相同。只有总应变(或热梯度等效量 or equivalent quantities such as thermal gradient)和应力(或热通量等效量 or equivalent quantities such as thermal flux)被保存为常规结果量。在结果文件中,其他变量被保存为不可求和的杂项变量

2.2.1 建议和限制

1)确认 USRELEMUSRDOF的输入参数与 UserElem.F 程序中的数值一致。例如,通过USRELEM定义的节点维数 (NDIM) 为2,则不要更改UserElem.F子程序中定义的维数。若数值不匹配,则会产生运行错误或者不正确的结果。
2)运行程序基于USER300单元的自由度,自动激活默认的求解设置,但是默认的求解设置对于自定义单元来说可能不是最优的。
3)USER300单元不支持截面(SECxxx)命令。对于复合梁和铺层壳,需通过实常数和相应的UserElem.F子程序输入数据。

2.2.2 子程序 UserElem

UserElem子程序为单元创建提供了编程代码的接口。UserElem支持共享内存和分布式并行处理;但需用户确保代码可以使用并行处理。

子程序传递创建自定义单元所需的所有数据,并返回单元的所有数据和结果,以更新程序数据库和文件。基于API,几乎可以创建任何单元类型,而不必直接访问程序数据库和文件。子程序中包含两个例子:一个4节点四边形二维单元,和20节点砖结构六面体单元,都是几何线性分析。关键选项(KEYOPT设置)更改单元相关设置。

下表展示了输入和输出参数及其定义和用法。一些参数名称(如与单元矩阵和载荷向量有关的名称)与结构分析共用;也可以指定适合于其他工程学科分析的参数值。

Argument Input (I) or Output (O) Definition Purpose How Defined
elid i Element number Output At FE model creation

内容过多,详见help文件。

子程序 UserElem.F位于安装文件夹:Program Files\ANSYS Inc\v172\ansys\customize\user

*deck,UserElem                      USERSDISTRIB
c Copyright ANSYS.  All Rights Reserved.subroutine UserElem (elId, 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, isubst, ieqitr, timval, &                     keyEleErr, keyEleCnv,&                     eStiff, eMass, eDamp, eSStiff,&                     fExt, fInt, elVol, elMass, elCG, &                     nRsltBsc, RsltBsc, nRsltVar, RsltVar, &                     nElEng, elEnergy) &
c*************************************************************************
c
c *** Primary function: General User Element Subroutine
c *** Note:
c       This routine is completed with an example, see more details later.
c
c
c     PROGRAMMER SHOULD NOT CHANGE ANY PURE INPUT ARGUMENTS (marked by ....,in)!
c
c     elId      (int,sc,in)        element number
c     matId     (int,sc,in)        material number of this element
c     keyMtx    (int,ar(10),in)    matrix and load vector form requests
c                                     0 = not requested, 1 = requested
c                                     see below for more details
c     lumpm     (int,sc,in)        mass matrix format
c                                    = 0 no lumped mass matrix
c                                    = 1 lumped mass matrix
c     nDim      (int,sc,in)        number of dimensions of the problem
c                                       (defined on USRELEM command as NDIM)
c                                    = 2 2D
c                                    = 3 3D
c     nNodes    (int,sc,in)        number of nodes of the element
c                                       (defined on USRELEM command as NNODES)
c     Nodes     (int,ar(nNodes),in)node list of this element
c     nIntPnts  (int,sc,in)        maximum number of integration points
c                                       (defined on USRELEM command as NINTPNTS)
c     nUsrDof   (int,sc,in)        number of DOFs of this element (matrix and
c                                     load vector size)
c     kEStress  (int,sc,in)        kEStress
c                                       (defined on USRELEM command as KESTRESS)
c     keyAnsMat (int,sc,in)        key to indicate if ANSYS material
c                                     routine is going to be called
c                                     (defined on USRELEM command as KEYANSMAT)
c                                     = 0, No
c                                     = 1, Yes
c     keySym    (int,sc,in)        key to indicate if element matrices
c                                     is symmetric
c                                       (defined on USRELEM command as KEYSYM)
c                                     = 0, symmetric
c                                     = 1, unsymmetric
c     nKeyOpt   (int,sc,in)        number of element key options able to be
c                                     used in this routine
c     KeyOpt    (int,ar(nKeyOpt),in) values of element key option defined
c                                     by et or keyopt command for the
c                                     user elements, only the first
c                                     nKeyOpt values are passed in and can
c                                     be used to branch the routine for
c                                     different formulations
c     temper    (dp,ar(nNodes),in) nodal temperatures at current time
c     temperB   (dp,ar(nNodes),in) nodal temperatures at the beginning of this
c                                     incremental step (substep)
c     tRef      (dp,sc,in)         reference temperature
c     kTherm    (int,sc,inout)     input:  flag for thermal loading
c                                      = 1, Temperatures at nodes are different
c                                      from the reference temperature,
c                                      thermal loading might be needed.
c                                      = 0, Temperatures at nodes are the same
c                                      as the reference temperature,
c                                      thermal loading is not needed.
c                                  output:  flag for thermal strains
c     nPress    (int,sc,in)        number of pressure values for this element
c     Press     (dp,ar(nPress),in) applied elemental face load (pressure)
c     kPress    (int,sc,in)        flag for pressure loading
c                                      = 1, pressure load is applied and
c                                      equivalent nodal forces should be
c                                      calculated
c                                      = 0, no pressure loading
c     nReal     (int,sc,in)        number of real constants
c                                       (defined on USRELEM command as NREAL)
c     RealConst (dp,ar(nReal),in)  user defined real constants
c     nSaveVars (int,sc,in)        number of saved variables
c                                      (defined on USRELEM command as NSAVEVARS)
c     saveVars  (dp,ar(nSaveVars),inout) user saved variables
c     xRef      (dp,ar(nDim,nNodes),in)
c                                  nodal coordinates in initial configuration
c     xCur      (dp,ar(nDim,nNodes),in)
c                                  nodal coordinates in current configuration
c     TotValDofs (dp,ar(nUsrDof),in) total values of DOFs (displacements)
c                                     from time = 0
c     IncValDofs (dp,ar(nUsrDof),in) incremental values of DOFs (displacements)
c                                     for the current step
c     ItrValDofs (dp,ar(nUsrDof),in) iterative values of DOFs (displacements)
c                                     for the current iteration
c                                     (normally needed for debug only)
c     VelValDofs (dp,ar(nUsrDof),in) first time derivatives of DOFs
c                                             (velocities) (normally not needed)
c     AccValDofs (dp,ar(nUsrDof),in) second time derivatives of DOFs
c                                          (accelerations) (normally not needed)
c     kfstps    (int,sc,in)        key for the first iteration of first
c                                     substep of the first load step
c                                     = 1 yes
c                                     = 0 no
c     nlgeom    (int,sc,in)        large deformation key [from nlgeom command]
c                                     = 0 NLGEOM,OFF
c                                     = 1 NLGEOM, ON
c     nrkey     (int,sc,in)        key to indicate a newton-raphson
c                                     (incremental) procedure
c                                     = 0 No
c                                     = 1 Yes
c     outkey    (int,sc,in)        key to indicate if any element output is
c                                     to be placed on the print file or the
c                                     result file
c                                     = 0 No
c                                     = 1 Yes
c     elPrint   (int,sc,in)        key to indicate if any element output is
c                                     to be placed on the print file
c                                     = 0 No
c                                     = 1 Yes
c     iott      (int,sc,in)        print output file unit number
c     keyHisUpd (int,sc,in)        key to indicate if history-dependent
c                                    variables need to be updated, like
c                                    equivalent plastic strain, back stress
c                                    etc. since the iteration is already
c                                    converged
c                                     = 0 not converged, don't need to update
c                                         history dependent variables
c                                     = 1 yes, converged, need to update
c                                         history dependent variables
c
c     --- The following 7 variable group can usually be ignored.
c     --- The variables are used for debug, timing, and convergence control.
c     ldstep    (int,sc,in)        current load step number
c     isubst    (int,sc,in)        current substep number
c     ieqitr    (int,sc,in)        current equilibium iteration  number
c     timval    (int,sc,in)        current time value
c     keyEleErr (int,sc,inout)     key to indicate if there is any element
c                                     formulation error, like negative Jacobian.
c                                     The error could be caused by too
c                                     large incremental step, illegal model.
c                                     = 0 no error (preset value before calling)
c                                     = 1 some error happens. ANSYS will
c                                     decide to stop the analysis or cutback
c                                     the substep (bi-section) based on other
c                                     user input and information at higher
c                                     level.
c     keyEleCnv (int,sc,inout)     key to flag if this element satisfies
c                                     the user defined element convergence
c                                     criterion.
c                                     = 1, yes, the criterion is satisfied
c                                       or don't have any criterion at all
c                                       it is preset value before calling
c                                     = 0, no, the element doesn't satisfy
c                                       element convergence criterion. If
c                                       this is the case, the iteration will
c                                       not converge even when both force
c                                       and displacement converge
c       ---- end of 7 variable group -----
c
c                                                                  requested if
c     eStiff(dp,ar(nUsrDof,nUsrDof),inout) stiffness matrix         keyMtx(1)=1
c     eMass (dp,ar(nUsrDof,nUsrDof),inout) mass matrix              keyMtx(2)=1
c     eDamp (dp,ar(nUsrDof,nUsrDof),inout) damping matrix           keyMtx(3)=1
c     eSStiff(dp,ar(nUsrDof,nUsrDof),inout)stress stiffness matrix  keyMtx(4)=1
c     fExt      (dp,ar(nUsrDof),out)       applied f vector         keyMtx(5)=1
c     fInt      (dp,ar(nUsrDof),out)       internal force vector    keyMtx(6)=1c     elVol     (dp,sc,out)        element volume
c     elMass    (dp,sc,out)        element mass
c     elCG      (dp,ar(3),out)     element centroid coordinates in current
c                                     configuration
c     nRsltBsc  (dp,sc,in)         number of basic elemental results saved in
c                                   result files
c     RsltBsc   (dp,ar(nRsltBsc),out) basic elemental results
c                                       (see EXPLANATION below)
c     nRsltVar  (int,sc,in)        number of elemental results saved in
c                                     result file as non-summable miscellaneous
c                                     variables
c                                       (defined on USRELEM command as NRSLTVAR)
c     RsltVar   (dp,ar(nRsltVar),out) variables to saved in result files as
c                                      non-summable miscellaneous variables
c                                      requested when outkey = 1
c
c     nElEng    (int,sc,in)        number of energies (fixed at 3)
c
c     elEnergy  (dp,ar(nElEng),out) elemental energy
c                                     elEnergy(1), element strain energy
c                                     elEnergy(2), element plastic strain energy
c                                     elEnergy(3), element creep strain energy
c
c     EXPLANATION OF RsltBsc
c
c       Basic element results are saved and total number of result
c     quantities is nRsltBsc, where:
c            nRsltBsc = (7+7)* number of corner nodes at one element.
c       To process the quantites by post processing properly, the results
c     must be in the following order:
c       1.) Stresses: Sx Sy Sz Sxy Syz Sxz Seqv at all corner points,
c     followed by:
c       2.) Strains : Ex Ey Ez Exy Eyz Exz Eeqv at all corner points
c     where Seqv and Eeqv = equivalent stress and strain respectively
c

2.2.2 子程序 ElemGetMat

调用标准结构材料数据库。
ElemGetMat子程序是标准材料API。
USRELEM命令设置KEYANSMAT参数后,子程序将访问标准结构材料库。它允许你关注单元表达式的运动学部分,而程序处理单元表达式的材料部分。
当调用子程序时,通过标准方法输入相关的材料数据。不需要访问这个子程序,只需要调用它。
下表显示了输入和输出参数及其定义和用法。

Argument Input (I) or Output (O) Definition Purpose How Defined
elid I Element number Output At FE model creation

内容过多,详见help文件。

子程序中的张量分量值:对于实体单元,采用全局笛卡尔坐标系;对于杆、梁和壳单元,采用共旋单元笛卡尔坐标系(co-rotated element Cartesian coordinate system)。

*deck,ElemGetMatsubroutine 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)c*************************************************************************
c
c *** Primary function: call ANSYS material routines to obtain material
c                        data for USER300 elementsc *** Notice - This file contains ANSYS Confidential information ***
c
c     input arguments
c     ===============
c     elId        (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       (int,sc)           number of stress/strain components
c     nDirect     (int,sc)           number of stress/strain direct
c                                      components
c     intPnt      (int,sc)           current integration point number
c     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
c     IncStrain   (dp,ar(nTens))     strain for the current substep step when
c                                       nlgeom = on
c                                    total strain when nlgeom = off
c     defG0       (dp,ar(3x3))       deformation gradient tensor at the end
c                                       of last incremental step
c
c     input output arguments         input desc     / output desc
c     ======================         ==========       ===========
c     defG        (dp, ar(3x3))      deformation gradient tensor at current
c                                      time, updated for thichness change in
c                                      plane stress when nlgeom=on
c     kTherm      (int,sc)           flag for thermal loading
c                                      input as:
c                                      = 0 if temp = tref
c                                      = 1 if temp .ne. tref
c                                      gets reset to 0
c                                                   if ALPX, ALPY, and ALPZ = 0
c
c     output arguments
c     ================
c     cMat        (nTens*nTens)      material Jacobian matrix
c     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
c                                    MatProp(5), nuxy
c     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
c     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) creep energy density
c     MatRotGlb   (dp,ar(3,3))       The rotation matrix from global
c                                     to  material coordinate system

2.2 直接访问程序数据库创建新单元

用于创建新单元的用户子程序和支持子程序。

使用这些子程序,您可以创建新的单元类型,将它们添加到单元库中,并将它们作为“常规”单元使用。最多可以创建 6 种独立的单元类型(名称 USER100 - USER105)。

推广产品中以uel100子程序(用于结构质量单元)和uel101子程序(用于简单杆单元)为例。

2.2.1 用户子程序概述

子程序 uec100uec105 描述单元特征(a),子程序 elccmt (在分布介质上) 详细描述了这些子程序的输入。可以使用子程序 uex100uex105 来覆盖这些默认逻辑(b)。子程序 uec100uec105 可定义如下参数:
1)二维或三维几何
2)自由度集
3)对称或不对称矩阵
4)节点数量
5)体载荷(如温度)
6)表面载荷(如压力)
7)实常数数量
8)需要保存的变量数量
9)单元矩阵的行数
10)线性或非线性单元

子程序uel100uel105计算单元矩阵(刚度、比热等)、单元载荷向量(力、热流等)和任何单元输出量(c)。还将生成单元输出,并计算要保存的变量并存储在结果文件中。

子程序uep100uep105提供行单元的打印输出(d)。一般的后处理器POST1调用子例程,或者您可以使用uel100通过uel105调用子程序。

子程序usertr允许访问节点转换(e)

子程序userac描述了一些数据处理(f)

2.2.2 子程序 uec100

用于定义 usr100 子程序的属性。

*deck,uec100                      USERSDISTRIBsubroutine uec100 (elcdn,ielc,kerr)
c     ***** this subroutine defines the characteristics of user100.
c
c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c     typ=int,dp,log,chr   siz=sc,ar(n)   intent=in,out,inout
c
c  input arguments:
c     variable (typ,siz,intent)     description
c     ielc (int,ar(IELCSZ),inout) - element characteristics
c
c     kerr   (int,sc,inout)       - error flag up to this point.
c                                    (do not initialize to zero)
c
c  output arguments:
c     variable (typ,siz,intent)     description
c     elcdn   (chr,sc,out)        - name of element
c     ielc (int,ar(IELCSZ),inout) - element characteristics
c
c     kerr   (int,sc,inout)       - error flag (set to 1 if error)
c       note to programmers:  the validity of keyopt values may be checked here
c

子程序uec101uec102uec103uec104uec105的输入和输出参数与上面列出的uec100子例程相同。

2.2.3 子程序 uex100

覆盖默认的单元特征

*deck,uex100                      USERSDISTRIBsubroutine uex100 (ielc,kerr)
c     *** subroutine to override element characteristic defaults ***
c     *** hence, this routine is needed only in rare cases.
c
c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c     *** input and output are the same as for uec100, except that this
c     *** logic is called after the defaulting logic is finished.
c     *** this defaulting is done in ansys subroutine echdft(not a upf).
c     *** as indicated above, this routine is rarely needed, but if it is
c     *** desired to see the effect of echdft, you may print out the ielc array
c     *** leaving uec100 and print it out again entering this routine.
c
c     typ=int,dp,log,chr   siz=sc,ar(n)   intent=in,out,inout
c
c  input arguments:
c     variable (typ,siz,intent)     description
c     ielc (int,ar(IELCSZ),inout) - element characteristics
c
c     kerr   (int,sc,inout)       - error flag up to this point.
c                                  (do not initialize to zero)
c
c  output arguments:
c     variable (typ,siz,intent)     description
c     ielc (int,ar(IELCSZ),inout) - element characteristics
c
c     kerr   (int,sc,inout)       - error flag (set to 1 if error)
c     *** standard defaults are taken.  the final results are given with
c     *** the debug accessed with /debug,,, ,,1
c

2.2.4 子程序 uel100

计算单元矩阵、载荷向量和结果

*deck,uel100                      USERSDISTRIBsubroutine uel100 (elem,ielc,elmdat,eomask,nodes,locsvrL,kelreq,x kelfil,nr,xyz,u,kelout,zs,zass,damp,gstif,zsc,zscnr,elvol,elmass,x center,elener,edindxL,lcerstL)
c --- general lumped mass is demonstrated --------------------------------
c *** primary function:
c        1. compute element matrices, load vectors, and results
c *** secondary functions:
c        2. maintain element solution datac *** user programmable functions may not be used in parallel processing ***c *** Notice - This file contains ANSYS Confidential information ***c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.c  input arguments:
c       elem   (int,sc,in)         - element label (number)
c       ielc   (int,ar(IELCSZ),in) - array of element type characteristics
c                                     (IELCSZ = array size, defined in echprm)
c       elmdat (int,ar(EL_DIM),in) - array of element data
c       eomask (int,sc,in)         - bit pattern for element output
c                                    (see outpcm)
c       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
c       kelreq (int,ar(10),in)     - matrix and load vector form requests
c                                  (indices for kelreq are given with output
c                                                            arguments below)
c       kelfil (int,ar(10),in)     - keys indicating incoming matrices and
c                                    load vectors (indices for kelfil are the
c                                    same as given for kelreq with output
c                                    arguments below)
c       nr     (int,sc,in)         - matrix and load vector size
c       xyz    (dp,ar(6,nnod),in)  - nodal coordinates (orig) and rotation angle
c       u      (dp,ar(nr,5),in)    - element nodal solution valuesc  output arguments:
c       kelout (int,ar(10),out)    - keys indicating created matrices and
c                                         load vectors (indices for kelout
c                                            are the same as for kelreq below,
c                                            as well as kelin and kelout later)
c       zs     (dp,ar(nr,nr),inout)- stiffness/conductivity matrix (kelreq(1))
c       zass   (dp,ar(nr,nr),inout)- mass matrix                   (kelreq(2))
c       damp   (dp,ar(nr,nr),inout)- damping/specific heat matrix  (kelreq(3))
c       gstif  (dp,ar(nr,nr),inout)- stress stiffness matrix       (kelreq(4))
c       zsc    (dp,ar(nr),out)     - applied f vector              (kelreq(5))
c       zscnr  (dp,ar(nr),out)     - n-r restoring f vector        (kelreq(6))
c                                    or imaginary f vector         (kelreq(7))
c       elvol  (dp,sc,out)         - element volume
c       elmass (dp,sc,out)         - element mass
c       center (dp,ar(3),out)      - centroid location
c       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
c

2.2.5 子程序 uep100

通过 POST1PRESOL,ELEM进行用户单元的输出打印。

*deck,uep100                      USERSDISTRIBsubroutine 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)
c
c *** primary function:    produce printed output for user100
c
c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c  **********  this subroutine is provided for user information  *********
c *** user programmable features may not be used in parallel processing ***
c
c  input arguments:
c     iott     (int,sc,in)         - output unit number
c     elem     (int,sc,in)         - element number
c     nodes    (int,ar(2),in)      - node numbers
c     mat      (int,sc,in)         - material number
c     kept     (int,sc,in)         - key to print temperatures
c     tem      (dp,ar(2),in)       - nodal temperatures
c     kemn     (inr,sc,in)         - key to print fluences
c     fluen    (dp,ar(2),in)       - neutron fluences
c     kems     (int,sc,in)         - key to print moment forces
c     force    (int,sc,in)         - member force fx
c     kens     (int,sc,in)         - key to print strains
c     sig      (dp,sc,in)          - axial stress
c     keel     (int,sc,in)         - key to print elastic strain
c     epel     (dp,sc,in)          - axial elastic strain
c     keth     (int,sc,in)         - key to print thermal,initial,swelling strai
c     eptho    (dp,sc,in)          - axial thermal strain
c     epswel   (dp,sc,in)          - swelling strain
c     epino    (dp,sc,in)          - initial axial strain
c     kenl     (int,sc,in)         - key set if any nonlinear materials present
c     sigepl   (dp,sc,in)          - stress in stress-strain curve
c     sigrat   (dp,sc,in)          - stress ratio
c     hpres    (dp,sc,in)          - hydrostatic pressure
c     epeq     (dp,sc,in)          - plastic equivalent strain
c     kepl     (int,sc,in)         - key to print plastic strain
c     eppl     (dp,sc,in)          - plastic strain
c     kecr     (int,sc,in)         - key to print creep strain
c     epcrp    (dp,sc,in)          - creep strain
c
c  output arguments:     none
c

2.2.6 子程序 usertr

调整节点的方向矩阵

*deck,usertr                      USERSDISTRIBsubroutine usertr (node,tr)
c *** primary function:  adjust nodal orientation matrix
c     secondary function: study nodal orientation matrix
c       accessed with ielc(notran) = -100
c
c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.
c
c *** Notice - This file contains ANSYS Confidential information ***
c
c     typ=int,dp,log,chr,dcp   siz=sc,ar(n)   intent=in,out,inout
c
c  input arguments:
c     variable (typ,siz,intent)    description
c     node     (int,sc,in)       - node number being acted upon
c     tr       (dp,ar(32,32),inout) - nodal to global orientation matrix
c
c  output arguments:
c     variable (typ,siz,intent)    description
c     tr       (dp,ar(32,32),inout) - nodal to global orientation matrix
c
c          tr is a matrix that is already defined based on the degrees
c          of freedom selected.
c          it does not normally need to be changed.
c          it may be printed out here to study.  its functional size is
c          nr by nr, where nr is the number of degrees of freedom in the
c          element
c

2.2.7 子程序 userac

获取单元数据

*deck,userac                      USERSDISTRIBsubroutine userac (elem)
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.
c
c         *** Copyright ANSYS.  All Rights Reserved.
c         *** ansys, inc.
c *** Notice - This file contains ANSYS Confidential information ***
c
c  input arguments:
c     variable (typ,siz,intent)    description
c     elem     (int,sc,in)       - element number
c
c  output arguments:
c     none
c

未完待续

参考文献

[1]. ANSYS Mechanical APDL Element Reference. Release 17.2
[2]. ANSYS Mechanical APDL Command Reference. Release 17.2
[3]. ANSYS Mechanical APDL Programmer‘s Reference. Release 17.2

ANSYS Help USER300相关推荐

  1. ansys添加力矩_ansys中的workbench怎么添加力矩

    展开全部 ansys中的workbench添加力矩,只要将要加力矩的面建一组建,然后将力矩施加其62616964757a686964616fe4b893e5b19e31333431366363上,选定 ...

  2. yjk只算弹性的不计算弹塑性_基于ANSYS Workbench的表面裂纹计算

    一.写在前面 本教程使用ANSYS Workbench17.0 进行试件表面裂纹的分析,求应力强度因子.需要提前说明的是,本案例没有工程背景,仅为说明裂纹相的计算方法,因此参数取值比较随意,大量设置都 ...

  3. ansys大变形开关要不要打开_ANSYS不收敛问题的解决办法

    笔者应聘时发现此公众号内容也备受同行专家认可, 继续努力,再接再厉! 本文经验是基于仿真秀专家学者总结,在此感谢仿真秀的支持与鼓励. 80%的线性不收敛都是因为接触问题!!! 一.材料问题的不收敛可以 ...

  4. 《ANSYS 14.0超级学习手册》一第2章 高级应用的基石——APDL

    本节书摘来自异步社区<ANSYS 14.0超级学习手册>一书中的第2章,作者 张建伟 , 白海波 , 李昕, 更多章节内容可以访问云栖社区"异步社区"公众号查看 第2章 ...

  5. ansys大变形开关要不要打开_ANSYS网格质量评定指标介绍

    不良的单元形状会导致不准确的结果,然而到目前为止,还没有一个比较通用的标准来判定单元形状的好坏.一种单元形状在一个分析中可能会带来不正确的结果,但在另外一个分析中又可能是完全能接受的,因而单元形状的好 ...

  6. ansys选择一个面上所有节点_如何使用ANSYS经典界面的选择工具

    我们都已经发现,ANSYS的WORKBENCH界面比经典界面好用很多,所以一旦我们使用WORKBENCH以后,就很难再去喜欢经典界面. 但是经典界面有它的优势.它的主要优势体现在它对底层的精细操控,例 ...

  7. matlab土体变形实例,ansys案例——20例ansys经典实例】.pdf

    ansys案例--20例ansys经典实例] [ANSYS 算例]3.3.7(3) 三梁平面框架结构的有限元分析 针对 [典型例题]3.3.7(1) 的模型,即如图3-19 所示的框架结构,其顶端受均 ...

  8. 《ANSYS 14.0超级学习手册》一第1章 绪 论

    本节书摘来自异步社区<ANSYS 14.0超级学习手册>一书中的第1章,第1.1节,作者 张建伟 , 白海波 , 李昕, 更多章节内容可以访问云栖社区"异步社区"公众号 ...

  9. ANSYS滑块导轨配合方法

    一直报错,发现是ANSYS中滑块与导轨配合出错了,记录一下应该怎么配合: 1,选择General 2,分别选择滑块与导轨的两个面: 3,确定好面之后,确定相对滑动的方向,下面说明是沿着X轴方向滑动: ...

  10. ANSYS报错Accelerations are exceeding internal limit解决方法

    ANSYS进行仿真的时候报错如下 查找一些资料: 最后发现的问题:我对应的结构不能使用速度过快的转速,当我改成1的时候,就没问题了 点击插入探针,计算生成位移和形变:

最新文章

  1. 在Myeclipse里使用Junit
  2. Activiti最全入门教程
  3. 160个Crackme036
  4. Vue.nextTick和Vue.$nextTick
  5. LIVE555建立RTSP服务记录
  6. H618B刷了tomato0530版本 呵呵,测试一下
  7. Linux驱动(10)--注册驱动
  8. 这些智能合约漏洞,可能会影响你的账户安全!
  9. Postman离线安装包
  10. 【Flutter】Dart中的匿名函数、闭包
  11. java mina 框架 获取字节_浅谈Java的Mina框架传递对象
  12. Java实现对文件的读与写
  13. 四川教师职称计算机考试试题,四川省中小学教师职称计算机应用能力考试、外语免试审批表.doc...
  14. iPhone 14 全系售价及配置曝光,绝了!
  15. mysql 汉字一排序规则_MySQL 的字符集与排序规则
  16. shell学习之引号
  17. Mac--键盘输入的技巧
  18. 2021年国网计算机考试难吗,2021想要通过国家电网招聘考试到底有多难?
  19. 计算机专业方面主要有哪些证书
  20. Linux内核有没有rootfs,Linux内核rootfs的初始化过程

热门文章

  1. WSO2 ESB 5.0.0 的一些控制台显示配置
  2. [HYSYS学习]逻辑单元-循环器
  3. 考研高等数学张宇30讲笔记——第二讲 数列极限
  4. 北京航空航天大学计算机科学与技术考研科目,2022北京航空航天大学计算机科学与技术考研备考指导-参考书、分数线...
  5. social-share,社会化分享组件之jquery版
  6. 【爬虫进阶】验证码处理:打码平台的使用(反反爬)
  7. SA8155 QNX 系统启动时序
  8. linux下常用的dns软件,Linux常见应用--DNS服务器常见应用实现
  9. 高通平台开发系列讲解(音频篇)Codec驱动移植步骤
  10. 积分器-微分器-抽取器