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_von_mises_yield_surface.h
Go to the documentation of this file.
1 // KRATOS ___ _ _ _ _ _ __ _
2 // / __\___ _ __ ___| |_(_) |_ _ _| |_(_)_ _____ / / __ ___ _____ /_\ _ __ _ __
3 // / / / _ \| '_ \/ __| __| | __| | | | __| \ \ / / _ \/ / / _` \ \ /\ / / __| //_\\| '_ \| '_ |
4 // / /__| (_) | | | \__ \ |_| | |_| |_| | |_| |\ V / __/ /__| (_| |\ V V /\__ \/ _ \ |_) | |_) |
5 // \____/\___/|_| |_|___/\__|_|\__|\__,_|\__|_| \_/ \___\____/\__,_| \_/\_/ |___/\_/ \_/ .__/| .__/
6 //
7 // License: BSD License
8 // license: structural_mechanics_application/license.txt
9 //
10 // Main authors: Alejandro Cornejo
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // Project includes
19 
20 namespace Kratos
21 {
24 
28 
32 
36 
40 
49 template <class TPlasticPotentialType>
51 {
52 public:
55 
57  using PlasticPotentialType = TPlasticPotentialType;
58 
60 
62  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
63 
65  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
66 
69 
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 BoundedVector& rStressVector,
118  const Vector& rStrainVector,
119  double& rEquivalentStress,
121  )
122  {
123  BaseType::CalculateEquivalentStress(rStressVector, rStrainVector, rEquivalentStress, rValues);
124  }
125 
133  double& rThreshold
134  )
135  {
136  const auto& r_props = rValues.GetMaterialProperties();
137  double yield_tension;
138  if (rValues.IsSetShapeFunctionsValues()) { // This is needed since at Initialize level the N are not set yet...
139  yield_tension = r_props.Has(YIELD_STRESS) ? AdvCLutils::GetMaterialPropertyThroughAccessor(YIELD_STRESS, rValues) : AdvCLutils::GetMaterialPropertyThroughAccessor(YIELD_STRESS_TENSION, rValues);
140  } else {
141  const double ref_temperature = r_props.Has(REFERENCE_TEMPERATURE) ? r_props[REFERENCE_TEMPERATURE] : rValues.GetElementGeometry().GetValue(REFERENCE_TEMPERATURE);
142  yield_tension = r_props.Has(YIELD_STRESS) ? AdvCLutils::GetPropertyFromTemperatureTable(YIELD_STRESS, rValues, ref_temperature) : AdvCLutils::GetPropertyFromTemperatureTable(YIELD_STRESS_TENSION, rValues, ref_temperature);
143  }
144  rThreshold = std::abs(yield_tension);
145  }
146 
155  double& rAParameter,
156  const double CharacteristicLength
157  )
158  {
159  const Properties& r_material_properties = rValues.GetMaterialProperties();
160 
161  const auto &r_geom = rValues.GetElementGeometry();
162  const auto &r_N = rValues.GetShapeFunctionsValues();
163  const auto &r_process_info = rValues.GetProcessInfo();
164 
165  // In here we check the accessor
166  const double fracture_energy = r_material_properties.GetValue(FRACTURE_ENERGY, r_geom, r_N, r_process_info);
167  const double young_modulus = r_material_properties.GetValue(YOUNG_MODULUS, r_geom, r_N, r_process_info);
168  const double yield_compression = r_material_properties.Has(YIELD_STRESS) ? r_material_properties.GetValue(YIELD_STRESS, r_geom, r_N, r_process_info) : r_material_properties.GetValue(YIELD_STRESS_COMPRESSION, r_geom, r_N, r_process_info);
169 
170  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
171  rAParameter = 1.0 / (fracture_energy * young_modulus / (CharacteristicLength * std::pow(yield_compression, 2)) - 0.5);
172  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture energy is too low, increase FRACTURE_ENERGY..." << std::endl;
173  } else if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Linear)) { // linear
174  rAParameter = -std::pow(yield_compression, 2) / (2.0 * young_modulus * fracture_energy / CharacteristicLength);
175  } else {
176  rAParameter = 0.0;
177  }
178  }
179 
189  const BoundedVector& rStressVector,
190  const BoundedVector& rDeviator,
191  const double J2,
192  BoundedVector& rDerivativePlasticPotential,
194  )
195  {
196  BaseType::CalculatePlasticPotentialDerivative(rStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
197  }
198 
211  const BoundedVector& rStressVector,
212  const BoundedVector& rDeviator,
213  const double J2,
214  BoundedVector& rFFlux,
216  )
217  {
218  BaseType::CalculateYieldSurfaceDerivative(rStressVector, rDeviator, J2, rFFlux, rValues);
219  }
220 
225  static int Check(const Properties& rMaterialProperties)
226  {
227  return BaseType::Check(rMaterialProperties);
228  }
229 
234  {
236  }
237 
241  static double GetScaleFactorTension(const Properties& rMaterialProperties)
242  {
243  return BaseType::GetScaleFactorTension(rMaterialProperties);
244  }
245 
249 
253 
257 
261 
263 
264 protected:
267 
271 
275 
279 
283 
287 
291 
293 private:
296 
300 
304 
308 
312 
316 
320 
322 
323 }; // Class ThermalVonMisesYieldSurface
324 
326 
329 
333 
335 
336 } // namespace Kratos.
This class includes several utilities necessaries for the computation of the constitutive law.
Definition: advanced_constitutive_law_utilities.h:59
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 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
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
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
bool Has(TVariableType const &rThisVariable) const
Definition: properties.h:578
This class defines a yield surface according to Von-Mises theory.
Definition: thermal_von_mises_yield_surface.h:51
virtual ~ThermalVonMisesYieldSurface()
Destructor.
Definition: thermal_von_mises_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: thermal_von_mises_yield_surface.h:153
KRATOS_CLASS_POINTER_DEFINITION(ThermalVonMisesYieldSurface)
Counted pointer of ThermalVonMisesYieldSurface.
ThermalVonMisesYieldSurface & operator=(ThermalVonMisesYieldSurface const &rOther)
Assignment operator.
Definition: thermal_von_mises_yield_surface.h:94
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: thermal_von_mises_yield_surface.h:225
static constexpr double tolerance
The machine precision zero tolerance.
Definition: thermal_von_mises_yield_surface.h:77
ThermalVonMisesYieldSurface(ThermalVonMisesYieldSurface const &rOther)
Copy constructor.
Definition: thermal_von_mises_yield_surface.h:89
static void CalculatePlasticPotentialDerivative(const BoundedVector &rStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rDerivativePlasticPotential, ConstitutiveLaw::Parameters &rValues)
This method calculates the derivative of the plastic potential DG/DS.
Definition: thermal_von_mises_yield_surface.h:188
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: thermal_von_mises_yield_surface.h:57
static void CalculateEquivalentStress(const BoundedVector &rStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method computes sqrt(3*J2)
Definition: thermal_von_mises_yield_surface.h:116
ThermalVonMisesYieldSurface()
Initialization constructor.
Definition: thermal_von_mises_yield_surface.h:84
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: thermal_von_mises_yield_surface.h:241
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: thermal_von_mises_yield_surface.h:62
static void CalculateYieldSurfaceDerivative(const BoundedVector &rStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rFFlux, ConstitutiveLaw::Parameters &rValues)
This script calculates the derivatives of the Yield Surf according to NAYAK-ZIENKIEWICZ paper Interna...
Definition: thermal_von_mises_yield_surface.h:210
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: thermal_von_mises_yield_surface.h:233
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: thermal_von_mises_yield_surface.h:131
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: thermal_von_mises_yield_surface.h:65
This class defines a yield surface according to Von-Mises theory.
Definition: von_mises_yield_surface.h:59
static void CalculateEquivalentStress(const array_1d< double, VoigtSize > &rStressVector, const Vector &rStrainVector, double &rEquivalentStress, ConstitutiveLaw::Parameters &rValues)
This method the uniaxial equivalent stress.
Definition: von_mises_yield_surface.h:118
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: von_mises_yield_surface.h:245
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: von_mises_yield_surface.h:253
static void CalculateYieldSurfaceDerivative(const BoundedVector &rPredictiveStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rFFlux, ConstitutiveLaw::Parameters &rValues)
This script calculates the derivatives of the Yield Surf according to NAYAK-ZIENKIEWICZ paper Interna...
Definition: von_mises_yield_surface.h:201
static void CalculatePlasticPotentialDerivative(const BoundedVector &rStressVector, const BoundedVector &rDeviator, const double J2, BoundedVector &rDerivativePlasticPotential, ConstitutiveLaw::Parameters &rValues)
This method calculates the derivative of the plastic potential DG/DS.
Definition: von_mises_yield_surface.h:179
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: von_mises_yield_surface.h:220
#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
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