SPHinXsys icon indicating copy to clipboard operation
SPHinXsys copied to clipboard

draft PR -- hourglass control (updated Lagrangian) for elasticity and plasticity

Open Shuaihao-Zhang opened this issue 1 year ago • 56 comments

Here, I will show the results when dealing with the hourglass control method for ULSPH.

Shuaihao-Zhang avatar Nov 24 '23 15:11 Shuaihao-Zhang

This is the method we discussed just now. We only calculate the inverse of shear strain for particle i when the return mapping is called, i.e., when particle i is plastic. Then, we can calculate the scale matrix. If particle i is elastic, the scale matrix is the identity matrix. image

https://github.com/Xiangyu-Hu/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L545-L553

The result is as follows: 2d_talor_bar

As Prof. Hu mentioned, if the particle is plastic, then the inverse of shear strain exists.

However, there are some other problems, and the simulation crash after several steps. And it looks like tensile instability.

I think this may because the scale matrix is too small at the bottom of the bar, as shown in the following figure. image The color indicates the scale matrix. It's an identity matrix when the particle is elastic, and the magnitude is 1.4 in 2D. If the particle is plastic, the magnitude of the scale matrix is smaller than 1.4.

I suppose, if the scale matrix is very small, the effect of this hourglass control method is also very small. So hourglass and tensile instability occurs.

The figure below shows the plastic indicator. image

Shuaihao-Zhang avatar Nov 24 '23 16:11 Shuaihao-Zhang

Are you sure that you have 1/2 in front of (\phi_i + \phi_j)?

Xiangyu-Hu avatar Nov 24 '23 17:11 Xiangyu-Hu

So the parameter \xi has not effect to the solution?

Xiangyu-Hu avatar Nov 24 '23 17:11 Xiangyu-Hu

This is the method we discussed just now. We only calculate the inverse of shear strain for particle i when the return mapping is called, i.e., when particle i is plastic. Then, we can calculate the scale matrix. If particle i is elastic, the scale matrix is the identity matrix. image

https://github.com/Xiangyu-Hu/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L545-L553

The result is as follows: 2d_talor_bar 2d_talor_bar

As Prof. Hu mentioned, if the particle is plastic, then the inverse of shear strain exists.

However, there are some other problems, and the simulation crash after several steps. And it looks like tensile instability.

I think this may because the scale matrix is too small at the bottom of the bar, as shown in the following figure. image The color indicates the scale matrix. It's an identity matrix when the particle is elastic, and the magnitude is 1.4 in 2D. If the particle is plastic, the magnitude of the scale matrix is smaller than 1.4.

I suppose, if the scale matrix is very small, the effect of this hourglass control method is also very small. So hourglass and tensile instability occurs.

The figure below shows the plastic indicator. image

Also, in the first part of the equation should it be \tild{\sigma_i} + \tild{\sigma_j}?

Xiangyu-Hu avatar Nov 24 '23 17:11 Xiangyu-Hu

Are you sure that you have 1/2 in front of (\phi_i + \phi_j)?

Yes, I do put 1/2 in the code. This actually doesn't matter because we have this coefficient in front of this integration. image

Shuaihao-Zhang avatar Nov 25 '23 02:11 Shuaihao-Zhang

So the parameter \xi has not effect to the solution?

The parameter 𝜉 do have effects. But the simulation still crash even I used a large 𝜉 . I think this is because the difference between the elastic correction and plastic correction is too large, due to the scale matrix 𝝋 for plastic particle is too small.

Shuaihao-Zhang avatar Nov 25 '23 02:11 Shuaihao-Zhang

Also, in the first part of the equation should it be \tild{\sigma_i} + \tild{\sigma_j}?

Yes, this should be the shear stress after return mapping. This is a typo here. The code is correct. image

Shuaihao-Zhang avatar Nov 25 '23 02:11 Shuaihao-Zhang

I have checked you code and found, besides quite intervened coding, a serious consistent issue. That is. If I comment line https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L533 to skip return mapping and change https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L555 to Mat3d deviatoric_stress = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]);

Then the scaling factor should be Identity even we are applying https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L548

