Alamo
PFCZM.H
Go to the documentation of this file.
1#ifndef MODEL_INTERFACE_CRACK_PFCZM_H
2#define MODEL_INTERFACE_CRACK_PFCZM_H
3
4#include <iostream>
5#include <fstream>
6#include <cmath>
7
8#include "AMReX.H"
9#include "Crack.H"
10#include "Set/Set.H"
11#include "Util/Util.H"
12
13namespace Model
14{
15namespace Interface
16{
17namespace Crack
18{
19class PFCZM : public Crack
20{
21public:
23
24 PFCZM() = default;
25 virtual ~PFCZM() = default;
26
27 // In Wu 2024 formulation, Gc is scaled by a constant C_alpha.
28 // $C_\alpha = 4 \int_0^1 \sqrt{\alpha(\beta)} d\beta$
29 // where $\alpha$ is the geometric function defined in the code as w_phi
30 // For the optimal function chosen in Wu 2024, $C_\alpha = \pi$
31 Set::Scalar Gc (Set::Scalar /*ratio*/) { return _Gc / _c_alpha; }
33 Set::Scalar l_w() { return _l_w; }
34
35 // this hould check if we need to do mixed mode loading.
36 bool mixed_mode() { return _mixed_mode; }
38
39 // added functions for mixed mode - Wang 2023 surface
42 Set::Scalar chi() { return _chi; }
44 Set::Scalar sig_t() { return _sig_t; }
45 Set::Scalar tau_s() { return _tau_s; }
46
47 // added functions for mixed mode - mohr columb surface
50
51 // For now, we are storing things like youngs modulus stuff here.
52 // ideally, they should be moved to Material -> Solid -> Affine.
53 Set::Scalar DGc (Set::Scalar /*theta*/) { return 0.0; }
54 Set::Scalar DDGc (Set::Scalar /*theta*/) { return 0.0; }
55 Set::Scalar Zeta(Set::Scalar /*theta*/) { return zeta; }
58
59private:
61 Set::Scalar _c_alpha = pi; // scaling factor.
62 Set::Scalar _l_w = 1.e-5; //irwing length
66
69
70 bool _mixed_mode = false;
72
75
76 // Parameters specific to WANG 2023 failure surface
82
83 // Parameters specific to MC failure surface
86
87public:
88 static void Parse(PFCZM & value, IO::ParmParse & pp)
89 {
90 pp.query_default("czm_order", value.czm_order, 1.0); //Order 1, 1.5, or 2 (Wu 2024, JMPS)
91 pp.query_default("G_c",value._Gc,1.0e3); // Fracture energy in N/m
92 pp.query_default("zeta",value.zeta,1.e-5); // Lengthscale regularization in m
93
94 Set::Scalar fracture_strength = NAN;
95
96 Set::Scalar youngs = NAN;
97 Set::Scalar nu = NAN;
98 Set::Scalar tensile_strength = 2.e8;
99 Set::Scalar shear_strength = 1.41e8;
100 Set::Scalar compressive_strength = NAN;
101
102 // Toggle to determine mixed mode
103 pp.query_if_else("mixed_mode",[&]() {
104 value._mixed_mode = true;
105
106 // Young's modulus
107 pp.query_default("E", youngs, 2.e11);
108
109 // Poisson's ratio $\nu$
110 pp.query_default("nu", nu, 0.3);
111
112 // shear modulus
113 Set::Scalar mu = 0.5 * youngs / (1. + nu);
114
115 std::string fail_surf_type = "";
116 // type of failure surface
117 pp.query_validate("failure_surface", fail_surf_type, {"wang2023", "mohr", "mc", "columb"}); // degradation function. For now, we only have linear softening
118
119 pp.query_switch("failure_surface",{
120 {"wang2023", [&]() {
122
123 // Fracture strength
124 pp.query_default("fracture_strength", fracture_strength, 1.e6);
125
126 // $\chi$ value
127 pp.query_default("chi", value._chi, 1.0);
128
129 // Compressive strength
130 pp.query_default("compressive_strength", compressive_strength,4.e8);
131 value.k1 = ( value._chi < 1/std::sqrt(2) ) ? ( 2 * value._chi * std::sqrt(1.0 - value._chi*value._chi) ) : 1.0;
132
133 tensile_strength = fracture_strength / value.k1;
134 shear_strength = value._chi * tensile_strength;
135 value._beta_bar = (1.0 / (value._chi * value._chi)) - (compressive_strength * compressive_strength / (4.0 * value._chi * value._chi * shear_strength * shear_strength));
136
137 value._GcI_bar = value._Gc/(value.k1*value.k1);
138 value._GcII_bar = value._GcI_bar * youngs * value._chi * value._chi / mu ;
139 fracture_strength = tensile_strength * value.k1;
140
141 Util::Message(INFO, "Chi = ", value._chi);
142 Util::Message(INFO, "mu = ", mu);
143 Util::Message(INFO, "k1 = ", value.k1);
144 Util::Message(INFO, "beta_bar = ", value._beta_bar);
145 Util::Message(INFO, "GcI_bar = ", value._GcI_bar);
146 Util::Message(INFO, "GcII_bar = ", value._GcII_bar);
147 Util::Message(INFO, "f_t = ", fracture_strength);
148 Util::Message(INFO, "f_c = ", compressive_strength);
149 Util::Message(INFO, "sig_t = ", tensile_strength);
150 Util::Message(INFO, "tau_s = ", shear_strength);
151
152 value._sig_t = tensile_strength;
153 value._tau_s = shear_strength;
154
155 }},
156 {"mohr", [&]() {
158
159 // cohesion coefficient for MC FS type
160 pp.query_default("cohesion", value._cohesion, 1.0);
161 // friction coefficient for MC FS type
162 pp.query_default("friction", value._friction, 0.5);
163
164 Set::Scalar phi = std::atan(value._friction);
165 fracture_strength = 2.0 * value._cohesion * std::cos(phi) / (1.0 + std::sin(phi));
166 }},
167 {"mc", [&]() {
169
170 // cohesion coefficient for MC FS type
171 pp.query_default("cohesion", value._cohesion, 1.0);
172 // friction coefficient for MC FS type
173 pp.query_default("friction", value._friction, 0.5);
174
175 Set::Scalar phi = std::atan(value._friction);
176 fracture_strength = 2.0 * value._cohesion * std::cos(phi) / (1.0 + std::sin(phi));
177 }},
178 {"coulomb", [&]() {
180
181 // cohesion coefficient for MC FS type
182 pp.query_default("cohesion", value._cohesion, 1.0);
183 // friction coefficient for MC FS type
184 pp.query_default("friction", value._friction, 0.5);
185
186 Set::Scalar phi = std::atan(value._friction);
187 fracture_strength = 2.0 * value._cohesion * std::cos(phi) / (1.0 + std::sin(phi));
188 }}
189 });
190
191 }, [&]() { // else
192
193 // Young's modulus
194 pp.query_default("E", youngs, 2.e11);
195 // fracture strength beyond which softening starts [Pa]
196 pp.query_default("fracture_strength", fracture_strength,1.e6);
197 });
198
199 Set::Scalar irwing_length = youngs * value._Gc / (fracture_strength * fracture_strength);
200 value.czm_a0 = 4.0 * irwing_length / (pi * value.zeta);
201 Util::Message(INFO, "irwing_length = ", irwing_length, ", a0 = ", value.czm_a0);
202 value._l_w = irwing_length;
203
204 if (value.zeta > 0.33 * irwing_length) Util::Warning(INFO, "Zeta value is greater than irwing length. Consider reducing it.");
205
206 pp.query_default("mobility",value.mobility,1.0e-2); // Mobility (speed)
207 pp.query_default("threshold", value.threshold,0.0); // Threshold
208
209 std::string gtype = "";
210 std::string wtype = "";
211 pp.query_validate("gtype", gtype, {"wu_linear"}); // degradation function. For now, we only have linear softening
212 pp.query_validate("wtype", wtype, {"wu"}); // geometric function. no choice except for the optimal one for now.
213
214 std::map<std::string,Model::Interface::Crack::Crack::GType> g_map;
216
217 std::map<std::string,Model::Interface::Crack::Crack::WType> w_map;
219
220 value.SetGType(g_map[gtype]);
221 value.SetWType(w_map[wtype]);
222
223 if (w_map[wtype] == Model::Interface::Crack::Crack::WType::WU) value._c_alpha = pi;
224
225 value.SetPFCZMConstants(value.czm_order, value.czm_a0);
226 }
227};
228}
229}
230}
231#endif
#define INFO
Definition Util.H:24
int query_if_else(std::string name, TrueAction &&true_action, FalseAction &&false_action, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:862
int query_validate(std::string name, int &value, std::vector< int > possibleintvals, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:569
int query_default(std::string name, T &value, T defaultvalue, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:492
int query_switch(std::string name, std::initializer_list< std::pair< std::string, std::function< void()> > > cases, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:714
void SetPFCZMConstants(const Set::Scalar a_pf_czm_order, const Set::Scalar a_pf_czm_a0)
Definition Crack.H:176
void SetWType(const WType a_type)
Definition Crack.H:161
static constexpr Set::Scalar pi
Definition Crack.H:183
void SetGType(const GType a_type)
Definition Crack.H:156
Set::Scalar Mobility(Set::Scalar)
Definition PFCZM.H:56
Set::Scalar DGc(Set::Scalar)
Definition PFCZM.H:53
static void Parse(PFCZM &value, IO::ParmParse &pp)
Definition PFCZM.H:88
Set::Scalar DDGc(Set::Scalar)
Definition PFCZM.H:54
Set::Scalar Zeta(Set::Scalar)
Definition PFCZM.H:55
Set::Scalar Gc(Set::Scalar)
Definition PFCZM.H:31
Set::Scalar DrivingForceThreshold(Set::Scalar)
Definition PFCZM.H:57
amrex::Real Scalar
Definition Base.H:19
void Warning(std::string file, std::string func, int line, Args const &... args)
Definition Util.H:213
void Message(std::string file, std::string func, int line, Args const &... args)
Definition Util.H:140