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.
von_mises_yield_surface.h
Go to the documentation of this file.
1 // KRATOS ___| | | |
2 // \___ \ __| __| | | __| __| | | __| _` | |
3 // | | | | | ( | | | | ( | |
4 // _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS
5 //
6 // License: BSD License
7 // license: structural_mechanics_application/license.txt
8 //
9 // Main authors: Alejandro Cornejo & Lucia Barbu
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // Project includes
17 #include "includes/checks.h"
18 #include "generic_yield_surface.h"
20 
21 namespace Kratos
22 {
25 
29 
30  // The size type definition
31  using SizeType = std::size_t;
32 
36 
40 
44 
57 template <class TPlasticPotentialType>
59 {
60 public:
63 
65  using PlasticPotentialType = TPlasticPotentialType;
66 
68  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
69 
71  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
72 
74 
77 
79  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
80 
84 
87  {
88  }
89 
92  {
93  }
94 
97  {
98  return *this;
99  }
100 
103 
107 
111 
119  const array_1d<double, VoigtSize>& rStressVector,
120  const Vector& rStrainVector,
121  double& rEquivalentStress,
123  )
124  {
126  }
127 
135  double& rThreshold
136  )
137  {
138  const Properties& r_material_properties = rValues.GetMaterialProperties();
139  const double yield_tension = r_material_properties.Has(YIELD_STRESS) ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_TENSION];
140  rThreshold = std::abs(yield_tension);
141  }
142 
151  double& rAParameter,
152  const double CharacteristicLength
153  )
154  {
155  const Properties& r_material_properties = rValues.GetMaterialProperties();
156 
157  const double fracture_energy = r_material_properties[FRACTURE_ENERGY];
158  const double young_modulus = r_material_properties[YOUNG_MODULUS];
159  const double yield_compression = r_material_properties.Has(YIELD_STRESS) ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
160 
161  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
162  rAParameter = 1.00 / (fracture_energy * young_modulus / (CharacteristicLength * std::pow(yield_compression, 2)) - 0.5);
163  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture energy is too low, increase FRACTURE_ENERGY..." << std::endl;
164  } else if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Linear)) { // linear
165  rAParameter = -std::pow(yield_compression, 2) / (2.0 * young_modulus * fracture_energy / CharacteristicLength);
166  } else {
167  rAParameter = 0.0;
168  }
169  }
170 
180  const BoundedVector& rStressVector,
181  const BoundedVector& rDeviator,
182  const double J2,
183  BoundedVector& rDerivativePlasticPotential,
185  )
186  {
187  TPlasticPotentialType::CalculatePlasticPotentialDerivative(rStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
188  }
189 
202  const BoundedVector& rPredictiveStressVector,
203  const BoundedVector& rDeviator,
204  const double J2,
205  BoundedVector& rFFlux,
207  )
208  {
209  BoundedVector second_vector;
211  const double c2 = std::sqrt(3.0);
212 
213  noalias(rFFlux) = c2 * second_vector;
214  }
215 
220  static int Check(const Properties& rMaterialProperties)
221  {
222  if (!rMaterialProperties.Has(YIELD_STRESS)) {
223  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_TENSION)) << "YIELD_STRESS_TENSION is not a defined value" << std::endl;
224  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_COMPRESSION)) << "YIELD_STRESS_COMPRESSION is not a defined value" << std::endl;
225 
226  const double yield_compression = rMaterialProperties[YIELD_STRESS_COMPRESSION];
227  const double yield_tension = rMaterialProperties[YIELD_STRESS_TENSION];
228 
229  KRATOS_ERROR_IF(yield_compression < tolerance) << "Yield stress in compression almost zero or negative, include YIELD_STRESS_COMPRESSION in definition";
230  KRATOS_ERROR_IF(yield_tension < tolerance) << "Yield stress in tension almost zero or negative, include YIELD_STRESS_TENSION in definition";
231  } else {
232  const double yield_stress = rMaterialProperties[YIELD_STRESS];
233 
234  KRATOS_ERROR_IF(yield_stress < tolerance) << "Yield stress almost zero or negative, include YIELD_STRESS in definition";
235  }
236  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRACTURE_ENERGY)) << "FRACTURE_ENERGY is not a defined value" << std::endl;
237  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not a defined value" << std::endl;
238 
239  return TPlasticPotentialType::Check(rMaterialProperties);
240  }
241 
246  {
247  return true;
248  }
249 
253  static double GetScaleFactorTension(const Properties& rMaterialProperties)
254  {
255  return 1.0;
256  }
257 
261 
265 
269 
273 
275 
276 protected:
279 
283 
287 
291 
295 
299 
303 
305 private:
308 
312 
316 
320 
324 
328 
332 
334 
335 }; // Class VonMisesYieldSurface
336 
338 
341 
345 
347 
348 } // namespace Kratos.
static void CalculateSecondVector(const BoundedVectorType &rDeviator, const double J2, BoundedVectorType &rSecondVector)
This method computes the first vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:100
static double CalculateVonMisesEquivalentStress(const TVector &rStressVector)
This method the uniaxial equivalent stress for Von Mises.
Definition: constitutive_law_utilities.h:208
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
This class defines a yield surface according to Von-Mises theory.
Definition: von_mises_yield_surface.h:59
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: von_mises_yield_surface.h:118
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: von_mises_yield_surface.h:245
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: von_mises_yield_surface.h:133
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: von_mises_yield_surface.h:71
VonMisesYieldSurface(VonMisesYieldSurface const &rOther)
Copy constructor.
Definition: von_mises_yield_surface.h:91
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: von_mises_yield_surface.h:253
static void CalculateYieldSurfaceDerivative(const BoundedVector &rPredictiveStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rFFlux, ConstitutiveLaw::Parameters &rValues)
This script calculates the derivatives of the Yield Surf according to NAYAK-ZIENKIEWICZ paper Interna...
Definition: von_mises_yield_surface.h:201
KRATOS_CLASS_POINTER_DEFINITION(VonMisesYieldSurface)
Counted pointer of VonMisesYieldSurface.
static void CalculateDamageParameter(ConstitutiveLaw::Parameters &rValues, double &rAParameter, const double CharacteristicLength)
This method returns the damage parameter needed in the exp/linear expressions of damage.
Definition: von_mises_yield_surface.h:149
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: von_mises_yield_surface.h:68
virtual ~VonMisesYieldSurface()
Destructor.
Definition: von_mises_yield_surface.h:102
VonMisesYieldSurface & operator=(VonMisesYieldSurface const &rOther)
Assignment operator.
Definition: von_mises_yield_surface.h:96
static void CalculatePlasticPotentialDerivative(const BoundedVector &rStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rDerivativePlasticPotential, ConstitutiveLaw::Parameters &rValues)
This method calculates the derivative of the plastic potential DG/DS.
Definition: von_mises_yield_surface.h:179
static constexpr double tolerance
The machine precision zero tolerance.
Definition: von_mises_yield_surface.h:79
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: von_mises_yield_surface.h:220
VonMisesYieldSurface()
Initialization constructor.
Definition: von_mises_yield_surface.h:86
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: von_mises_yield_surface.h:65
#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
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457