Closed thiagordonho closed 4 years ago
@thiagordonho Thanks for figuring this out. @ezrayst we might have this issue as well.
@thiagordonho thanks so much for this. Can you review #653 and approve it? We can merge it quickly.
J3 should be positive and J2 is always positive, though it is not the case numerically. Thus, I think your suggestion is good in making sure it's positive by std::abs()
Describe the bug The computed stresses at some particles will sometimes be
nan
when using the Mohr-Coulomb material. Further inspection of the issue lead to the conclusion that this happens when(1-r*r)
is negative andstd::abs(1-r*r) > tolerance
inmaterial_utility.tcc
where the invariants and Lode parameters are calculated. This particular condition results indtheta_dr = nan
because a square root of a negative number is used in its calculation:To Reproduce Steps to reproduce the behavior:
"locate_particles": true
Using the Mohr-Coulombparticle outside of mesh domain
Expected behavior A clear and concise description of what you expected to happen.
Screenshots As aforementioned, if
locate_particles
is set totrue
, the simulation will stop due to aparticle outside the mesh domain
. Otherwise, the material point with stresses equal tonan
, along with all the other material points in its cell and neighboring cells, will be removed as exemplified below:This happens because the
nan
values are used to compute the internal force, nodal velocities and acceleration which are later mapped to all material points, leaving their parameters "corrupted" as well.Runtime environment (please complete the following information):
Additional context
r
that leads to this problem is usually very close to -1 (e.g.r = -1.000000000000029
).factor
to use the absolute value of1-r*r
fixes the problem numerically.material_utility.tcc
, any other constitutive model that uses the functions in this file are also susceptible to the same issue.