OGS 6.2.0-97-g4a610c866
Damage.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include <Eigen/Eigenvalues>
15 #include <logog/include/logog.hpp>
16 
18 
19 namespace ProcessLib
20 {
21 namespace SmallDeformationNonlocal
22 {
25 inline double calculateDamage(double const kappa_d, double const alpha_d,
26  double const beta_d)
27 {
28  double const damage = (1 - beta_d) * (1 - std::exp(-kappa_d / alpha_d));
29 
30  if (damage < 0. || damage >= 1.)
31  {
32  OGS_FATAL("Damage value %g outside of [0,1) interval.", damage);
33  }
34 
35  return damage;
36 }
37 
38 template <int DisplacementDim, typename KelvinVectorType>
40  double const eps_p_eff_diff,
41  KelvinVectorType const& sigma,
42  double const kappa_d_prev,
43  double const h_d,
45 {
46  // Default case of the rate problem. Updated below if volumetric plastic
47  // strain rate is positive (dilatancy).
48 
49  // non-const for Eigen solver.
50  auto sigma_tensor = MathLib::KelvinVector::kelvinVectorToTensor(sigma);
51 
52  Eigen::EigenSolver<decltype(sigma_tensor)> eigen_solver(sigma_tensor);
53  auto const principal_stress = real(eigen_solver.eigenvalues().array());
54  double const prod_stress = std::sqrt(principal_stress.square().sum());
55 
56  // Brittleness decrease with confinement for the nonlinear flow rule.
57  // ATTENTION: For linear flow rule -> constant brittleness.
58  double const tensile_strength =
59  std::sqrt(3.0) * mp.kappa / (1 + std::sqrt(3.0) * mp.beta);
60  double const r_s = prod_stress / tensile_strength - 1.;
61 
62  // Compute normalizing strain.
63  double const x_s = [](double const h_d, double const r_s) {
64  if (r_s < 0)
65  {
66  return 1.;
67  }
68  if (r_s <= 1)
69  {
70  return 1. + h_d * r_s * r_s;
71  }
72  return 1. - 3 * h_d + 4 * h_d * std::sqrt(r_s);
73  }(h_d, r_s);
74 
75  return kappa_d_prev + eps_p_eff_diff / x_s;
76 }
77 } // namespace SmallDeformationNonlocal
78 } // namespace ProcessLib
double calculateDamageKappaD(double const eps_p_eff_diff, KelvinVectorType const &sigma, double const kappa_d_prev, double const h_d, MaterialLib::Solids::Ehlers::MaterialProperties const &mp)
Definition: Damage.h:39
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
double calculateDamage(double const kappa_d, double const alpha_d, double const beta_d)
Definition: Damage.h:25
#define OGS_FATAL(fmt,...)
Definition: Error.h:63
Eigen::Matrix< double, KelvinVectorDimensions< DisplacementDim >::value, 1, Eigen::ColMajor > KelvinVectorType
Definition: KelvinVector.h:49