However, the simulation still gives crashed results. Please have a check.

Xiangyu-Hu avatar Nov 26 '23 16:11 Xiangyu-Hu

Also. in the TL version, we use full strain to obtain scaling factor. Please have a look. https://github.com/Xiangyu-Hu/SPHinXsys/blob/bbe70dc9411ab91c98b5c08fa3d8848b65112bef/src/shared/particle_dynamics/solid_dynamics/inelastic_dynamics.cpp#L44-L47C49

Xiangyu-Hu avatar Nov 26 '23 16:11 Xiangyu-Hu

I have checked you code and found, besides quite intervened coding, a serious consistent issue. That is. If I comment line https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L533 to skip return mapping and change https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L555 to Mat3d deviatoric_stress = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]);

Then the scaling factor should be Identity even we are applying https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L548

However, the simulation still gives crashed results. Please have a check.

(1) Sorry for the coding. I have deleted some unnecessary code blocks and comments to make it more clear. (2) The plastic behavior is not only controlled by return mapping, but also by the constitutive model. If we want to transfer the material to elasticity, besides skip the return mapping, we also need to modify a line of code in the constitutive model. https://github.com/Xiangyu-Hu/SPHinXsys/blob/2eac06a0ef5745f0c97d47e71832d9114a21e9ef/tests/user_examples/extra_src/shared/general_continuum/general_continuum.cpp#L92-L114 We just change the Line-112 to return shear_stress_rate_elastic;, then we can get this elastic behavior. 2d_taylor_bar_elastic And the scale matrix is an identity matrix for all particles. image

Shuaihao-Zhang avatar Nov 26 '23 16:11 Shuaihao-Zhang

Also. in the TL version, we use full strain to obtain scaling factor. Please have a look. https://github.com/Xiangyu-Hu/SPHinXsys/blob/bbe70dc9411ab91c98b5c08fa3d8848b65112bef/src/shared/particle_dynamics/solid_dynamics/inelastic_dynamics.cpp#L44-L47C49

I will check this in detail tomorrow.

Shuaihao-Zhang avatar Nov 26 '23 16:11 Shuaihao-Zhang

@Shuaihao-Zhang, the returning map you wrote is to return the deviatoric part. The inconsistency between the elastic and plastic behaviors may arise due to the incompressible assumption. Pls, check it. Could you write down the plastic constitutive relation formulation in detail?

DongWuTUM avatar Nov 26 '23 17:11 DongWuTUM

@Xiangyu-Hu @Shuaihao-Zhang Form the derivation, we should use the shear strain to obtain the scaling factor. But we can have a try for full strain.

DongWuTUM avatar Nov 26 '23 17:11 DongWuTUM

Further more, the TL version use the full strain tensor not only the shear tension for the scaling factor. Please see

I have checked you code and found, besides quite intervened coding, a serious consistent issue. That is. If I comment line https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L533 to skip return mapping and change https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L555 to Mat3d deviatoric_stress = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]); Then the scaling factor should be Identity even we are applying https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L548 However, the simulation still gives crashed results. Please have a check.

(1) Sorry for the coding. I have deleted some unnecessary code blocks and comments to make it more clear. (2) The plastic behavior is not only controlled by return mapping, but also by the constitutive model. If we want to transfer the material to elasticity, besides skip the return mapping, we also need to modify a line of code in the constitutive model.

https://github.com/Xiangyu-Hu/SPHinXsys/blob/2eac06a0ef5745f0c97d47e71832d9114a21e9ef/tests/user_examples/extra_src/shared/general_continuum/general_continuum.cpp#L92-L114

We just change the Line-112 to return shear_stress_rate_elastic;, then we can get this elastic behavior. 2d_taylor_bar_elastic And the scale matrix is an identity matrix for all particles. image

Sorry. If I do as you said the

