-
-
September 23, 2019 at 7:36 pm
zhonghu
SubscriberHello,
I am planning to write a user defined material model subroutine USERMAT compiling with ANSYS, I am wondering if gfortran 4.8.5 is a good one to use for writing and compiling, and currently the what version of fortran ANSYS used? fortran 95/2003/2008? and where is the link to read the interface of the USERMAT? Anything else I need to prepare before starting writing the code?
Â
Thanks
-
October 16, 2019 at 2:23 pm
peteroznewman
SubscriberI moved this Discussion to Structural from Embedded Software for better visibility.
-
October 16, 2019 at 8:05 pm
David Weed
Ansys EmployeeHi,
Can you let me know which release of ANSYS you are using? We don't support gfortran, but rather Intel Fortran compilers for both Windows and Linux platforms.
-
October 21, 2019 at 4:26 pm
zhonghu
SubscriberHello David,
Thanks for your response and info. Right now I am using the latest version ANSYS 19.3R research license and planing to write the USERMAT in unix with codeblocks GNU GCC Compiler or  GNU Fortran Compiler. I am not sure if it is ok. Also I am wondering if you can advice me the interface format of the USERMAT.
Many thanks,
Zhong
-
October 21, 2019 at 5:31 pm
zhonghu
Subscribersorry, I should be working on Linux platform.
-
October 25, 2019 at 11:22 pm
David Weed
Ansys EmployeeHi Zhong,
You can find the compiler requirements for R19.3 on the Linux Platform here: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v193/installation/installation_set_cbn_sqj_r5.html?q=compiler
Intel 17.0.4 (FORTRAN, C, C++) and GCC 6.3.0 (for user programmable features)
Please note that GCC 6.3.0 is only available through ANSYS, Inc. Customers are required to go through the Customer Portal to download the compiler there. You may have to discuss doing procuring this with your account manager. Also, for the Intel Fortran compiler, you need an Intel account and your institution would have to purchase the compiler. Please only use the specific software versions listed in the link above. We can't ensure that routines will successfully compile or produce reliable results outside of those versions.
-
October 29, 2019 at 11:00 pm
zhonghu
SubscriberHi David,
Thanks for your info. Now I have some other questions for you:
(1) What files I need to load in my account on the server machine before I can compile my usermat.f with ANSYS and does ANSYS can provide all these files (such as all MAPDL files);
(2) Where I can find the current version of the example of usermat3d.f I can check out or compare with mine.
Thanks,
-
October 30, 2019 at 7:51 pm
zhonghu
SubscriberHi David,
Looks like I found the necessary ANSYS files under the ansys/customize/user folder. Now I left one more question is that can you send me or tell me where the usermat3d example, I need check with mine to see the compatibility to this ansys2019r3 version.
Thanks.Â
-
October 30, 2019 at 8:27 pm
zhonghu
SubscriberHi David,
Ok, I found it in the same folder, but it was generated in 1999, so I guess its format doesn't change. So I can test the compiler I have installed of the Intel.
Thanks,Â
-
October 31, 2019 at 4:31 pm
David Weed
Ansys EmployeeHi Zhong,
Yes, usermat3D is a subroutine within usermat.F itself. From what I've heard, these routines have changed very little, if at all, since their initial inception.
-
October 31, 2019 at 5:42 pm
zhonghu
SubscriberHi David,
When I compile I need compile all the files in the folder, not just the files with .F?
Thanks,
-
November 1, 2019 at 10:37 pm
David Weed
Ansys EmployeeHi Zhong,
I would suggest reading the help which details the different compilation/linking methods:Â https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v193/ans_prog/GxI4r398wfl.html. You can create a separate directory specifically for compiling your routines; it should contain the script for whichever compile method you've chosen (e.g., /UPF or shared library) and the routines of interest. You also mentioned using an unsupported compiler; this section may be relevant:
ANSYS, Inc. 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 Installation 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 executable(s) as distributed.
-
December 20, 2019 at 4:49 pm
zhonghu
SubscriberHello David,
Yes, I made the user customized system work.
I did a test by using ANSYS BISO material and the USERMAT (ANSYS provided sample BISO), I found something different:
(1) Test conditions: A cylindrical (Axi-symmetric) metallic volume with radius of 20 mm and height of 40 mm undergone a 4% tension;
(2) Material data: Young's modulus E = 220.8 GPa, Poisson's ratio = 0.3, Yield strength = 1137.7 MPa, Strain Hardening slope H = 1466.0 MPa
(3) Results extracted from the data: The tension displacement (Uy), tension force (Fy), average von Mises stress (S eqv, actually it is a uniform deformation, every element has the same value), average von Mises elastic strain (EPEL eqv, every element has the same value), and von Mises plastic strain (EPPL eqv, every element has the same value);
(4) The same: Under the same load step, both ANSYS BISO and USERMAT provided the same Uy, Fy, von Mises stress, von Mises plastic strain;
(5) Difference: However, at the beginning of tension, it is elastic deformation, so the Young's modulus should be the ratio of the von Mises stress to the von Mises elastic strain, the result from ANSYS BISO provided the right answer, compared to the Young's modulus input in the batch file, but the result from USERMAT is not right (smaller elastic strain, resulting in higher Young's modulus); also all the elastic strains during the tension from USERMAT are smaller than that from ANSYS BISO;
Attached please find the APDL input batch file and the result files from ANSYS BISO and USERMAT;
Can you take a look if there is anything wrong? Since I really care about the elastic strain and my project needs very accurate elastic strain modeling.
By the way, I am wondering if ANSYS can share BKIN subroutine with me, since I am developing a subroutine with a very unique Bauschinger effect (not the 2 time yield stress 2Y by BKIN, but would be very helpful).
Thanks and happy holidays,
Zhong
APDL batch file input
! This is a Tension-Compression testing using USERMAT BISO for A723-1130Â
/FILNAM, Tension_USERMAT-ANSYS_BISO
!/TITLE, This is a Tension-Compression testing using USERMAT BISO A723-1130 material inputÂ
/UNITS,user !Length-mm, force-N, stress-MPa
Â
!Specimen dimensions
r_=20 !width of specimen
h_=40 !depth of specimen
Â
Â
! generate model
/PREP7
Â
ET,1,PLANE183,0,,1,   !2-D 8-node for specimen
            ! keyopt(1)=0, 8-node quadrilateral; keyopt(3)=1, axisymmetric
Â
!!ANSYS BISO input
MP,EX,1,220.8122966e3Â Â Â Â Â !Young's modulus and Poisson ratio for tension
MP,PRXY,1,0.3Â Â Â Â Â Â Â Â Â !Poisson's ratio
TB,BISO,1,1
TBTEMP,0
TBDATA,1, 1137.708703, 1466.033865Â Â ! Sigy0, H
Â
Â
!!Usermat BISO input
!TB,User,1,1,4Â Â Â Â Â !User defined Bi-linear with four inputsÂ
!TBTEMP,0
!TBDATA,1,220.8122966e3, 0.3, 1137.708703, 1466.033865 !E, Posn, Sigy0, H
!TB,STATE,1,,16
Â
!Generate model for the specimen
K,1,0,0
K,2,r_,0
K,3,r_,h_
K,4,0,h_
A,1,2,3,4
Â
LESIZE,1,,,20
LESIZE,2,,,40
LESIZE,3,,,20
LESIZE,4,,,40
Â
TYPE,1
MAT,1
Amesh,1
Â
save
Â
finish
Â
/solution
Â
ANTYPE,trans,new
Â
nlgeom,on
nropt,full,on
!predict,off
neqit,20
ncnv,0
solcontrol,on
cnvtol,f,,0.01
cnvtol,u,,0.01
!AUTOTS,ONÂ !!!!
Â
! define displacement boundary conditions on the axisymmetric axis of the specimen
NSEL,S,loc,x,0
D,all,ux,0
NSEL,all
Â
! define displacement boundary conditions on the bottom of the specimen
NSEL,s,loc,y,0 ! select nodes at the bottomÂ
D,all,uy,0
NSEL,all
Â
!!!!!! apply 4% the tension displacement on the top surface of the specimen
NSEL,s,loc,y,h_Â
D,all,uy,0.04*h_
NSEL,all
Â
Â
TIME,1
DELTIM,0.005,0.001,0.01
OUTRES,all,-100
KBC,0
SOLVE
save
Â
fini
Â
/post26
STORE,NEW
Â
NSEL,S,LOC,y,h_
*GET,NODETOT,NODE,,COUNT
*GET,MINNODE,NODE,,NUM,MIN
Â
nsol,2,MinNode,u,y,DispY
Â
RFORCE,3,MinNode,F,Y
*GET,SigEqv,NODE,MinNode,s,eqv
Â
NODENUM=MINNODE
Â
*do,i,1,NodeTot-1,1
 NodeNum=ndnext(NodeNum)
 rforce,4,NodeNum,f,y
 add,3,3,4,,Load,,,1,1
*enddo
Â
add,3,3,,,Load,,,1
add,2,2,,,Disp,,,1
Â
NSEL,all
ESEL,all
*GET,ELEMTOT,ELEM,,COUNT
Â
*do,i,1,ELEMTOT,1
 ESOL,6,i,,S,EQV,SEQV
 ADD,5,5,6,,SEQV,,,1,1
 ESOL,8,i,,EPEL,EQV,EEEQV
 ADD,7,7,8,,EEEQV,,,1,1
 ESOL,10,i,,EPPL,EQV,EPEQV
 ADD,9,9,10,,EPEQV,,,1,1
*enddo
Â
add,2,2,,,Disp,,,1
add,3,3,,,Load,,,1
add,5,5,,,SEQV,,,1/ELEMTOT
add,7,7,,,EEEQV,,,1/ELEMTOT
add,9,9,,,EPEQV,,,1/ELEMTOT
Â
*dim,T_Data,array,100
*dim,Dy_Data,array,100
*dim,Fy_Data,array,100
*dim,Si_Data,array,100
*dim,Eli_Data,array,100
*dim,Epi_Data,array,100
Â
vget,T_Data(1),1
vget,Dy_Data(1),2
vget,Fy_Data(1),3
vget,Si_Data(1),5
vget,Eli_Data(1),7
vget,Epi_Data(1),9
Â
/xrange,0,0.04*h_
/yrange,0,2000000
/grid,1
xvar,2
plvar,3
Â
/output,Tension_ANSYS_BISO_Data,txt,,append
!/output,Tension_USERMAT_BISO_Data,txt,,append
*vwrite,T_Data(1),Dy_Data(1),Fy_Data(1),Si_Data(1),Eli_Data(1),Epi_Data(1)
(6(F18.6,2x))
/output
fini
Â
Data from ANSYS BISO
     time       Tension Uy (mm) Tension Fy (N)    von Mises Seqv(MPa) Elastic strain eqv  Plastic strain eqv
Â
     0.010000      0.016000    110943.548964      88.307259      0.000400      0.000000
     0.027500      0.044000    304860.088252     242.760025      0.001099      0.000000
     0.037500      0.060000    415535.645173     330.970276      0.001499      0.000000
     0.047500      0.076000    526113.972334     419.145294      0.001898      0.000000
     0.057500      0.092000    636595.187567     507.285126      0.002297      0.000000
     0.067500      0.108000    746979.408514     595.389771      0.002696      0.000000
     0.077500      0.124000    857266.752633     683.459290      0.003095      0.000000
     0.087500      0.140000    967457.337195     771.493713      0.003494      0.000000
     0.097500      0.156000   1077551.279287     859.493042      0.003892      0.000000
     0.107500      0.172000   1187548.695808     947.457275      0.004291      0.000000
     0.117500      0.188000   1297449.703475     1035.386475      0.004689      0.000000
     0.127500      0.204000   1407254.418817     1123.280762      0.005087      0.000000
     0.137500      0.220000   1425411.889183     1138.196289      0.005155      0.000330
     0.147500      0.236000   1425576.512573     1138.779297      0.005157      0.000725
     0.157500      0.252000   1425740.715944     1139.362183      0.005160      0.001120
     0.167500      0.268000   1425904.500026     1139.944824      0.005163      0.001515
     0.177500      0.284000   1426067.865545     1140.527222      0.005165      0.001910
     0.187500      0.300000   1426230.813230     1141.109375      0.005168      0.002304
     0.197500      0.316000   1426393.343804     1141.691284      0.005170      0.002699
     0.207500      0.332000   1426555.457993     1142.272949      0.005173      0.003093
.........
Â
Data from USERMAT
     time       Tension Uy (mm) Tension Fy (N)    von Mises Seqv(MPa) Elastic strain eqv  Plastic strain eqv
Â
     0.010000      0.016000    110943.548964      88.307259      0.000347      0.000000
     0.027500      0.044000    304860.088252     242.760025      0.000953      0.000000
     0.037500      0.060000    415535.645173     330.970276      0.001299      0.000000
     0.047500      0.076000    526113.972334     419.145294      0.001645      0.000000
     0.057500      0.092000    636595.187567     507.285126      0.001991      0.000000
     0.067500      0.108000    746979.408514     595.389771      0.002337      0.000000
     0.077500      0.124000    857266.752633     683.459290      0.002683      0.000000
     0.087500      0.140000    967457.337195     771.493713      0.003028      0.000000
     0.097500      0.156000   1077551.279287     859.493042      0.003373      0.000000
     0.107500      0.172000   1187548.695808     947.457275      0.003719      0.000000
     0.117500      0.188000   1297449.703475     1035.386475      0.004064      0.000000
     0.127500      0.204000   1407254.418817     1123.280762      0.004409      0.000000
     0.137500      0.220000   1425411.889183     1138.196289      0.004467      0.000330
     0.147500      0.236000   1425576.512573     1138.779297      0.004470      0.000725
     0.157500      0.252000   1425740.715944     1139.362183      0.004472      0.001120
     0.167500      0.268000   1425904.500026     1139.944824      0.004474      0.001515
     0.177500      0.284000   1426067.865545     1140.527222      0.004476      0.001910
     0.187500      0.300000   1426230.813230     1141.109375      0.004479      0.002304
     0.197500      0.316000   1426393.343804     1141.691284      0.004481      0.002699
     0.207500      0.332000   1426555.457993     1142.272949      0.004483      0.003093
...........
Â
Â
-
March 11, 2020 at 3:34 pm
AntiNeutrino03
SubscriberCan the community edition of the Fortran Compilers and Visual studio be used for UDFs?
Also, do the later versions of the compilers work?
-
- The topic ‘Tool (software) for user defined material model subrountine’ is closed to new replies.
-
3492
-
1057
-
1051
-
966
-
942
© 2025 Copyright ANSYS, Inc. All rights reserved.