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.
mohr_coulomb_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
10 //
11 
12 #pragma once
13 
14 // System includes
15 
16 // Project includes
17 #include "includes/checks.h"
18 #include "generic_yield_surface.h"
19 
20 namespace Kratos
21 {
24 
28 
29  // The size type definition
30  typedef std::size_t SizeType;
31 
35 
39 
43 
57 template <class TPlasticPotentialType>
59 {
60 public:
63 
65  typedef TPlasticPotentialType PlasticPotentialType;
66 
68  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
69 
71  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
72 
75 
77  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
78 
82 
85  {
86  }
87 
90  {
91  }
92 
95  {
96  return *this;
97  }
98 
101 
105 
109 
117  const array_1d<double, VoigtSize>& rPredictiveStressVector,
118  const Vector& rStrainVector,
119  double& rEquivalentStress,
121  )
122  {
123  double I1, J2, J3, lode_angle;
125 
127  AdvancedConstitutiveLawUtilities<VoigtSize>::CalculateJ2Invariant(rPredictiveStressVector, I1, deviator, J2);
130 
131  const Properties& r_material_properties = rValues.GetMaterialProperties();
132  const double friction_angle = r_material_properties[FRICTION_ANGLE] * Globals::Pi / 180.0;
133 
134  rEquivalentStress = (std::cos(lode_angle) - std::sin(lode_angle) * std::sin(friction_angle) / std::sqrt(3.0)) * std::sqrt(J2) +
135  I1 * std::sin(friction_angle) / 3.0;
136  }
137 
145  double& rThreshold
146  )
147  {
148  const Properties& r_material_properties = rValues.GetMaterialProperties();
149  const double cohesion = r_material_properties[COHESION];
150  const double friction_angle = r_material_properties[FRICTION_ANGLE] * Globals::Pi / 180.0;
151 
152  rThreshold = cohesion * std::cos(friction_angle);
153  }
154 
163  double& rAParameter,
164  const double CharacteristicLength
165  )
166  {
167  const Properties& r_material_properties = rValues.GetMaterialProperties();
168  const double fracture_energy = r_material_properties[FRACTURE_ENERGY];
169  const double young_modulus = r_material_properties[YOUNG_MODULUS];
170  double equivalent_yield;
171  GetInitialUniaxialThreshold(rValues, equivalent_yield);
172  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
173  rAParameter = 1.00 / (fracture_energy * young_modulus / (CharacteristicLength * std::pow(equivalent_yield, 2)) - 0.5);
174  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture Energy is too low, increase FRACTURE_ENERGY..." << std::endl;
175  } else { // linear
176  rAParameter = -std::pow(equivalent_yield, 2) / (2.0 * young_modulus * fracture_energy / CharacteristicLength);
177  }
178  }
179 
189  const array_1d<double, VoigtSize>& rPredictiveStressVector,
190  const array_1d<double, VoigtSize>& rDeviator,
191  const double J2,
192  array_1d<double, VoigtSize>& rDerivativePlasticPotential,
194  )
195  {
196  TPlasticPotentialType::CalculatePlasticPotentialDerivative(rPredictiveStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
197  }
198 
211  const array_1d<double, VoigtSize>& rPredictiveStressVector,
212  const array_1d<double, VoigtSize>& rDeviator,
213  const double J2,
216  )
217  {
218  array_1d<double, VoigtSize> first_vector, second_vector, third_vector;
219  const Properties& r_material_properties = rValues.GetMaterialProperties();
220  const double friction_angle = r_material_properties[FRICTION_ANGLE] * Globals::Pi / 180.0;
221 
225 
226  double J3, lode_angle;
229 
230  double c1, c3, c2;
231  double checker = std::abs(lode_angle * 180.0 / Globals::Pi);
232 
233  if (std::abs(checker) < 29.0) { // If it is not the edge
234  c1 = std::sin(friction_angle) / 3.0;
235  c3 = (std::sqrt(3.0) * std::sin(lode_angle) + std::sin(friction_angle) * std::cos(lode_angle)) /
236  (2.0 * J2 * std::cos(3.0 * lode_angle));
237  c2 = 0.5 * std::cos(lode_angle)*(1.0 + std::tan(lode_angle) * std::sin(3.0 * lode_angle) +
238  std::sin(friction_angle) * (std::tan(3.0 * lode_angle) - std::tan(lode_angle)) / std::sqrt(3.0));
239  } else { // smoothing with drucker-praguer
240  c1 = 3.0 * (2.0 * std::sin(friction_angle) / (std::sqrt(3.0) * (3.0 - std::sin(friction_angle))));
241  c2 = 1.0;
242  c3 = 0.0;
243  }
244 
245  noalias(rFFlux) = c1 * first_vector + c2 * second_vector + c3 * third_vector;
246  }
247 
252  static int Check(const Properties& rMaterialProperties)
253  {
254  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(COHESION)) << "COHESION is not a defined value" << std::endl;
255  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRICTION_ANGLE)) << "FRICTION_ANGLE is not a defined value" << std::endl;
256  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRACTURE_ENERGY)) << "FRACTURE_ENERGY is not a defined value" << std::endl;
257  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not a defined value" << std::endl;
258  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS)) << "YIELD_STRESS is not a defined value" << std::endl;
259 
260  return TPlasticPotentialType::Check(rMaterialProperties);
261  }
262 
267  {
268  return true;
269  }
270 
274  static double GetScaleFactorTension(const Properties& rMaterialProperties)
275  {
276  return 1.0;
277  }
278 
282 
286 
290 
294 
296 
297 protected:
300 
304 
308 
312 
316 
320 
324 
326 private:
329 
333 
337 
341 
345 
349 
353 
355 
356 }; // Class MohrCoulombYieldSurface
357 
359 
362 
366 
368 
369 } // 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
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 void CalculateFirstVector(BoundedVectorType &rFirstVector)
This method computes the first vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:80
static void CalculateThirdVector(const BoundedVectorType &rDeviator, const double J2, BoundedVectorType &rThirdVector)
This method computes the third vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:131
static void CalculateLodeAngle(const double J2, const double J3, double &rLodeAngle)
This method computes the lode angle.
Definition: advanced_constitutive_law_utilities.cpp:158
static void CalculateI1Invariant(const TVector &rStressVector, double &rI1)
This method computes the first invariant from a given stress vector.
Definition: advanced_constitutive_law_utilities.h:116
static void CalculateJ3Invariant(const BoundedVectorType &rDeviator, double &rJ3)
This method computes the third invariant of J.
Definition: advanced_constitutive_law_utilities.cpp:62
This class defines a yield surface according to Von-Mises theory.
Definition: mohr_coulomb_yield_surface.h:59
static constexpr double tolerance
The machine precision zero tolerance.
Definition: mohr_coulomb_yield_surface.h:77
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: mohr_coulomb_yield_surface.h:71
MohrCoulombYieldSurface()
Initialization constructor.
Definition: mohr_coulomb_yield_surface.h:84
MohrCoulombYieldSurface & operator=(MohrCoulombYieldSurface const &rOther)
Assignment operator.
Definition: mohr_coulomb_yield_surface.h:94
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: mohr_coulomb_yield_surface.h:68
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: mohr_coulomb_yield_surface.h:266
virtual ~MohrCoulombYieldSurface()
Destructor.
Definition: mohr_coulomb_yield_surface.h:100
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: mohr_coulomb_yield_surface.h:161
KRATOS_CLASS_POINTER_DEFINITION(MohrCoulombYieldSurface)
Counted pointer of MohrCoulombYieldSurface.
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: mohr_coulomb_yield_surface.h:252
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: mohr_coulomb_yield_surface.h:274
static void CalculatePlasticPotentialDerivative(const array_1d< double, VoigtSize > &rPredictiveStressVector, const array_1d< double, VoigtSize > &rDeviator, const double J2, array_1d< double, VoigtSize > &rDerivativePlasticPotential, ConstitutiveLaw::Parameters &rValues)
This method calculates the derivative of the plastic potential DG/DS.
Definition: mohr_coulomb_yield_surface.h:188
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rPredictiveStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: mohr_coulomb_yield_surface.h:116
MohrCoulombYieldSurface(MohrCoulombYieldSurface const &rOther)
Copy constructor.
Definition: mohr_coulomb_yield_surface.h:89
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: mohr_coulomb_yield_surface.h:143
static void CalculateYieldSurfaceDerivative(const array_1d< double, VoigtSize > &rPredictiveStressVector, const array_1d< double, VoigtSize > &rDeviator, const double J2, array_1d< double, VoigtSize > &rFFlux, ConstitutiveLaw::Parameters &rValues)
This script calculates the derivatives of the Yield Surf according to NAYAK-ZIENKIEWICZ paper Interna...
Definition: mohr_coulomb_yield_surface.h:210
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: mohr_coulomb_yield_surface.h:65
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
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
constexpr double Pi
Definition: global_variables.h:25
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
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
I1
Definition: isotropic_damage_automatic_differentiation.py:230
def J3
Definition: isotropic_damage_automatic_differentiation.py:176
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457