Code Integration
Custom code blocks allow engineers to implement specialized material laws that are not available in the standard libraries of finite element software. In computational mechanics, a user material subroutine defines the stress strain relationship for complex substances like viscoplastic alloys or advanced composites. The software calls this script at every integration point in the model during each time increment.
This provides the flexibility needed to simulate the behavior of proprietary or newly developed materials.
Numerical Solver
The subroutine receives the current state of the material and the strain increment as inputs and must return the updated stress and the material stiffness matrix. Writing a user material subroutine requires a deep understanding of both the physics of the material and the numerical methods used by the solver. Errors in the coding can lead to slow convergence or incorrect results that are difficult to debug.
For this reason, practitioners often verify the code against simple analytical solutions before running large scale simulations.
Simulation Power
Simulation power is particularly evident when modeling the effects of temperature, moisture and chemical aging on the performance of a part. For example, a user material subroutine can be used to simulate the curing of an epoxy adhesive, tracking how the stiffness increases as the chemical reaction progresses. It also allows for the inclusion of damage models that predict when and where a material will crack or delaminate.
By using a custom script, a company can protect its proprietary material data while still performing accurate structural analysis. This level of detail is necessary for the design of microelectronics where the material properties are constantly changing during the fabrication process.
Computational Efficiency
Highly optimized code is essential because the routine is executed millions of times during a single simulation. Streamlining the mathematical operations reduces the total time required to reach a solution.