KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
high_cycle_fatigue_law_integrator.h
Go to the documentation of this file.
1 // KRATOS ___ _ _ _ _ _ __ _
2 // / __\___ _ __ ___| |_(_) |_ _ _| |_(_)_ _____ / / __ ___ _____ /_\ _ __ _ __
3 // / / / _ \| '_ \/ __| __| | __| | | | __| \ \ / / _ \/ / / _` \ \ /\ / / __| //_\\| '_ \| '_ |
4 // / /__| (_) | | | \__ \ |_| | |_| |_| | |_| |\ V / __/ /__| (_| |\ V V /\__ \/ _ \ |_) | |_) |
5 // \____/\___/|_| |_|___/\__|_|\__|\__,_|\__|_| \_/ \___\____/\__,_| \_/\_/ |___/\_/ \_/ .__/| .__/
6 // |_| |_|
7 //
8 // License: BSD License
9 // license: structural_mechanics_application/license.txt
10 //
11 // Main authors: Sergio Jimenez/Alejandro Cornejo/Lucia Barbu
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // Project includes
21 
22 namespace Kratos
23 {
26 
30 
31  // The size type definition
32  using SizeType = std::size_t;
33 
37 
41 
45 
54 template <SizeType TVoigtSize = 6>
56 {
57 public:
60 
63 
67 
70  {
71  }
72 
75  {
76  }
77 
80  {
81  return *this;
82  }
83 
86  {
87  }
88 
92 
96 
107  const double CurrentStress,
108  double& rMaximumStress,
109  double& rMinimumStress,
110  const Vector& PreviousStresses,
111  bool& rMaxIndicator,
112  bool& rMinIndicator)
113  {
114  const double stress_1 = PreviousStresses[1];
115  const double stress_2 = PreviousStresses[0];
116  const double stress_increment_1 = stress_1 - stress_2;
117  const double stress_increment_2 = CurrentStress - stress_1;
118  if (stress_increment_1 > 1.0e-3 && stress_increment_2 < -1.0e-3) {
119  rMaximumStress = stress_1;
120  rMaxIndicator = true;
121  } else if (stress_increment_1 < -1.0e-3 && stress_increment_2 > 1.0e-3) {
122  rMinimumStress = stress_1;
123  rMinIndicator = true;
124  }
125  }
126 
131  static double CalculateTensionCompressionFactor(const Vector& rStressVector)
132  {
133  array_1d<double,3> principal_stresses;
134  AdvancedConstitutiveLawUtilities<6>::CalculatePrincipalStresses(principal_stresses, rStressVector);
135 
136 
137  double abs_component = 0.0, average_component = 0.0, sum_abs = 0.0, sum_average = 0.0;
138  for (unsigned int i = 0; i < principal_stresses.size(); ++i) {
139  abs_component = std::abs(principal_stresses[i]);
140  average_component = 0.5 * (principal_stresses[i] + abs_component);
141  sum_average += average_component;
142  sum_abs += abs_component;
143  }
144  const double pre_indicator = sum_average / sum_abs;
145  if (pre_indicator < 0.5) {
146  return -1.0;
147  } else {
148  return 1.0;
149  }
150  }
151 
157  static double CalculateReversionFactor(const double MaxStress, const double MinStress)
158  {
159  return MinStress / MaxStress;
160  }
161 
171  static void CalculateFatigueParameters(const double MaxStress,
172  double ReversionFactor,
173  const Properties& rMaterialParameters,
174  double& rB0,
175  double& rSth,
176  double& rAlphat,
177  double& rN_f)
178  {
179  const Vector& r_fatigue_coefficients = rMaterialParameters[HIGH_CYCLE_FATIGUE_COEFFICIENTS];
180  double ultimate_stress = rMaterialParameters.Has(YIELD_STRESS) ? rMaterialParameters[YIELD_STRESS] : rMaterialParameters[YIELD_STRESS_TENSION];
181  const double yield_stress = ultimate_stress;
182 
183  // The calculation is prepared to update the rN_f value when using a softening curve which initiates with hardening.
184  // The jump in the advance in time process is done in these cases to the Syield rather to Sult.
185  const int softening_type = rMaterialParameters[SOFTENING_TYPE];
186  const int curve_by_points = static_cast<int>(SofteningType::CurveFittingDamage);
187  if (softening_type == curve_by_points) {
188  const Vector& stress_damage_curve = rMaterialParameters[STRESS_DAMAGE_CURVE]; //Integrated_stress points of the fitting curve
189  const SizeType curve_points = stress_damage_curve.size() - 1;
190 
191  ultimate_stress = 0.0;
192  for (IndexType i = 1; i <= curve_points; ++i) {
193  ultimate_stress = std::max(ultimate_stress, stress_damage_curve[i-1]);
194  }
195  }
196 
197  //These variables have been defined following the model described by S. Oller et al. in A continuum mechanics model for mechanical fatigue analysis (2005), equation 13 on page 184.
198  const double Se = r_fatigue_coefficients[0] * ultimate_stress;
199  const double STHR1 = r_fatigue_coefficients[1];
200  const double STHR2 = r_fatigue_coefficients[2];
201  const double ALFAF = r_fatigue_coefficients[3];
202  const double BETAF = r_fatigue_coefficients[4];
203  const double AUXR1 = r_fatigue_coefficients[5];
204  const double AUXR2 = r_fatigue_coefficients[6];
205 
206  if (std::abs(ReversionFactor) < 1.0) {
207  rSth = Se + (ultimate_stress - Se) * std::pow((0.5 + 0.5 * ReversionFactor), STHR1);
208  rAlphat = ALFAF + (0.5 + 0.5 * ReversionFactor) * AUXR1;
209  } else {
210  rSth = Se + (ultimate_stress - Se) * std::pow((0.5 + 0.5 / ReversionFactor), STHR2);
211  rAlphat = ALFAF - (0.5 + 0.5 / ReversionFactor) * AUXR2;
212  }
213 
214  const double square_betaf = std::pow(BETAF, 2.0);
215  if (MaxStress > rSth && MaxStress <= ultimate_stress) {
216  rN_f = std::pow(10.0,std::pow(-std::log((MaxStress - rSth) / (ultimate_stress - rSth))/rAlphat,(1.0/BETAF)));
217  rB0 = -(std::log(MaxStress / ultimate_stress) / std::pow((std::log10(rN_f)), square_betaf));
218 
219  if (softening_type == curve_by_points) {
220  rN_f = std::pow(rN_f, std::pow(std::log(MaxStress / yield_stress) / std::log(MaxStress / ultimate_stress), 1.0 / square_betaf));
221  }
222  }
223  }
224 
237  static void CalculateFatigueReductionFactorAndWohlerStress(const Properties& rMaterialParameters,
238  const double MaxStress,
239  unsigned int LocalNumberOfCycles,
240  unsigned int GlobalNumberOfCycles,
241  const double B0,
242  const double Sth,
243  const double Alphat,
244  double& rFatigueReductionFactor,
245  double& rWohlerStress)
246  {
247  const double BETAF = rMaterialParameters[HIGH_CYCLE_FATIGUE_COEFFICIENTS][4];
248  if (GlobalNumberOfCycles > 2){
249  double ultimate_stress = rMaterialParameters.Has(YIELD_STRESS) ? rMaterialParameters[YIELD_STRESS] : rMaterialParameters[YIELD_STRESS_TENSION];
250 
251  // The calculation is prepared to update the rN_f value when using a softening curve which initiates with hardening.
252  // The jump in the advance in time process is done in these cases to the Syield rather to Sult.
253  const int softening_type = rMaterialParameters[SOFTENING_TYPE];
254  const int curve_by_points = static_cast<int>(SofteningType::CurveFittingDamage);
255  if (softening_type == curve_by_points) {
256  const Vector& stress_damage_curve = rMaterialParameters[STRESS_DAMAGE_CURVE]; //Integrated_stress points of the fitting curve
257  const SizeType curve_points = stress_damage_curve.size() - 1;
258 
259  ultimate_stress = 0.0;
260  for (IndexType i = 1; i <= curve_points; ++i) {
261  ultimate_stress = std::max(ultimate_stress, stress_damage_curve[i-1]);
262  }
263  }
264  rWohlerStress = (Sth + (ultimate_stress - Sth) * std::exp(-Alphat * (std::pow(std::log10(static_cast<double>(LocalNumberOfCycles)), BETAF)))) / ultimate_stress;
265  }
266  if (MaxStress > Sth) {
267  rFatigueReductionFactor = std::exp(-B0 * std::pow(std::log10(static_cast<double>(LocalNumberOfCycles)), (BETAF * BETAF)));
268  rFatigueReductionFactor = (rFatigueReductionFactor < 0.01) ? 0.01 : rFatigueReductionFactor;
269  }
270  }
271 
275 
279 
283 
287 
289 
290 protected:
293 
297 
301 
305 
309 
313 
317 
319 
320 private:
323 
327 
331 
335 
339 
343 
347 
349 
350 }; // Class HighCycleFatigueLawIntegrator
351 
353 
356 
360 
362 
363 } // namespace Kratos.
static void CalculatePrincipalStresses(array_1d< double, Dimension > &rPrincipalStressVector, const BoundedVectorType &rStressVector)
This method computes the principal stresses vector.
: This object computes all the required information for the high cycle fatigue constitutive law.
Definition: high_cycle_fatigue_law_integrator.h:56
HighCycleFatigueLawIntegrator()
Initialization constructor.
Definition: high_cycle_fatigue_law_integrator.h:69
static void CalculateFatigueParameters(const double MaxStress, double ReversionFactor, const Properties &rMaterialParameters, double &rB0, double &rSth, double &rAlphat, double &rN_f)
This method computes internal variables (B0, Sth and ALPHAT) of the CL.
Definition: high_cycle_fatigue_law_integrator.h:171
static double CalculateTensionCompressionFactor(const Vector &rStressVector)
This method checks if the global stress state is tension or compression; -1 for a generalized compres...
Definition: high_cycle_fatigue_law_integrator.h:131
KRATOS_CLASS_POINTER_DEFINITION(HighCycleFatigueLawIntegrator)
Counted pointer of HighCycleFatigueLawIntegrator.
static void CalculateMaximumAndMinimumStresses(const double CurrentStress, double &rMaximumStress, double &rMinimumStress, const Vector &PreviousStresses, bool &rMaxIndicator, bool &rMinIndicator)
This method checks and saves the previous stress state if it was a maximum or a minimum.
Definition: high_cycle_fatigue_law_integrator.h:106
HighCycleFatigueLawIntegrator & operator=(HighCycleFatigueLawIntegrator const &rOther)
Assignment operator.
Definition: high_cycle_fatigue_law_integrator.h:79
static void CalculateFatigueReductionFactorAndWohlerStress(const Properties &rMaterialParameters, const double MaxStress, unsigned int LocalNumberOfCycles, unsigned int GlobalNumberOfCycles, const double B0, const double Sth, const double Alphat, double &rFatigueReductionFactor, double &rWohlerStress)
This method computes the reduction factor and the wohler stress (SN curve)
Definition: high_cycle_fatigue_law_integrator.h:237
HighCycleFatigueLawIntegrator(HighCycleFatigueLawIntegrator const &rOther)
Copy constructor.
Definition: high_cycle_fatigue_law_integrator.h:74
virtual ~HighCycleFatigueLawIntegrator()
Destructor.
Definition: high_cycle_fatigue_law_integrator.h:85
static double CalculateReversionFactor(const double MaxStress, const double MinStress)
This method returns de reversion factor.
Definition: high_cycle_fatigue_law_integrator.h:157
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
bool Has(TVariableType const &rThisVariable) const
Definition: properties.h:578
BOOST_UBLAS_INLINE size_type size() const
Definition: array_1d.h:370
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
static double max(double a, double b)
Definition: GeometryFunctions.h:79
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
integer i
Definition: TensorModule.f:17