37 ShapeFunctionPressure, DisplacementDim>::
38 HydroMechanicsLocalAssemblerFracture(
41 std::vector<unsigned>
const& dofIndex_to_localIndex,
43 bool const is_axially_symmetric,
46 e, is_axially_symmetric, integration_method,
47 ShapeFunctionDisplacement::NPOINTS * DisplacementDim +
48 ShapeFunctionPressure::NPOINTS,
49 dofIndex_to_localIndex),
54 unsigned const n_integration_points =
57 _ip_data.reserve(n_integration_points);
60 auto const shape_matrices_u =
63 DisplacementDim>(e, is_axially_symmetric,
66 auto const shape_matrices_p =
69 e, is_axially_symmetric, integration_method);
72 auto frac_id =
_process_data.map_materialID_to_fractureID[mat_id];
78 aperture0_node_values =
82 for (
unsigned ip = 0; ip < n_integration_points; ip++)
85 auto const& sm_u = shape_matrices_u[ip];
86 auto const& sm_p = shape_matrices_p[ip];
95 ip_data.integration_weight =
96 sm_u.detJ * sm_u.integralMeasure *
101 ShapeFunctionDisplacement::NPOINTS * DisplacementDim);
103 DisplacementDim, ShapeFunctionDisplacement::NPOINTS,
106 ip_data.N_p = sm_p.N;
107 ip_data.dNdx_p = sm_p.dNdx;
112 ip_data.w.setZero(DisplacementDim);
113 ip_data.sigma_eff.setZero(DisplacementDim);
116 ip_data.w_prev.resize(DisplacementDim);
117 ip_data.sigma_eff_prev.resize(DisplacementDim);
119 ip_data.C.resize(DisplacementDim, DisplacementDim);
121 ip_data.aperture0 = aperture0_node_values.dot(sm_u.N);
122 ip_data.aperture = ip_data.aperture0;
124 auto const initial_effective_stress =
125 _process_data.initial_fracture_effective_stress(0, x_position);
126 for (
int i = 0; i < DisplacementDim; i++)
128 ip_data.sigma_eff[i] = initial_effective_stress[i];
129 ip_data.sigma_eff_prev[i] = initial_effective_stress[i];
168 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
169 assembleBlockMatricesWithJacobian(
170 double const t,
double const dt,
171 Eigen::Ref<const Eigen::VectorXd>
const& p,
172 Eigen::Ref<const Eigen::VectorXd>
const& p_prev,
173 Eigen::Ref<const Eigen::VectorXd>
const& g,
174 Eigen::Ref<const Eigen::VectorXd>
const& g_prev,
175 Eigen::Ref<Eigen::VectorXd> rhs_p, Eigen::Ref<Eigen::VectorXd> rhs_g,
176 Eigen::Ref<Eigen::MatrixXd> J_pp, Eigen::Ref<Eigen::MatrixXd> J_pg,
177 Eigen::Ref<Eigen::MatrixXd> J_gg, Eigen::Ref<Eigen::MatrixXd> J_gp)
183 auto constexpr index_normal = DisplacementDim - 1;
186 ShapeMatricesTypePressure::NodalMatrixType::Zero(
pressure_size,
190 ShapeMatricesTypePressure::NodalMatrixType::Zero(
pressure_size,
193 typename ShapeMatricesTypeDisplacement::template MatrixType<
195 Kgp = ShapeMatricesTypeDisplacement::template MatrixType<
200 Eigen::MatrixXd
const global2local_rotation =
201 R.template topLeftCorner<ShapeFunctionPressure::DIM, DisplacementDim>();
204 global2local_rotation *
212 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
215 .template value<double>(variables, x_position, t, dt);
218 unsigned const n_integration_points =
_ip_data.size();
219 for (
unsigned ip = 0; ip < n_integration_points; ip++)
222 auto const& ip_w = ip_data.integration_weight;
223 auto const& N_p = ip_data.N_p;
224 auto const& dNdx_p = ip_data.dNdx_p;
225 auto const& H_g = ip_data.H_u;
226 auto const& identity2 =
236 auto& mat = ip_data.fracture_material;
237 auto& effective_stress = ip_data.sigma_eff;
238 auto const& effective_stress_prev = ip_data.sigma_eff_prev;
240 auto const& w_prev = ip_data.w_prev;
242 auto& state = *ip_data.material_state_variables;
243 auto& b_m = ip_data.aperture;
247 .template value<double>(variables, x_position, t, dt);
252 .template value<double>(variables, x_position, t, dt);
256 .template value<double>(variables, x_position, t, dt);
260 .template value<double>(variables, x_position, t, dt);
263 w.noalias() = R * H_g * g;
266 b_m = ip_data.aperture0 + w[index_normal];
270 "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it must "
272 "non-negative. Setting it to zero.",
277 auto const initial_effective_stress =
278 _process_data.initial_fracture_effective_stress(0, x_position);
280 Eigen::Map<typename HMatricesType::ForceVectorType const>
const stress0(
281 initial_effective_stress.data(), initial_effective_stress.size());
284 mat.computeConstitutiveRelation(
285 t, x_position, ip_data.aperture0, stress0, w_prev, w,
286 effective_stress_prev, effective_stress, C, state);
292 H_g.transpose() * R.transpose() * effective_stress * ip_w;
293 J_gg.noalias() += H_g.transpose() * R.transpose() * C * R * H_g * ip_w;
299 H_g.transpose() * R.transpose() * alpha * identity2 * N_p * ip_w;
307 auto const permeability =
309 .value(variables, x_position, t, dt);
311 auto& k = ip_data.permeability;
312 k = std::get<double>(permeability);
313 double const k_over_mu = k / mu;
314 storage_p.noalias() += N_p.transpose() * b_m * S * N_p * ip_w;
315 laplace_p.noalias() +=
316 dNdx_p.transpose() * b_m * k_over_mu * dNdx_p * ip_w;
318 dNdx_p.transpose() * b_m * k_over_mu * rho_fr * gravity_vec * ip_w;
324 Eigen::Matrix<double, 1, displacement_size>
const mT_R_Hg =
325 identity2.transpose() * R * H_g;
327 ip_data.darcy_velocity = -k_over_mu * grad_head;
329 N_p.transpose() * S * N_p * (p - p_prev) / dt * mT_R_Hg * ip_w;
332 double const dk_db_over_mu =
334 .template dValue<double>(variables,
339 dNdx_p.transpose() * k_over_mu * grad_head * mT_R_Hg * ip_w;
340 J_pg.noalias() += dNdx_p.transpose() * b_m * dk_db_over_mu * grad_head *
345 J_gp.noalias() -= Kgp;
348 J_pp.noalias() += laplace_p + storage_p / dt;
351 J_pg.noalias() += Kgp.transpose() / dt;
354 rhs_p.noalias() -= laplace_p * p + storage_p * (p - p_prev) / dt +
355 Kgp.transpose() * (g - g_prev) / dt;
358 rhs_g.noalias() -= -Kgp * p;
367 Eigen::VectorXd
const&
375 auto constexpr index_normal = DisplacementDim - 1;
381 unsigned const n_integration_points =
_ip_data.size();
382 for (
unsigned ip = 0; ip < n_integration_points; ip++)
385 auto const& H_g = ip_data.H_u;
386 auto& mat = ip_data.fracture_material;
387 auto& effective_stress = ip_data.sigma_eff;
388 auto const& effective_stress_prev = ip_data.sigma_eff_prev;
390 auto const& w_prev = ip_data.w_prev;
392 auto& state = *ip_data.material_state_variables;
393 auto& b_m = ip_data.aperture;
403 w.noalias() = R * H_g * nodal_g;
406 b_m = ip_data.aperture0 + w[index_normal];
410 "Element {:d}, gp {:d}: Fracture aperture is {:g}, but it is "
411 "expected to be non-negative. Setting it to zero now.",
416 auto const initial_effective_stress =
417 _process_data.initial_fracture_effective_stress(0, x_position);
419 Eigen::Map<typename HMatricesType::ForceVectorType const>
const stress0(
420 initial_effective_stress.data(), initial_effective_stress.size());
423 mat.computeConstitutiveRelation(
424 t, x_position, ip_data.aperture0, stress0, w_prev, w,
425 effective_stress_prev, effective_stress, C, state);
431 HMatricesType::ForceVectorType::Zero(DisplacementDim);
433 HMatricesType::ForceVectorType::Zero(DisplacementDim);
436 double ele_Fs = -std::numeric_limits<double>::max();
439 ele_b += ip.aperture;
440 ele_k += ip.permeability;
442 ele_sigma_eff += ip.sigma_eff;
443 ele_velocity += ip.darcy_velocity;
445 ele_Fs, ip.material_state_variables->getShearYieldFunctionValue());
447 ele_b /=
static_cast<double>(n_integration_points);
448 ele_k /=
static_cast<double>(n_integration_points);
449 ele_w /=
static_cast<double>(n_integration_points);
450 ele_sigma_eff /=
static_cast<double>(n_integration_points);
451 ele_velocity /=
static_cast<double>(n_integration_points);
452 auto const element_id =
_element.getID();
456 Eigen::Map<GlobalDimVectorType>(
457 &(*
_process_data.element_fracture_stresses)[e_id * DisplacementDim]) =
460 Eigen::Map<GlobalDimVectorType>(
461 &(*
_process_data.element_fracture_velocities)[e_id * DisplacementDim]) =
464 Eigen::Map<GlobalDimVectorType>(
465 &(*
_process_data.element_local_jumps)[e_id * DisplacementDim]) = ele_w;
467 (*
_process_data.mesh_prop_fracture_shear_failure)[element_id] = ele_Fs;
473 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
474 getIntPtFractureVelocity(
476 std::vector<GlobalVector*>
const& ,
477 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
478 std::vector<double>& cache)
const
480 unsigned const n_integration_points =
_ip_data.size();
483 double, DisplacementDim, Eigen::Dynamic, Eigen::RowMajor>>(
484 cache, DisplacementDim, n_integration_points);
486 for (
unsigned ip = 0; ip < n_integration_points; ip++)
488 cache_matrix.col(ip).noalias() =
_ip_data[ip].darcy_velocity;