.. _models-viscoplastic:

******************
Viscoplastic Model
******************

Theory
======

The viscoplastic model is a rate dependent plasticity model that is useful for modeling solders and brazes and was developed by Neilsen et al. [:footcite:`mat:ref:neilsen3`].  This model is formulated in terms of the stress rate for the material. Like many inelastic models, the rate of deformation, :math:`D_{ij}`, is additively decomposed into an elastic, :math:`D_{ij}^{\text{e}}`, and an inelastic, :math:`D_{ij}^{\text{in}}` part such that,

.. math::

  D_{ij} = D_{ij}^{\text{e}} + D_{ij}^{\text{in}}.

The elastic rate of deformation is the only part that contributes to the stress rate and it does so through the elastic moduli, :math:`\mathbb{C}_{ijkl}`, in a linear fashion leading to the relation,

.. math::
   :label: mat:eq:vp-conLaw

   \stackrel{\circ}{\sigma}_{ij} = \mathbb{C}_{ijkl} D_{kl}^{\text{e}},

where :math:`\mathbb{C}_{ijkl}` are the components of the fourth-order, isotropic elasticity tensor. The stress rate is arbitrary, as long as it is objective. Two objective stress rates are commonly used: the Jaumann rate and the Green-McInnis rate. For problems with fixed principal axes of deformation, these two rates give the same answers. For problems where the principal axes of deformation rotate during the deformation, the two rates can give different answers. Generally speaking there is no reason to pick one objective rate over another.

The inelastic strain rate is a function of the stress state, :math:`\sigma_{ij}`, the temperature, :math:`\theta`, and a number of internal state variables including both scalar isotropic, :math:`D`, and tensorial kinematic, :math:`B_{ij}`, hardening variables.  With these dependencies defined, a general form for the evolution of the inelastic deformation may be given by,

.. math::

  D_{ij}^{\text{in}} = \frac{3}{2} \gamma\left( \sigma_{ij}, \theta; D,  B_{ij} \right) n_{ij},

where :math:`n_{ij}` is the direction of inelastic deformation and is defined as,

.. math::
   :label: mat:vp-normal

   n_{ij}=\frac{1}{\tau}\left(s_{ij}-\frac{2}{3}B_{ij}\right),

and

.. math::

   \tau=\sqrt{\frac{3}{2}\left(s_{ij}-\frac{2}{3}B_{ij}\right)\left(s_{ij}-\frac{2}{3}B_{ij}\right)},

with :math:`s_{ij}` being the deviatoric stress tensor. The inelastic strain rate, :math:`\gamma`, is defined via a hyperbolic sin law,

.. math::
   :label: mat:eq:vpedot

   \gamma = f(\theta)\left[ \sinh\left( \frac{\tau}{\alpha(\theta) D} \right) \right]^{p(\theta)},

where :math:`f(\theta) = \exp(g(\theta))`. The expressions :math:`g(\theta)`, :math:`\alpha(\theta)`, and :math:`p(\theta)` are model parameters that are functions of temperature.  

The evolution laws for the state variables :math:`D` and :math:`B_{ij}` are,

.. math::
   :label: vp-isohard

   \dot{D} = \frac{A_{1}}{\left( D-D_{0} \right)^{A_{3}}}\gamma - A_{2}\left( D-D_{0} \right)^{2},

and

.. math::
   :label: mat:vp-kinHard

   \dot{B}_{ij} = \frac{A_{4}}{b^{A_{6}}} D_{ij}^{\text{in}} - A_{5} b B_{ij},

where

.. math::

   b = \sqrt{\frac{2}{3}B_{ij}B_{ij}}.

The parameters :math:`D_{0}`, :math:`A_{1}`, :math:`A_{2}`, :math:`A_{3}`, :math:`A_{4}`, :math:`A_{5}` and :math:`A_{6}` are model parameters. The parameters :math:`A_{1}`, :math:`A_{2}`, :math:`A_{4}` and :math:`A_{5}` are also functions of temperature. The model can be simplified with the appropriate choice of these parameters.

