-
Notifications
You must be signed in to change notification settings - Fork 286
[GeoMechanicsApplication] Convert the reordering of Mohr-Coulomb principal stresses to averaging #13595
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
[GeoMechanicsApplication] Convert the reordering of Mohr-Coulomb principal stresses to averaging #13595
Changes from 25 commits
e20e5d3
123353e
60635e2
f949e95
2e4eecd
7d822b3
0cf33f3
79cc3ef
5ee1a94
6df01ee
2347626
973eb6c
15c201a
3b0321f
6ccab5b
03fa072
d9b40d3
9a8b9ba
08a58e8
c888d43
92bdda8
fdb6071
595fb9c
1cd462f
7144edb
813e5a9
edd24b1
96f1c9a
c464ba5
62f225d
3a6c667
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,49 @@ | |
|
|
||
| #include <cmath> | ||
|
|
||
| namespace | ||
| { | ||
| using namespace Kratos; | ||
|
|
||
| std::size_t AveragingTypeToArrayIndex(CoulombYieldSurface::CoulombAveragingType AveragingType) | ||
| { | ||
| switch (AveragingType) { | ||
| case CoulombYieldSurface::CoulombAveragingType::LOWEST_PRINCIPAL_STRESSES: | ||
| return 0; | ||
| case CoulombYieldSurface::CoulombAveragingType::HIGHEST_PRINCIPAL_STRESSES: | ||
| return 2; | ||
| default: | ||
| return 1; | ||
| } | ||
| } | ||
|
|
||
| Vector AveragePrincipalStressComponents(const Vector& rPrincipalStressVector, | ||
| CoulombYieldSurface::CoulombAveragingType AveragingType) | ||
| { | ||
| auto result = rPrincipalStressVector; | ||
| if (AveragingType == CoulombYieldSurface::CoulombAveragingType::LOWEST_PRINCIPAL_STRESSES) { | ||
| std::fill(result.begin(), result.begin() + 1, | ||
| (rPrincipalStressVector[0] + rPrincipalStressVector[1]) * 0.5); | ||
| } else if (AveragingType == CoulombYieldSurface::CoulombAveragingType::HIGHEST_PRINCIPAL_STRESSES) { | ||
| std::fill(result.begin() + 1, result.begin() + 2, | ||
| (rPrincipalStressVector[1] + rPrincipalStressVector[2]) * 0.5); | ||
| } | ||
| return result; | ||
| } | ||
|
|
||
| CoulombYieldSurface::CoulombAveragingType FindAveragingType(const Vector& rMappedPrincipalStressVector) | ||
| { | ||
| if (rMappedPrincipalStressVector[0] < rMappedPrincipalStressVector[1]) { | ||
| return CoulombYieldSurface::CoulombAveragingType::LOWEST_PRINCIPAL_STRESSES; | ||
| } | ||
| if (rMappedPrincipalStressVector[1] < rMappedPrincipalStressVector[2]) { | ||
| return CoulombYieldSurface::CoulombAveragingType::HIGHEST_PRINCIPAL_STRESSES; | ||
| } | ||
| return CoulombYieldSurface::CoulombAveragingType::NO_AVERAGING; | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| namespace Kratos | ||
| { | ||
|
|
||
|
|
@@ -149,28 +192,43 @@ void MohrCoulombWithTensionCutOff::CalculateMaterialResponseCauchy(ConstitutiveL | |
| mpConstitutiveDimension->CalculateElasticMatrix(r_prop[YOUNG_MODULUS], r_prop[POISSON_RATIO]); | ||
| } | ||
|
|
||
| const auto trail_stress_vector = CalculateTrialStressVector( | ||
| const auto trial_stress_vector = CalculateTrialStressVector( | ||
| rParameters.GetStrainVector(), r_prop[YOUNG_MODULUS], r_prop[POISSON_RATIO]); | ||
|
|
||
| Vector principal_trial_stress_vector; | ||
| Matrix rotation_matrix; | ||
| StressStrainUtilities::CalculatePrincipalStresses( | ||
| trail_stress_vector, principal_trial_stress_vector, rotation_matrix); | ||
| trial_stress_vector, principal_trial_stress_vector, rotation_matrix); | ||
|
|
||
| auto trial_sigma_tau = | ||
| StressStrainUtilities::TransformPrincipalStressesToSigmaTau(principal_trial_stress_vector); | ||
| while (!mCoulombWithTensionCutOffImpl.IsAdmissibleSigmaTau(trial_sigma_tau)) { | ||
| trial_sigma_tau = mCoulombWithTensionCutOffImpl.DoReturnMapping(r_prop, trial_sigma_tau); | ||
| principal_trial_stress_vector = StressStrainUtilities::TransformSigmaTauToPrincipalStresses( | ||
| trial_sigma_tau, principal_trial_stress_vector); | ||
|
|
||
| StressStrainUtilities::ReorderEigenValuesAndVectors(principal_trial_stress_vector, rotation_matrix); | ||
mnabideltares marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| trial_sigma_tau = | ||
| StressStrainUtilities::TransformPrincipalStressesToSigmaTau(principal_trial_stress_vector); | ||
|
|
||
| if (mCoulombWithTensionCutOffImpl.IsAdmissibleSigmaTau(trial_sigma_tau)) { | ||
| mStressVector = trial_stress_vector; | ||
| } else { | ||
| auto mapped_sigma_tau = mCoulombWithTensionCutOffImpl.DoReturnMapping( | ||
| r_prop, trial_sigma_tau, CoulombYieldSurface::CoulombAveragingType::NO_AVERAGING); | ||
| auto mapped_principal_stress_vector = StressStrainUtilities::TransformSigmaTauToPrincipalStresses( | ||
| mapped_sigma_tau, principal_trial_stress_vector); | ||
|
|
||
| // for interchanging principal stresses, retry mapping with averaged principal stresses. | ||
| const auto averaging_type = FindAveragingType(mapped_principal_stress_vector); | ||
| if (averaging_type != CoulombYieldSurface::CoulombAveragingType::NO_AVERAGING) { | ||
| const auto averaged_principal_trial_stress_vector = | ||
| AveragePrincipalStressComponents(principal_trial_stress_vector, averaging_type); | ||
| trial_sigma_tau = StressStrainUtilities::TransformPrincipalStressesToSigmaTau( | ||
| averaged_principal_trial_stress_vector); | ||
| mapped_sigma_tau = | ||
| mCoulombWithTensionCutOffImpl.DoReturnMapping(r_prop, trial_sigma_tau, averaging_type); | ||
| mapped_principal_stress_vector = StressStrainUtilities::TransformSigmaTauToPrincipalStresses( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When there is averaging, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before the result of the first call is overwritten, the result of the first call is used to determine ( with FindAveragingType() ) whether the averaging route should be taken. There is no redundant call.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what you mean. We can discuss it when you are available. |
||
| mapped_sigma_tau, averaged_principal_trial_stress_vector); | ||
| mapped_principal_stress_vector[1] = | ||
| mapped_principal_stress_vector[AveragingTypeToArrayIndex(averaging_type)]; | ||
| } | ||
| mStressVector = StressStrainUtilities::RotatePrincipalStresses( | ||
| mapped_principal_stress_vector, rotation_matrix, mpConstitutiveDimension->GetStrainSize()); | ||
| } | ||
|
|
||
| mStressVector = StressStrainUtilities::RotatePrincipalStresses( | ||
| principal_trial_stress_vector, rotation_matrix, mpConstitutiveDimension->GetStrainSize()); | ||
| rParameters.GetStressVector() = mStressVector; | ||
| } | ||
|
|
||
|
|
||
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.
This is now general, such that it can be used for all return directions.