OGS
PhaseFieldProcessData.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <Eigen/Core>
14 #include <memory>
15 #include <utility>
16 
17 #include "MeshLib/PropertyVector.h"
18 #include "ParameterLib/Parameter.h"
19 
20 namespace MaterialLib
21 {
22 namespace Solids
23 {
24 template <int DisplacementDim>
25 struct MechanicsBase;
26 }
27 } // namespace MaterialLib
28 namespace ProcessLib
29 {
30 template <typename T>
31 struct Parameter;
32 
33 namespace PhaseField
34 {
35 enum class PhaseFieldModel
36 {
37  AT1,
38  AT2,
39  COHESIVE
40 };
41 
42 enum class SofteningCurve
43 {
44  Linear,
46 };
47 
48 enum class EnergySplitModel
49 {
50  Isotropic,
51  VolDev,
53 };
54 
56 {
57 public:
58  virtual ~DegradationDerivative() = default;
59  virtual double degradation(double const d_ip,
60  double const k,
61  double const ls) = 0; /* degradation_df0 */
62  virtual double degradation_df1(double const d_ip, double const ls) = 0;
63  virtual double degradation_df2(double const d_ip, double const ls) = 0;
64 };
65 
67 {
68 public:
69  double degradation(double const d_ip,
70  double const k,
71  double const /* ls */) override
72  {
73  return d_ip * d_ip * (1. - k) + k;
74  };
75  double degradation_df1(double const d_ip, double const /* ls */) override
76  {
77  return 2. * d_ip;
78  };
79  double degradation_df2(double const /* d_ip */,
80  double const /* ls */) override
81  {
82  return 2.;
83  };
84 };
85 
87 {
88 private:
89  double const lch;
91 
92 public:
93  COHESIVE_DegradationDerivative(double const Parameter_lch,
94  SofteningCurve Parameter_softening_curve)
95  : lch(Parameter_lch), softening_curve(Parameter_softening_curve){};
96  double degradation(double const d_ip,
97  double const k,
98  double const ls) override
99  {
100  double const m1 = 4.0 * lch / acos(-1.) / ls;
101  switch (softening_curve)
102  {
104  {
105  double const m2 = std::pow(2., 5. / 3.) - 3.;
106  double const n = 2.5;
107  return std::pow(d_ip, n) /
108  (std::pow(d_ip, n) +
109  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip))) *
110  (1.0 - k) +
111  k;
112  }
113  default:
114  {
115  double const m2 = -0.5;
116  double const n = 2.;
117  return std::pow(d_ip, n) /
118  (std::pow(d_ip, n) +
119  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip))) *
120  (1. - k) +
121  k;
122  }
123  }
124  };
125  double degradation_df1(double const d_ip, double const ls) override
126  {
127  double const m1 = 4.0 * lch / acos(-1.) / ls;
128  switch (softening_curve)
129  {
131  {
132  double const m2 = std::pow(2., 5. / 3.) - 3.;
133  double const n = 2.5;
134  double const a1 = std::pow(d_ip, n) +
135  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip));
136  double const a2 = n * std::pow(d_ip, n - 1.) -
137  2. * m1 * m2 * (1. - d_ip) - m1;
138  return (n * std::pow(d_ip, n - 1.) * a1 -
139  std::pow(d_ip, n) * a2) /
140  (a1 * a1);
141  }
142  default:
143  {
144  double const m2 = -0.5;
145  double const n = 2.;
146  double const a1 = std::pow(d_ip, n) +
147  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip));
148  double const a2 = n * std::pow(d_ip, n - 1.) -
149  2. * m1 * m2 * (1. - d_ip) - m1;
150  return (n * std::pow(d_ip, n - 1.) * a1 -
151  std::pow(d_ip, n) * a2) /
152  (a1 * a1);
153  }
154  }
155  };
156  double degradation_df2(double const d_ip, double const ls) override
157  {
158  double const m1 = 4.0 * lch / acos(-1.) / ls;
159  switch (softening_curve)
160  {
162  {
163  double const m2 = std::pow(2., 5. / 3.) - 3.;
164  double const n = 2.5;
165  double a1 = std::pow(d_ip, n) +
166  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip));
167  double a2 = n * std::pow(d_ip, n - 1.) -
168  2. * m1 * m2 * (1. - d_ip) - m1;
169  return (2. * a2 * a2 * std::pow(d_ip, n) -
170  a1 * std::pow(d_ip, n) *
171  (2. * m1 * m2 +
172  n * std::pow(d_ip, n - 2.) * (n - 1.)) -
173  2. * a1 * a2 * n * std::pow(d_ip, n - 1.) +
174  a1 * a1 * n * std::pow(d_ip, n - 2.) * (n - 1.)) /
175  (std::pow(a1, 3));
176  }
177  default:
178  {
179  double const m2 = -0.5;
180  double const n = 2.;
181  double const a1 = std::pow(d_ip, n) +
182  m1 * (1. - d_ip) * (1. + m2 * (1. - d_ip));
183  double const a2 = n * std::pow(d_ip, n - 1.) -
184  2. * m1 * m2 * (1. - d_ip) - m1;
185  return (2. * a2 * a2 * std::pow(d_ip, n) -
186  a1 * std::pow(d_ip, n) *
187  (2. * m1 * m2 +
188  n * std::pow(d_ip, n - 2.) * (n - 1.)) -
189  2. * a1 * a2 * n * std::pow(d_ip, n - 1.) +
190  a1 * a1 * n * std::pow(d_ip, n - 2.) * (n - 1.)) /
191  (std::pow(a1, 3));
192  }
193  }
194  };
195 };
196 
197 template <int DisplacementDim>
199 {
201 
202  std::map<
203  int,
204  std::unique_ptr<MaterialLib::Solids::MechanicsBase<DisplacementDim>>>
210  Eigen::Matrix<double, DisplacementDim, 1> const specific_body_force;
211  bool hydro_crack = false;
212  bool crack_pressure = false;
218  std::unique_ptr<DegradationDerivative> degradation_derivative;
219 
220  double const unity_pressure = 1.0;
221  double pressure = 0.0;
222  double pressure_old = 0.0;
223  double pressure_error = 0.0;
224  double injected_volume = 0.0;
225  double crack_volume = 0.0;
226  double elastic_energy = 0.0;
227  double surface_energy = 0.0;
228  double pressure_work = 0.0;
229 };
230 
231 } // namespace PhaseField
232 } // namespace ProcessLib
double degradation_df2(double const, double const) override
double degradation_df1(double const d_ip, double const) override
double degradation(double const d_ip, double const k, double const) override
double degradation(double const d_ip, double const k, double const ls) override
double degradation_df2(double const d_ip, double const ls) override
COHESIVE_DegradationDerivative(double const Parameter_lch, SofteningCurve Parameter_softening_curve)
double degradation_df1(double const d_ip, double const ls) override
virtual double degradation(double const d_ip, double const k, double const ls)=0
virtual double degradation_df1(double const d_ip, double const ls)=0
virtual double degradation_df2(double const d_ip, double const ls)=0
ParameterLib::Parameter< double > const & solid_density
ParameterLib::Parameter< double > const & crack_resistance
ParameterLib::Parameter< double > const & crack_length_scale
ParameterLib::Parameter< double > const & residual_stiffness
Eigen::Matrix< double, DisplacementDim, 1 > const specific_body_force
MeshLib::PropertyVector< int > const *const material_ids
std::map< int, std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > solid_materials
std::unique_ptr< DegradationDerivative > degradation_derivative