The following material parameters are functions of temperature and have the following form

.. math::

   G(\theta) = G_{0} h_{G}(\theta) \;\;\; ; \;\;\;
   K(\theta) = K_{0} h_{K}(\theta) \nonumber \\
   \nonumber \\
   g(\theta) = g_{0} h_{g}(\theta) \;\;\; ; \;\;\;
   p(\theta) = p_{0} h_{p}(\theta) \;\;\; ; \;\;\;
   \alpha (\theta) = \alpha_{0} h_{\alpha}(\theta) \nonumber \\
   \\
   A_{1} (\theta) = A_{1}^{0} h_{1}(\theta) \;\;\; ; \;\;\;
   A_{2} (\theta) = A_{2}^{0} h_{2}(\theta) \nonumber \\
   \nonumber \\
   A_{4} (\theta) = A_{4}^{0} h_{4}(\theta) \;\;\; ; \;\;\;
   A_{5} (\theta) = A_{5}^{0} h_{5}(\theta) \nonumber  

where the functions :math:`h_{*}(\theta)` are normalized functions of temperature and the values :math:`(*)_{0}` or :math:`(*)^{0}` are the reference values that are input in the command block.

Implementation
==============

An explicit, forward Euler scheme is used to integrate the viscoplastic 
model. First, during initialization, the isotropic hardening variable :math:`D` is set to :math:`1.001 D_{0}`. 
This is done to avoid a singularity in :eq:`vp-isohard`.  Additionally, the kinematic variable is set to 
zero (:math:`B_{ij}=0`).

Like the power law creep model that is integrated in a similar fashion, the chosen numerical scheme is conditionally 
stable.  As detailed in [:footcite:`mat:ref:neilsen3`], a critical stability time step of,

.. math::

   \Delta t_{n+1}\leq\frac{2\alpha\left(\theta\right)D}{3Gf\left(\theta\right)p\left(\theta\right)\sinh^{p\left(\theta\right)-1}\left(\frac{\tau}{\alpha\left(\theta\right)D}\right)\cosh\left(\frac{\tau}{\alpha\left(\theta\right)D}\right)},

may be determined.  For convince, in the following the dependence of :math:`f,~p,` and :math:`\alpha` will be assumed and not explicitly 
written.  Instead, :math:`f^{n+1}` will be used to refer to :math:`f\left(\theta^{n+1}\right)`.  Two additional limits are 
also imposed to ensure accurate integration of the state variables.  Specifically,

.. math::

   \Delta t_{n+1}\leq\sqrt{\frac{2\delta D_0\Delta t_n}{|\dot{D}_n-\dot{D}_{n-1}|}},

and 

.. math::

   \Delta t_{n+1}\leq\sqrt{\frac{2\delta D_0\Delta t_n}{|\dot{b}_n-\dot{b}_{n-1}|}},

where :math:`\delta` is an allowable error measure (here, :math:`1.0x10^{-3}`) and :math:`\dot{x}_n` refers to the time rate of 
change of variable :math:`x` at time step :math:`n`.  The current time step is checked to ensure it meets those criteria or 
else it is scaled back to ensure accurate integration.

After assessing the acceptability of the time step, the new material state at time :math:`t=t_{n+1}` is determined.  
If the time step needs to be cut back, multiple sub-increments are used.  To elaborate, let :math:`k` denote a specific sub-increment 
and :math:`N` represent the total number of sub-increments.  Each :math:`k^{th}` interval evaluates the numerical routine over a step size 
:math:`\delta t^k` where :math:`\Delta t =\sum_{k=0}^N\delta t^k`.  In such cases, temperature dependent variables are 
linearly interpolated between their values at :math:`t_n` and :math:`t_{n+1}`.  For example,

.. math::

   G^k=G_n+\frac{\Delta t^k}{\Delta t}\left(G_{n+1}-G_n\right),

