7 #include "../Curvilinear/ContextDynamicRupture.h"
9 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
17 easi::ArraysAdapter<T> adapter;
18 adapter.addBindingPoint(
"s_xx",&sxx);
19 adapter.addBindingPoint(
"s_yy",&syy);
20 adapter.addBindingPoint(
"s_zz",&szz);
21 adapter.addBindingPoint(
"s_xy",&sxy);
22 adapter.addBindingPoint(
"s_yz",&syz);
23 adapter.addBindingPoint(
"s_xz",&sxz);
25 easi::Query query(1,3);
31 model->evaluate(query,adapter);
36 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
38 T& T0_n, T& T0_m, T& T0_l,
39 double*
const x,
double t,
40 T*
const l, T*
const m, T*
const n
43 T sxx, syy, szz, sxy, sxz, syz;
47 initialStressTensor(sxx, syy, szz, sxy, sxz, syz,
x);
50 Tx = n[0] * sxx + n[1] * sxy + n[2] * sxz;
51 Ty = n[0] * sxy + n[1] * syy + n[2] * syz;
52 Tz = n[0] * sxz + n[1] * syz + n[2] * szz;
57 easi::ArraysAdapter<T> adapter;
59 adapter.addBindingPoint(
"n_yz",&n_yz);
62 easi::Query query(1,3);
68 model->evaluate(query,adapter);
74 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
76 T& tau_str, T sigma_n, T S,
77 double*
const x,
double t
85 easi::ArraysAdapter<T> adapter;
86 adapter.addBindingPoint(
"cohesion",&cohesion);
87 adapter.addBindingPoint(
"forced_rupture_time",&r_T);
88 adapter.addBindingPoint(
"d_c" ,&d_c);
90 easi::Query query(1,3);
96 model->evaluate(query,adapter);
104 cohesion += 1e10*(1.0-fy*fz);
108 }
else if ((t0_rupture > 0.00001) && (
t < r_T+t0_rupture)){
109 f_T = (
t-r_T)/t0_rupture;
115 T fric_coeff = mu_s - (mu_s-mu_d) * std::max<T>(f_T,
std::min(S,d_c)/d_c);
117 tau_str = cohesion + fric_coeff*std::max<T>(0.0,sigma_n);
121 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
126 if ((-
w+tol)<
x &&
x< (
w-tol)){
129 else if (std::abs(-
w-
x)<=tol || std::abs(
x-
w)<=tol){
140 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
142 T& v1, T& v2, T& Vel,
145 T eta, T tau_str, T sigma_n
148 T Phi = std::sqrt(std::pow(phi_1, 2) + std::pow(phi_2, 2));
149 Vel = (Phi - tau_str)/eta;
152 v1 = phi_1/(eta+tau_str/Vel);
153 v2 = phi_2/(eta+tau_str/Vel);
156 tau1 = phi_1 - eta*v1;
157 tau2 = phi_2 - eta*v2;
162 template <
class Shortcuts,
int basisSize,
int numberOfVariables,
int numberOfParameters,
typename T>
167 T& vn_hat_p, T& vn_hat_m,
168 T& Tn_hat_p, T& Tn_hat_m,
172 T& vm_hat_p, T& vm_hat_m,
173 T& Tm_hat_p, T& Tm_hat_m,
177 T& vl_hat_p, T& vl_hat_m,
178 T& Tl_hat_p, T& Tl_hat_m,
179 T*
const l, T*
const m, T*
const n,
double*
const x, T S,
double t
182 T p_l = zl_p*vl_p + Tl_p;
183 T p_m = zm_p*vm_p + Tm_p;
184 T p_n = zn_p*vn_p + Tn_p;
186 T q_l = zl_m*vl_m - Tl_m;
187 T q_m = zm_m*vm_m - Tm_m;
188 T q_n = zn_m*vn_m - Tn_m;
191 T eta_s=(zl_p*zl_m)/(zl_p+zl_m);
192 T eta_n=(zn_p*zn_m)/(zn_p+zn_m);
194 T phi_l= eta_s*(p_l/zl_p - q_l/zl_m);
195 T phi_m= eta_s*(p_m/zm_p - q_m/zm_m);
196 T phi_n= eta_n*(p_n/zn_p - q_n/zn_m);
203 preStress(T0_n, T0_m, T0_l,
x, 0.0, l, m, n);
205 vn_hat_m = (p_n - phi_n)/zn_p;
207 vn_hat_p = (q_n + phi_n)/zn_m;
210 T tau_lock = std::sqrt(std::pow(T0_l + phi_l, 2) + std::pow(T0_m + phi_m, 2));
211 T sigma_n = std::max<T>(0.0, -(T0_n + phi_n));
214 T Tl, Tm, vv_l, vv_m;
215 tauStrength(tau_str, sigma_n, S,
x,
t);
217 if (tau_lock >= tau_str){
219 slipWeakening(vv_m, vv_l, Vel, Tm, Tl, phi_m+T0_m, phi_l+T0_l, eta_s, tau_str, sigma_n);
221 Tm_hat_m = Tm - T0_m;
222 Tl_hat_m = Tl - T0_l;
224 Tm_hat_p = Tm - T0_m;
225 Tl_hat_p = Tl - T0_l;
239 vm_hat_p = (Tm_hat_m + q_m)/zm_m + vv_m;
240 vl_hat_p = (Tl_hat_m + q_l)/zl_m + vv_l;
242 vm_hat_m = (p_m - Tm_hat_p)/zm_p - vv_m;
243 vl_hat_m = (p_l - Tl_hat_p)/zl_p - vv_l;
void slipWeakening(T &v1, T &v2, T &Vel, T &tau1, T &tau2, T phi_1, T phi_2, T eta, T tau_str, T sigma_n)
T boxcar(T &f, double x, T w)
void slipWeakeningFriction(T vn_p, T vn_m, T Tn_p, T Tn_m, T zn_p, T zn_m, T &vn_hat_p, T &vn_hat_m, T &Tn_hat_p, T &Tn_hat_m, T vm_p, T vm_m, T Tm_p, T Tm_m, T zl_p, T zl_m, T &vm_hat_p, T &vm_hat_m, T &Tm_hat_p, T &Tm_hat_m, T vl_p, T vl_m, T Tl_p, T Tl_m, T zm_p, T zm_m, T &vl_hat_p, T &vl_hat_m, T &Tl_hat_p, T &Tl_hat_m, T *const l, T *const m, T *const n, double *const x, T S, double t)
void preStress(T &T0_n, T &T0_m, T &T0_l, double *const x, double t, T *const l, T *const m, T *const n)
void initialStressTensor(T &sxx, T &syy, T &szz, T &sxy, T &sxz, T &syz, double *const x)
void tauStrength(T &tau_str, T sigma_n, T S, double *const x, double t)
void rotateIntoOrthogonalBasis(T *n, T *m, T *l, T Tx, T Ty, T Tz, T &Tn, T &Tm, T &Tl)
static double min(double const x, double const y)
double boxcar(double &f, double x, double w)