• No results found

Example ANSYS Input

In document SCRIPTINGans_prog.pdf (Page 189-196)

/batch /com

/com example for user 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,,1 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,,1 vmesh,1

mat,1

block,,1,,1,,1 vmesh,2

! SHELL181 element sectype,1,shell secdata, 0.100000,1 secdata, 0.100000,2 rect,,1,,1

secn,1 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 /post1 set,1 pres,s pres,epel fini

6.4.5. Subroutine userfc (Defining Your Own Failure Criteria)

*deck,userfc USERSDISTRIB

subroutine userfc (elem,matlay,iott,tem,elim,slim, x eps, sig, nfcOut, fc)

6.4.5. Subroutine userfc (Defining Your Own Failure Criteria)

c primary function: user subroutine for defining your own failure criterion c *** secondary functions: none

c

c *** user programmable functions may not be used in parallel processing ***

c this is currently only available with c

c *** copyright(c) 2009 SAS IP, Inc. All rights reserved.

c *** ansys, inc.

c

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 elim (dp,ar(9),in) - failure strains at the current temperature c (see FC command input with Lab1 = EPEL) c slim (dp,ar(12),in) - failure stresses and coupling coefficients c at the current temperature

c (see FC command input with Lab1 = S) c eps (dp,ar(6),in) - vector of strains

c sig (dp,ar(6),in) - vector of stresses

c tem (dp,sc,in) - temperature at this point in the model c matlay (int,sc,in) - material number

c iott (int,sc,in) - unit number for writing c

c output arguments:

c variable (typ,siz,intent) description

c nfcOut (int,sc, out) - number of user fc computed c fc (dp,ar(9),out) - user failure criterion c

6.4.6. 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-ticity material model, the UserPL subroutine is applicable to the following legacy elements: LINK1, LINK8, PIPE20, BEAM23, BEAM24, PLANE42, SOLID45, PIPE60, SOLID62, SOLID65, PLANE82, SOLID92, and SOLID95.

*deck,userpl USERSDISTRIB

subroutine userpl (elem,intpt,mat,ncomp,kfirst,kfsteq,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)

c

c *** primary function: allow users to write their own plasticity laws.

c this logic is accessed with tb,user.

c the below demonstration logic is the same as using c tb,bkin, without adaptive descent (nropt,,,off).

c Other plasticity rules may require internal c iterations and/or the more general definition of c plasticity theory, discussed in the Theory c Manual.

c *** secondary function: demonstrate the use of user-written plasticity laws c in this routine:

c a. update the nonlinear strain history

c b. compute the material tangent matrix if requested c

c *** Notice - This file contains ANSYS Confidential information ***

c c

c *** ansys(r) copyright(c) 2008 c *** ansys, inc.

c

c input arguments:

c variable (type,sze,intent) description c

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 ncomp (int,sc,in) - no. of stress/strain components (1,4 or 6)

c epel (dp,ar(ncomp),inout)- modified total strain (trial strain) c epel = eptot - eppl - eptherm - ...

c if a large strain analysis, epel is c rotation neutralized and is the hencky c (i.e. log) strain

c eppl (dp,ar(ncomp),inout)- plastic strain from previous substep c