I have checked you code and found, besides quite intervened coding, a serious consistent issue. That is. If I comment line https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L533 to skip return mapping and change https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L555 to Mat3d deviatoric_stress = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]); Then the scaling factor should be Identity even we are applying https://github.com/Shuaihao-Zhang/SPHinXsys/blob/06d36e86df5301e93e3381d6e9ed49e9a845ff88/tests/user_examples/extra_src/shared/general_continuum/continuum_dynamics/continuum_dynamics_inner.cpp#L548 However, the simulation still gives crashed results. Please have a check.

(1) Sorry for the coding. I have deleted some unnecessary code blocks and comments to make it more clear. (2) The plastic behavior is not only controlled by return mapping, but also by the constitutive model. If we want to transfer the material to elasticity, besides skip the return mapping, we also need to modify a line of code in the constitutive model.

https://github.com/Xiangyu-Hu/SPHinXsys/blob/2eac06a0ef5745f0c97d47e71832d9114a21e9ef/tests/user_examples/extra_src/shared/general_continuum/general_continuum.cpp#L92-L114

We just change the Line-112 to return shear_stress_rate_elastic;, then we can get this elastic behavior. 2d_taylor_bar_elastic And the scale matrix is an identity matrix for all particles. image

If I do as you said by: return shear_stress_rate_elastic; Then I do not comments line 533 but move it before, Mat3d deviatoric_stress = shear_stress_3D_[index_i]; The simulation now should not blowup. but it does. So, there seems still has consistent issue.

Xiangyu-Hu avatar Nov 26 '23 17:11 Xiangyu-Hu

Because it does not blowup if we simply constrain scale factor to identity in any case.

Xiangyu-Hu avatar Nov 26 '23 17:11 Xiangyu-Hu

If I do as you said by: return shear_stress_rate_elastic; Then I do not comments line 533 but move it before, Mat3d deviatoric_stress = shear_stress_3D_[index_i]; The simulation now should not blowup. but it does. So, there seems still has consistent issue.

To transfer to elasticity, we should switch to return shear_stress_rate_elastic; and also comment Line 533 shear_stress_3D_[index_i] = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]); to skip return mapping. If we don't, then the return mapping still works, which makes the stress-strain behavior is non-linear. The stress and strain after return mapping is very small, so the scale matrix 𝝋 will be small. Then effect the hourglass control is small, and the simulation crashes because (I guess) tensile instability, as I mention above.

Shuaihao-Zhang avatar Nov 27 '23 01:11 Shuaihao-Zhang

@Shuaihao-Zhang, the returning map you wrote is to return the deviatoric part. The inconsistency between the elastic and plastic behaviors may arise due to the incompressible assumption. Pls, check it. Could you write down the plastic constitutive relation formulation in detail?

Yes, this is the constitutive for J2 plasticity. image For J2 plasticity, the plastic part only related to the shear stress and the pressure part has nothing to do with the plasticity. This is why the return mapping only applied to the deviatoric part.

Shuaihao-Zhang avatar Nov 27 '23 01:11 Shuaihao-Zhang

@Xiangyu-Hu @Shuaihao-Zhang Form the derivation, we should use the shear strain to obtain the scaling factor. But we can have a try for full strain.

@Xiangyu-Hu @DongWuTUM I have check the full strain, and there is a problem. image For shear strain, we can get the shear strain form shear stress by dividing by 2G. While for total strain, we can not simply get the total strain from total stress.

Shuaihao-Zhang avatar Nov 27 '23 02:11 Shuaihao-Zhang

If I do as you said by: return shear_stress_rate_elastic; Then I do not comments line 533 but move it before, Mat3d deviatoric_stress = shear_stress_3D_[index_i]; The simulation now should not blowup. but it does. So, there seems still has consistent issue.

To transfer to elasticity, we should switch to return shear_stress_rate_elastic; and also comment Line 533 shear_stress_3D_[index_i] = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]); to skip return mapping. If we don't, then the return mapping still works, which makes the stress-strain behavior is non-linear. The stress and strain after return mapping is very small, so the scale matrix 𝝋 will be small. Then effect the hourglass control is small, and the simulation crashes because (I guess) tensile instability, as I mention above.

I think that I am wrong here because the shear stress became plastic at next time step then the scale factor is not identity anymore. However, the scaling in TL version should have check.