where :math:`\Delta t^k` is the current sub-increment time, :math:`\Delta t^k=\sum_{r=0}^k\delta t^r`.  
For simplicity and clarity of presentation, in the discussion below it is assumed that the input time step is acceptable 
and only a single increment is needed.  If additional sub-increments were needed, the below steps would be repeated :math:`N` times 
with time intervals of :math:`\delta t^k`.
 
It is first noted that the unrotated stress, :math:`T_{ij}`, and deformation rate, 
:math:`d_{ij}`, may be decomposed as,

.. math::

   T^n_{ij}=-p^n\delta_{ij}+s^n_{ij}, \\
   d^n_{ij}=\frac{1}{3}d^n_{kk}\delta_{ij}+\hat{d}^n_{ij},

with :math:`p` being the pressure (:math:`p=-\frac{1}{3}T_{kk}`) and :math:`\hat{d}_{ij}` being the rate of deviatoric deformation.  
As the inelastic deformation flows in a deviatoric direction, the hydrostatic and deviatoric components may be 
evaluated separately.  With this in mind, the pressure may be easily integrated via,

.. math::

   p^{n+1}=p^n\frac{K^{n+1}}{K^n}+\frac{1}{2}\left(K^n+K^{n+1}\right)d_{kk}\Delta t,


where :math:`K^n` is abbreviated notation for :math:`K\left(\theta^{n}\right)`.  The inelastic deformation rate is then determined as,

.. math::

   D^{\text{in}}_{ij}=\frac{3}{2}\gamma\left(\sigma_{ij}^n,\theta^n;D^n,B^n_{ij}\right)n^{n}_{ij},

by evaluating expressions :eq:`mat:vp-normal`-:eq:`mat:eq:vpedot` at :math:`t=t_n` and :math:`\theta=\theta^n`.  The internal 
state variables may then be similar evolved via :eq:`vp-isohard` and :eq:`mat:vp-kinHard`.  With the inelastic state determined, 
the updated deviatoric stress may be found via,

.. math::

   s_{ij}^{n+1}=\frac{G^{n+1}}{G^n}s_{ij}^n+2\Delta t G^{n}\left(\hat{d}_{ij}-D^{\text{in}}_{ij}\right),

with the updated stress being,

.. math::

   T^{n+1}_{ij}=-p^{n+1}\delta_{ij}+s^{n+1}_{ij}.

Verification
============

The viscoplastic model is verified through two, time-dependent tests -- creep and stress relaxation.  
To simplify the problem for verification purposes, the isothermal response only considering isotropic hardening and 
recovery is investigated.  It is noted, however, that given the stress dependence and evolving 
internal state variable in the inelastic strain rate, a closed-form analytical solution may not be found.  Semi-analytical approaches 
numerically integrating the differential equations are easily obtainable and used for comparison purposes.  
The considered test temperature is 450\ :math:`^{\circ}`C (:math:`723` K) and material properties and model 
parameters are those of CusilABA taken from Table 3 of [:footcite:`mat:ref:neilsen3`] and are reproduced for convenience below in 
:numref:`tab-vp-verProps`.  

.. _tab-vp-verProps:

.. csv-table:: Material properties and model parameters used for isothermal, isotropic hardening/recovery creep and stress 
   :align: center
   :delim: &

   :math:`E` & 77.8 GPa & :math:`\nu` & 0.375
   :math:`g` & -13.88 & :math:`p` & 2.589
   :math:`A_1` & :math:`3x10^4` MPa\ :math:`^{A_3+1}` & :math:`A_2` & :math:`2.07x10^{-5}` :math:`\frac{1}{\text{MPa s}}`
   :math:`A_3` & 1.746 & :math:`D_0` & 50.0 MPa
   :math:`A_4` & 0 MPa\ :math:`^{A_6+1}` & :math:`A_5` & 0.0 :math:`\frac{1}{\text{MPa s}}`
   :math:`A_6` & 0.0 & :math:`\alpha` & :math:`1.0`

Creep
-----

