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.
associative_plastic_damage_model.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
12 // Sergio Jimenez
13 //
14 //
15 
16 #pragma once
17 
18 // System includes
19 
20 // External includes
21 
22 // Project includes
23 #include "custom_constitutive/elastic_isotropic_3d.h"
24 #include "custom_constitutive/linear_plane_strain.h"
26 #include "custom_utilities/constitutive_law_utilities.h"
28 
29 namespace Kratos
30 {
33 
37 
41 
45 
49 
60 template<class TYieldSurfaceType>
61 class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) AssociativePlasticDamageModel
62  : public std::conditional<TYieldSurfaceType::VoigtSize == 6, ElasticIsotropic3D, LinearPlaneStrain >::type
63 {
64 public:
65 
70  typedef std::size_t SizeType;
71 
72  static constexpr SizeType Dimension = TYieldSurfaceType::Dimension;
73 
75  static constexpr SizeType VoigtSize = TYieldSurfaceType::VoigtSize;
76 
79 
82 
84  static constexpr double machine_tolerance = std::numeric_limits<double>::epsilon();
85 
86  static constexpr double tolerance = 1.0e-8;
87 
89  typedef Node NodeType;
90 
93 
96 
99 
102 
104  BoundedMatrixType ComplianceMatrixIncrement{ZeroMatrix(VoigtSize, VoigtSize)};
105  BoundedMatrixType ComplianceMatrix{ZeroMatrix(VoigtSize, VoigtSize)};
106  BoundedMatrixType ComplianceMatrixCompression{ZeroMatrix(VoigtSize, VoigtSize)};
107  BoundedMatrixType ConstitutiveMatrix{ZeroMatrix(VoigtSize, VoigtSize)};
108  BoundedMatrixType TangentTensor{ZeroMatrix(VoigtSize, VoigtSize)};
109  BoundedVectorType PlasticFlow{ZeroVector(VoigtSize)};
110  BoundedVectorType PlasticStrain{ZeroVector(VoigtSize)};
111  BoundedVectorType PlasticStrainIncrement{ZeroVector(VoigtSize)};
112  BoundedVectorType StrainVector{ZeroVector(VoigtSize)};
113  BoundedVectorType StressVector{ZeroVector(VoigtSize)};
114  double NonLinearIndicator = 0.0; // F
115  double PlasticConsistencyIncrement = 0.0; // Lambda dot
116  double UniaxialStress = 0.0;
117  double DamageDissipation = 0.0; // Kappa d
118  double DamageDissipationIncrement = 0.0; // Kappa d dot
119  double PlasticDissipation = 0.0; // Kappa p
120  double PlasticDissipationIncrement = 0.0; // Kappa p dot
121  double TotalDissipation = 0.0; // Kappa
122  double CharacteristicLength = 0.0;
123  double Threshold = 0.0;
124  double Slope = 0.0; // d(Threshold)/d(dissipation)
125  double PlasticDamageProportion = 0.5; // 0-> Plastic 1->Damage
126  };
127 
129  typedef std::function<double(const double, const double, ConstitutiveLaw::Parameters& , PlasticDamageParameters &)> ResidualFunctionType;
130 
133 
138  {}
139 
144  {}
145 
149 
153 
157  ConstitutiveLaw::Pointer Clone() const override;
158 
163  : BaseType(rOther),
164  mPlasticDissipation(rOther.mPlasticDissipation),
165  mDamageDissipation(rOther.mDamageDissipation),
166  mThreshold(rOther.mThreshold),
167  mPlasticStrain(rOther.mPlasticStrain),
168  mOldStrain(rOther.mOldStrain),
169  mComplianceMatrix(rOther.mComplianceMatrix),
170  mComplianceMatrixCompression(rOther.mComplianceMatrixCompression)
171  {
172  }
173 
178  {
179  return false;
180  }
181 
186  {
187  return true;
188  }
189 
195  bool Has(const Variable<double>& rThisVariable) override;
196 
202  bool Has(const Variable<Vector>& rThisVariable) override;
203 
210  double& GetValue(
211  const Variable<double>& rThisVariable,
212  double& rValue
213  ) override;
214 
221  Vector& GetValue(
222  const Variable<Vector>& rThisVariable,
223  Vector& rValue
224  ) override;
225 
232  void SetValue(
233  const Variable<double>& rThisVariable,
234  const double& rValue,
235  const ProcessInfo& rCurrentProcessInfo
236  ) override;
237 
244  void SetValue(
245  const Variable<Vector >& rThisVariable,
246  const Vector& rValue,
247  const ProcessInfo& rCurrentProcessInfo
248  ) override;
249 
257  double& CalculateValue(
258  ConstitutiveLaw::Parameters& rParameterValues,
259  const Variable<double>& rThisVariable,
260  double& rValue
261  ) override;
262 
270  void InitializeMaterial(
271  const Properties& rMaterialProperties,
272  const GeometryType& rElementGeometry,
273  const Vector& rShapeFunctionsValues
274  ) override;
275 
280  void CalculateMaterialResponsePK1 (ConstitutiveLaw::Parameters& rValues) override;
281 
286  void CalculateMaterialResponsePK2 (ConstitutiveLaw::Parameters& rValues) override;
287 
292  void CalculateMaterialResponseKirchhoff (ConstitutiveLaw::Parameters& rValues) override;
293 
298  void CalculateMaterialResponseCauchy (ConstitutiveLaw::Parameters& rValues) override;
299 
304  void InitializeMaterialResponsePK1 (ConstitutiveLaw::Parameters& rValues) override;
305 
310  void InitializeMaterialResponsePK2 (ConstitutiveLaw::Parameters& rValues) override;
311 
316  void InitializeMaterialResponseKirchhoff (ConstitutiveLaw::Parameters& rValues) override;
317 
322  void InitializeMaterialResponseCauchy (ConstitutiveLaw::Parameters& rValues) override;
323 
328  void FinalizeMaterialResponsePK1 (ConstitutiveLaw::Parameters& rValues) override;
329 
334  void FinalizeMaterialResponsePK2 (ConstitutiveLaw::Parameters& rValues) override;
335 
340  void FinalizeMaterialResponseKirchhoff (ConstitutiveLaw::Parameters& rValues) override;
341 
346  void FinalizeMaterialResponseCauchy (ConstitutiveLaw::Parameters& rValues) override;
347 
356  int Check(
357  const Properties& rMaterialProperties,
358  const GeometryType& rElementGeometry,
359  const ProcessInfo& rCurrentProcessInfo
360  ) const override;
361 
362 
367  void CalculateTangentTensor(
368  ConstitutiveLaw::ConstitutiveLaw::Parameters& rValues,
369  PlasticDamageParameters &rPlasticDamageParameters);
370 
371 
377  void CalculateElasticComplianceMatrix(
378  BoundedMatrixType& rConstitutiveMatrix,
379  const Properties& rMaterialProperties
380  );
381 
386  double& rToBeAdded,
387  const double Increment
388  )
389  {
390  if (Increment > machine_tolerance)
391  rToBeAdded += Increment;
392  }
393 
397  double MacaullyBrackets(const double Number)
398  {
399  return (Number > machine_tolerance) ? Number : 0.0;
400  }
401 
406  void CalculatePlasticDissipationIncrement(
407  const Properties &rMaterialProperties,
408  PlasticDamageParameters &rPlasticDamageParameters);
409 
414  void CalculateDamageDissipationIncrement(
415  const Properties &rMaterialProperties,
416  PlasticDamageParameters &rPlasticDamageParameters);
417 
422  void CalculateThresholdAndSlope(
424  PlasticDamageParameters &rPlasticDamageParameters);
425 
429  void CalculateFlowVector(
431  PlasticDamageParameters &rPlasticDamageParameters);
432 
436  void CalculatePlasticStrainIncrement(
438  PlasticDamageParameters &rPlasticDamageParameters);
439 
443  void CalculateComplianceMatrixIncrement(
445  PlasticDamageParameters &rPlasticDamageParameters);
446 
450  void CalculatePlasticConsistencyIncrement(
452  PlasticDamageParameters &rPlasticDamageParameters);
453 
457  void IntegrateStressPlasticDamageMechanics(
459  PlasticDamageParameters &rPlasticDamageParameters);
460 
464  void CalculateConstitutiveMatrix(
466  PlasticDamageParameters &rPlasticDamageParameters);
467 
471  void UpdateInternalVariables(
472  PlasticDamageParameters &rPlasticDamageParameters
473  );
474 
478  void CheckMinimumFractureEnergy(
480  PlasticDamageParameters &rPDParameters
481  );
482 
488  const BoundedVectorType& rStrainVector,
489  const Properties& rMaterialProperties,
490  const double CharateristicLength,
491  PlasticDamageParameters &rPlasticDamageParameters
492  )
493  {
494  rPlasticDamageParameters.PlasticDissipation = mPlasticDissipation;
495  rPlasticDamageParameters.DamageDissipation = mDamageDissipation;
496  rPlasticDamageParameters.TotalDissipation = mPlasticDissipation + mDamageDissipation;
497  rPlasticDamageParameters.Threshold = mThreshold;
498  noalias(rPlasticDamageParameters.PlasticStrain) = mPlasticStrain;
499  noalias(rPlasticDamageParameters.ComplianceMatrix) = mComplianceMatrix;
500  noalias(rPlasticDamageParameters.ComplianceMatrixCompression) = mComplianceMatrixCompression;
501  noalias(rPlasticDamageParameters.StrainVector) = rStrainVector;
502  rPlasticDamageParameters.CharacteristicLength = CharateristicLength;
503  rPlasticDamageParameters.PlasticDamageProportion = rMaterialProperties[PLASTIC_DAMAGE_PROPORTION];
504  }
505 
510  void CalculateAnalyticalTangentTensor(
512  PlasticDamageParameters &rParam
513  );
514 
520  PlasticDamageParameters &rPDParameters
521  )
522  {
523  rPDParameters.DamageDissipation += rPDParameters.DamageDissipationIncrement;
524  rPDParameters.DamageDissipation = (rPDParameters.DamageDissipation > 0.99999) ?
525  0.99999 : rPDParameters.DamageDissipation;
526 
527  rPDParameters.PlasticDissipation += rPDParameters.PlasticDissipationIncrement;
528  rPDParameters.PlasticDissipation = (rPDParameters.PlasticDissipation > 0.99999) ?
529  0.99999 : rPDParameters.PlasticDissipation;
530 
531  rPDParameters.TotalDissipation = (rPDParameters.PlasticDissipation +
532  rPDParameters.DamageDissipation);
533  rPDParameters.TotalDissipation = (rPDParameters.TotalDissipation > 0.99999) ?
534  0.99999 : rPDParameters.TotalDissipation;
535  }
536 
542  static double CalculateVolumetricFractureEnergy( // g_F
543  const Properties& rMaterialProperties,
544  PlasticDamageParameters &rPDParameters
545  );
546 
552  double CalculatePlasticDenominator(
554  PlasticDamageParameters &rParam);
555 
561  double CalculateThresholdImplicitExpression(
562  ResidualFunctionType &rF,
563  ResidualFunctionType &rdF_dk,
565  PlasticDamageParameters &rPDParameters,
566  const double MaxThreshold = std::numeric_limits<double>::max());
567 
573  double CalculateSlopeFiniteDifferences(
574  ResidualFunctionType &rF,
575  ResidualFunctionType &rdF_dk,
577  PlasticDamageParameters &rPDParameters,
578  const double MaxThreshold = std::numeric_limits<double>::max());
579 
585  ResidualFunctionType ExponentialSofteningImplicitFunction();
586 
591  ResidualFunctionType ExponentialSofteningImplicitFunctionDerivative();
592 
598  ResidualFunctionType ExponentialHardeningImplicitFunction();
599 
604  ResidualFunctionType ExponentialHardeningImplicitFunctionDerivative();
605 protected:
606 
609 
613 
617 
621 
623 
624 private:
625 
628 
632 
633  double mPlasticDissipation = 0.0;
634  double mDamageDissipation = 0.0;
635  double mThreshold = 0.0;
636  BoundedVectorType mPlasticStrain = ZeroVector(VoigtSize);
637  BoundedVectorType mOldStrain = ZeroVector(VoigtSize);
638  BoundedMatrixType mComplianceMatrix = ZeroMatrix(VoigtSize, VoigtSize);
639  BoundedMatrixType mComplianceMatrixCompression = ZeroMatrix(VoigtSize, VoigtSize);
640 
644 
649 
654 
658  friend class Serializer;
659 
660  void save(Serializer &rSerializer) const override
661  {
663  rSerializer.save("PlasticDissipation", mPlasticDissipation);
664  rSerializer.save("DamageDissipation", mDamageDissipation);
665  rSerializer.save("Threshold", mThreshold);
666  rSerializer.save("PlasticStrain", mPlasticStrain);
667  rSerializer.save("OldStrain", mOldStrain);
668  rSerializer.save("ComplianceMatrix", mComplianceMatrix);
669  rSerializer.save("ComplianceMatrixCompression", mComplianceMatrixCompression);
670  }
671 
672  void load(Serializer &rSerializer) override
673  {
675  rSerializer.load("PlasticDissipation", mPlasticDissipation);
676  rSerializer.load("DamageDissipation", mDamageDissipation);
677  rSerializer.load("Threshold", mThreshold);
678  rSerializer.load("PlasticStrain", mPlasticStrain);
679  rSerializer.load("OldStrain", mOldStrain);
680  rSerializer.load("ComplianceMatrix", mComplianceMatrix);
681  rSerializer.load("ComplianceMatrixCompression", mComplianceMatrixCompression);
682  }
683 
684 
685 }; // Class AssociativePlasticDamageModel
686 } // namespace Kratos.
This law defines a parallel rule of mixture (classic law of mixture)
Definition: associative_plastic_damage_model.h:63
ProcessInfo ProcessInfoType
The definition of the process info.
Definition: associative_plastic_damage_model.h:78
Node NodeType
The node definition.
Definition: associative_plastic_damage_model.h:89
std::size_t SizeType
Definition: associative_plastic_damage_model.h:70
void AddNonLinearDissipation(PlasticDamageParameters &rPDParameters)
This method increases the damage and plastic dissipation with the increment.
Definition: associative_plastic_damage_model.h:519
void InitializePlasticDamageParameters(const BoundedVectorType &rStrainVector, const Properties &rMaterialProperties, const double CharateristicLength, PlasticDamageParameters &rPlasticDamageParameters)
This method initializes all the values in the PlasticDamageParameters.
Definition: associative_plastic_damage_model.h:487
std::conditional< VoigtSize==6, ElasticIsotropic3D, LinearPlaneStrain >::type BaseType
The definition of the CL base class.
Definition: associative_plastic_damage_model.h:81
bool RequiresFinalizeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: associative_plastic_damage_model.h:185
BoundedMatrix< double, VoigtSize, VoigtSize > BoundedMatrixType
The definition of the bounded matrix type.
Definition: associative_plastic_damage_model.h:98
AssociativePlasticDamageModel(const AssociativePlasticDamageModel &rOther)
Definition: associative_plastic_damage_model.h:162
std::function< double(const double, const double, ConstitutiveLaw::Parameters &, PlasticDamageParameters &)> ResidualFunctionType
The definition of the lambdas to compute implicitly the threshold.
Definition: associative_plastic_damage_model.h:129
void AddIfPositive(double &rToBeAdded, const double Increment)
This method add somehting if the increment is positive.
Definition: associative_plastic_damage_model.h:385
bool RequiresInitializeMaterialResponse() override
If the CL requires to initialize the material response, called by the element in InitializeSolutionSt...
Definition: associative_plastic_damage_model.h:177
AssociativePlasticDamageModel()
Default constructor.
Definition: associative_plastic_damage_model.h:137
KRATOS_CLASS_POINTER_DEFINITION(AssociativePlasticDamageModel)
Pointer definition of AssociativePlasticDamageModel.
array_1d< double, VoigtSize > BoundedVectorType
The definition of the Voigt array type.
Definition: associative_plastic_damage_model.h:95
~AssociativePlasticDamageModel() override
Destructor.
Definition: associative_plastic_damage_model.h:143
Geometry< NodeType > GeometryType
The geometry definition.
Definition: associative_plastic_damage_model.h:92
double MacaullyBrackets(const double Number)
This method evaluates the Macaulay brackets.
Definition: associative_plastic_damage_model.h:397
Definition: constitutive_law.h:47
Geometry base class.
Definition: geometry.h:71
Definition: amatrix_interface.h:41
This class defines the node.
Definition: node.h:65
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
static double max(double a, double b)
Definition: GeometryFunctions.h:79
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
type
Definition: generate_gid_list_file.py:35
def load(f)
Definition: ode_solve.py:307
Definition: associative_plastic_damage_model.h:103
BoundedMatrixType ComplianceMatrixCompression
Definition: associative_plastic_damage_model.h:106
double CharacteristicLength
Definition: associative_plastic_damage_model.h:122
double PlasticDissipationIncrement
Definition: associative_plastic_damage_model.h:120
double PlasticDissipation
Definition: associative_plastic_damage_model.h:119
double Threshold
Definition: associative_plastic_damage_model.h:123
double PlasticDamageProportion
Definition: associative_plastic_damage_model.h:125
BoundedVectorType PlasticStrain
Definition: associative_plastic_damage_model.h:110
double DamageDissipationIncrement
Definition: associative_plastic_damage_model.h:118
BoundedMatrixType ComplianceMatrix
Definition: associative_plastic_damage_model.h:105
BoundedVectorType StrainVector
Definition: associative_plastic_damage_model.h:112
double DamageDissipation
Definition: associative_plastic_damage_model.h:117
double TotalDissipation
Definition: associative_plastic_damage_model.h:121
Definition: constitutive_law.h:189