elasticipy.plasticity
- class elasticipy.plasticity.IsotropicHardening(criterion='von Mises')[source]
Bases:
objectTemplate class for isotropic hardening plasticity models
Create an instance of a plastic model, assuming isotropic hardening
- Parameters:
criterion (str or elasticipy.yield_criteria.YieldCriterion) – Plasticity criterion to use. Can be ‘von Mises’, ‘Tresca’ or ‘J2’. J2 is the same as von Mises.
- apply_strain(strain, **kwargs)[source]
Apply strain to the current plasticity model.
This function updates the internal variable to store hardening state.
- Parameters:
strain (float or StrainTensor)
kwargs (dict) – Keyword arguments passed to flow_stress()
- Returns:
Associated flow stress (positive)
- Return type:
float
See also
flow_stresscompute the flow stress, given a cumulative equivalent strain
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26) >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.0
>>> stress = JC.apply_strain(0.1) >>> print(stress) 1072.2658456673885 >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.1
Obvisously, the applied strain is cumulative:
>>> stress = JC.apply_strain(0.1) >>> print(stress) 1127.612381818713 >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.2
- compute_strain_increment(stress, criterion='von Mises', apply_strain=True, **kwargs)[source]
Given the equivalent stress, compute the strain increment with respect to the normality rule.
- Parameters:
stress (float or StressTensor) – Equivalent stress to compute the stress from, or full stress tensor.
apply_strain (bool, optional) – If true, the plasticity model will be updated to account for the applied strain (hardening)
criterion (str, optional) – Plasticity criterion to consider to compute the equivalent stress and apply the normality rule. It can be ‘von Mises’, ‘Tresca’ or ‘J2’. ‘J2’ is equivalent to ‘von Mises’.
kwargs – Keyword arguments passed to the model
- Returns:
Increment of plastic strain. If the input stress is float, only the magnitude of the increment will be returned (float value). If the stress is of type StressTensor, the returned value will be a full StrainTensor.
- Return type:
StrainTensor or float
See also
apply_strainapply strain to the JC model and updates its hardening value
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26)
The yield stress is equal to A here. So consider a tensile stress whose magnitude below A:
>>> from elasticipy.tensors.stress_strain import StressTensor >>> sigma = StressTensor.tensile([1,0,0], 700) >>> strain_inc = JC.compute_strain_increment(sigma) >>> print(strain_inc) Strain tensor [[ 0. 0. 0.] [ 0. -0. 0.] [ 0. 0. -0.]]
whereas if the stress is larger than A:
>>> sigma = StressTensor.tensile([1,0,0], 800) >>> strain_inc = JC.compute_strain_increment(sigma) >>> print(strain_inc) Strain tensor [[ 1.14733854e-07 0.00000000e+00 0.00000000e+00] [ 0.00000000e+00 -5.73669268e-08 0.00000000e+00] [ 0.00000000e+00 0.00000000e+00 -5.73669268e-08]]
Check out that the JC model has been updated:
>>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 1.1473385353505149e-07
Therefore, the yield stress has increased because of hardening. For instance, if we apply the same stress has before, we get:
>>> JC.compute_strain_increment(sigma) Strain tensor [[ 0. 0. 0.] [ 0. -0. 0.] [ 0. 0. -0.]]
- flow_stress(strain, **kwargs)[source]
Compute the stress from the cumulative plastic strain
- Parameters:
strain (float) – Equivalent Plastic strain
kwargs – Additional arguments passed to the function
- Return type:
float or np.ndarray
Examples
As an example, we consider a Jonhson-Cook model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26) >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.0
>>> print(JC.flow_stress(0.0)) # Check that the yield stress = A 792.0
In order to get the full tensile curve in 0 to 10% strain range:
>>> import numpy as np >>> JC.flow_stress(np.linspace(0,0.1,5)) # Check that the yield stress = B array([ 792. , 987.44950657, 1026.04662195, 1052.067513 , 1072.26584567])
- reset_strain()[source]
Update the internal variable so that the plastic strain is reset to zero.
- Return type:
None
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26)
First apply a strain increment:
>>> stress = JC.apply_strain(0.1) >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.1
If one wants to reset the JC, without recreating it:
>>> stress = JC.reset_strain() >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.0
- class elasticipy.plasticity.JohnsonCook(A, B, n, C=None, eps_dot_ref=1.0, m=None, T0=25, Tm=None, criterion='von Mises')[source]
Bases:
IsotropicHardeningSpecial case of isotropic hardening with an underlying Johnson Cook hardening evolution rule
Constructor for a Johnson-Cook (JC) model.
The JC model is an exponential-law strain hardening model, which can take into account strain-rate sensibility and temperature-dependence (although they are not mandatory). See notes for details.
- Parameters:
A (float) – Yield stress
B (float) – Work hardening coefficient
n (float) – Work hardening exponent
C (float, optional) – Strain-rate sensitivity coefficient
eps_dot_ref (float, optional) – Reference strain-rate
m (float, optional) – Temperature sensitivity exponent
T0 (float, optional) – Reference temperature
Tm (float, optional) – Melting temperature (at which the flow stress is zero)
criterion (str or PlasticityCriterion, optional) – Plasticity criterion to use. It can be ‘von Mises’ or ‘Tresca’.
Notes
The flow stress (\(\sigma\)) depends on the strain (\(\varepsilon\)), the strain rate \(\dot{\varepsilon}\) and the temperature (\(T\)) so that:
\[\sigma = \left(A + B\varepsilon^n\right) \left(1 + C\log\left(\frac{\varepsilon}{\dot{\varepsilon}_0}\right)\right) \left(1-\theta^m\right)\]with
\[\begin{split}\theta = \begin{cases} \frac{T-T_0}{T_m-T_0} & \text{if } T<T_m\\ 1 & \text{otherwise} \end{cases}\end{split}\]- apply_strain(strain, **kwargs)[source]
Apply strain to the current plasticity model.
This function updates the internal variable to store hardening state.
- Parameters:
strain (float or StrainTensor)
kwargs (dict) – Keyword arguments passed to flow_stress()
- Returns:
Associated flow stress (positive)
- Return type:
float
See also
flow_stresscompute the flow stress, given a cumulative equivalent strain
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26) >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.0
>>> stress = JC.apply_strain(0.1) >>> print(stress) 1072.2658456673885 >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.1
Obvisously, the applied strain is cumulative:
>>> stress = JC.apply_strain(0.1) >>> print(stress) 1127.612381818713 >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.2
- compute_strain_increment(stress, T=None, apply_strain=True, criterion='von Mises')[source]
Given the equivalent stress, compute the strain increment with respect to the normality rule.
- Parameters:
stress (float or StressTensor) – Equivalent stress to compute the stress from, or full stress tensor.
apply_strain (bool, optional) – If true, the plasticity model will be updated to account for the applied strain (hardening)
criterion (str, optional) – Plasticity criterion to consider to compute the equivalent stress and apply the normality rule. It can be ‘von Mises’, ‘Tresca’ or ‘J2’. ‘J2’ is equivalent to ‘von Mises’.
kwargs – Keyword arguments passed to the model
- Returns:
Increment of plastic strain. If the input stress is float, only the magnitude of the increment will be returned (float value). If the stress is of type StressTensor, the returned value will be a full StrainTensor.
- Return type:
StrainTensor or float
See also
apply_strainapply strain to the JC model and updates its hardening value
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26)
The yield stress is equal to A here. So consider a tensile stress whose magnitude below A:
>>> from elasticipy.tensors.stress_strain import StressTensor >>> sigma = StressTensor.tensile([1,0,0], 700) >>> strain_inc = JC.compute_strain_increment(sigma) >>> print(strain_inc) Strain tensor [[ 0. 0. 0.] [ 0. -0. 0.] [ 0. 0. -0.]]
whereas if the stress is larger than A:
>>> sigma = StressTensor.tensile([1,0,0], 800) >>> strain_inc = JC.compute_strain_increment(sigma) >>> print(strain_inc) Strain tensor [[ 1.14733854e-07 0.00000000e+00 0.00000000e+00] [ 0.00000000e+00 -5.73669268e-08 0.00000000e+00] [ 0.00000000e+00 0.00000000e+00 -5.73669268e-08]]
Check out that the JC model has been updated:
>>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 1.1473385353505149e-07
Therefore, the yield stress has increased because of hardening. For instance, if we apply the same stress has before, we get:
>>> JC.compute_strain_increment(sigma) Strain tensor [[ 0. 0. 0.] [ 0. -0. 0.] [ 0. 0. -0.]]
- flow_stress(eps_p, eps_dot=None, T=None)[source]
Compute the flow stress from the Johnson-Cook model
- Parameters:
eps_p (float or list or tuple or numpy.ndarray) – Equivalent plastic strain
eps_dot (float or list or tuple or numpy.ndarray, optional) – Equivalent plastic strain rate. If float, the strain-rate is supposed to be homogeneous for every value of eps_p.
T (float or list or tuple or np.ndarray) – Temperature. If float, the temperature is supposed to be homogeneous for every value of eps_p.
- Returns:
Flow stress
- Return type:
float or numpy.ndarray
- reset_strain()[source]
Update the internal variable so that the plastic strain is reset to zero.
- Return type:
None
Examples
As an example, we consider the Johnson-Cook plasticity model:
>>> from elasticipy.plasticity import JohnsonCook >>> JC = JohnsonCook(A=792, B=510, n=0.26)
First apply a strain increment:
>>> stress = JC.apply_strain(0.1) >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.1
If one wants to reset the JC, without recreating it:
>>> stress = JC.reset_strain() >>> print(JC) Johnson-Cook plasticity model type: Isotropic criterion: von Mises current strain: 0.0