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.
simo_ju_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"
19 
20 namespace Kratos
21 {
24 
28 
29  // The size type definition
30  typedef std::size_t SizeType;
31 
35 
39 
43 
54 template <class TPlasticPotentialType>
56 {
57  public:
60 
62  typedef TPlasticPotentialType PlasticPotentialType;
63 
65  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
66 
68  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
69 
72 
74  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
75 
79 
82  {
83  }
84 
87  {
88  }
89 
92  {
93  return *this;
94  }
95 
97  virtual ~SimoJuYieldSurface(){};
98 
105 
114  const array_1d<double, VoigtSize>& rPredictiveStressVector,
115  const Vector& rStrainVector,
116  double& rEquivalentStress,
118  )
119  {
120  const Properties& r_material_properties = rValues.GetMaterialProperties();
121 
122  // It compares with fc / sqrt(E)
123  array_1d<double, Dimension> principal_stress_vector;
124  AdvancedConstitutiveLawUtilities<VoigtSize>::CalculatePrincipalStresses(principal_stress_vector, rPredictiveStressVector);
125 
126  const bool has_symmetric_yield_stress = r_material_properties.Has(YIELD_STRESS);
127  const double yield_compression = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
128  const double yield_tension = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_TENSION];
129  const double n = std::abs(yield_compression / yield_tension);
130 
131  double SumA = 0.0, SumB = 0.0, SumC = 0.0, ere0, ere1;
132  for (std::size_t cont = 0; cont < 2; ++cont) {
133  SumA += std::abs(principal_stress_vector[cont]);
134  SumB += 0.5 * (principal_stress_vector[cont] + std::abs(principal_stress_vector[cont]));
135  SumC += 0.5 * (-principal_stress_vector[cont] + std::abs(principal_stress_vector[cont]));
136  }
137  ere0 = SumB / SumA;
138  ere1 = SumC / SumA;
139 
140  double auxf = 0.0;
141  for (std::size_t cont = 0; cont < VoigtSize; ++cont) {
142  auxf += rStrainVector[cont] * rPredictiveStressVector[cont]; // E:S
143  }
144  rEquivalentStress = std::sqrt(auxf);
145  rEquivalentStress *= (ere0 * n + ere1);
146  }
147 
155  double& rThreshold
156  )
157  {
158  const Properties& r_material_properties = rValues.GetMaterialProperties();
159 
160  const double yield_compression = r_material_properties.Has(YIELD_STRESS) ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
161  rThreshold = std::abs(yield_compression / std::sqrt(r_material_properties[YOUNG_MODULUS]));
162  }
163 
172  double& rAParameter,
173  const double CharacteristicLength
174  )
175  {
176  const Properties& r_material_properties = rValues.GetMaterialProperties();
177 
178  const double fracture_energy = r_material_properties[FRACTURE_ENERGY];
179  const bool has_symmetric_yield_stress = r_material_properties.Has(YIELD_STRESS);
180  const double yield_compression = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_COMPRESSION];
181  const double yield_tension = has_symmetric_yield_stress ? r_material_properties[YIELD_STRESS] : r_material_properties[YIELD_STRESS_TENSION];
182  const double n = yield_compression / yield_tension;
183 
184  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
185  rAParameter = 1.0 / (fracture_energy * n * n / (CharacteristicLength * std::pow(yield_compression, 2)) - 0.5);
186  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture energy is too low, increase FRACTURE_ENERGY..." << std::endl;
187  } else { // linear
188  rAParameter = -std::pow(yield_compression, 2) / (2.0 * fracture_energy * n * n / CharacteristicLength);
189  }
190  }
191 
201  const array_1d<double, VoigtSize>& rPredictiveStressVector,
202  const array_1d<double, VoigtSize>& rDeviator,
203  const double J2,
204  array_1d<double, VoigtSize>& rDerivativePlasticPotential,
206  )
207  {
208  TPlasticPotentialType::CalculatePlasticPotentialDerivative(rPredictiveStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
209  }
210 
223  const array_1d<double, VoigtSize>& rPredictiveStressVector,
225  const double J2,
228  )
229  {
230  KRATOS_ERROR << "Yield surface derivative not defined for SimoJu..." << std::endl;
231  }
232 
237  static int Check(const Properties& rMaterialProperties)
238  {
239  if (!rMaterialProperties.Has(YIELD_STRESS)) {
240  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_TENSION)) << "YIELD_STRESS_TENSION is not a defined value" << std::endl;
241  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YIELD_STRESS_COMPRESSION)) << "YIELD_STRESS_COMPRESSION is not a defined value" << std::endl;
242 
243  const double yield_compression = rMaterialProperties[YIELD_STRESS_COMPRESSION];
244  const double yield_tension = rMaterialProperties[YIELD_STRESS_TENSION];
245 
246  KRATOS_ERROR_IF(yield_compression < tolerance) << "Yield stress in compression almost zero or negative, include YIELD_STRESS_COMPRESSION in definition";
247  KRATOS_ERROR_IF(yield_tension < tolerance) << "Yield stress in tension almost zero or negative, include YIELD_STRESS_TENSION in definition";
248  } else {
249  const double yield_stress = rMaterialProperties[YIELD_STRESS];
250 
251  KRATOS_ERROR_IF(yield_stress < tolerance) << "Yield stress almost zero or negative, include YIELD_STRESS in definition";
252  }
253  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(FRACTURE_ENERGY)) << "FRACTURE_ENERGY is not a defined value" << std::endl;
254  KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not a defined value" << std::endl;
255 
256  return TPlasticPotentialType::Check(rMaterialProperties);
257  }
258 
263  {
264  return false;
265  }
266 
270  static double GetScaleFactorTension(const Properties& rMaterialProperties)
271  {
272  const double yield_compression = rMaterialProperties.Has(YIELD_STRESS) ? rMaterialProperties[YIELD_STRESS] : rMaterialProperties[YIELD_STRESS_COMPRESSION];
273  const double yield_tension = rMaterialProperties.Has(YIELD_STRESS) ? rMaterialProperties[YIELD_STRESS] : rMaterialProperties[YIELD_STRESS_TENSION];
274  return std::sqrt(rMaterialProperties[YOUNG_MODULUS]) * yield_tension / yield_compression;
275  }
279 
283 
287 
291 
293 
294  protected:
297 
301 
305 
309 
313 
317 
321 
323  private:
326 
330 
334 
338 
342 
346 
350 
352 
353 }; // Class SimoJuYieldSurface
354 
356 
359 
363 
365 
366 } // 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
Short class definition.
Definition: simo_ju_yield_surface.h:56
KRATOS_CLASS_POINTER_DEFINITION(SimoJuYieldSurface)
Counted pointer of SimoJuYieldSurface.
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: simo_ju_yield_surface.h:262
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: simo_ju_yield_surface.h:153
static void CalculateYieldSurfaceDerivative(const array_1d< double, VoigtSize > &rPredictiveStressVector, const array_1d< double, VoigtSize > &Deviator, 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: simo_ju_yield_surface.h:222
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: simo_ju_yield_surface.h:65
virtual ~SimoJuYieldSurface()
Destructor.
Definition: simo_ju_yield_surface.h:97
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: simo_ju_yield_surface.h:62
SimoJuYieldSurface & operator=(SimoJuYieldSurface const &rOther)
Assignment operator.
Definition: simo_ju_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: simo_ju_yield_surface.h:270
static constexpr double tolerance
The machine precision zero tolerance.
Definition: simo_ju_yield_surface.h:74
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: simo_ju_yield_surface.h:237
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rPredictiveStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: simo_ju_yield_surface.h:113
SimoJuYieldSurface(SimoJuYieldSurface const &rOther)
Copy constructor.
Definition: simo_ju_yield_surface.h:86
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: simo_ju_yield_surface.h:68
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: simo_ju_yield_surface.h:200
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: simo_ju_yield_surface.h:170
SimoJuYieldSurface()
Initialization constructor.
Definition: simo_ju_yield_surface.h:81
#define KRATOS_ERROR
Definition: exception.h:161
#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
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
Deviator
Definition: isotropic_damage_automatic_differentiation.py:135
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