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.
rankine_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"
21 
22 
23 namespace Kratos
24 {
27 
31 
32  // The size type definition
33  typedef std::size_t SizeType;
34 
38 
42 
46 
59 template <class TPlasticPotentialType>
61 {
62 public:
65 
67  typedef TPlasticPotentialType PlasticPotentialType;
68 
70  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
71 
73  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
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 
102  virtual ~RankineYieldSurface(){};
103 
110 
118  const array_1d<double, VoigtSize>& rPredictiveStressVector,
119  const Vector& rStrainVector,
120  double& rEquivalentStress,
122  )
123  {
124  array_1d<double, Dimension> principal_stress_vector = ZeroVector(Dimension);
125  AdvancedConstitutiveLawUtilities<VoigtSize>::CalculatePrincipalStresses(principal_stress_vector, rPredictiveStressVector);
126  // The rEquivalentStress is the maximum principal stress
127  if constexpr (Dimension == 3)
128  rEquivalentStress = std::max(std::max(principal_stress_vector[0], principal_stress_vector[1]), principal_stress_vector[2]);
129  else // 2D
130  rEquivalentStress = std::max(principal_stress_vector[0], principal_stress_vector[1]);
131  }
132 
138  static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters& rValues, double& rThreshold)
139  {
140  const Properties& r_material_properties = rValues.GetMaterialProperties();
141 
142  const double yield_tension = r_material_properties.Has(YIELD_STRESS) ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_TENSION];
143  rThreshold = std::abs(yield_tension);
144  }
145 
154  double& rAParameter,
155  const double CharacteristicLength)
156  {
157  const Properties& r_material_properties = rValues.GetMaterialProperties();
158 
159  const double Gf = r_material_properties[FRACTURE_ENERGY];
160  const double E = r_material_properties[YOUNG_MODULUS];
161  const double yield_compression = r_material_properties.Has(YIELD_STRESS) ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
162 
163  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
164  rAParameter = 1.00 / (Gf * E / (CharacteristicLength * std::pow(yield_compression, 2)) - 0.5);
165  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture energy is too low, increase FRACTURE_ENERGY..." << std::endl;
166  } else { // linear
167  rAParameter = -std::pow(yield_compression, 2) / (2.0 * E * Gf / CharacteristicLength);
168  }
169  }
170 
180  const array_1d<double, VoigtSize>& rPredictiveStressVector,
181  const array_1d<double, VoigtSize>& rDeviator,
182  const double J2,
183  array_1d<double, VoigtSize>& rPlasticPotential,
185  )
186  {
187  TPlasticPotentialType::CalculatePlasticPotentialDerivative(rPredictiveStressVector, rDeviator, J2, rPlasticPotential, rValues);
188  }
189 
202  const array_1d<double, VoigtSize>& rPredictiveStressVector,
203  const array_1d<double, VoigtSize>& rDeviator,
204  const double J2,
207  )
208  {
209  RankinePlasticPotential<VoigtSize>::CalculatePlasticPotentialDerivative(rPredictiveStressVector, rDeviator, J2, rFFlux, rValues);
210  }
211 
216  static int Check(const Properties& rMaterialProperties)
217  {
218  if (!rMaterialProperties.Has(YIELD_STRESS)) {
219  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_TENSION)) << "YIELD_STRESS_TENSION is not a defined value" << std::endl;
220  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_COMPRESSION)) << "YIELD_STRESS_COMPRESSION is not a defined value" << std::endl;
221 
222  const double yield_compression = rMaterialProperties[YIELD_STRESS_COMPRESSION];
223  const double yield_tension = rMaterialProperties[YIELD_STRESS_TENSION];
224 
225  KRATOS_ERROR_IF(yield_compression < tolerance) << "Yield stress in compression almost zero or negative, include YIELD_STRESS_COMPRESSION in definition";
226  KRATOS_ERROR_IF(yield_tension < tolerance) << "Yield stress in tension almost zero or negative, include YIELD_STRESS_TENSION in definition";
227  } else {
228  const double yield_stress = rMaterialProperties[YIELD_STRESS];
229 
230  KRATOS_ERROR_IF(yield_stress < tolerance) << "Yield stress almost zero or negative, include YIELD_STRESS in definition";
231  }
232  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRACTURE_ENERGY)) << "FRACTURE_ENERGY is not a defined value" << std::endl;
233  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not a defined value" << std::endl;
234 
235  return TPlasticPotentialType::Check(rMaterialProperties);
236  }
237 
242  {
243  return true;
244  }
245 
249  static double GetScaleFactorTension(const Properties& rMaterialProperties)
250  {
251  return 1.0;
252  }
253 
257 
261 
265 
269 
271 
272 protected:
275 
279 
283 
287 
291 
295 
299 
301 private:
304 
308 
312 
316 
320 
324 
328 
330 
331 }; // Class RankineYieldSurface
332 
334 
337 
341 
343 
344 } // namespace Kratos.
static void CalculatePrincipalStresses(array_1d< double, Dimension > &rPrincipalStressVector, const BoundedVectorType &rStressVector)
This method computes the principal stresses vector.
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
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: rankine_plastic_potential.h:108
This class defines a yield surface according to Rankine theory.
Definition: rankine_yield_surface.h:61
static void CalculatePlasticPotentialDerivative(const array_1d< double, VoigtSize > &rPredictiveStressVector, const array_1d< double, VoigtSize > &rDeviator, const double J2, array_1d< double, VoigtSize > &rPlasticPotential, ConstitutiveLaw::Parameters &rValues)
This method calculates the derivative of the plastic potential DG/DS.
Definition: rankine_yield_surface.h:179
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: rankine_yield_surface.h:152
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: rankine_yield_surface.h:138
RankineYieldSurface & operator=(RankineYieldSurface const &rOther)
Assignment operator.
Definition: rankine_yield_surface.h:96
RankineYieldSurface(RankineYieldSurface const &rOther)
Copy constructor.
Definition: rankine_yield_surface.h:91
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: rankine_yield_surface.h:70
RankineYieldSurface()
Initialization constructor.
Definition: rankine_yield_surface.h:86
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: rankine_yield_surface.h:201
static constexpr double tolerance
The zero tolerance definition.
Definition: rankine_yield_surface.h:79
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: rankine_yield_surface.h:67
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: rankine_yield_surface.h:73
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: rankine_yield_surface.h:216
KRATOS_CLASS_POINTER_DEFINITION(RankineYieldSurface)
Counted pointer of RankineYieldSurface.
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: rankine_yield_surface.h:241
virtual ~RankineYieldSurface()
Destructor.
Definition: rankine_yield_surface.h:102
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rPredictiveStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: rankine_yield_surface.h:117
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: rankine_yield_surface.h:249
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
static double max(double a, double b)
Definition: GeometryFunctions.h:79
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
E
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:26
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
Gf
Definition: isotropic_damage_automatic_differentiation.py:135
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457