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_compression_cl_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: Alejandro Cornejo
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"
25 
26 namespace Kratos
27 {
28 
31 
35 
36  // The size type definition
37  typedef std::size_t SizeType;
38 
42 
46 
50 
61 template <class TYieldSurfaceType>
63 {
64  public:
65 
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  const int softening_type = r_material_properties.Has(SOFTENING_TYPE_COMPRESSION) ? r_material_properties[SOFTENING_TYPE_COMPRESSION] : r_material_properties[SOFTENING_TYPE];
133  double damage_parameter;
134  CalculateDamageParameterCompression(rValues, damage_parameter, CharacteristicLength);
135 
136  switch (softening_type)
137  {
138  case static_cast<int>(SofteningType::Linear):
139  CalculateLinearDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
140  break;
141  case static_cast<int>(SofteningType::Exponential):
142  CalculateExponentialDamage(UniaxialStress, rThreshold, damage_parameter, CharacteristicLength, rValues, rDamage);
143  break;
144  default:
145  KRATOS_ERROR << "SOFTENING_TYPE not defined or wrong..." << softening_type << std::endl;
146  break;
147  }
148  rPredictiveStressVector *= (1.0 - rDamage);
149  }
150 
158  double& rDamageParameter,
159  const double CharacteristicLength
160  )
161  {
162  const double fracture_energy_compression = rValues.GetMaterialProperties()[FRACTURE_ENERGY_COMPRESSION];
163  ConstitutiveLaw::Parameters modified_values = rValues;
164  auto r_properties = modified_values.GetMaterialProperties();
165  r_properties.SetValue(FRACTURE_ENERGY, fracture_energy_compression);
166  modified_values.SetMaterialProperties(r_properties);
167  TYieldSurfaceType::CalculateDamageParameter(modified_values, rDamageParameter, CharacteristicLength);
168  }
169 
177  double& rThreshold
178  )
179  {
180  // This is done to allow tension-driven yields to work as compression yields
181  if (YieldSurfaceType::IsWorkingWithTensionThreshold()) {
182  ConstitutiveLaw::Parameters modified_ones = rValues;
183  const double yield_compression = modified_ones.GetMaterialProperties()[YIELD_STRESS_COMPRESSION];
184  Properties material_props = modified_ones.GetMaterialProperties();
185  material_props.SetValue(YIELD_STRESS_TENSION, yield_compression);
186  modified_ones.SetMaterialProperties(material_props);
187  TYieldSurfaceType::GetInitialUniaxialThreshold(modified_ones, rThreshold);
188  } else {
189  TYieldSurfaceType::GetInitialUniaxialThreshold(rValues, rThreshold);
190  }
191  }
192 
202  const double UniaxialStress,
203  const double Threshold,
204  const double DamageParameter,
205  const double CharacteristicLength,
207  double& rDamage
208  )
209  {
210  double initial_threshold;
211  GetInitialUniaxialThreshold(rValues, initial_threshold);
212  rDamage = 1.0 - (initial_threshold / UniaxialStress) * std::exp(DamageParameter *
213  (1.0 - UniaxialStress / initial_threshold));
214  }
215 
225  const double UniaxialStress,
226  const double Threshold,
227  const double DamageParameter,
228  const double CharacteristicLength,
230  double& rDamage
231  )
232  {
233  double initial_threshold;
234  GetInitialUniaxialThreshold(rValues, initial_threshold);
235  rDamage = (1.0 - initial_threshold / UniaxialStress) / (1.0 + DamageParameter);
236  }
237 
242  static int Check(const Properties& rMaterialProperties)
243  {
244  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(SOFTENING_TYPE)) << "MAXIMUM_STRESS is not a defined value" << std::endl;
245  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_TENSION)) << "YIELD_STRESS_TENSION is not a defined value" << std::endl;
246  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_COMPRESSION)) << "YIELD_STRESS_COMPRESSION is not a defined value" << std::endl;
247  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not a defined value" << std::endl;
248  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRACTURE_ENERGY)) << "FRACTURE_ENERGY is not a defined value" << std::endl;
249 
250  return TYieldSurfaceType::Check(rMaterialProperties);
251  }
252 
256 
260 
264 
268 
270 
271  protected:
274 
278 
282 
286 
290 
294 
298 
300 
301  private:
304 
308 
312 
316 
320 
324 
328 
330 
331 };
332 } // namespace Kratos
: This object integrates the predictive stress using the isotropic the d+d- damage theory
Definition: generic_compression_cl_integrator.h:63
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: generic_compression_cl_integrator.h:175
TYieldSurfaceType YieldSurfaceType
The type of yield surface.
Definition: generic_compression_cl_integrator.h:70
GenericCompressionConstitutiveLawIntegratorDplusDminusDamage(GenericCompressionConstitutiveLawIntegratorDplusDminusDamage const &rOther)
Copy constructor.
Definition: generic_compression_cl_integrator.h:90
static int Check(const Properties &rMaterialProperties)
This method defines in the CL integrator.
Definition: generic_compression_cl_integrator.h:242
YieldSurfaceType::PlasticPotentialType PlasticPotentialType
The type of plastic potential.
Definition: generic_compression_cl_integrator.h:79
virtual ~GenericCompressionConstitutiveLawIntegratorDplusDminusDamage()
Destructor.
Definition: generic_compression_cl_integrator.h:101
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_compression_cl_integrator.h:224
KRATOS_CLASS_POINTER_DEFINITION(GenericCompressionConstitutiveLawIntegratorDplusDminusDamage)
Counted pointer of GenericCompressionConstitutiveLawIntegratorDplusDminusDamage.
static constexpr SizeType VoigtSize
The define the Voigt size, already defined in the yield surface.
Definition: generic_compression_cl_integrator.h:76
static void CalculateDamageParameterCompression(ConstitutiveLaw::Parameters &rValues, double &rDamageParameter, const double CharacteristicLength)
This method returns the initial uniaxial stress threshold.
Definition: generic_compression_cl_integrator.h:156
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_compression_cl_integrator.h:122
static constexpr SizeType Dimension
The define the working dimension size, already defined in the yield surface.
Definition: generic_compression_cl_integrator.h:73
GenericCompressionConstitutiveLawIntegratorDplusDminusDamage()
Initialization constructor.
Definition: generic_compression_cl_integrator.h:85
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_compression_cl_integrator.h:201
GenericCompressionConstitutiveLawIntegratorDplusDminusDamage & operator=(GenericCompressionConstitutiveLawIntegratorDplusDminusDamage const &rOther)
Assignment operator.
Definition: generic_compression_cl_integrator.h:95
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
void SetValue(TVariableType const &rV, typename TVariableType::Type const &rValue)
Definition: properties.h:287
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
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
Definition: constitutive_law.h:189
void SetMaterialProperties(const Properties &rMaterialProperties)
Definition: constitutive_law.h:406
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457