Xiangyu-Hu avatar Nov 27 '23 06:11 Xiangyu-Hu

@Xiangyu-Hu @Shuaihao-Zhang Form the derivation, we should use the shear strain to obtain the scaling factor. But we can have a try for full strain.

@Xiangyu-Hu @DongWuTUM I have check the full strain, and there is a problem. image For shear strain, we can get the shear strain form shear stress by dividing by 2G. While for total strain, we can not simply get the total strain from total stress.

You can have check the TL version. For the scaling factor, the method add the isotropic part back to the right hand cauchy strain.

Xiangyu-Hu avatar Nov 27 '23 06:11 Xiangyu-Hu

It is clear that if we included the isotropic part the variation of the scaling factor will be smaller.

Xiangyu-Hu avatar Nov 27 '23 06:11 Xiangyu-Hu

It is clear that if we included the isotropic part the variation of the scaling factor will be smaller.

Sure, I will check this.

Shuaihao-Zhang avatar Nov 27 '23 07:11 Shuaihao-Zhang

Another thing is that the transformation between 2 and 3 d may introduce consistent issue.

Xiangyu-Hu avatar Nov 27 '23 09:11 Xiangyu-Hu

We better begin with the simplest plastic case first.

Xiangyu-Hu avatar Nov 27 '23 09:11 Xiangyu-Hu

Another thing is that the transformation between 2 and 3 d may introduce consistent issue.

I think this is ok. We can use the case zsh_2d_oscillating_beam_plastic to test. The J2 plasticity material is used in this case. If we skip the return mapping and also switch to return shear_stress_rate_elastic; in the constitutive relative. We can get exactly the same result as the case test_2d_oscillating_beam_ul, which use the elastic material.

Shuaihao-Zhang avatar Nov 27 '23 09:11 Shuaihao-Zhang

We better begin with the simplest plastic case first.

Sure, I will try to find some other cases, maybe one dimensional stretching or compression of metals.

Shuaihao-Zhang avatar Nov 27 '23 09:11 Shuaihao-Zhang

We better begin with the simplest plastic case first.

Sure, I will try to find some other cases, maybe one dimensional stretching or compression of metals.

No. As our issue is stability, we need just simply the material properties for testing.

Xiangyu-Hu avatar Nov 27 '23 09:11 Xiangyu-Hu

We better begin with the simplest plastic case first.

Sure, I will try to find some other cases, maybe one dimensional stretching or compression of metals.

No. As our issue is stability, we need just simply the material properties for testing.

I guess J2 plasticity is one of the simplest plastic models. I will check.

Shuaihao-Zhang avatar Nov 27 '23 09:11 Shuaihao-Zhang

If I do as you said by: return shear_stress_rate_elastic; Then I do not comments line 533 but move it before, Mat3d deviatoric_stress = shear_stress_3D_[index_i]; The simulation now should not blowup. but it does. So, there seems still has consistent issue.

To transfer to elasticity, we should switch to return shear_stress_rate_elastic; and also comment Line 533 shear_stress_3D_[index_i] = J2_plasticity_.ReturnMappingShearStress(shear_stress_3D_[index_i]); to skip return mapping. If we don't, then the return mapping still works, which makes the stress-strain behavior is non-linear. The stress and strain after return mapping is very small, so the scale matrix 𝝋 will be small. Then effect the hourglass control is small, and the simulation crashes because (I guess) tensile instability, as I mention above.

I think that I am wrong here because the shear stress became plastic at next time step then the scale factor is not identity anymore. However, the scaling in TL version should have check.

I think it is Okay that the scale factor is identity because we have checked whether it is the plastic stage or not just before calculating the scale factor. And it is just related to this time step, not the next step.

DongWuTUM avatar Nov 27 '23 11:11 DongWuTUM

We better begin with the simplest plastic case first.

Sure, I will try to find some other cases, maybe one dimensional stretching or compression of metals.

No. As our issue is stability, we need just simply the material properties for testing.

I guess J2 plasticity is one of the simplest plastic models. I will check.

Yes, it is already the simplest.

DongWuTUM avatar Nov 27 '23 11:11 DongWuTUM