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.
generic_cl_integrator_damage.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: Alejandro Cornejo & Lucia Barbu
12 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // Project includes
19 #include "includes/define.h"
20 #include "includes/checks.h"
21 #include "includes/serializer.h"
22 #include "includes/properties.h"
23 #include "utilities/math_utils.h"
26 
27 namespace Kratos
28 {
31 
35 
36  // The size type definition
37  typedef std::size_t SizeType;
38 
42 
46 
50 
62 template <class TYieldSurfaceType>
64 {
65  public:
68 
70  typedef TYieldSurfaceType YieldSurfaceType;
71 
73  static constexpr SizeType Dimension = YieldSurfaceType::Dimension;
74 
76  static constexpr SizeType VoigtSize = YieldSurfaceType::VoigtSize;
77 
79  typedef typename YieldSurfaceType::PlasticPotentialType PlasticPotentialType;
80 
83 
86  {
87  }
88 
91  {
92  }
93 
96  {
97  return *this;
98  }
99 
102  {
103  }
104 
108 
112 
123  array_1d<double, VoigtSize>& rPredictiveStressVector,
124  const double UniaxialStress,
125  double& rDamage,
126  double& rThreshold,
128  const double CharacteristicLength
129  )
130  {
131  const Properties& r_material_properties = rValues.GetMaterialProperties();
132 
133  const int softening_type = r_material_properties[SOFTENING_TYPE];
134  double damage_parameter;
135  TYieldSurfaceType::CalculateDamageParameter(rValues, damage_parameter, CharacteristicLength);
136 
137  switch (softening_type)
138  {
139  case static_cast<int>(SofteningType::Linear):
140  CalculateLinearDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
141  break;
142  case static_cast<int>(SofteningType::Exponential):
143  CalculateExponentialDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
144  break;
145  case static_cast<int>(SofteningType::HardeningDamage):
146  CalculateHardeningDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
147  break;
148  case static_cast<int>(SofteningType::CurveFittingDamage):
149  CalculateCurveFittingDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
150  break;
151  default:
152  KRATOS_ERROR << "SOFTENING_TYPE not defined or wrong..." << softening_type << std::endl;
153  break;
154  }
155  rDamage = (rDamage > 0.99999) ? 0.99999 : rDamage;
156  rDamage = (rDamage < 0.0) ? 0.0 : rDamage;
157  rPredictiveStressVector *= (1.0 - rDamage);
158  }
159 
169  const double UniaxialStress,
170  const double Threshold,
171  const double DamageParameter,
172  const double CharacteristicLength,
174  double& rDamage
175  )
176  {
177  double initial_threshold;
178  TYieldSurfaceType::GetInitialUniaxialThreshold(rValues, initial_threshold);
179  rDamage = 1.0 - (initial_threshold / UniaxialStress) * std::exp(DamageParameter *
180  (1.0 - UniaxialStress / initial_threshold));
181  }
182 
193  const double UniaxialStress,
194  const double Threshold,
195  const double DamageParameter,
196  const double CharacteristicLength,
198  double& rDamage
199  )
200  {
201  const auto &r_mat_props = rValues.GetMaterialProperties();
202  const double max_stress = r_mat_props[MAXIMUM_STRESS];
203  const double Gf = r_mat_props[FRACTURE_ENERGY];
204  const double E = r_mat_props[YOUNG_MODULUS];
205  const bool has_symmetric_yield_stress = r_mat_props.Has(YIELD_STRESS);
206  const double yield_compression = has_symmetric_yield_stress ? r_mat_props[YIELD_STRESS] : r_mat_props[YIELD_STRESS_COMPRESSION];
207  const double yield_tension = has_symmetric_yield_stress ? r_mat_props[YIELD_STRESS] : r_mat_props[YIELD_STRESS_TENSION];
208  const double n = yield_compression / yield_tension;
209 
210  double initial_threshold;
211  TYieldSurfaceType::GetInitialUniaxialThreshold(rValues, initial_threshold);
212 
213  const double re = max_stress / initial_threshold;
214  const double rp = 1.5 * re;
215  const double Ad = (rp - re) / re;
216  const double Ad_tilda = Ad * (std::pow(rp, 3) - 3.0 * rp + 2.0 / 3.0) / (6.0 * re * std::pow((rp - 1.0), 2));
217  const double Hd = 1.0 / (2.0 * (E * Gf * n * n / max_stress / max_stress / CharacteristicLength - 0.5 * rp / re - Ad_tilda));
218 
219  const double r = UniaxialStress / initial_threshold;
220 
221  if (r <= rp) {
222  rDamage = Ad * re / r * std::pow(((r - 1.0) / (rp - 1.0)), 2);
223  } else {
224  rDamage = 1.0 - re / r + Hd * (1.0 - rp / r);
225  }
226  }
227 
237  const double UniaxialStress,
238  const double Threshold,
239  const double DamageParameter,
240  const double CharacteristicLength,
242  double& rDamage
243  )
244  {
245  double initial_threshold;
246  TYieldSurfaceType::GetInitialUniaxialThreshold(rValues, initial_threshold);
247  rDamage = (1.0 - initial_threshold / UniaxialStress) / (1.0 + DamageParameter);
248  }
249 
261  const double UniaxialStress,
262  const double Threshold,
263  const double DamageParameter,
264  const double CharacteristicLength,
266  double& rDamage
267  )
268  {
269  const Properties &r_mat_props = rValues.GetMaterialProperties();
270  const double fracture_energy = r_mat_props[FRACTURE_ENERGY];
271  const double volumetric_fracture_energy = fracture_energy / CharacteristicLength;
272  const double yield_stress = r_mat_props[YIELD_STRESS];
273  const double E = r_mat_props[YOUNG_MODULUS];
274  const Vector& strain_damage_curve = r_mat_props[STRAIN_DAMAGE_CURVE]; //Strain points of the fitting curve
275  const Vector& stress_damage_curve = r_mat_props[STRESS_DAMAGE_CURVE]; //Integrated_stress points of the fitting curve
276  const SizeType curve_points = strain_damage_curve.size() - 1;
277 
278  //Fracture energy required to cover the first region of the curve defined by points
279  double volumentric_fracture_energy_first_region = 0.5 * std::pow(yield_stress, 2.0) / E; //Fracture energy corresponding to the elastic regime
280  for (IndexType i = 1; i <= curve_points; ++i) {
281  volumentric_fracture_energy_first_region += 0.5 * (stress_damage_curve[i-1] + stress_damage_curve[i])
282  * (strain_damage_curve[i] - strain_damage_curve[i-1]);
283  const double irreversibility_damage_check = (stress_damage_curve[i] - stress_damage_curve[i-1]) / (strain_damage_curve[i] - strain_damage_curve[i-1]);
284  KRATOS_ERROR_IF(irreversibility_damage_check > E)<< "The defined S-E curve induces negative damage at region " << i << std::endl;
285  }
286  KRATOS_ERROR_IF(volumentric_fracture_energy_first_region > volumetric_fracture_energy) << "The Fracture Energy is too low: " << fracture_energy << std::endl;
287 
288  const double predictive_stress_end_first_region = strain_damage_curve[curve_points] * E;
289  if (UniaxialStress < predictive_stress_end_first_region){ //First region: point-by-point definition with linear interpolation
290  for (IndexType i = 1; i <= curve_points; ++i) {
291  if (UniaxialStress < strain_damage_curve[i] * E){
292  const double current_integrated_stress = stress_damage_curve[i-1] + (UniaxialStress / E - strain_damage_curve[i-1])
293  * (stress_damage_curve[i] - stress_damage_curve[i-1]) / (strain_damage_curve[i] - strain_damage_curve[i-1]);
294  rDamage = 1.0 - current_integrated_stress / UniaxialStress;
295  break;
296  }
297  }
298  } else { //Second region: exponential definition to consume the remaining fracture energy
299  const double volumentric_fracture_energy_second_region = volumetric_fracture_energy - volumentric_fracture_energy_first_region;
300  rDamage = 1.0 - stress_damage_curve[curve_points] / UniaxialStress * std::exp(stress_damage_curve[curve_points] * (strain_damage_curve[curve_points] * E - UniaxialStress) / (E * volumentric_fracture_energy_second_region));
301  }
302  }
303 
311  double& rInitialThreshold
312  )
313  {
314  TYieldSurfaceType::GetInitialUniaxialThreshold(rValues, rInitialThreshold);
315  }
316 
321  static int Check(const Properties& rMaterialProperties)
322  {
323  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(SOFTENING_TYPE)) << "SOFTENING_TYPE is not a defined value" << std::endl;
324  return TYieldSurfaceType::Check(rMaterialProperties);
325  }
326 
333  const array_1d<double, VoigtSize>& rStressVector,
334  array_1d<double, VoigtSize>& rYieldDerivative,
336  )
337  {
339  double J2;
340  const double I1 = rStressVector[0] + rStressVector[1] + rStressVector[2];
342  YieldSurfaceType::CalculateYieldSurfaceDerivative(rStressVector, deviator, J2, rYieldDerivative, rValues);
343  }
344 
348 
352 
356 
360 
362 
363  protected:
366 
370 
374 
378 
382 
386 
390 
392 
393  private:
396 
400 
404 
408 
412 
416 
420 
422 
423 }; // Class GenericYieldSurface
424 
426 
429 
433 
435 
436 } // namespace Kratos.
static void CalculateJ2Invariant(const TVector &rStressVector, const double I1, BoundedVectorType &rDeviator, double &rJ2)
This method computes the second invariant of J.
Definition: advanced_constitutive_law_utilities.h:157
: This object integrates the predictive stress using the isotropic damage theory by means of linear/e...
Definition: generic_cl_integrator_damage.h:64
static void CalculateYieldSurfaceDerivative(const array_1d< double, VoigtSize > &rStressVector, array_1d< double, VoigtSize > &rYieldDerivative, ConstitutiveLaw::Parameters &rValues)
This method returns the derivative of the yield surface.
Definition: generic_cl_integrator_damage.h:332
static constexpr SizeType VoigtSize
The define the Voigt size, already defined in the yield surface.
Definition: generic_cl_integrator_damage.h:76
YieldSurfaceType::PlasticPotentialType PlasticPotentialType
The type of plastic potential.
Definition: generic_cl_integrator_damage.h:79
static void CalculateHardeningDamage(const double UniaxialStress, const double Threshold, const double DamageParameter, const double CharacteristicLength, ConstitutiveLaw::Parameters &rValues, double &rDamage)
This computes the damage variable according to parabolic hardening and exponential softening.
Definition: generic_cl_integrator_damage.h:192
static constexpr SizeType Dimension
The define the working dimension size, already defined in the yield surface.
Definition: generic_cl_integrator_damage.h:73
static int Check(const Properties &rMaterialProperties)
This method defines in the CL integrator.
Definition: generic_cl_integrator_damage.h:321
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rInitialThreshold)
This method returns the initial uniaxial stress threshold.
Definition: generic_cl_integrator_damage.h:309
GenericConstitutiveLawIntegratorDamage & operator=(GenericConstitutiveLawIntegratorDamage const &rOther)
Assignment operator.
Definition: generic_cl_integrator_damage.h:95
KRATOS_CLASS_POINTER_DEFINITION(GenericConstitutiveLawIntegratorDamage)
Counted pointer of GenericConstitutiveLawIntegratorDamage.
static void CalculateLinearDamage(const double UniaxialStress, const double Threshold, const double DamageParameter, const double CharacteristicLength, ConstitutiveLaw::Parameters &rValues, double &rDamage)
This computes the damage variable according to linear softening.
Definition: generic_cl_integrator_damage.h:236
static void CalculateCurveFittingDamage(const double UniaxialStress, const double Threshold, const double DamageParameter, const double CharacteristicLength, ConstitutiveLaw::Parameters &rValues, double &rDamage)
This computes the damage variable according to a two region curve:
Definition: generic_cl_integrator_damage.h:260
virtual ~GenericConstitutiveLawIntegratorDamage()
Destructor.
Definition: generic_cl_integrator_damage.h:101
static void IntegrateStressVector(array_1d< double, VoigtSize > &rPredictiveStressVector, const double UniaxialStress, double &rDamage, double &rThreshold, ConstitutiveLaw::Parameters &rValues, const double CharacteristicLength)
This method integrates the predictive stress vector with the CL using linear or exponential softening...
Definition: generic_cl_integrator_damage.h:122
GenericConstitutiveLawIntegratorDamage()
Initialization constructor.
Definition: generic_cl_integrator_damage.h:85
GenericConstitutiveLawIntegratorDamage(GenericConstitutiveLawIntegratorDamage const &rOther)
Copy constructor.
Definition: generic_cl_integrator_damage.h:90
static void CalculateExponentialDamage(const double UniaxialStress, const double Threshold, const double DamageParameter, const double CharacteristicLength, ConstitutiveLaw::Parameters &rValues, double &rDamage)
This computes the damage variable according to exponential softening.
Definition: generic_cl_integrator_damage.h:168
TYieldSurfaceType YieldSurfaceType
The type of yield surface.
Definition: generic_cl_integrator_damage.h:70
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
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
E
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:26
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
I1
Definition: isotropic_damage_automatic_differentiation.py:230
Gf
Definition: isotropic_damage_automatic_differentiation.py:135
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
integer i
Definition: TensorModule.f:17
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457