Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Shuaihao-Zhang
Copy link
Collaborator

@Shuaihao-Zhang Shuaihao-Zhang commented Nov 24, 2023

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

@Shuaihao-Zhang
Copy link
Collaborator Author

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

// calculate scale matrix
if (plastic_indicator_[index_i])
{
scale_coef_[index_i] = reduceTensor(shear_stress_3D_[index_i]) * reduceTensor(shear_strain_3D_[index_i]).inverse() / (2.0 * G_);
}
else
{
scale_coef_[index_i] = Matd::Identity();
}

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

@Xiangyu-Hu
Copy link
Owner

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

@Xiangyu-Hu
Copy link
Owner

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

@Xiangyu-Hu
Copy link
Owner

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

// calculate scale matrix
if (plastic_indicator_[index_i])
{
scale_coef_[index_i] = reduceTensor(shear_stress_3D_[index_i]) * reduceTensor(shear_strain_3D_[index_i]).inverse() / (2.0 * G_);
}
else
{
scale_coef_[index_i] = Matd::Identity();
}

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}?

@Shuaihao-Zhang
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@Xiangyu-Hu
Copy link
Owner

Xiangyu-Hu commented Nov 26, 2023

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
Copy link
Owner

@Shuaihao-Zhang
Copy link
Collaborator Author

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.

Mat3d J2Plasticity::ConstitutiveRelationShearStress(Mat3d& velocity_gradient, Mat3d& shear_stress)
{
Real dim = 3.0;
Mat3d strain_rate = 0.5 * (velocity_gradient + velocity_gradient.transpose());
Mat3d spin_rate = 0.5 * (velocity_gradient - velocity_gradient.transpose());
Mat3d deviatoric_strain_rate = strain_rate - (1.0 / dim) * strain_rate.trace() * Mat3d::Identity();
//consider the elastic part
Mat3d shear_stress_rate_elastic = 2.0 * G_ * deviatoric_strain_rate;
//consider the plastic part
Mat3d deviatoric_stress_tensor = shear_stress;
Real stress_tensor_J2 = 0.5 * (deviatoric_stress_tensor.cwiseProduct(deviatoric_stress_tensor.transpose())).sum();
Real f = sqrt(2.0 * stress_tensor_J2) - sqrt(2.0 / 3.0) * yield_stress_;
Real lambda_dot_ = 0;
Mat3d g = Mat3d::Zero();
if (f > TinyReal)
{
Real deviatoric_stress_times_strain_rate = (deviatoric_stress_tensor.cwiseProduct(strain_rate)).sum();
lambda_dot_ = deviatoric_stress_times_strain_rate / sqrt(2.0 * stress_tensor_J2);
g = lambda_dot_ * (sqrt(2.0) * G_ * deviatoric_stress_tensor / (sqrt(stress_tensor_J2)));
}
return shear_stress_rate_elastic - g;
//return shear_stress_rate_elastic;
}

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
Copy link
Collaborator Author

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.

@DongWuTUM
Copy link
Collaborator

@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
Copy link
Collaborator

DongWuTUM commented Nov 26, 2023

@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
Copy link
Owner

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.

Mat3d J2Plasticity::ConstitutiveRelationShearStress(Mat3d& velocity_gradient, Mat3d& shear_stress)
{
Real dim = 3.0;
Mat3d strain_rate = 0.5 * (velocity_gradient + velocity_gradient.transpose());
Mat3d spin_rate = 0.5 * (velocity_gradient - velocity_gradient.transpose());
Mat3d deviatoric_strain_rate = strain_rate - (1.0 / dim) * strain_rate.trace() * Mat3d::Identity();
//consider the elastic part
Mat3d shear_stress_rate_elastic = 2.0 * G_ * deviatoric_strain_rate;
//consider the plastic part
Mat3d deviatoric_stress_tensor = shear_stress;
Real stress_tensor_J2 = 0.5 * (deviatoric_stress_tensor.cwiseProduct(deviatoric_stress_tensor.transpose())).sum();
Real f = sqrt(2.0 * stress_tensor_J2) - sqrt(2.0 / 3.0) * yield_stress_;
Real lambda_dot_ = 0;
Mat3d g = Mat3d::Zero();
if (f > TinyReal)
{
Real deviatoric_stress_times_strain_rate = (deviatoric_stress_tensor.cwiseProduct(strain_rate)).sum();
lambda_dot_ = deviatoric_stress_times_strain_rate / sqrt(2.0 * stress_tensor_J2);
g = lambda_dot_ * (sqrt(2.0) * G_ * deviatoric_stress_tensor / (sqrt(stress_tensor_J2)));
}
return shear_stress_rate_elastic - g;
//return shear_stress_rate_elastic;
}

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.

