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.
modified_mohr_coulomb_plastic_potential.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/checks.h"
21 
22 namespace Kratos
23 {
26 
30 
31  // The size type definition
32  typedef std::size_t SizeType;
33 
37 
41 
45 
56 template <SizeType TVoigtSize = 6>
58 {
59  public:
62 
64  static constexpr SizeType Dimension = TVoigtSize == 6 ? 3 : 2;
65 
67  static constexpr SizeType VoigtSize = TVoigtSize;
68 
71 
73  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
74 
78 
81  {
82  }
83 
86  {
87  }
88 
91  {
92  return *this;
93  }
94 
97 
101 
105 
116  const array_1d<double, VoigtSize>& rPredictiveStressVector,
117  const array_1d<double, VoigtSize>& rDeviator,
118  const double J2,
121  )
122  {
123  const Properties& r_material_properties = rValues.GetMaterialProperties();
124 
125  array_1d<double, VoigtSize> first_vector, second_vector, third_vector;
126 
130 
131  double J3, lode_angle;
134 
135  const double checker = std::abs(lode_angle * 180.0 / Globals::Pi);
136 
137  const double dilatancy = r_material_properties[DILATANCY_ANGLE] * Globals::Pi / 180.0;
138  const double sin_dil = std::sin(dilatancy);
139  const double cos_dil = std::cos(dilatancy);
140  const double sin_theta = std::sin(lode_angle);
141  const double cos_theta = std::cos(lode_angle);
142  const double cos_3theta = std::cos(3.0 * lode_angle);
143  const double tan_theta = std::tan(lode_angle);
144  const double tan_3theta = std::tan(3.0 * lode_angle);
145  const double Root3 = std::sqrt(3.0);
146 
147  const bool has_symmetric_yield_stress = r_material_properties.Has(YIELD_STRESS);
148  const double compr_yield = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
149  const double tensi_yield = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_TENSION];
150  const double n = compr_yield / tensi_yield;
151 
152  const double angle_phi = (Globals::Pi * 0.25) + dilatancy * 0.5;
153  const double alpha = n / (std::tan(angle_phi) * std::tan(angle_phi));
154 
155  const double CFL = 2.0 * std::tan(angle_phi) / cos_dil;
156 
157  const double K1 = 0.5 * (1 + alpha) - 0.5 * (1 - alpha) * sin_dil;
158  const double K2 = 0.5 * (1 + alpha) - 0.5 * (1 - alpha) / sin_dil;
159  const double K3 = 0.5 * (1 + alpha) * sin_dil - 0.5 * (1 - alpha);
160 
161  double c1, c2, c3;
162  if (std::abs(sin_dil) > tolerance)
163  c1 = CFL * K3 / 3.0;
164  else
165  c1 = 0.0; // check
166 
167  if (checker < 29.0) {
168  c2 = cos_theta * CFL * (K1 * (1 + tan_theta * tan_3theta) + K2 * sin_dil * (tan_3theta - tan_theta) / Root3);
169  c3 = CFL * (K1 * Root3 * sin_theta + K2 * sin_dil * cos_theta) / (2.0 * J2 * cos_3theta);
170  } else {
171  c3 = 0.0;
172  double Aux = 1.0;
173  if (std::abs(lode_angle) > tolerance)
174  Aux = -1.0;
175  c2 = 0.5 * CFL * (K1 * Root3 + Aux * K2 * sin_dil / Root3);
176  }
177 
178  noalias(rGFlux) = c1 * first_vector + c2 * second_vector + c3 * third_vector;
179  }
180 
185  static int Check(const Properties& rMaterialProperties)
186  {
187  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(DILATANCY_ANGLE)) << "DILATANCY_ANGLE is not a defined value" << std::endl;
188  if (!rMaterialProperties.Has(YIELD_STRESS)) {
189  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_TENSION)) << "YIELD_STRESS_TENSION is not a defined value" << std::endl;
190  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_COMPRESSION)) << "YIELD_STRESS_COMPRESSION is not a defined value" << std::endl;
191 
192  const double yield_compression = rMaterialProperties[YIELD_STRESS_COMPRESSION];
193  const double yield_tension = rMaterialProperties[YIELD_STRESS_TENSION];
194 
195  KRATOS_ERROR_IF(yield_compression < tolerance) << "Yield stress in compression almost zero or negative, include YIELD_STRESS_COMPRESSION in definition";
196  KRATOS_ERROR_IF(yield_tension < tolerance) << "Yield stress in tension almost zero or negative, include YIELD_STRESS_TENSION in definition";
197  } else {
198  const double yield_stress = rMaterialProperties[YIELD_STRESS];
199 
200  KRATOS_ERROR_IF(yield_stress < tolerance) << "Yield stress almost zero or negative, include YIELD_STRESS in definition";
201  }
202 
203  return 0;
204  }
205 
209 
213 
217 
221 
223 
224 protected:
227 
231 
235 
239 
243 
247 
251 
253 
254 private:
257 
261 
265 
269 
273 
277 
281 
283 
284 }; // Class GenericYieldSurface
285 
287 
290 
294 
296 
297 } // 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 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 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 plastic potential following the theory of Mohr-Coulomb (modified)
Definition: modified_mohr_coulomb_plastic_potential.h:58
static constexpr double tolerance
The zero tolerance definition.
Definition: modified_mohr_coulomb_plastic_potential.h:73
static constexpr SizeType Dimension
We define the dimension.
Definition: modified_mohr_coulomb_plastic_potential.h:64
ModifiedMohrCoulombPlasticPotential(ModifiedMohrCoulombPlasticPotential const &rOther)
Copy constructor.
Definition: modified_mohr_coulomb_plastic_potential.h:85
static void CalculatePlasticPotentialDerivative(const array_1d< double, VoigtSize > &rPredictiveStressVector, const array_1d< double, VoigtSize > &rDeviator, const double J2, array_1d< double, VoigtSize > &rGFlux, ConstitutiveLaw::Parameters &rValues)
This script calculates the derivatives of the plastic potential according to NAYAK-ZIENKIEWICZ paper ...
Definition: modified_mohr_coulomb_plastic_potential.h:115
KRATOS_CLASS_POINTER_DEFINITION(ModifiedMohrCoulombPlasticPotential)
Counted pointer of ModifiedMohrCoulombPlasticPotential.
ModifiedMohrCoulombPlasticPotential()
Initialization constructor.
Definition: modified_mohr_coulomb_plastic_potential.h:80
static constexpr SizeType VoigtSize
The define the Voigt size.
Definition: modified_mohr_coulomb_plastic_potential.h:67
ModifiedMohrCoulombPlasticPotential & operator=(ModifiedMohrCoulombPlasticPotential const &rOther)
Assignment operator.
Definition: modified_mohr_coulomb_plastic_potential.h:90
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the plastic potential.
Definition: modified_mohr_coulomb_plastic_potential.h:185
virtual ~ModifiedMohrCoulombPlasticPotential()
Destructor.
Definition: modified_mohr_coulomb_plastic_potential.h:96
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
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
float K2
Definition: isotropic_damage_automatic_differentiation.py:178
float K3
Definition: isotropic_damage_automatic_differentiation.py:179
CFL
Definition: isotropic_damage_automatic_differentiation.py:156
def J3
Definition: isotropic_damage_automatic_differentiation.py:176
float K1
Definition: isotropic_damage_automatic_differentiation.py:177
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457