c statev (dp,ar(ncomp,6),inout)- state variables from previous substep c usvr (dp,ar(nuval,nintp),inout)- additional state variables from c previous equilibrium iteration (saved

c variable (type,sze,intent) description c

c epel (dp,ar(ncomp),inout)- elastic strain

c eppl (dp,ar(ncomp),inout)- updated plastic strain c

c statev (dp,ar(ncomp,6),inout)- updated state variables

c usvr (dp,ar(nuval,nintp),inout)- updated additional state variables c

c fortran parameters (to be defined by the user):

c variable (type) description

c (14 is the maximum)

c *** primary function: allow users to write their own swelling laws.

c this logic is accessed with c72 = 10

c *** secondary function: demonstrate the use of user-written swelling laws c

c

c *** copyright(c) 2008 SAS IP, Inc. All rights reserved.

c *** ansys, inc.

c *** Notice - This file contains ANSYS Confidential information ***

c c usvr (dp,ar(*),inout) user-defined state variables(optional) c

c

6.4.8. Subroutine userck (Checking User-Defined Material Data)

*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 c

c *** copyright(c) 2006 SAS IP, Inc. All rights reserved.

c *** ansys, inc.

c *** Notice - This file contains ANSYS Confidential information ***

c

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 c

c output arguments:

c none c

6.4.9. Subroutine UserVisLaw (Defining Viscosity Laws)

*deck,UserVisLaw

subroutine UserVisLaw x (dudx,dudy,dudz, x dvdx,dvdy,dvdz, x dwdx,dwdy,dwdz, x u,v,w,x,y,z,kGeom,

x Vis,Temp,Tref,Pres,Pref,Cf, x MFrac,DfNSpec,Time,VisNew,toffst)

C Primary function: to provide a user defined viscosity C relationship in terms of the following:

C pressure, temperature, position, time, C velocity, & velocity-gradient

C This routine is for use with the FLOTRAN C elements, Fluid141 and Fluid142 only.

C

C In order to activate this subroutine the user must issue C FLDA,PROT,VISC,USRV command.

C

C In addition the initial value of viscosity must be specified via C FLDA,PROP,IVIS,value. This value is not available in this routine.

C

C Optionally the user may specify 4 additional coefficients C which are available in this routine by the commands:

C FLDA,NOMI,VISC,value1 C FLDA,COF1,VISC,value1 C FLDA,COF2,VISC,value2 C FLDA,COF3,VISC,value3 C

c *** copyright(c) 2008 SAS IP, Inc. All rights reserved.

c *** ansys, inc.

C

C input arguments:

C variable (typ,siz,intent) description

C dudx (dp,sc,in) velocity gradient component C dudy (dp,sc,in) velocity gradient component C dudz (dp,sc,in) velocity gradient component C dvdx (dp,sc,in) velocity gradient component C dvdy (dp,sc,in) velocity gradient component C dvdz (dp,sc,in) velocity gradient component C dwdx (dp,sc,in) velocity gradient component C dwdy (dp,sc,in) velocity gradient component

6.4.9. Subroutine UserVisLaw (Defining Viscosity Laws)

C dwdz (dp,sc,in) velocity gradient component

This subroutine is applicable to the following contact elements: CONTA171, CONTA172, CONTA173, CONTA174, CONTA175, CONTA176, CONTA177, and CONTA178.

c *** primary function: Allow users to write their own friction laws.

c This logic is accessed with tb,fric with tbopt=user.

c The below demonstration logic is the same as using c tb,fric for isotropic Coulomb friction.

c Other friction laws may require more general c definition of friction forces.

c *** secondary function: demonstrate the use of user-written friction laws c in this routine:

c a. update history variables

c b. compute consistent tangent matrix c

c *** Notice - This file contains ANSYS Confidential information ***

c

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

c keyopt(1) : Select degree of freedom

c rlconst(2) : GAP

c ... so on (see ANSYS documentation)

c ncomp (int,sc,in) - no. of friction stress components (1 or 2) c 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 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 c previous equilibrium iteration (saved

c variable (type,sze,intent) description c

c dt(3,3): d(pres)/d(normal gap) c dt(3,3) set to kn internally

c usvr (dp,ar(nuval,nintp),inout)- updated additional state variables c For example, mu value and absolute

c accumated slip could be output as follows:

c usvr(1,intpt) : mu

c usvr(2,intpt) : abs. acc. slip in dir1 c usvr(3,intpt) : abs. acc. slip in dir2 c Use NSVR command to size usvr array and c set nuval to same value as number of c variables on NSVR commands

c Use userou.F to save these values c on NMISC record for output purposes c fdiss (dp,sc,out) - incremental frictional dissipation c per unit area

c elener (dp,sc,out) - incremental elastic stored energy c per unit area

c

c fortran parameters (to be defined by the user):

c variable (type) description

c nuval (int) - number of additional state variables per c integration point

c nintp (int) - maximum number of integration points of c an element to be used with this routine c (14 is the maximum)

c note: nuval x nintp = nstv(on nsvr command); cannot exceed 840!

c

c internal variables:

c variable (type,sze) description

c mu (dp,sc ) - friction coefficient c dtfac (dp,sc) - temporary variable c taulim (dp,sc) - limit frictional stress c taueq (dp,sc) - equivalent frictional stress c dir1 (dp,sc) - slip increment direction 1 c dir2 (dp,sc) - slip increment direction 2 c dslipeq (dp,sc) - equivalent slip increment

c oldt1 (dp,sc) - frictional stress 1 from prev substep c oldt2 (dp,sc) - frictional stress 2 from prev substep c eldslip (dp,ar(2)) - elastic slip increment

c err (dp,ar(2)) - data array for diagnostic message c

6.4.11. Supporting Function egen

In document SCRIPTINGans_prog.pdf (Page 189-196)