基于 Visual Studio 2017 和 LS-DYNA R11 进行用户自定义材料二次开发(UMAT)

本文介绍基于 LS DYNA R11,进行材料的二次开发,开发环境基于 Visual Studio 2017 Community Version 15.9.27,Intel Parallel Studio XE 2017 with Intel Fortran Compiler 17.0,LS DYNA smp d R11.1.0 ifort 2017 vs2017 lib。

Please let me know if any of the information below is outdated or you would like to add something.

1. Workflow Windows

1.1 What you need

  • A DYNA version suitable for making UMATs: currently I’m using
LS-DYNA_smp_d_R11_1_0_ifort2017vs2017_lib
Visual Studio 2017 Community Version 15.9.27.
Intel Parallel Studio XE 2017 with Intel Fortran Compiler 17.0.
  • Optional: LS-Run
  • Please note that other versions or combinations of versions might also run. If you have trouble finding the right combination of Compiler, Visual Studio etc., it is probably a good idea to contact the LS-DYNA support.

1.2 Step by step

  • Unzip your DYNA version to the file location where you want to run the calculations.
  • Install Visual Studio. Other versions than the above-mentioned might not work (.e.g. community, express, etc). During the installation you can select several additional features. They are not necessary for the compilation of LS-Dyna.
  • Install the Intel Fortran Compiler. During the installation process from the compiler, it should be recognized that Visual Studio is already installed. If this is not the case, help can be found here:

https://software.intel.com/content/www/us/en/develop/articles/troubleshooting-Fortran-integration-issues-with-visual-studio.html

  • Now you are ready to compile your own executable file.

Open Start->All Programs->Intel Parallel Studio XE 2017-> Compiler 17.0 Update 8 for Intel 64 Visual Studio 2017 environment

Change directory to the folder, where you unzipped the LS-DYNA_smp package

->cd C:\……\……\……

Make the executable:

->nmake
  • Check if your freshly compiled executable is working:

Either use LS-Run (open the .k - keyfile in LS-Prepost > File > Run LS-DYNA), or the manager.exe, make sure to choose the correct executable and keyfile. I recommend starting with a basic keyfile without UMATs.

  • If you want to run a keyfile with UMATs, modify dyn21.f with your UMAT. Compile again (nmake). Run the simulation. From here on it’s rinse and repeat – every time you change your UMAT in dyn21.f you have to compile a new executable.

1.3 Common problems and possible solutions

  • "program can't start because libiomp5md.dll is missing"
-> The missing dll file should be in: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\Intel64\compiler

If not, download the file and

-> copy paste the file into the folder, where the executable is compiled
-> OR change path variables (administrator rights required)

-> https://stackoverflow.com/questions/694351/setting-library-path-for-Win32-console-applications

-> https://msdn.microsoft.com/en-us/library/Office/ee537574(v=office.14).aspx
  • If the libiomp5md.dll error appears when starting a LS-DYNA simulation, it can also help to simply copy the file to the folder where you also compile the LS-DYNA executable.

  • LS-Run is not running in parallel although you set NCPU >= 1

Insert NCPU=X in Expression behind "\(SOLVER" i=\)INPUT
  • Simulation stops without any warning.

This could be a license issue. Have a look at your message file in the calculation folder. It is possible that you have to set the network license either in LS-Run under Settings or in“edit system environment variables”。

LSTC_LICENSE = network
LSTC_LICENSE_SERVER =“your_license_server.com”LSTC_MEMORY = auto

2. Material Modeling with LS-DYNA

You can find information on user defined material models in Appendix A of the Keywords manual from LS-DYNA, some additional information can be found in [1].

2.1. User defined materials (scalar version)

UMATs are implemented in the dyn21.f file with any kind of text editor in Fortran 77 or Fortran 90, depending on what kind of compiler you are using. Most of the LS-DYNA specific coding of material models is explained in the original dyn21.f file in the material model 41.

attachments-2020-11-4y6ri76a5fb8fe944d8dc.png

Generally, the subroutine runs on integration point level. The most important inputs are the stresses of the previous time step and the strain increments in the current time step. The routine expects an update of the stresses to the current time step. The stresses and strains at the beginning and end of the routine, respectively, are given as vectors, similar to Voigt Notation. Inside LS-DYNA, the notation is as follows. If the stress tensor is

$$ \sigma =\begin{bmatrix} \sigma_{11}&\sigma_{12}&\sigma_{13}\\ \sigma_{21}& \sigma_{22} & \sigma_{23}\\ \sigma_{31}&\sigma_{32}& \sigma_{33} \end{bmatrix} $$

the stress vector is

$$ \sigma =\begin{bmatrix}\sigma_{11}&\sigma_{22}&\sigma_{33} & \sigma_{12} & \sigma_{23} & \sigma_{13}\end{bmatrix}^T$$

Therefore

c     sig(1)=local x  stress
c     sig(2)=local y  stress
c     sig(3)=local z  stress
c     sig(4)=local xy stress
c     sig(5)=local yz stress
c     sig(6)=local zx stress

the same applies to the strain increment.

Other inputs are the material constants \(cm(1..n)\). You can set these values in the material model of your keyfile and access them in the subroutine via \(cm(1..n)\). Additionally, you can use history values \(hsv(1..n)\) to access parameters or values you calculated in the time steps before the current time step, e.g. to calculate an accumulated damage value. The history variables should also be updated to the
current time step. Don’t change the included nlqparam file. Everything besides the history variables and other objects the subroutine initializes by default is not accessible outside the subroutine and will possibly be deleted or overwritten at the end of each time step.
Besides programming the UMAT routine you have to implement your material model in your key file. This is done through the keycard“MAT_USER_DEFINED_MATERIAL_MODELS”。

attachments-2020-11-6hjrktJV5fb8fea7c34f5.png

RO is the density. MT is the number of the material model in the dyn21.f file. LMC is the length of the material constants array, NHV the number of history variables. The material constants are set in a matrix with 8 columns (P1 – P8) and an arbitrary number of rows. However, they are accessed as a vector, counting from 1 to n, e.g. the material constant set in the second row of the matrix in column P8 is accessed as \(cm(16)\). You always have to set at least a bulk modulus as well as a shear modulus in the material constants array and give their position in the \(cm(1..n)\) array under IBULK and IG.

2.2. User defined materials (vectorized version)

Vectorized material subroutines follow the same principles as the scalar versions, except that the variables are accessed a little differently. A loop over all integration points in the block of length nlq is required.

  • 发表于 · 2020.11.21 21:03 · 阅读 · 6436

[版权声明] :本文文字、代码及图片版权归原作者所有,任何媒体、网站或个人未经本网协议授权不得采集、整理、转载或以其他方式复制发表。已经本站协议授权的媒体、网站,在使用时必须注明“稿件来源:学研谷”。

3 条评论

请先 登录 后评论
猜猜我是谁
李佳涵

12
提问
8
回答
4
文章
注册推广