OGS
CohesiveZoneModeI.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "CohesiveZoneModeI.h"
5
6#include "LogPenalty.h"
7#include "MathLib/MathTools.h"
8
9namespace MaterialLib
10{
11namespace Fracture
12{
14{
15namespace
16{
17double computeDamage(double const damage_prev,
18 double const w_n,
19 double const w_np,
20 double const w_nf)
21{
22 return std::min(
23 1.0,
24 std::max(damage_prev, std::max(0.0, (w_n - w_np)) / (w_nf - w_np)));
25}
26
27} // namespace
28
29template <int DisplacementDim>
31 double const t,
33 double const aperture0,
34 Eigen::Ref<Eigen::VectorXd const>
35 sigma0,
36 Eigen::Ref<Eigen::VectorXd const>
37 /*w_prev*/,
38 Eigen::Ref<Eigen::VectorXd const>
39 w,
40 Eigen::Ref<Eigen::VectorXd const>
41 /*sigma_prev*/,
42 Eigen::Ref<Eigen::VectorXd>
43 sigma,
44 Eigen::Ref<Eigen::MatrixXd>
45 C,
47 material_state_variables)
48{
49 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
50 &material_state_variables) != nullptr);
51
52 auto& state =
53 static_cast<StateVariables<DisplacementDim>&>(material_state_variables);
54 // reset damage in each iteration
56
57 auto const mp = evaluatedMaterialProperties(t, x);
58
59 C.setZero();
60
61 // Separately compute shear and normal stresses because of the penalty for
62 // the normal component.
63 const int index_ns = DisplacementDim - 1;
64 double const w_n = w[index_ns];
65 for (int i = 0; i < index_ns; i++)
66 {
67 C(i, i) = mp.Ks;
68 }
69
70 sigma.noalias() = C * w;
71
72 double const aperture = w_n + aperture0;
73
74 sigma.coeffRef(index_ns) =
75 mp.Kn * w_n * logPenalty(aperture0, aperture, _penalty_aperture_cutoff);
76
77 C(index_ns, index_ns) =
78 mp.Kn *
80
81 sigma.noalias() += sigma0;
82
83 // Exit if fracture is closing
84 if (sigma[index_ns] < 0)
85 {
86 return;
87 }
88
89 //
90 // Continue with fracture opening.
91 //
92 // effective opening calculated by shift to state corresponding to sigma0=0
93 const double w_n_effective = w_n + sigma0[index_ns] / mp.Kn;
94 double degradation = 0.0;
95 if (mp.w_nf == 0.0) // can be used to model tension-cutoff
96 {
97 state.damage_prev = 1.0;
98 state.damage = 1.0;
99 }
100 else
101 {
102 state.damage =
103 computeDamage(state.damage_prev, w_n_effective, mp.w_np, mp.w_nf);
104 degradation = ((1 - state.damage) * mp.w_np) /
105 (mp.w_np + state.damage * (mp.w_nf - mp.w_np));
106 }
107
108 // Degrade stiffness tensor in tension.
109 C = C * degradation;
110 // Create effective relative displacement vector
111 Eigen::VectorXd w_eff = w;
112 // Only origin of normal entry is shifted, shear unaffected
113 w_eff[index_ns] = w_n_effective;
114 sigma = C * w_eff;
115
116 if (state.damage > state.damage_prev)
117 {
118 // If damage is increasing, provide extension to consistent tangent.
119
120 Eigen::Matrix<double, DisplacementDim, 1> dd_dw =
121 Eigen::Matrix<double, DisplacementDim, 1>::Zero();
122
123 double const tmp = mp.w_np + state.damage * (mp.w_nf - mp.w_np);
124 dd_dw[index_ns] =
125 (mp.w_np * mp.w_nf) / ((mp.w_nf - mp.w_np) * (tmp * tmp));
126
127 C -= C * w_eff * (dd_dw).transpose();
128 }
129
130 // TODO (nagel) Initial stress not considered, yet.
131 // sigma.noalias() += sigma0;
132}
133
134template class CohesiveZoneModeI<2>;
135template class CohesiveZoneModeI<3>;
136
137} // namespace CohesiveZoneModeI
138} // namespace Fracture
139} // namespace MaterialLib
void computeConstitutiveRelation(double const t, ParameterLib::SpatialPosition const &x, double const aperture0, Eigen::Ref< Eigen::VectorXd const > sigma0, Eigen::Ref< Eigen::VectorXd const > w_prev, Eigen::Ref< Eigen::VectorXd const > w, Eigen::Ref< Eigen::VectorXd const > sigma_prev, Eigen::Ref< Eigen::VectorXd > sigma, Eigen::Ref< Eigen::MatrixXd > C, typename FractureModelBase< DisplacementDim >::MaterialStateVariables &material_state_variables) override
MaterialProperties evaluatedMaterialProperties(double const t, ParameterLib::SpatialPosition const &x) const
double computeDamage(double const damage_prev, double const w_n, double const w_np, double const w_nf)
double logPenalty(double const aperture0, double const aperture, double const aperture_cutoff)
Definition LogPenalty.h:43
double logPenaltyDerivative(double const aperture0, double const aperture, double const aperture_cutoff)
Definition LogPenalty.h:17