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_plastic_potential.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 //
13 
14 #pragma once
15 
16 // System includes
17 
18 // Project includes
20 
21 namespace Kratos
22 {
25 
29 
30  // The size type definition
31  typedef std::size_t SizeType;
32 
36 
40 
44 
50 template <SizeType TVoigtSize = 6>
52 {
53  public:
56 
58  static constexpr SizeType Dimension = TVoigtSize == 6 ? 3 : 2;
59 
61  static constexpr SizeType VoigtSize = TVoigtSize;
62 
65 
69 
72  {
73  }
74 
77  {
78  }
79 
82  {
83  return *this;
84  }
85 
88 
92 
96 
109  const array_1d<double, VoigtSize>& rPredictiveStressVector,
110  const array_1d<double, VoigtSize>& rDeviator,
111  const double J2,
114  )
115  {
116  array_1d<double, VoigtSize> first_vector, second_vector, third_vector;
120 
121  double J3, lode_angle;
124 
125  double c1, c3, c2;
126  double checker = std::abs(lode_angle * 180.0 / Globals::Pi);
127  const double sqrt_3 = std::sqrt(3.0);
128 
129  if (std::abs(checker) < 29.0) { // If it is not the edge
130  const double sqrt_J2 = std::sqrt(J2);
131  const double square_sin_3_lode = std::pow(std::sin(3.0 * lode_angle), 2);
132  const double angle = lode_angle + Globals::Pi / 6.0;
133  const double dLode_dJ2 = (3.0 * sqrt_3 * J3) / (4.0 * J2 * J2 * sqrt_J2 * std::sqrt(1.0 - square_sin_3_lode));
134  const double dLode_dJ3 = -sqrt_3 / (2.0 * J2 * sqrt_J2 * std::sqrt(1.0 - square_sin_3_lode));
135  c1 = 1.0 / 3.0;
136  c2 = 2.0 * sqrt_3 / 3.0 * (std::cos(angle) / (2.0 * sqrt_J2) - 2.0 * sqrt_3 * sqrt_J2 / 3.0 * std::sin(angle) * dLode_dJ2) * 2.0 * sqrt_J2;
137  c3 = -2.0 * std::sqrt(3.0 * J2) / 3.0 * std::sin(angle) * dLode_dJ3;
138  } else { // smoothing with drucker-praguer
139  const double friction_angle = rValues.GetMaterialProperties()[FRICTION_ANGLE] * Globals::Pi / 180.0;
140  const double sin_phi = std::sin(friction_angle);
141  const double CFL = -sqrt_3 * (3.0 - sin_phi) / (3.0 * sin_phi - 3.0);
142  c1 = CFL * 2.0 * sin_phi / (sqrt_3 * (3.0 - sin_phi));
143  c2 = CFL;
144  c3 = 0.0;
145  }
146  noalias(rGFlux) = c1 * first_vector + c2 * second_vector + c3 * third_vector;
147  }
148 
153  static int Check(const Properties& rMaterialProperties)
154  {
155  return 0;
156  }
157 
161 
165 
169 
173 
175 
176  protected:
179 
183 
187 
191 
195 
199 
203 
205 
206  private:
209 
213 
217 
221 
225 
229 
233 
235 
236 }; // Class GenericYieldSurface
237 
239 
242 
246 
248 
249 } // namespace Kratos.
static void CalculateSecondVector(const BoundedVectorType &rDeviator, const double J2, BoundedVectorType &rSecondVector)
This method computes the first vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:100
static void CalculateFirstVector(BoundedVectorType &rFirstVector)
This method computes the first vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:80
static void CalculateThirdVector(const BoundedVectorType &rDeviator, const double J2, BoundedVectorType &rThirdVector)
This method computes the third vector to be used in the derivative of the yield surface.
Definition: advanced_constitutive_law_utilities.cpp:131
static void CalculateLodeAngle(const double J2, const double J3, double &rLodeAngle)
This method computes the lode angle.
Definition: advanced_constitutive_law_utilities.cpp:158
static void CalculateJ3Invariant(const BoundedVectorType &rDeviator, double &rJ3)
This method computes the third invariant of J.
Definition: advanced_constitutive_law_utilities.cpp:62
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
This class defines a plastic potential following the theory of Rankine.
Definition: rankine_plastic_potential.h:52
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
static int Check(const Properties &rMaterialProperties)
This method defines the check to be performed in the plastic potential.
Definition: rankine_plastic_potential.h:153
RankinePlasticPotential()
Initialization constructor.
Definition: rankine_plastic_potential.h:71
static constexpr SizeType VoigtSize
The define the Voigt size.
Definition: rankine_plastic_potential.h:61
static constexpr SizeType Dimension
We define the dimension.
Definition: rankine_plastic_potential.h:58
virtual ~RankinePlasticPotential()
Destructor.
Definition: rankine_plastic_potential.h:87
KRATOS_CLASS_POINTER_DEFINITION(RankinePlasticPotential)
Counted pointer of RankinePlasticPotential.
RankinePlasticPotential & operator=(RankinePlasticPotential const &rOther)
Assignment operator.
Definition: rankine_plastic_potential.h:81
RankinePlasticPotential(RankinePlasticPotential const &rOther)
Copy constructor.
Definition: rankine_plastic_potential.h:76
constexpr double Pi
Definition: global_variables.h:25
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
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
float J2
Definition: isotropic_damage_automatic_differentiation.py:133
CFL
Definition: isotropic_damage_automatic_differentiation.py:156
def J3
Definition: isotropic_damage_automatic_differentiation.py:176
sin_phi
Definition: isotropic_damage_automatic_differentiation.py:153
Definition: constitutive_law.h:189
const Properties & GetMaterialProperties()
Definition: constitutive_law.h:457