Skip to content

Commit a763d6c

Browse files
Merge pull request #14070 from KratosMultiphysics/TFM_Jaume
[CL App] Exposing MINIMUM_FATIGUE_REDUCTION_FACTOR for High cycle fatigue CL
2 parents 251970d + a45a8e0 commit a763d6c

7 files changed

Lines changed: 51 additions & 2 deletions

File tree

applications/ConstitutiveLawsApplication/constitutive_laws_application.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ void KratosConstitutiveLawsApplication::Register()
444444
KRATOS_REGISTER_VARIABLE(DAMAGE_ACTIVATION)
445445
KRATOS_REGISTER_VARIABLE(PREVIOUS_CYCLE);
446446
KRATOS_REGISTER_VARIABLE(CYCLE_PERIOD)
447+
KRATOS_REGISTER_VARIABLE(MINIMUM_FATIGUE_REDUCTION_FACTOR)
447448
KRATOS_REGISTER_VARIABLE(ADVANCE_STRATEGY_APPLIED)
448449

449450

applications/ConstitutiveLawsApplication/constitutive_laws_application_variables.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ KRATOS_CREATE_VARIABLE(double, TIME_INCREMENT)
3636
KRATOS_CREATE_VARIABLE(bool, DAMAGE_ACTIVATION)
3737
KRATOS_CREATE_VARIABLE(double, PREVIOUS_CYCLE)
3838
KRATOS_CREATE_VARIABLE(double, CYCLE_PERIOD)
39+
KRATOS_CREATE_VARIABLE(double, MINIMUM_FATIGUE_REDUCTION_FACTOR)
3940
KRATOS_CREATE_VARIABLE(bool, ADVANCE_STRATEGY_APPLIED)
4041

4142

applications/ConstitutiveLawsApplication/constitutive_laws_application_variables.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace Kratos
4646
KRATOS_DEFINE_APPLICATION_VARIABLE(CONSTITUTIVE_LAWS_APPLICATION, bool, DAMAGE_ACTIVATION)
4747
KRATOS_DEFINE_APPLICATION_VARIABLE(CONSTITUTIVE_LAWS_APPLICATION, double, PREVIOUS_CYCLE)
4848
KRATOS_DEFINE_APPLICATION_VARIABLE(CONSTITUTIVE_LAWS_APPLICATION, double, CYCLE_PERIOD)
49+
KRATOS_DEFINE_APPLICATION_VARIABLE(CONSTITUTIVE_LAWS_APPLICATION, double, MINIMUM_FATIGUE_REDUCTION_FACTOR)
4950
KRATOS_DEFINE_APPLICATION_VARIABLE(CONSTITUTIVE_LAWS_APPLICATION, bool, ADVANCE_STRATEGY_APPLIED)
5051

5152

applications/ConstitutiveLawsApplication/custom_constitutive/auxiliary_files/cl_integrators/high_cycle_fatigue_law_integrator.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// System includes
1717

1818
// Project includes
19+
#include "includes/define.h"
20+
#include "includes/checks.h"
1921
#include "constitutive_laws_application_variables.h"
2022
#include "custom_utilities/advanced_constitutive_law_utilities.h"
2123

@@ -278,7 +280,7 @@ class HighCycleFatigueLawIntegrator
278280
}
279281
if (MaxStress > Sth) { //In those cases with no fatigue in course (MaxStress < Sth), tbe fatigue reduction factor does not evolve.
280282
rFatigueReductionFactor = std::min(rFatigueReductionFactor, std::exp(-B0 * std::pow(std::log10(static_cast<double>(LocalNumberOfCycles)), FatigueReductionFactorSmoothness * (BETAF * BETAF))));
281-
const double min_fatigue_reduction_factor = rMaterialParameters[HIGH_CYCLE_FATIGUE_COEFFICIENTS][0];
283+
const double min_fatigue_reduction_factor = rMaterialParameters.Has(MINIMUM_FATIGUE_REDUCTION_FACTOR) ? rMaterialParameters[MINIMUM_FATIGUE_REDUCTION_FACTOR] : rMaterialParameters[HIGH_CYCLE_FATIGUE_COEFFICIENTS][0];
282284
rFatigueReductionFactor = (rFatigueReductionFactor < min_fatigue_reduction_factor) ? min_fatigue_reduction_factor : rFatigueReductionFactor;
283285
}
284286
}
@@ -305,6 +307,18 @@ class HighCycleFatigueLawIntegrator
305307
return ultimate_stress;
306308
}
307309

