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_simo_ju_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
20 
21 namespace Kratos
22 {
25 
29 
33 
37 
41 
52 template <class TPlasticPotentialType>
54 {
55  public:
58 
60  using PlasticPotentialType = TPlasticPotentialType;
61 
64 
66  static constexpr SizeType Dimension = PlasticPotentialType::Dimension;
67 
69  static constexpr SizeType VoigtSize = PlasticPotentialType::VoigtSize;
70 
73 
75  static constexpr double tolerance = std::numeric_limits<double>::epsilon();
76 
79 
83 
86  {
87  }
88 
91  {
92  }
93 
96  {
97  return *this;
98  }
99 
102 
109 
118  const array_1d<double, VoigtSize>& rStressVector,
119  const Vector& rStrainVector,
120  double& rEquivalentStress,
122  )
123  {
124  BaseType::CalculateEquivalentStress(rStressVector, rStrainVector, rEquivalentStress, rValues);
125  }
126 
134  double& rThreshold
135  )
136  {
137  const auto& r_props = rValues.GetMaterialProperties();
138 
139  double yield_compression, E;
140  if (rValues.IsSetShapeFunctionsValues()) { // This is needed since at Initialize level the N are not set yet...
141  E = AdvCLutils::GetMaterialPropertyThroughAccessor(YOUNG_MODULUS, rValues);
142  yield_compression = r_props.Has(YIELD_STRESS) ? AdvCLutils::GetMaterialPropertyThroughAccessor(YIELD_STRESS, rValues) : AdvCLutils::GetMaterialPropertyThroughAccessor(YIELD_STRESS_COMPRESSION, rValues);
143  } else {
144  const double ref_temperature = r_props.Has(REFERENCE_TEMPERATURE) ? r_props[REFERENCE_TEMPERATURE] : rValues.GetElementGeometry().GetValue(REFERENCE_TEMPERATURE);
145  E = AdvCLutils::GetPropertyFromTemperatureTable(YOUNG_MODULUS, rValues, ref_temperature);
146  yield_compression = r_props.Has(YIELD_STRESS) ? AdvCLutils::GetPropertyFromTemperatureTable(YIELD_STRESS, rValues, ref_temperature) : AdvCLutils::GetPropertyFromTemperatureTable(YIELD_STRESS_COMPRESSION, rValues, ref_temperature);
147  }
148  rThreshold = yield_compression / std::sqrt(E);
149  }
150 
159  double& rAParameter,
160  const double CharacteristicLength
161  )
162  {
163  const auto& r_material_properties = rValues.GetMaterialProperties();
164 
165  const auto &r_geom = rValues.GetElementGeometry();
166  const auto &r_N = rValues.GetShapeFunctionsValues();
167  const auto &r_process_info = rValues.GetProcessInfo();
168 
169  const double fracture_energy = r_material_properties.GetValue(FRACTURE_ENERGY, r_geom, r_N, r_process_info);
170  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);
171  const double yield_tension = 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_TENSION, r_geom, r_N, r_process_info);
172  const double n = yield_compression / yield_tension;
173 
174  if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Exponential)) {
175  rAParameter = 1.0 / (fracture_energy * n * n / (CharacteristicLength * std::pow(yield_compression, 2)) - 0.5);
176  KRATOS_ERROR_IF(rAParameter < 0.0) << "Fracture energy is too low, increase FRACTURE_ENERGY..." << std::endl;
177  } else if (r_material_properties[SOFTENING_TYPE] == static_cast<int>(SofteningType::Linear)) { // linear
178  rAParameter = -std::pow(yield_compression, 2) / (2.0 * fracture_energy * n * n / CharacteristicLength);
179  } else {
180  rAParameter = 0.0;
181  }
182  }
183 
193  const array_1d<double, VoigtSize>& rStressVector,
194  const array_1d<double, VoigtSize>& rDeviator,
195  const double J2,
196  array_1d<double, VoigtSize>& rDerivativePlasticPotential,
198  )
199  {
200  BaseType::CalculatePlasticPotentialDerivative(rStressVector, rDeviator, J2, rDerivativePlasticPotential, rValues);
201  }
202 
215  const array_1d<double, VoigtSize>& rPredictiveStressVector,
217  const double J2,
220  )
221  {
222  KRATOS_ERROR << "Yield surface derivative not defined for SimoJu..." << std::endl;
223  }
224 
229  static int Check(const Properties& rMaterialProperties)
230  {
231  return BaseType::Check(rMaterialProperties);
232  }
233 
238  {
240  }
241 
245  static double GetScaleFactorTension(const Properties& rMaterialProperties)
246  {
247  // The reduction or increase of yield due to temperature is proportional in tension and compression so...
248  return BaseType::GetScaleFactorTension(rMaterialProperties);
249  }
250 
254 
258 
262 
266 
268 
269  protected:
272 
276 
280 
284 
288 
292 
296 
298  private:
301 
305 
309 
313 
317 
321 
325 
327 
328 }; // Class SimoJuYieldSurface
329 
331 
334 
338 
340 
341 } // 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
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
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
Short class definition.
Definition: simo_ju_yield_surface.h:56
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: simo_ju_yield_surface.h:262
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 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
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
This class defines a yield surface according to Simo-Ju theory.
Definition: thermal_simo_ju_yield_surface.h:54
TPlasticPotentialType PlasticPotentialType
The type of potential plasticity.
Definition: thermal_simo_ju_yield_surface.h:60
static double GetScaleFactorTension(const Properties &rMaterialProperties)
This method returns the scaling factor of the yield surface surfacecompares with the tension tield st...
Definition: thermal_simo_ju_yield_surface.h:245
ThermalSimoJuYieldSurface & operator=(ThermalSimoJuYieldSurface const &rOther)
Assignment operator.
Definition: thermal_simo_ju_yield_surface.h:95
static void GetInitialUniaxialThreshold(ConstitutiveLaw::Parameters &rValues, double &rThreshold)
This method returns the initial uniaxial stress threshold.
Definition: thermal_simo_ju_yield_surface.h:132
virtual ~ThermalSimoJuYieldSurface()
Destructor.
Definition: thermal_simo_ju_yield_surface.h:101
static bool IsWorkingWithTensionThreshold()
This method returns true if the yield surfacecompares with the tension tield stress.
Definition: thermal_simo_ju_yield_surface.h:237
static constexpr double tolerance
The machine precision zero tolerance.
Definition: thermal_simo_ju_yield_surface.h:75
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_simo_ju_yield_surface.h:117
static constexpr SizeType Dimension
The Plastic potential already defines the working simension size.
Definition: thermal_simo_ju_yield_surface.h:66
ThermalSimoJuYieldSurface()
Initialization constructor.
Definition: thermal_simo_ju_yield_surface.h:85
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: thermal_simo_ju_yield_surface.h:214
ThermalSimoJuYieldSurface(ThermalSimoJuYieldSurface const &rOther)
Copy constructor.
Definition: thermal_simo_ju_yield_surface.h:90
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_simo_ju_yield_surface.h:192
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_simo_ju_yield_surface.h:157
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the yield surface.
Definition: thermal_simo_ju_yield_surface.h:229
static constexpr SizeType VoigtSize
The Plastic potential already defines the Voigt size.
Definition: thermal_simo_ju_yield_surface.h:69
KRATOS_CLASS_POINTER_DEFINITION(ThermalSimoJuYieldSurface)
Counted pointer of SimoJuYieldSurface.
This class defines a yield surface according to Von-Mises theory.
Definition: thermal_von_mises_yield_surface.h:51
#define KRATOS_ERROR
Definition: exception.h:161
#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
E
Definition: generate_hyper_elastic_simo_taylor_neo_hookean.py:26
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 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