The creep response of the viscoplastic model is investigated both numerically and semi-analytically.  For such a loading, the 
stress tensor is :math:`\sigma_{ij}=\sigma\left(t\right)\delta_{i1}\delta_{j1}` with :math:`\sigma\left(t\right)` being a prescribed quantity.  
For this study, :math:`\sigma\left(t\right)` ramps linearly from :math:`0` to :math:`\sigma_{max}` over the interval :math:`t=[0,100~\text{s}]` with 
:math:`\sigma_{max}=300` MPa.  That magnitude is then maintained for the next 900 s.

To analytically determine the model response, the constitutive law :eq:`mat:eq:vp-conLaw` is inverted to yield

.. math::
   :label: mat:eq:vp-invConLaw
   
   D_{ij}=\mathbb{S}_{ijkl}\dot{\sigma}_{kl}+D^{\text{in}}_{ij},

and it is trivial to determine that

.. math::
   :label: mat:eq:vp-stressSimple
   
   \mathbb{S}_{ijkl}\dot{\sigma}_{kl}=\dot{\sigma}\mathbb{S}_{11kl}.

For the inelastic response, for the purely isotropic case it is noted that :math:`\tau=\sigma\left(t\right)` and therefore 
:math:`n_{ij}=\frac{2}{3}\left[\delta_{i1}\delta_{j1}-\frac{1}{2}\left(\delta_{i2}\delta_{j2}+\delta_{i3}\delta_{j3}\right)\right]`.
Additionally, the inelastic strain rate reduces to,

.. math::
   :label: mat:eq:creepGamma
   
   \gamma=f\left[\sinh\left(\frac{\sigma\left(t\right)}{\alpha D}\right)\right]^p

producing a rate of inelastic deformation of,

.. math::
   :label: mat:eq:creepInelasticStrain
   
   D^{\text{in}}_{ij}=\gamma\left[\delta_{i1}\delta_{j1}-\frac{1}{2}\left(\delta_{i2}\delta_{j2}+\delta_{i3}\delta_{j3}\right)\right].

Expressions :eq:`mat:eq:vp-invConLaw`, :eq:`mat:eq:vp-stressSimple`, :eq:`mat:eq:creepInelasticStrain`, and :eq:`vp-isohard` 
can be easily integrated (via forward Euler or Runge-Kutta) to determine a semi-analytical response.  Both the numerical and 
semi-analytical responses of the strain and stress (including flow stress, :math:`D`) are presented below in :numref:`fig-vp-creep`\ (a) and 
:numref:`fig-vp-creep`\ (b), respectively.

.. _fig-vp-creep:

.. subfigure:: AB
   :subcaptions: below
   :align: center

   .. image:: ../../_static/figures/viscoplastic/creepStrain.png
      :alt: Strain
      :scale: 25 %

   .. image:: ../../_static/figures/viscoplastic/creepStress.png
      :alt: Stress
      :scale: 25 %

   Semi-analytical and numerical results of (a) strain and (b) external and internal, (:math:`D`), stress evolution during a creep test with the viscoplastic model.

Stress Relaxation
-----------------

The model response through a stress relaxation type loading is considered here both numerically and semi-analytically.  For this purpose,
a displacement controlled loading, :math:`u_1=\lambda\left(t\right)`, is employed.  The other displacement degrees of freedom are not prescribed to 
ensure that a uniaxial stress state (:math:`\sigma_{ij}=\sigma\left(t\right)\delta_{i1}\delta_{j1}`) develops.  Specifically, the displacement 
is set to scale linearly over 100 s (from :math:`t=0` to :math:`t=100` s) obtaining a maximum of :math:`u_1=0.01` at :math:`t=100` s.  Initially, a unit length is assumed.  
This displacement is held fixed over the next 900 s to investigate the stress relaxation characteristics of the model.

A similar procedure to the power law creep model (:numref:`models-power_law_creep-verification-stress_relaxation`) is employed here.  Specifically, 
by noting the elastic isotropy, uniaxial stress state, and :eq:`mat:eq:creepInelasticStrain` the elastic deformation rate in the 
direction of loading (:math:`D^{\text{e}}_{11}`) is found to be,