Mat3d J2Plasticity::ConstitutiveRelationShearStress(Mat3d& velocity_gradient, Mat3d& shear_stress)
{
Real dim = 3.0;
Mat3d strain_rate = 0.5 * (velocity_gradient + velocity_gradient.transpose());
Mat3d spin_rate = 0.5 * (velocity_gradient - velocity_gradient.transpose());
Mat3d deviatoric_strain_rate = strain_rate - (1.0 / dim) * strain_rate.trace() * Mat3d::Identity();
//consider the elastic part
Mat3d shear_stress_rate_elastic = 2.0 * G_ * deviatoric_strain_rate;
//consider the plastic part
Mat3d deviatoric_stress_tensor = shear_stress;
Real stress_tensor_J2 = 0.5 * (deviatoric_stress_tensor.cwiseProduct(deviatoric_stress_tensor.transpose())).sum();
Real f = sqrt(2.0 * stress_tensor_J2) - sqrt(2.0 / 3.0) * yield_stress_;
Real lambda_dot_ = 0;
Mat3d g = Mat3d::Zero();
if (f > TinyReal)
{
Real deviatoric_stress_times_strain_rate = (deviatoric_stress_tensor.cwiseProduct(strain_rate)).sum();
lambda_dot_ = deviatoric_stress_times_strain_rate / sqrt(2.0 * stress_tensor_J2);
g = lambda_dot_ * (sqrt(2.0) * G_ * deviatoric_stress_tensor / (sqrt(stress_tensor_J2)));
}
return shear_stress_rate_elastic - g;
//return shear_stress_rate_elastic;
}

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
Copy link
Owner

Xiangyu-Hu commented Nov 26, 2023

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

@Shuaihao-Zhang
Copy link
Collaborator Author

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
Copy link
Collaborator Author

@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
Copy link
Collaborator Author

@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.

@Xiangyu-Hu
Copy link
Owner

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
Copy link
Owner

@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
Copy link
Owner

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

@Shuaihao-Zhang
Copy link
Collaborator Author

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

Sure, I will check this.

@Xiangyu-Hu
Copy link
Owner

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

@Xiangyu-Hu
Copy link
Owner

We better begin with the simplest plastic case first.

@Shuaihao-Zhang
Copy link
Collaborator Author

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.

@DongWuTUM
Copy link
Collaborator

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 am still confused about why "the stress and strain after return mapping are very small, so the scale matrix 𝝋 will be small". If it is perfect plasticity, the shear strain after the return map should be the same as the elastic strain. Does it mean the elastic strain is very small? Please check this.

@Shuaihao-Zhang
Copy link
Collaborator Author

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 am still confused about why "the stress and strain after return mapping are very small, so the scale matrix 𝝋 will be small". If it is perfect plasticity, the shear strain after the return map should be the same as the elastic strain. Does it mean the elastic strain is very small? Please check this.

Yeah, this may be the issue here.
Here, we calculate the shear strain after return mapping based on the shear stress after return mapping.
image
Initially, we use the way because we thought that, for elasticity, the scale matrix 𝝋 will be the identity matrix; while for plasticity, there is a reduction for the shear stress (due to return mapping and plastic constitutive relation), then the shear strain after return mapping will also decrease. Then we can get a smaller scale matrix 𝝋 for plasticity, i.e., smaller hourglass control for plasticity, which is what we want.

But, as you mentioned just now, the return mapping only works for shear stress, and theoretically, the shear strain should not change.
I guess the stress-strain relationship is not reversible. We can get the stress from strain, but we can not get strain from stress, because one stress state may corresponds to multiple strains.

@DongWuTUM
Copy link
Collaborator

The shear stress is changing, but the J2 remains the same. I am not sure. Please check it. I think the stress-strain relationship is reversible as they are tensors.

@Shuaihao-Zhang
Copy link
Collaborator Author

The shear stress is changing, but the J2 remains the same. I am not sure. Please check it. I think the stress-strain relationship is reversible as they are tensors.

The second invariant J2 also changes after return mapping.
If you check the return mapping process in I1-J2 (first Invariant and second Invariant ) space, it's clear.
The following figure is the returning mapping in I1-J2 space for DP constitutive model [1].
image

