-
Notifications
You must be signed in to change notification settings - Fork 910
FIX: Correct 2D Von Mises Stress Calculation in CFEAElasticity (#2603) #2665
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
FIX: Correct 2D Von Mises Stress Calculation in CFEAElasticity (#2603) #2665
Conversation
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Can you look into the plain strain case too?
|
@pcarruscag I have added support for Plane Strain as requested. Implementation Details:
|
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
|
@pcarruscag I have applied the requested changes:
Builds are passing locally. Ready for final review! |
pcarruscag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve the tests to run, but there will be plenty of segmentation faults.
| static su2double VonMisesStress(unsigned short nDim, const T& stress, su2double Nu, bool isPlaneStrain) { | ||
| if (nDim == 2) { | ||
| su2double Sxx = stress[0], Syy = stress[1], Sxy = stress[2]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the 4th element of "stress" is Szz you don't need to pass Nu and isPlainStrain to this function.
|
@pcarruscag Done. I have refactored the implementation as requested to ensure memory safety.
I updated all 3 call sites to pack the stress vector correctly before passing it to the utility, preventing any potential segfaults. |
Issue:
As reported in Issue #2603, the 2D implementation of the Von Mises stress calculation in
CFEAElasticity::VonMisesStresswas mathematically incorrect.The previous code implemented:
$$\sigma_{vm} = \sqrt{S_1^2 + S_2^2 - 2S_1S_2} = \sqrt{(S_1 - S_2)^2} = |S_1 - S_2|$$
This formula corresponds to the Tresca equivalent stress (twice the maximum shear stress), not the Von Mises stress.
Fix:
$$\sigma_{vm} = \sqrt{S_1^2 + S_2^2 - S_1S_2}$$
Updated the formula to the correct 2D Plane Stress Von Mises definition:
Verification:
Verified that the term
-2*S1*S2was the source of the discrepancy. The updated implementation now aligns with standard continuum mechanics definitions for plane stress.