310+
/**
311+
* @brief This method defines in the CL integrator
312+
* @return 0 if OK, 1 otherwise
313+
*/
314+
static int Check(const Properties& rMaterialProperties)
315+
{
316+
const double min_fatigue_reduction_factor = rMaterialProperties.Has(MINIMUM_FATIGUE_REDUCTION_FACTOR) ? rMaterialProperties[MINIMUM_FATIGUE_REDUCTION_FACTOR] : rMaterialProperties[HIGH_CYCLE_FATIGUE_COEFFICIENTS][0];
317+
KRATOS_ERROR_IF(min_fatigue_reduction_factor <= 0.0 || min_fatigue_reduction_factor >= 1.0) << "Minimum fatigue reduction factor must be in (0,1). Provided: " << min_fatigue_reduction_factor << std::endl;
318+
319+
return 0;
320+
}
321+
308322
///@}
309323
///@name Access
310324
///@{

applications/ConstitutiveLawsApplication/custom_constitutive/small_strains/fatigue/generic_small_strain_high_cycle_fatigue_law.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,22 @@ Matrix& GenericSmallStrainHighCycleFatigueLaw<TConstLawIntegratorType>::Calculat
653653
/***********************************************************************************/
654654
/***********************************************************************************/
655655

656+
template <class TConstLawIntegratorType>
657+
int GenericSmallStrainHighCycleFatigueLaw<TConstLawIntegratorType>::Check(
658+
const Properties& rMaterialProperties,
659+
const GeometryType& rElementGeometry,
660+
const ProcessInfo& rCurrentProcessInfo
661+
) const
662+
{
663+
const int check_base = BaseType::Check(rMaterialProperties, rElementGeometry, rCurrentProcessInfo);
664+
const int check_integrator = HighCycleFatigueLawIntegrator<6>::Check(rMaterialProperties);
665+
if ((check_base + check_integrator) > 0) return 1;
666+
return 0;
667+
}
668+
669+
/***********************************************************************************/
670+
/***********************************************************************************/
671+
656672
template class GenericSmallStrainHighCycleFatigueLaw <GenericConstitutiveLawIntegratorDamage<VonMisesYieldSurface<VonMisesPlasticPotential<6>>>>;
657673
template class GenericSmallStrainHighCycleFatigueLaw <GenericConstitutiveLawIntegratorDamage<ModifiedMohrCoulombYieldSurface<ModifiedMohrCoulombPlasticPotential<6>>>>;
658674
template class GenericSmallStrainHighCycleFatigueLaw <GenericConstitutiveLawIntegratorDamage<TrescaYieldSurface<TrescaPlasticPotential<6>>>>;

applications/ConstitutiveLawsApplication/custom_constitutive/small_strains/fatigue/generic_small_strain_high_cycle_fatigue_law.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,21 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericSmallStrainHighCycleFatig
317317
Matrix& rValue
318318
) override;
319319

320+
/**
321+
* @brief This function provides the place to perform checks on the completeness of the input.
322+
* @details It is designed to be called only once (or anyway, not often) typically at the beginning
323+
* of the calculations, so to verify that nothing is missing from the input or that no common error is found.
324+
* @param rMaterialProperties The properties of the material
325+
* @param rElementGeometry The geometry of the element
326+
* @param rCurrentProcessInfo The current process info instance
327+
* @return 0 if OK, 1 otherwise
328+
*/
329+
int Check(
330+
const Properties& rMaterialProperties,
331+
const GeometryType& rElementGeometry,
332+
const ProcessInfo& rCurrentProcessInfo
333+
) const override;
334+
320335
/**
321336
* @brief If the CL requires to initialize the material response, called by the element in InitializeSolutionStep.
322337
*/
@@ -507,7 +522,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericSmallStrainHighCycleFatig
507522
rSerializer.load("PreviousCycleTime", mPreviousCycleTime);
508523
rSerializer.load("Period", mPeriod);
509524
rSerializer.load("ReferenceDamage", mReferenceDamage);
510-
rSerializer.save("PreviousCycleDamage", mPreviousCycleDamage);
525+
rSerializer.load("PreviousCycleDamage", mPreviousCycleDamage);
511526
rSerializer.load("FirstCycleOfANewLoad", mFirstCycleOfANewLoad);
512527
rSerializer.load("CFactor", mCFactor);
513528
}

applications/ConstitutiveLawsApplication/custom_python/constitutive_laws_python_application.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ PYBIND11_MODULE(KratosConstitutiveLawsApplication,m)
6262
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, DAMAGE_ACTIVATION)
6363
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, PREVIOUS_CYCLE);
6464
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, CYCLE_PERIOD)
65+
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, MINIMUM_FATIGUE_REDUCTION_FACTOR)
6566
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, ADVANCE_STRATEGY_APPLIED)
6667

6768

0 commit comments

Comments
 (0)