The process B-C is the return mapping for deviatoric stress (I1 keeps unchanged). We can see the J2 (y-axis) also changed. And for J2 plasticity model, the return mapping process is similar with the DP model.

I think the stress-strain relationship is not reversible. We can get the stress from strain as one strain only corresponds to one stress, but we can not get strain from stress because on stress corresponds to several strains, as shown in the figure below.
image

[1]Bui, H. H., Fukagawa, R., Sako, K., Ohno, S., 2008. Lagrangian meshfree particles method (SPH) for large deformation and failure flows of geomaterial using elastic–plastic soil constitutive model. International journal for numerical and analytical methods in geomechanics 32(12), 1537-1570.

@DongWuTUM
Copy link
Collaborator

summarize

I have summarized the differences between the TL and UL.

  1. Please check whether it is correct or not.
  2. Check the difference in the scaling matrix when running cases of TL and UL.
  3. Try: a. include the isotropic term before inverse operation (Please show me how you do it); b. Ɛ^(-1) = (Ɛ+I)^(-1) - I (Here, we can try Ɛ is shear strain or full strain); c. scaling matrix = (Ɛ_corrected+I)(Ɛ+I)^(-1).
  4. The TL code is in branch "try_plastic_decomposed". (Note that the factor zeta in the code has not been adjusted. I will upload the newest code tomorrow.)
  5. The shear stress-strain invertibility is not important here as the relation between them is only needed to times 2G.

@Xiangyu-Hu
Copy link
Owner

Xiangyu-Hu commented Nov 27, 2023

I have the feeling that the inconsistency is coming from the \phi term and \hat{v}_ij term.
Since we are using full strain tensor for the second part of \hat{V}_ij, the \phi term should also be the same.
The derivation is e_ij = \epsilon_ij^-1 * \epsilon_ij * e_ij -> \epsilon_ij^-1 * (v_ij - \epsilon_ij * e_ij) = \epsilon_ij^-1 * \hat{v}_ij.

@Xiangyu-Hu
Copy link
Owner

20231128_094909.jpg

The suggested formulation on the correction term. Note that we need compute the effective strain rate within return mapping.

@Shuaihao-Zhang
Copy link
Collaborator Author

@Xiangyu-Hu @DongWuTUM
Thanks a lot. I will check these in detail.

@Shuaihao-Zhang
Copy link
Collaborator Author

20231128_094909.jpg

The suggested formulation on the correction term. Note that we need compute the effective strain rate within return mapping.

The new form is different from the previous formulation even for elastic case.
image
I tested the new formulation and it doesn't work for elastic oscillating beam. It seems the correction term is too large. I do use B_ correction here
oscillating_beam

@Xiangyu-Hu
Copy link
Owner

Xiangyu-Hu commented Nov 29, 2023

20231128_094909.jpg
The suggested formulation on the correction term. Note that we need compute the effective strain rate within return mapping.

The new form is different from the previous formulation even for elastic case. image I tested the new formulation and it doesn't work for elastic oscillating beam. It seems the correction term is too large. I do use B_ correction here oscillating_beam oscillating_beam

It seems you misunderstood the new formulation, it should recover the elastic correction exactly before plasticity shows up. Because in that case, the two strain rates, yield identity.

@Shuaihao-Zhang
Copy link
Collaborator Author

It seems you misunderstood the new formulation, it should recover the elastic correction exactly before plasticity shows up. Because in that case, the two strain rates, yield identity.

I see. I guess there is a typo in you new formulation.
image
The new scale matrix 𝝋 based on the strain rate in ok. But for the \hat{v}_ij, we should still use the old one. The new \hat{v}_ij used the strain rate. The strain rate incudes the transpose of velocity gradient, which we don't have in the old formulation.

Then, I tested the following formulation:
image
The formulation can reproduce the elastic deformation, But for plasticity, it still crashes like this.
image

@Xiangyu-Hu
Copy link
Owner

Xiangyu-Hu commented Nov 29, 2023

It seems you misunderstood the new formulation, it should recover the elastic correction exactly before plasticity shows up. Because in that case, the two strain rates, yield identity.

I see. I guess there is a typo in you new formulation. image The new scale matrix 𝝋 based on the strain rate in ok. But for the \hat{v}_ij, we should still use the old one. The new \hat{v}_ij used the strain rate. The strain rate incudes the transpose of velocity gradient, which we don't have in the old formulation.

