-
Notifications
You must be signed in to change notification settings - Fork 245
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
[CLApp] Implementing fatigue data container #11494
Conversation
const Vector& r_aux_stresses = mPreviousStresses; | ||
rFatigueVariables.PreviousStresses[1] = CurrentStress; | ||
rFatigueVariables.PreviousStresses[0] = r_aux_stresses[1]; | ||
// mPreviousStresses = rFatigueVariables.PreviousStresses; |
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.
Leftover?
bool DamageActivation; | ||
}; | ||
|
||
HCFDataContainer() |
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.
Remove the tabulation
ConstitutiveLaw::Parameters rValues = ConstitutiveLaw::Parameters(); | ||
public: | ||
|
||
struct FatigueVariables { |
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.
Every variable must be saved in every GP, there are not common values that can be stored in properties?
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 agree, some double
values can be recomuted, not being necessary to be stored
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.
these are all fatigue variables which have been gathered in one place. Not all of them are stored but the remaining ones are necessary for calculations.
|
||
///@name Member Variables | ||
///@{ | ||
double mMaxStress = 0.0; |
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.
Idem, a lot of variables, it is required for every GP?
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.
After checking the HCF CL, yes, it needs tracking of many things...
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.
BTW, the member variables should be in the private
section of the class
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.
solved
double Alphat = 0.0; | ||
double PreviousReversionFactor = 0.0; | ||
double ReversionFactor = 0.0; | ||
bool AdnvanceStrategyApplied; |
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.
there is a typo here
rFatigueVariables.MinIndicator); | ||
const Vector& r_aux_stresses = mPreviousStresses; | ||
rFatigueVariables.PreviousStresses[1] = CurrentStress; | ||
rFatigueVariables.PreviousStresses[0] = r_aux_stresses[1]; |
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.
Where is the r_aux_stresses
? This cannot compile
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.
sorry I did not read it right, it is okkey
|
||
void CalculateFatigueReductionFactorAndWohlerStress(const Properties& rMaterialParameters, HCFDataContainer::FatigueVariables &rFatigueVariables) | ||
{ | ||
HighCycleFatigueLawIntegrator<6>::CalculateFatigueReductionFactorAndWohlerStress(rMaterialParameters, |
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.
We should separate this file into .cpp and .h
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.
done
|
||
CalculateFatigueParameters(rMaterialProperties, rFatigueVariables); | ||
|
||
double betaf = rMaterialProperties[HIGH_CYCLE_FATIGUE_COEFFICIENTS][4]; |
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.
const
?
|
||
double betaf = rMaterialProperties[HIGH_CYCLE_FATIGUE_COEFFICIENTS][4]; | ||
|
||
if (std::abs(rFatigueVariables.MinStress) < 0.001) { |
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.
we should set this tolerance as a static constexpr double tolerance = 1.0e-3;
like we do in the plasticity integrator
|
||
CalculateFatigueReductionFactorAndWohlerStress(rMaterialProperties, rFatigueVariables); | ||
} | ||
if (rFatigueVariables.AdnvanceStrategyApplied) { |
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.
typo there
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.
Some comments
rFatigueVariables.MinIndicator); | ||
const Vector& r_aux_stresses = mPreviousStresses; | ||
rFatigueVariables.PreviousStresses[1] = CurrentStress; | ||
rFatigueVariables.PreviousStresses[0] = r_aux_stresses[1]; |
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.
sorry I did not read it right, it is okkey
CalculateFatigueParameters(rMaterialProperties, rFatigueVariables); | ||
|
||
const double betaf = rMaterialProperties[HIGH_CYCLE_FATIGUE_COEFFICIENTS][4]; | ||
static constexpr double tolerance = 1.0e-3; |
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 declaration you should do it in the .h
file, see plasticity integrator
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.
done
} | ||
rFatigueVariables.MaxStressRelativeError = std::abs((rFatigueVariables.MaxStress - rFatigueVariables.PreviousMaxStress) / rFatigueVariables.MaxStress); | ||
|
||
if (!rFatigueVariables.DamageActivation && rFatigueVariables.GlobalNumberOfCycles > 2 && !rFatigueVariables.AdvanceStrategyApplied && (rFatigueVariables.ReversionFactorRelativeError > 0.001 || rFatigueVariables.MaxStressRelativeError > 0.001)) { |
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.
What tolerance we use here instead of hardcoding 0.001?
|
||
///@name Member Variables | ||
///@{ | ||
double mMaxStress = 0.0; |
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.
After checking the HCF CL, yes, it needs tracking of many things...
|
||
///@name Member Variables | ||
///@{ | ||
double mMaxStress = 0.0; |
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.
BTW, the member variables should be in the private
section of the class
seems good now @SergioJimenezReyes |
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.
my last comments
ConstitutiveLaw::StressVectorType stress_vector, | ||
double uniaxial_stress) | ||
{ | ||
double sign_factor = CalculateTensionOrCompressionIdentifier(stress_vector); |
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.
const?
|
||
CalculateSminAndSmax(uniaxial_stress, rFatigueVariables); | ||
|
||
rFatigueVariables.AdvanceStrategyApplied = rCurrentProcessInfo[ADVANCE_STRATEGY_APPLIED]; |
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.
retrieving something without checking if has been set is dangerous... Think that somebody could use this class without the AITS. I'd use:
``
rFatigueVariables.AdvanceStrategyApplied = rCurrentProcessInfo[ADVANCE_STRATEGY_APPLIED]; | |
rFatigueVariables.AdvanceStrategyApplied = rCurrentProcessInfo.Has(ADVANCE_STRATEGY_APPLIED) ? rCurrentProcessInfo[ADVANCE_STRATEGY_APPLIED : false; |
{}; | ||
|
||
// Defining fatigue methods | ||
|
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.
BTW I think that we need a new method called Check
which ensures that the material properties have the required Fatigue parameters in them.
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.
to be called in the Check
from the CL
A check method has been added. |
uniaxial_stress *= sign_factor; | ||
|
||
CalculateSminAndSmax(uniaxial_stress, rFatigueVariables); | ||
|
||
rFatigueVariables.AdvanceStrategyApplied = rCurrentProcessInfo[ADVANCE_STRATEGY_APPLIED]; | ||
rFatigueVariables.AdvanceStrategyApplied = rCurrentProcessInfo.Has(ADVANCE_STRATEGY_APPLIED) ? rCurrentProcessInfo[ADVANCE_STRATEGY_APPLIED] : false; | ||
rFatigueVariables.DamageActivation = rCurrentProcessInfo[DAMAGE_ACTIVATION]; |
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.
you should do the same with this one, use Has()
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.
all those variables set by the AITS, we should check because we may not use AITS
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.
nice!
📝 Description
In this PR, a fatigue data container has been added. Using this class, it would be much easier to incorporate fatigue calculations in other constitutive laws.
@SergioJimenezReyes @lagoncalvesjr @balcayde @lgratiela