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.
thermal_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
19 
20 namespace Kratos
21 {
24 
28 
32 
36 
40 
54 template <class TPlasticPotentialType>
56 {
57 public:
60 
62  using PlasticPotentialType = TPlasticPotentialType;
63 
65 
67  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
68 
70  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
71 
74 
76  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
77 
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  {
125  double I1, J2, J3, lode_angle;
127 
132 
133  const double friction_angle = AdvCLutils::GetMaterialPropertyThroughAccessor(FRICTION_ANGLE, rValues) * Globals::Pi / 180.0;
134 
135  rEquivalentStress = (std::cos(lode_angle) - std::sin(lode_angle) * std::sin(friction_angle) / std::sqrt(3.0)) * std::sqrt(J2) +
136  I1 * std::sin(friction_angle) / 3.0;
137  }
138 
146  double& rThreshold
147  )
148  {
149  const auto& r_material_properties = rValues.GetMaterialProperties();
150  double friction_angle, cohesion;
151  if (rValues.IsSetShapeFunctionsValues()) { // This is needed since at Initialize level the N are not set yet...
152  friction_angle = AdvCLutils::GetMaterialPropertyThroughAccessor(FRICTION_ANGLE, rValues);
153  cohesion = AdvCLutils::GetMaterialPropertyThroughAccessor(COHESION, rValues);
154  } else {
155  const double ref_temperature = r_material_properties.Has(REFERENCE_TEMPERATURE) ? r_material_properties[REFERENCE_TEMPERATURE] : rValues.GetElementGeometry().GetValue(REFERENCE_TEMPERATURE);
156  friction_angle = AdvCLutils::GetPropertyFromTemperatureTable(FRICTION_ANGLE, rValues, ref_temperature);
157  cohesion = AdvCLutils::GetPropertyFromTemperatureTable(COHESION, rValues, ref_temperature);
158  }
159  rThreshold = cohesion * std::cos(friction_angle);
160  }
161 
170  double& rAParameter,
171  const double CharacteristicLength
172  )
173  {
174  const Properties& r_material_properties = rValues.GetMaterialProperties();
175 
176  const auto &r_geom = rValues.GetElementGeometry();
177  const auto &r_N = rValues.GetShapeFunctionsValues();
178  const auto &r_process_info = rValues.GetProcessInfo();
179 
180  const double fracture_energy = r_material_properties.GetValue(FRACTURE_ENERGY, r_geom, r_N, r_process_info);
181  const double young_modulus = r_material_properties.GetValue(YOUNG_MODULUS, r_geom, r_N, r_process_info);
182 
183  double equivalent_yield;
184  GetInitialUniaxialThreshold(rValues, equivalent_yield);
185  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
186  rAParameter = 1.00 / (fracture_energy * young_modulus / (CharacteristicLength * std::pow(equivalent_yield, 2)) - 0.5);
187  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture Energy is too low, increase FRACTURE_ENERGY..." << std::endl;
188  } else if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Linear)) { // linear
189  rAParameter = -std::pow(equivalent_yield, 2) / (2.0 * young_modulus * fracture_energy / CharacteristicLength);
190  } else {
191  rAParameter = 0.0;
192  }
193  }
194 
204  const array_1d<double, VoigtSize>& rStressVector,
205  const array_1d<double, VoigtSize>& rDeviator,
206  const double J2,
207  array_1d<double, VoigtSize>& rDerivativePlasticPotential,
209  )
210  {
211  TPlasticPotentialType::CalculatePlasticPotentialDerivative(rStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
212  }
213 
226  const array_1d<double, VoigtSize>& rPredictiveStressVector,
227  const array_1d<double, VoigtSize>& rDeviator,
228  const double J2,
231  )
232  {
233  array_1d<double, VoigtSize> first_vector, second_vector, third_vector;
234  const double friction_angle = AdvCLutils::GetMaterialPropertyThroughAccessor(FRICTION_ANGLE, rValues) * Globals::Pi / 180.0;
235 
239 
240  double J3, lode_angle;
243 
244  double c1, c3, c2;
245  double checker = std::abs(lode_angle * 180.0 / Globals::Pi);
246 
247  if (std::abs(checker) < 29.0) { // If it is not the edge
248  c1 = std::sin(friction_angle) / 3.0;
249  c3 = (std::sqrt(3.0) * std::sin(lode_angle) + std::sin(friction_angle) * std::cos(lode_angle)) /
250  (2.0 * J2 * std::cos(3.0 * lode_angle));
251  c2 = 0.5 * std::cos(lode_angle)*(1.0 + std::tan(lode_angle) * std::sin(3.0 * lode_angle) +
252  std::sin(friction_angle) * (std::tan(3.0 * lode_angle) - std::tan(lode_angle)) / std::sqrt(3.0));
253  } else { // smoothing with drucker-prager
254  c1 = 3.0 * (2.0 * std::sin(friction_angle) / (std::sqrt(3.0) * (3.0 - std::sin(friction_angle))));
255  c2 = 1.0;
256  c3 = 0.0;
257  }
258  noalias(rFFlux) = c1 * first_vector + c2 * second_vector + c3 * third_vector;
259  }
260 
265  static int Check(const Properties& rMaterialProperties)
266  {
267  return BaseType::Check(rMaterialProperties);
268  }
269 
274  {
276  }
277 
281  static double GetScaleFactorTension(const Properties& rMaterialProperties)
282  {
284  }
285 
289 
293 
297 
301 
303 
304 protected:
307 
311 
315 
319 
323 
327 
331 
333 private:
336 
340 
344 
348 
352 
356 
360 
362 
363 }; // Class MohrCoulombYieldSurface
364 
366 
369 
373 
375 
376 } // namespace Kratos.
This class includes several utilities necessaries for the computation of the constitutive law.
Definition: advanced_constitutive_law_utilities.h:59
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 double GetPropertyFromTemperatureTable(const Variable< double > &rVariable, ConstitutiveLaw::Parameters &rValues, const double Temperature)
This retrieves a double type variable from a table if exists, assumes TEMPERATURE to be the independe...
Definition: advanced_constitutive_law_utilities.cpp:833
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 double GetMaterialPropertyThroughAccessor(const Variable< double > &rVariable, ConstitutiveLaw::Parameters &rValues)
This retrieves a double type variable checking the accessor.
Definition: advanced_constitutive_law_utilities.cpp:818
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
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
This class defines a yield surface according to Von-Mises theory.
Definition: mohr_coulomb_yield_surface.h:59
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: mohr_coulomb_yield_surface.h:266
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
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
TVariableType::Type & GetValue(const TVariableType &rVariable)
Definition: properties.h:228
This class defines a yield surface according to Von-Mises theory.
Definition: thermal_mohr_coulomb_yield_surface.h:56
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: thermal_mohr_coulomb_yield_surface.h:265
ThermalMohrCoulombYieldSurface()
Initialization constructor.
Definition: thermal_mohr_coulomb_yield_surface.h:86
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: thermal_mohr_coulomb_yield_surface.h:168
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: thermal_mohr_coulomb_yield_surface.h:62
virtual ~ThermalMohrCoulombYieldSurface()
Destructor.
Definition: thermal_mohr_coulomb_yield_surface.h:102
KRATOS_CLASS_POINTER_DEFINITION(ThermalMohrCoulombYieldSurface)
Counted pointer of MohrCoulombYieldSurface.
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: thermal_mohr_coulomb_yield_surface.h:225
ThermalMohrCoulombYieldSurface & operator=(ThermalMohrCoulombYieldSurface const &rOther)
Assignment operator.
Definition: thermal_mohr_coulomb_yield_surface.h:96
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: thermal_mohr_coulomb_yield_surface.h:281
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: thermal_mohr_coulomb_yield_surface.h:144
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: thermal_mohr_coulomb_yield_surface.h:273
static void CalculatePlasticPotentialDerivative(const array_1d< double, VoigtSize > &rStressVector, 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: thermal_mohr_coulomb_yield_surface.h:203
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: thermal_mohr_coulomb_yield_surface.h:70
ThermalMohrCoulombYieldSurface(ThermalMohrCoulombYieldSurface const &rOther)
Copy constructor.
Definition: thermal_mohr_coulomb_yield_surface.h:91
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: thermal_mohr_coulomb_yield_surface.h:118
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: thermal_mohr_coulomb_yield_surface.h:67
static constexpr double tolerance
The machine precision zero tolerance.
Definition: thermal_mohr_coulomb_yield_surface.h:76
#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 GeometryType & GetElementGeometry()
Definition: constitutive_law.h:462
const Vector & GetShapeFunctionsValues()
Definition: constitutive_law.h:419
bool IsSetShapeFunctionsValues()
Definition: constitutive_law.h:483
const ProcessInfo & GetProcessInfo()
Definition: constitutive_law.h:452
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457