Then, I tested the following formulation: image The formulation can reproduce the elastic deformation, But for plasticity, it still crashes like this. image

In the second case, how you obtain the effective strain rate? Also they should be strain rate not shear rate.

@DongWuTUM
Copy link
Collaborator

@Shuaihao-Zhang I have upload the newest houglass control code to my branch https://github.com/DongWuTUM/SPHinXsys/tree/plastic_hourglass_control. I don't have time to test in Linux, but it already works in Windows.

@Xiangyu-Hu
Copy link
Owner

20231129_121048.jpg

@Xiangyu-Hu
Copy link
Owner

20231129_121048.jpg

@Shuaihao-Zhang Could you update the code with this formulation? Thanks.

@Shuaihao-Zhang
Copy link
Collaborator Author

@Shuaihao-Zhang Could you update the code with this formulation? Thanks.

Sure, I have add the new formulation and the simulation still crashes quick after the bar touches the plate.
image
You can check the code at:

/*shear strain and shear strain rate befor and after return mapping*/
shear_strain_[index_i] = reduceTensor(shear_strain_3D_[index_i]);
shear_strain_return_map_[index_i] = reduceTensor(shear_stress_3D_[index_i]) / (2.0 * G_);
//calculate the shear_strain_rate_return_map_ based on the strain increment between time step n and n-1
Real hydrostatic_strain_rate_i = strain_rate_3D_[index_i].trace() / 3.0;
shear_strain_rate_return_map_[index_i] = (shear_strain_return_map_[index_i] - shear_strain_pre_return_map_[index_i]) / dt;
//calculate total strain rate
Matd total_strain_rate_i = reduceTensor(strain_rate_3D_[index_i]);
Matd total_strain_rate_i_return_map = shear_strain_rate_return_map_[index_i] + hydrostatic_strain_rate_i * Matd::Identity();
//shear strain in the time step n-1
shear_strain_pre_return_map_[index_i] = shear_strain_return_map_[index_i];

I used the difference of the shear strain after return mapping between time t and t-1 to calculate the effective shear strain rate.
image
Then I also added the hydrostatic strain rate to get the effective total strain rate.
I also tried with only the shear strain rate, and it also crashed.

@Shuaihao-Zhang
Copy link
Collaborator Author

@Shuaihao-Zhang I have upload the newest houglass control code to my branch https://github.com/DongWuTUM/SPHinXsys/tree/plastic_hourglass_control. I don't have time to test in Linux, but it already works in Windows.

Thanks! I will check it in detail.

@Xiangyu-Hu
Copy link
Owner

Please have a check on a simple formulation at the branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy
numerical stability seems OK.

@Shuaihao-Zhang
Copy link
Collaborator Author

Please have a check on a simple formulation at the branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy numerical stability seems OK.

Thanks.
Although the Taylor bar didn't crash with the new formulation, the scale coefficient is not an identity matrix in elastic situations.

scale_coef_[index_i] = reduceTensor(shear_stress_3D_[index_i]) * (velocity_gradient_[index_i] + Eps * Matd::Identity()).inverse();

If I skip return mapping and use return shear_stress_rate_elastic;, ideally, the bar should bounce back like elastic material, but it didn't and the scale matrix is 0 everywhere.
image

Another thing is that I changed my branch to plane stress condition based on your branch for the J2 plasticity.
Previously, I use the plane strain condition, which means I also need to use 3D stress tensor in 2D cases. So I use the reduceTensor and increaseTensor to transfer from 2D and 3D. But this just affect 2D cases.

I checked Dong's code, and he used plane stress assumption for TLSPH, which means that the stress is 2D for 2D cases and 3D for 3D cases. Since his result is good, I suppose the plans stress is also ok for the J2 plasticity (for soils, it's not ok).
Then I just changed to plane stress condition based on your new branch. I deleted the transform between 2D and 3D tensors to simplify the code and reduce the source of error.

@Xiangyu-Hu
Copy link
Owner

Please have a check on a simple formulation at the branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy numerical stability seems OK.

Thanks. Although the Taylor bar didn't crash with the new formulation, the scale coefficient is not an identity matrix in elastic situations.

scale_coef_[index_i] = reduceTensor(shear_stress_3D_[index_i]) * (velocity_gradient_[index_i] + Eps * Matd::Identity()).inverse();