.. math::

   D^{\text{e}}_{11}=\frac{\dot{\lambda}\left(t\right)}{1+\lambda\left(t\right)}-\gamma, 

where an expression for :math:`\gamma` is given in :eq:`mat:eq:creepGamma`.  By noting :math:`\dot{\sigma}_{ij}=\mathbb{C}_{ijkl}D^{\text{e}}_{kl}` 
and :math:`D_{ij}=D^{\text{e}}_{ij}+D^{\text{in}}_{ij}`, the material state may easily be found via numerical integration.  The result strain and stress 
evolutions are given in :numref:`fig-vp-stressRelaxation`\ (a) and :numref:`fig-vp-stressRelaxation`\ (b), respectively. 

.. _fig-vp-stressRelaxation:

.. subfigure:: AB
   :subcaptions: below
   :align: center

   .. image:: ../../_static/figures/viscoplastic/creepStrain.png
      :alt: Strain
      :scale: 25 %

   .. image:: ../../_static/figures/viscoplastic/creepStress.png
      :alt: Stress
      :scale: 25 %

   Semi-analytical and numerical results of (a) strain and (b) external and internal (:math:`D`) stress evolution during a stress relaxation test with the viscoplastic model.

User Guide
==========

.. code-block:: sierrainput

   BEGIN PARAMETERS FOR MODEL VISCOPLASTIC
     #
     # Elastic constants
     #
     YOUNGS MODULUS = <real>
     POISSONS RATIO = <real>
     SHEAR MODULUS  = <real>
     BULK MODULUS   = <real>
     LAMBDA         = <real>
     TWO MU         = <real>

     FLOW RATE     = <real>
     SINH EXPONENT = <real>
     ALPHA         = <real>
     ISO HARDENING = <real>
     ISO RECOVERY  = <real>
     ISO EXPONENT  = <real>
     KIN HARDENING = <real>
     KIN RECOVERY  = <real>
     KIN EXPONENT  = <real>
     FLOW STRESS   = <real>

     SHEAR FUNCTION    = <string>
     BULK FUNCTION     = <string>
     RATE FUNCTION     = <string>
     EXPONENT FUNCTION = <string>
     ALPHA FUNCTION    = <string>
     IHARD FUNCTION    = <string>
     IREC FUNCTION     = <string>
     KHARD FUNCTION    = <string>
     KREC FUNCTION     = <string>
     MAX SUBINCREMENTS = <int> itmax (2000)
   END [PARAMETERS FOR MODEL VISCOPLASTIC]

In the above command blocks:

.. - See :numref:`mat:elasticConstants` for more information on elastic constants input.

- Since the model requires functions to describe the temperature dependence of the bulk and shear modulus, it is recommended that one inputs the bulk and shear modulus at some reference temperature. However, any two of the elastic constants can be used for input.
- The reference value in the equation for the flow rate, :math:`\ln f_{0}`, is defined with the ``FLOW RATE`` command line.
- The reference value for the exponent on the :math:`\sinh` function, :math:`p_{0}`, is defined with the ``SINH EXPONENT`` command line.
- The reference value :math:`alpha_{0}` is defined with the ``ALPHA`` command line.
- The reference value for the isotropic hardening parameter, :math:`A_{1}^{0}`, is defined with the ``ISO HARDENING`` command line.
- The reference value for the isotropic recovery parameter, :math:`A_{2}^{0}`, is defined with the ``ISO RECOVERY`` command line.
- The value for the isotropic hardening exponent parameter, :math:`A_{3}`, is defined with the ``ISO EXPONENT`` command line.
- The reference value for the kinematic hardening parameter, :math:`A_{4}^{0}`, is defined with the ``KIN HARDENING`` command line.
- The reference value for the kinematic recovery parameter, :math:`A_{5}^{0}`, is defined with the ``KIN RECOVERY`` command line.
- The value for the kinematic hardening exponent parameter, :math:`A_{6}`, is defined with the ``KIN EXPONENT`` command line.
- The value for the flow stress, :math:`D_{0}`, is defined with the ``FLOW STRESS`` command line.
- The user-defined and normalized function that gives the shear modulus as a function of temperature, :math:`h_{G}(\theta)`, is defined with the ``SHEAR FUNCTION`` command line.
- The user-defined and normalized function that gives the bulk modulus as a function of temperature, :math:`h_{K}(\theta)`, is defined with the ``BULK FUNCTION`` command line.
- The user-defined and normalized function that gives the flow rate as a function of temperature, :math:`h_{g}(\theta)`, is defined with the ``RATE FUNCTION`` command line.
- The user-defined and normalized function that gives the :math:`\sinh` exponent as a function of temperature, :math:`h_{p}(\theta)`, is defined with the ``EXPONENT FUNCTION`` command line.
- The user-defined and normalized function that gives :math:`\alpha` as a function of temperature, :math:`h_{\alpha}(\theta)`, is defined with the ``ALPHA FUNCTION`` command line.
- The user-defined and normalized function that gives :math:`A_{1}` as a function of temperature, :math:`h_{1}(\theta)`, is defined with the ``IHARD FUNCTION`` command line.
- The user-defined and normalized function that gives :math:`A_{2}` as a function of temperature, :math:`h_{2}(\theta)`, is defined with the ``IREC FUNCTION`` command line.
- The user-defined and normalized function that gives :math:`A_{4}` as a function of temperature, :math:`h_{4}(\theta)`, is defined with the ``KHARD FUNCTION`` command line.
- The user-defined and normalized function that gives :math:`A_{5}` as a function of temperature, :math:`h_{5}(\theta)`, is defined with the ``KREC FUNCTION`` command line.
- The Viscoplastic model may need to take sub-increments to solve for the plastic flow over the current time step.  The maximum number of steps that may be taken on a step prior to issuing an error can be set by the ``MAX SUBINCREMENTS`` command line.  This value defaults to 2000.

Output variables available for this model are listed in :numref:`out-tab-viscoplasticstvar`.

More information on the model can be found in the report by Neilsen, et. al. [:footcite:`mat:ref:neilsen3`].

.. _out-tab-viscoplasticstvar:

.. csv-table:: State Variables for VISCOPLASTIC Model
   :align: center
   :delim: &
   :header: Name, Description

   ``EQPS``   & equivalent plastic strain 
   ``SVB``    & kinematic hardening variable, :math:`{\bf B}` 
   ``SVB_XX`` & kinematic hardening variable - xx component, :math:`B_{xx}` 
   ``SVB_YY`` & kinematic hardening variable - yy component, :math:`B_{yy}` 
   ``SVB_ZZ`` & kinematic hardening variable - zz component, :math:`B_{zz}` 
   ``SVB_XY`` & kinematic hardening variable - xy component, :math:`B_{xy}` 
   ``SVB_YZ`` & kinematic hardening variable - yz component, :math:`B_{yz}` 
   ``SVB_ZX`` & kinematic hardening variable - zx component, :math:`B_{zx}` 
   ``SVD``    & isotropic hardening variable, :math:`D` 
   ``EQDOT``  & inelastic strain rate, :math:`\gamma` 
   ``COUNT``  & number of sub-increments 
   ``SHEAR``  & shear modulus, :math:`G(\theta)` 
   ``BULK``   & bulk modulus, :math:`K(\theta)` 
   ``RATE``   & :math:`g(\theta)` (see :eq:`mat:eq:vpedot`) 
   ``EXP``    & :math:`p(\theta)` (see :eq:`mat:eq:vpedot`) 
   ``ALPHA``  & :math:`\alpha(\theta)` (see :eq:`mat:eq:vpedot`) 
   ``A1``     & isotropic hardening parameter, :math:`A_{1}(\theta)` 
   ``A2``     & isotropic recovery parameter, :math:`A_{2}(\theta)` 
   ``A4``     & kinematic hardening parameter, :math:`A_{4}(\theta)` 
   ``A5``     & kinematic recovery parameter, :math:`A_{5}(\theta)` 

.. raw::
   html

   <hr>

.. footbibliography::