If I skip return mapping and use return shear_stress_rate_elastic;, ideally, the bar should bounce back like elastic material, but it didn't and the scale matrix is 0 everywhere.
image
Another thing is that I changed my branch to plane stress condition based on your branch for the J2 plasticity. Previously, I use the plane strain condition, which means I also need to use 3D stress tensor in 2D cases. So I use the reduceTensor and increaseTensor to transfer from 2D and 3D. But this just affect 2D cases.

I checked Dong's code, and he used plane stress assumption for TLSPH, which means that the stress is 2D for 2D cases and 3D for 3D cases. Since his result is good, I suppose the plans stress is also ok for the J2 plasticity (for soils, it's not ok). Then I just changed to plane stress condition based on your new branch. I deleted the transform between 2D and 3D tensors to simplify the code and reduce the source of error.

@Xiangyu-Hu Xiangyu-Hu closed this Nov 30, 2023
@Xiangyu-Hu Xiangyu-Hu reopened this Nov 30, 2023
@Xiangyu-Hu
Copy link
Owner

Please have a check on a simple formulation at the branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy numerical stability seems OK.

Thanks. Although the Taylor bar didn't crash with the new formulation, the scale coefficient is not an identity matrix in elastic situations.

scale_coef_[index_i] = reduceTensor(shear_stress_3D_[index_i]) * (velocity_gradient_[index_i] + Eps * Matd::Identity()).inverse();

If I skip return mapping and use return shear_stress_rate_elastic;, ideally, the bar should bounce back like elastic material, but it didn't and the scale matrix is 0 everywhere.
image
Another thing is that I changed my branch to plane stress condition based on your branch for the J2 plasticity. Previously, I use the plane strain condition, which means I also need to use 3D stress tensor in 2D cases. So I use the reduceTensor and increaseTensor to transfer from 2D and 3D. But this just affect 2D cases.
I checked Dong's code, and he used plane stress assumption for TLSPH, which means that the stress is 2D for 2D cases and 3D for 3D cases. Since his result is good, I suppose the plans stress is also ok for the J2 plasticity (for soils, it's not ok). Then I just changed to plane stress condition based on your new branch. I deleted the transform between 2D and 3D tensors to simplify the code and reduce the source of error.

It works for elastic (both elastic shear stress rate and no returnning map)
3D case as shown in the test branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy
Note that the correction is numerical force term, there is no requirement for the consistency mentioned by you. More important is they approaching zero when resolution is high and it is small value compared to the main stress induced force.
I made small change on the scaling factor, however i do not known which is better.

@DongWuTUM
Copy link
Collaborator

@Shuaihao-Zhang It is the plane strain (not plane stress) problem for 2D case. The stress in third coordinate is not needed for calculation. (I remember the stress in third coordinate is needed for soil. You can ignore this stress now.)

@Shuaihao-Zhang
Copy link
Collaborator Author

It works for elastic (both elastic shear stress rate and no returnning map) 3D case as shown in the test branch https://github.com/Xiangyu-Hu/SPHinXsys/tree/hourglass-control-ul_xy Note that the correction is numerical force term, there is no requirement for the consistency mentioned by you. More important is they approaching zero when resolution is high and it is small value compared to the main stress induced force. I made small change on the scaling factor, however i do not known which is better.

Thanks. I checked you branch. The 3D Taylor bar seems elastic if we use elastic shear stress rate and no return mapping.
But the scale matrix if super large, and theoretically, it should be an identity matrix for elasticity.
image
Also for 2D Taylor bar, the scale matrix is very large although is didn't crash.
image
For 2D oscillating beam, if I use the plastic constitutive relation (with elastic shear stress rate and no return mapping), the result should be exactly the same with the elastic beam (for previous method, we can total reproduce this). But it crashes and I think this is related to the unreasonable scale matrix.
image

@Shuaihao-Zhang
Copy link
Collaborator Author

@Shuaihao-Zhang It is the plane strain (not plane stress) problem for 2D case. The stress in third coordinate is not needed for calculation. (I remember the stress in third coordinate is needed for soil. You can ignore this stress now.)

Thanks! Then I will just use 2D matrix for 2D cases.

@Xiangyu-Hu
Copy link
Owner

@Shuaihao-Zhang @DongWuTUM
Finally, matrix inverse regularization is done. Now oscillation beam and Taylor bar both work.
shear_stress_try

@Shuaihao-Zhang
Copy link
Collaborator Author

@Shuaihao-Zhang @DongWuTUM Finally, matrix inverse regularization is done. Now oscillation beam and Taylor bar both work. shear_stress_try

Thanks! Now the elastic deformation can be totally reproduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants