30namespace RichardsMechanics
32template <
int DisplacementDim,
typename IPData>
37 double const rho_LR,
double const mu,
38 std::optional<MicroPorosityParameters> micro_porosity_parameters,
39 double const alpha,
double const phi,
double const p_cap_ip,
46 DisplacementDim)>::identity2;
48 auto& sigma_sw = ip_data.sigma_sw;
49 auto const& sigma_sw_prev = ip_data.sigma_sw_prev;
50 if (!medium.
hasProperty(MPL::PropertyType::saturation_micro))
54 sigma_sw = sigma_sw_prev;
55 if (solid_phase.
hasProperty(MPL::PropertyType::swelling_stress_rate))
57 auto const sigma_sw_dot =
58 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
60 solid_phase[MPL::PropertyType::swelling_stress_rate]
61 .value(variables, variables_prev, x_position, t,
63 sigma_sw += sigma_sw_dot * dt;
68 identity2.transpose() * C_el.inverse() * sigma_sw;
70 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
76 if (medium.
hasProperty(MPL::PropertyType::saturation_micro))
78 double const phi_M_prev = ip_data.transport_porosity_prev;
79 double const phi_prev = ip_data.porosity_prev;
80 double const phi_m_prev = phi_prev - phi_M_prev;
81 double const p_L_m_prev = ip_data.liquid_pressure_m_prev;
83 auto const S_L_m_prev = ip_data.saturation_m_prev;
85 auto const [delta_phi_m, delta_e_sw, delta_p_L_m, delta_sigma_sw] =
86 computeMicroPorosity<DisplacementDim>(
87 identity2.transpose() * C_el.inverse(), rho_LR, mu,
88 *micro_porosity_parameters, alpha, phi, -p_cap_ip, p_L_m_prev,
89 variables_prev, S_L_m_prev, phi_m_prev, x_position, t, dt,
90 medium.
property(MPL::PropertyType::saturation_micro),
91 solid_phase.
property(MPL::PropertyType::swelling_stress_rate));
93 auto& phi_M = ip_data.transport_porosity;
94 phi_M = phi - (phi_m_prev + delta_phi_m);
98 auto& p_L_m = ip_data.liquid_pressure_m;
99 p_L_m = p_L_m_prev + delta_p_L_m;
106 ip_data.saturation_m =
107 medium.
property(MPL::PropertyType::saturation_micro)
108 .template value<double>(variables, x_position, t, dt);
110 sigma_sw = sigma_sw_prev + delta_sigma_sw;
114template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
116RichardsMechanicsLocalAssembler<ShapeFunctionDisplacement,
117 ShapeFunctionPressure, DisplacementDim>::
118 RichardsMechanicsLocalAssembler(
122 bool const is_axially_symmetric,
124 : _process_data(process_data),
125 _integration_method(integration_method),
127 _is_axially_symmetric(is_axially_symmetric)
129 unsigned const n_integration_points =
132 _ip_data.reserve(n_integration_points);
135 auto const shape_matrices_u =
138 DisplacementDim>(e, is_axially_symmetric,
141 auto const shape_matrices_p =
146 auto const& solid_material =
155 for (
unsigned ip = 0; ip < n_integration_points; ip++)
158 _ip_data.emplace_back(solid_material);
160 auto const& sm_u = shape_matrices_u[ip];
163 sm_u.integralMeasure * sm_u.detJ;
165 ip_data.N_u = sm_u.N;
166 ip_data.dNdx_u = sm_u.dNdx;
168 ip_data.N_p = shape_matrices_p[ip].N;
169 ip_data.dNdx_p = shape_matrices_p[ip].dNdx;
174 .template initialValue<double>(
177 double>::quiet_NaN() );
179 ip_data.transport_porosity = ip_data.porosity;
180 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
182 ip_data.transport_porosity =
184 .template initialValue<double>(
187 double>::quiet_NaN() );
194template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
197 ShapeFunctionDisplacement, ShapeFunctionPressure,
199 double const* values,
200 int const integration_order)
202 if (integration_order !=
203 static_cast<int>(_integration_method.getIntegrationOrder()))
206 "Setting integration point initial conditions; The integration "
207 "order of the local assembler for element {:d} is different "
208 "from the integration order in the initial condition.",
212 if (name ==
"sigma_ip")
214 if (_process_data.initial_stress !=
nullptr)
217 "Setting initial conditions for stress from integration "
218 "point data and from a parameter '{:s}' is not possible "
220 _process_data.initial_stress->name);
222 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
223 values, _ip_data, &IpData::sigma_eff);
226 if (name ==
"saturation_ip")
229 &IpData::saturation);
231 if (name ==
"porosity_ip")
236 if (name ==
"transport_porosity_ip")
239 values, _ip_data, &IpData::transport_porosity);
241 if (name ==
"swelling_stress_ip")
243 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
244 values, _ip_data, &IpData::sigma_sw);
246 if (name ==
"epsilon_ip")
248 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
249 values, _ip_data, &IpData::eps);
251 if (name.starts_with(
"material_state_variable_") && name.ends_with(
"_ip"))
253 std::string
const variable_name = name.substr(24, name.size() - 24 - 3);
254 DBUG(
"Setting material state variable '{:s}'", variable_name);
258 auto const& internal_variables =
259 _ip_data[0].solid_material.getInternalVariables();
261 std::find_if(begin(internal_variables), end(internal_variables),
262 [&variable_name](
auto const& iv)
263 {
return iv.name == variable_name; });
264 iv != end(internal_variables))
267 values, _ip_data, &IpData::material_state_variables,
271 ERR(
"Could not find variable {:s} in solid material model's internal "
278template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
281 ShapeFunctionPressure, DisplacementDim>::
282 setInitialConditionsConcrete(std::vector<double>
const& local_x,
287 assert(local_x.size() == pressure_size + displacement_size);
290 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
291 pressure_size>
const>(local_x.data() + pressure_index,
294 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
295 auto const& medium = _process_data.media_map.getMedium(_element.getID());
301 auto const& solid_phase = medium->phase(
"Solid");
303 unsigned const n_integration_points =
304 _integration_method.getNumberOfPoints();
305 for (
unsigned ip = 0; ip < n_integration_points; ip++)
309 auto const& N_p = _ip_data[ip].N_p;
316 _ip_data[ip].liquid_pressure_m_prev = -p_cap_ip;
317 _ip_data[ip].liquid_pressure_m = -p_cap_ip;
319 auto const temperature =
320 medium->property(MPL::PropertyType::reference_temperature)
321 .template value<double>(variables, x_position, t, dt);
324 _ip_data[ip].saturation_prev =
325 medium->property(MPL::PropertyType::saturation)
326 .template value<double>(variables, x_position, t, dt);
328 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
333 medium->property(MPL::PropertyType::saturation_micro)
334 .template value<double>(vars, x_position, t, dt);
335 _ip_data[ip].saturation_m_prev = S_L_m;
340 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
341 t, x_position, dt, temperature);
342 auto& eps = _ip_data[ip].eps;
343 auto& sigma_sw = _ip_data[ip].sigma_sw;
345 _ip_data[ip].eps_m_prev.noalias() =
346 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
347 ? eps + C_el.inverse() * sigma_sw
352template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
355 ShapeFunctionDisplacement, ShapeFunctionPressure,
356 DisplacementDim>::assemble(
double const t,
double const dt,
357 std::vector<double>
const& local_x,
358 std::vector<double>
const& local_x_prev,
359 std::vector<double>& local_M_data,
360 std::vector<double>& local_K_data,
361 std::vector<double>& local_rhs_data)
363 assert(local_x.size() == pressure_size + displacement_size);
366 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
367 pressure_size>
const>(local_x.data() + pressure_index,
371 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
372 displacement_size>
const>(local_x.data() + displacement_index,
376 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
377 pressure_size>
const>(local_x_prev.data() + pressure_index,
381 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
382 displacement_size>
const>(local_x_prev.data() + displacement_index,
386 typename ShapeMatricesTypeDisplacement::template MatrixType<
387 displacement_size + pressure_size,
388 displacement_size + pressure_size>>(
389 local_K_data, displacement_size + pressure_size,
390 displacement_size + pressure_size);
393 typename ShapeMatricesTypeDisplacement::template MatrixType<
394 displacement_size + pressure_size,
395 displacement_size + pressure_size>>(
396 local_M_data, displacement_size + pressure_size,
397 displacement_size + pressure_size);
400 typename ShapeMatricesTypeDisplacement::template VectorType<
401 displacement_size + pressure_size>>(
402 local_rhs_data, displacement_size + pressure_size);
406 DisplacementDim)>::identity2;
408 auto const& medium = _process_data.media_map.getMedium(_element.getID());
409 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
410 auto const& solid_phase = medium->phase(
"Solid");
417 unsigned const n_integration_points =
418 _integration_method.getNumberOfPoints();
419 for (
unsigned ip = 0; ip < n_integration_points; ip++)
422 auto const& w = _ip_data[ip].integration_weight;
424 auto const& N_u = _ip_data[ip].N_u;
425 auto const& dNdx_u = _ip_data[ip].dNdx_u;
427 auto const& N_p = _ip_data[ip].N_p;
428 auto const& dNdx_p = _ip_data[ip].dNdx_p;
436 ShapeFunctionDisplacement::NPOINTS,
438 dNdx_u, N_u, x_coord, _is_axially_symmetric);
440 auto& eps = _ip_data[ip].eps;
441 auto& eps_m = _ip_data[ip].eps_m;
442 eps.noalias() = B * u;
444 auto& S_L = _ip_data[ip].saturation;
445 auto const S_L_prev = _ip_data[ip].saturation_prev;
450 double p_cap_prev_ip;
456 auto const temperature =
457 medium->property(MPL::PropertyType::reference_temperature)
458 .template value<double>(variables, x_position, t, dt);
462 medium->property(MPL::PropertyType::biot_coefficient)
463 .template value<double>(variables, x_position, t, dt);
464 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
465 t, x_position, dt, temperature);
469 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
473 liquid_phase.property(MPL::PropertyType::density)
474 .template value<double>(variables, x_position, t, dt);
477 auto const& b = _process_data.specific_body_force;
479 S_L = medium->property(MPL::PropertyType::saturation)
480 .template value<double>(variables, x_position, t, dt);
485 double const dS_L_dp_cap =
486 medium->property(MPL::PropertyType::saturation)
487 .template dValue<double>(variables,
488 MPL::Variable::capillary_pressure,
492 double const DeltaS_L_Deltap_cap =
493 (p_cap_ip == p_cap_prev_ip)
495 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
497 auto const chi = [medium, x_position, t, dt](
double const S_L)
501 return medium->property(MPL::PropertyType::bishops_effective_stress)
502 .template value<double>(vs, x_position, t, dt);
504 double const chi_S_L = chi(S_L);
505 double const chi_S_L_prev = chi(S_L_prev);
507 double const p_FR = -chi_S_L * p_cap_ip;
515 auto& phi = _ip_data[ip].porosity;
517 variables_prev.
porosity = _ip_data[ip].porosity_prev;
518 phi = medium->property(MPL::PropertyType::porosity)
519 .template value<double>(variables, variables_prev,
527 "RichardsMechanics: Biot-coefficient {} is smaller than "
528 "porosity {} in element/integration point {}/{}.",
529 alpha, phi, _element.getID(), ip);
534 auto& sigma_sw = _ip_data[ip].sigma_sw;
535 auto const& sigma_sw_prev = _ip_data[ip].sigma_sw_prev;
539 sigma_sw = sigma_sw_prev;
540 if (solid_phase.hasProperty(
541 MPL::PropertyType::swelling_stress_rate))
543 auto const sigma_sw_dot =
544 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
546 solid_phase[MPL::PropertyType::swelling_stress_rate]
547 .value(variables, variables_prev, x_position, t,
549 sigma_sw += sigma_sw_dot * dt;
554 identity2.transpose() * C_el.inverse() * sigma_sw;
556 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
559 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
562 _ip_data[ip].transport_porosity_prev;
564 _ip_data[ip].transport_porosity =
565 medium->property(MPL::PropertyType::transport_porosity)
566 .template value<double>(variables, variables_prev,
577 medium->property(MPL::PropertyType::relative_permeability)
578 .template value<double>(variables, x_position, t, dt);
580 liquid_phase.property(MPL::PropertyType::viscosity)
581 .template value<double>(variables, x_position, t, dt);
583 auto const& sigma_sw = _ip_data[ip].sigma_sw;
584 auto const& sigma_eff = _ip_data[ip].sigma_eff;
589 auto const sigma_total =
590 (sigma_eff - alpha * p_FR * identity2).eval();
599 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
601 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
602 medium->property(MPL::PropertyType::permeability)
603 .value(variables, x_position, t, dt));
606 K_intrinsic * rho_LR * k_rel / mu;
612 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
613 ? eps + C_el.inverse() * sigma_sw
619 _ip_data[ip].updateConstitutiveRelation(variables, t, x_position, dt,
624 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
626 solid_phase.property(MPL::PropertyType::density)
627 .template value<double>(variables, x_position, t, dt);
632 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
633 rhs.template segment<displacement_size>(displacement_index).noalias() -=
634 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
639 auto const beta_LR = 1 / rho_LR *
640 liquid_phase.property(MPL::PropertyType::density)
641 .template dValue<double>(
642 variables, MPL::Variable::phase_pressure,
645 double const a0 = S_L * (alpha - phi) * beta_SR;
647 double const specific_storage =
648 DeltaS_L_Deltap_cap * (p_cap_ip * a0 - phi) +
649 S_L * (phi * beta_LR + a0);
650 M.template block<pressure_size, pressure_size>(pressure_index,
652 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
654 K.template block<pressure_size, pressure_size>(pressure_index,
656 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
658 rhs.template segment<pressure_size>(pressure_index).noalias() +=
659 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
664 K.template block<displacement_size, pressure_size>(displacement_index,
666 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
671 M.template block<pressure_size, displacement_size>(pressure_index,
673 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
674 identity2.transpose() * B * w;
677 if (_process_data.apply_mass_lumping)
679 auto Mpp = M.template block<pressure_size, pressure_size>(
680 pressure_index, pressure_index);
681 Mpp = Mpp.colwise().sum().eval().asDiagonal();
685template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
688 ShapeFunctionPressure, DisplacementDim>::
689 assembleWithJacobian(
double const t,
double const dt,
690 std::vector<double>
const& local_x,
691 std::vector<double>
const& local_x_prev,
692 std::vector<double>& ,
693 std::vector<double>& ,
694 std::vector<double>& local_rhs_data,
695 std::vector<double>& local_Jac_data)
697 assert(local_x.size() == pressure_size + displacement_size);
700 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
701 pressure_size>
const>(local_x.data() + pressure_index,
705 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
706 displacement_size>
const>(local_x.data() + displacement_index,
710 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
711 pressure_size>
const>(local_x_prev.data() + pressure_index,
714 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
715 displacement_size>
const>(local_x_prev.data() + displacement_index,
719 typename ShapeMatricesTypeDisplacement::template MatrixType<
720 displacement_size + pressure_size,
721 displacement_size + pressure_size>>(
722 local_Jac_data, displacement_size + pressure_size,
723 displacement_size + pressure_size);
726 typename ShapeMatricesTypeDisplacement::template VectorType<
727 displacement_size + pressure_size>>(
728 local_rhs_data, displacement_size + pressure_size);
732 DisplacementDim)>::identity2;
735 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
739 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
743 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
747 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
750 typename ShapeMatricesTypeDisplacement::template MatrixType<
751 displacement_size, pressure_size>
752 Kup = ShapeMatricesTypeDisplacement::template MatrixType<
753 displacement_size, pressure_size>::Zero(displacement_size,
756 typename ShapeMatricesTypeDisplacement::template MatrixType<
757 pressure_size, displacement_size>
758 Kpu = ShapeMatricesTypeDisplacement::template MatrixType<
759 pressure_size, displacement_size>::Zero(pressure_size,
762 auto const& medium = _process_data.media_map.getMedium(_element.getID());
763 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
764 auto const& solid_phase = medium->phase(
"Solid");
771 unsigned const n_integration_points =
772 _integration_method.getNumberOfPoints();
773 for (
unsigned ip = 0; ip < n_integration_points; ip++)
776 auto const& w = _ip_data[ip].integration_weight;
778 auto const& N_u = _ip_data[ip].N_u;
779 auto const& dNdx_u = _ip_data[ip].dNdx_u;
781 auto const& N_p = _ip_data[ip].N_p;
782 auto const& dNdx_p = _ip_data[ip].dNdx_p;
790 ShapeFunctionDisplacement::NPOINTS,
792 dNdx_u, N_u, x_coord, _is_axially_symmetric);
797 double p_cap_prev_ip;
802 auto const temperature =
803 medium->property(MPL::PropertyType::reference_temperature)
804 .template value<double>(variables, x_position, t, dt);
807 auto& eps = _ip_data[ip].eps;
808 auto& eps_m = _ip_data[ip].eps_m;
809 eps.noalias() = B * u;
810 auto const& sigma_eff = _ip_data[ip].sigma_eff;
811 auto& S_L = _ip_data[ip].saturation;
812 auto const S_L_prev = _ip_data[ip].saturation_prev;
814 medium->property(MPL::PropertyType::biot_coefficient)
815 .template value<double>(variables, x_position, t, dt);
817 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
818 t, x_position, dt, temperature);
822 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
826 liquid_phase.property(MPL::PropertyType::density)
827 .template value<double>(variables, x_position, t, dt);
830 auto const& b = _process_data.specific_body_force;
832 S_L = medium->property(MPL::PropertyType::saturation)
833 .template value<double>(variables, x_position, t, dt);
838 double const dS_L_dp_cap =
839 medium->property(MPL::PropertyType::saturation)
840 .template dValue<double>(variables,
841 MPL::Variable::capillary_pressure,
845 double const DeltaS_L_Deltap_cap =
846 (p_cap_ip == p_cap_prev_ip)
848 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
850 auto const chi = [medium, x_position, t, dt](
double const S_L)
854 return medium->property(MPL::PropertyType::bishops_effective_stress)
855 .template value<double>(vs, x_position, t, dt);
857 double const chi_S_L = chi(S_L);
858 double const chi_S_L_prev = chi(S_L_prev);
860 double const p_FR = -chi_S_L * p_cap_ip;
868 auto& phi = _ip_data[ip].porosity;
871 variables_prev.
porosity = _ip_data[ip].porosity_prev;
872 phi = medium->property(MPL::PropertyType::porosity)
873 .template value<double>(variables, variables_prev,
881 "RichardsMechanics: Biot-coefficient {} is smaller than "
882 "porosity {} in element/integration point {}/{}.",
883 alpha, phi, _element.getID(), ip);
887 liquid_phase.property(MPL::PropertyType::viscosity)
888 .template value<double>(variables, x_position, t, dt);
891 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
892 _ip_data[ip], *medium, solid_phase, C_el, rho_LR, mu,
893 _process_data.micro_porosity_parameters, alpha, phi, p_cap_ip,
894 variables, variables_prev, x_position, t, dt);
896 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
898 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
901 _ip_data[ip].transport_porosity_prev;
903 _ip_data[ip].transport_porosity =
904 medium->property(MPL::PropertyType::transport_porosity)
905 .template value<double>(variables, variables_prev,
916 medium->property(MPL::PropertyType::relative_permeability)
917 .template value<double>(variables, x_position, t, dt);
922 auto const sigma_total =
923 (_ip_data[ip].sigma_eff + alpha * p_FR * identity2).eval();
931 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
933 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
934 medium->property(MPL::PropertyType::permeability)
935 .value(variables, x_position, t, dt));
942 auto& sigma_sw = _ip_data[ip].sigma_sw;
945 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
946 ? eps + C_el.inverse() * sigma_sw
952 auto C = _ip_data[ip].updateConstitutiveRelation(
953 variables, t, x_position, dt, temperature);
956 .template block<displacement_size, displacement_size>(
957 displacement_index, displacement_index)
958 .noalias() += B.transpose() * C * B * w;
962 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
964 solid_phase.property(MPL::PropertyType::density)
965 .template value<double>(variables, x_position, t, dt);
967 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
968 local_rhs.template segment<displacement_size>(displacement_index)
970 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
975 Kup.noalias() += B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
977 auto const dchi_dS_L =
978 medium->property(MPL::PropertyType::bishops_effective_stress)
979 .template dValue<double>(variables,
980 MPL::Variable::liquid_saturation,
983 .template block<displacement_size, pressure_size>(
984 displacement_index, pressure_index)
985 .noalias() -= B.transpose() * alpha *
986 (chi_S_L + dchi_dS_L * p_cap_ip * dS_L_dp_cap) *
990 .template block<displacement_size, pressure_size>(
991 displacement_index, pressure_index)
993 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1004 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1005 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
1007 using DimMatrix = Eigen::Matrix<double, 3, 3>;
1008 auto const dsigma_sw_dS_L =
1009 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
1011 .property(MPL::PropertyType::swelling_stress_rate)
1012 .
template dValue<DimMatrix>(
1013 variables, variables_prev,
1014 MPL::Variable::liquid_saturation, x_position, t,
1017 .template block<displacement_size, pressure_size>(
1018 displacement_index, pressure_index)
1020 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1025 if (_process_data.explicit_hm_coupling_in_unsaturated_zone)
1027 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1028 identity2.transpose() * B * w;
1032 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1033 identity2.transpose() * B * w;
1039 laplace_p.noalias() +=
1040 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1042 auto const beta_LR = 1 / rho_LR *
1043 liquid_phase.property(MPL::PropertyType::density)
1044 .template dValue<double>(
1045 variables, MPL::Variable::phase_pressure,
1048 double const a0 = (alpha - phi) * beta_SR;
1049 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1050 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1052 double const dspecific_storage_a_p_dp_cap =
1053 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1054 double const dspecific_storage_a_S_dp_cap =
1055 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1057 storage_p_a_p.noalias() +=
1058 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1060 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1061 specific_storage_a_S * DeltaS_L_Deltap_cap *
1065 .template block<pressure_size, pressure_size>(pressure_index,
1067 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1068 rho_LR * dspecific_storage_a_p_dp_cap * N_p * w;
1070 storage_p_a_S_Jpp.noalias() -=
1071 N_p.transpose() * rho_LR *
1072 ((S_L - S_L_prev) * dspecific_storage_a_S_dp_cap +
1073 specific_storage_a_S * dS_L_dp_cap) /
1076 if (!_process_data.explicit_hm_coupling_in_unsaturated_zone)
1079 .template block<pressure_size, pressure_size>(pressure_index,
1081 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1082 identity2.transpose() * B * (u - u_prev) / dt *
1086 double const dk_rel_dS_l =
1087 medium->property(MPL::PropertyType::relative_permeability)
1088 .template dValue<double>(variables,
1089 MPL::Variable::liquid_saturation,
1092 grad_p_cap = -dNdx_p * p_L;
1094 .template block<pressure_size, pressure_size>(pressure_index,
1096 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1097 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1100 .template block<pressure_size, pressure_size>(pressure_index,
1102 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1103 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1105 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1106 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1108 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1110 double const alpha_bar = _process_data.micro_porosity_parameters
1111 ->mass_exchange_coefficient;
1112 auto const p_L_m = _ip_data[ip].liquid_pressure_m;
1113 local_rhs.template segment<pressure_size>(pressure_index)
1115 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1118 .template block<pressure_size, pressure_size>(pressure_index,
1120 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1121 if (p_cap_ip != p_cap_prev_ip)
1123 double const p_L_m_prev = _ip_data[ip].liquid_pressure_m_prev;
1125 .template block<pressure_size, pressure_size>(
1126 pressure_index, pressure_index)
1127 .noalias() += N_p.transpose() * alpha_bar / mu *
1128 (p_L_m - p_L_m_prev) /
1129 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1134 if (_process_data.apply_mass_lumping)
1136 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1137 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1139 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1144 .template block<pressure_size, pressure_size>(pressure_index,
1146 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1150 .template block<pressure_size, displacement_size>(pressure_index,
1152 .noalias() = Kpu / dt;
1155 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1157 (storage_p_a_p + storage_p_a_S) * (p_L - p_L_prev) / dt +
1158 Kpu * (u - u_prev) / dt;
1161 local_rhs.template segment<displacement_size>(displacement_index)
1162 .noalias() += Kup * p_L;
1165template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1166 int DisplacementDim>
1168 ShapeFunctionDisplacement, ShapeFunctionPressure,
1169 DisplacementDim>::getSigma()
const
1171 constexpr int kelvin_vector_size =
1174 return transposeInPlace<kelvin_vector_size>(
1175 [
this](std::vector<double>& values)
1176 {
return getIntPtSigma(0, {}, {}, values); });
1179template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1180 int DisplacementDim>
1182 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1185 std::vector<GlobalVector*>
const& ,
1186 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1187 std::vector<double>& cache)
const
1189 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
1190 _ip_data, &IpData::sigma_eff, cache);
1193template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1194 int DisplacementDim>
1196 ShapeFunctionDisplacement, ShapeFunctionPressure,
1197 DisplacementDim>::getSwellingStress()
const
1199 constexpr int kelvin_vector_size =
1202 return transposeInPlace<kelvin_vector_size>(
1203 [
this](std::vector<double>& values)
1204 {
return getIntPtSwellingStress(0, {}, {}, values); });
1207template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1208 int DisplacementDim>
1210 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1211 getIntPtSwellingStress(
1213 std::vector<GlobalVector*>
const& ,
1214 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1215 std::vector<double>& cache)
const
1217 constexpr int kelvin_vector_size =
1219 auto const n_integration_points = _ip_data.size();
1223 double, kelvin_vector_size, Eigen::Dynamic, Eigen::RowMajor>>(
1224 cache, kelvin_vector_size, n_integration_points);
1226 for (
unsigned ip = 0; ip < n_integration_points; ++ip)
1228 auto const& sigma_sw = _ip_data[ip].sigma_sw;
1236template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1237 int DisplacementDim>
1239 ShapeFunctionDisplacement, ShapeFunctionPressure,
1240 DisplacementDim>::getEpsilon()
const
1242 constexpr int kelvin_vector_size =
1245 return transposeInPlace<kelvin_vector_size>(
1246 [
this](std::vector<double>& values)
1247 {
return getIntPtEpsilon(0, {}, {}, values); });
1250template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1251 int DisplacementDim>
1253 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1256 std::vector<GlobalVector*>
const& ,
1257 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1258 std::vector<double>& cache)
const
1260 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
1261 _ip_data, &IpData::eps, cache);
1264template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1265 int DisplacementDim>
1267 ShapeFunctionPressure,
1268 DisplacementDim>::getMaterialID()
const
1270 return _process_data.material_ids ==
nullptr
1272 : (*_process_data.material_ids)[_element.getID()];
1275template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1276 int DisplacementDim>
1278 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1279 getMaterialStateVariableInternalState(
1280 std::function<std::span<double>(
1282 MaterialStateVariables&)>
const& get_values_span,
1283 int const& n_components)
const
1286 _ip_data, &IpData::material_state_variables, get_values_span,
1290template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1291 int DisplacementDim>
1293 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1294 getIntPtDarcyVelocity(
1296 std::vector<GlobalVector*>
const& ,
1297 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1298 std::vector<double>& cache)
const
1300 unsigned const n_integration_points =
1301 _integration_method.getNumberOfPoints();
1305 double, DisplacementDim, Eigen::Dynamic, Eigen::RowMajor>>(
1306 cache, DisplacementDim, n_integration_points);
1308 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1310 cache_matrix.col(ip).noalias() = _ip_data[ip].v_darcy;
1316template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1317 int DisplacementDim>
1319 ShapeFunctionDisplacement, ShapeFunctionPressure,
1320 DisplacementDim>::getSaturation()
const
1322 std::vector<double> result;
1323 getIntPtSaturation(0, {}, {}, result);
1327template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1328 int DisplacementDim>
1330 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1333 std::vector<GlobalVector*>
const& ,
1334 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1335 std::vector<double>& cache)
const
1338 _ip_data, &IpData::saturation, cache);
1341template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1342 int DisplacementDim>
1344 ShapeFunctionDisplacement, ShapeFunctionPressure,
1345 DisplacementDim>::getMicroSaturation()
const
1347 std::vector<double> result;
1348 getIntPtMicroSaturation(0, {}, {}, result);
1352template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1353 int DisplacementDim>
1355 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1356 getIntPtMicroSaturation(
1358 std::vector<GlobalVector*>
const& ,
1359 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1360 std::vector<double>& cache)
const
1363 _ip_data, &IpData::saturation_m, cache);
1366template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1367 int DisplacementDim>
1369 ShapeFunctionDisplacement, ShapeFunctionPressure,
1370 DisplacementDim>::getMicroPressure()
const
1372 std::vector<double> result;
1373 getIntPtMicroPressure(0, {}, {}, result);
1377template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1378 int DisplacementDim>
1380 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1381 getIntPtMicroPressure(
1383 std::vector<GlobalVector*>
const& ,
1384 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1385 std::vector<double>& cache)
const
1388 _ip_data, &IpData::liquid_pressure_m, cache);
1391template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1392 int DisplacementDim>
1394 ShapeFunctionDisplacement, ShapeFunctionPressure,
1395 DisplacementDim>::getPorosity()
const
1397 std::vector<double> result;
1398 getIntPtPorosity(0, {}, {}, result);
1402template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1403 int DisplacementDim>
1405 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1408 std::vector<GlobalVector*>
const& ,
1409 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1410 std::vector<double>& cache)
const
1413 &IpData::porosity, cache);
1416template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1417 int DisplacementDim>
1419 ShapeFunctionDisplacement, ShapeFunctionPressure,
1420 DisplacementDim>::getTransportPorosity()
const
1422 std::vector<double> result;
1423 getIntPtTransportPorosity(0, {}, {}, result);
1427template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1428 int DisplacementDim>
1430 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1431 getIntPtTransportPorosity(
1433 std::vector<GlobalVector*>
const& ,
1434 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1435 std::vector<double>& cache)
const
1438 _ip_data, &IpData::transport_porosity, cache);
1441template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1442 int DisplacementDim>
1444 ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim>::
1445 getIntPtDryDensitySolid(
1447 std::vector<GlobalVector*>
const& ,
1448 std::vector<NumLib::LocalToGlobalIndexMap const*>
const& ,
1449 std::vector<double>& cache)
const
1452 _ip_data, &IpData::dry_density_solid, cache);
1455template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1456 int DisplacementDim>
1458 ShapeFunctionPressure, DisplacementDim>::
1459 assembleWithJacobianForPressureEquations(
1460 const double ,
double const ,
1461 Eigen::VectorXd
const& ,
1462 Eigen::VectorXd
const& ,
1463 std::vector<double>& ,
1464 std::vector<double>& ,
1465 std::vector<double>& ,
1466 std::vector<double>& )
1468 OGS_FATAL(
"RichardsMechanics; The staggered scheme is not implemented.");
1471template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1472 int DisplacementDim>
1474 ShapeFunctionPressure, DisplacementDim>::
1475 assembleWithJacobianForDeformationEquations(
1476 const double ,
double const ,
1477 Eigen::VectorXd
const& ,
1478 Eigen::VectorXd
const& ,
1479 std::vector<double>& ,
1480 std::vector<double>& ,
1481 std::vector<double>& ,
1482 std::vector<double>& )
1484 OGS_FATAL(
"RichardsMechanics; The staggered scheme is not implemented.");
1487template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1488 int DisplacementDim>
1490 ShapeFunctionPressure, DisplacementDim>::
1491 assembleWithJacobianForStaggeredScheme(
1492 double const t,
double const dt, Eigen::VectorXd
const& local_x,
1493 Eigen::VectorXd
const& local_x_prev,
int const process_id,
1494 std::vector<double>& local_M_data, std::vector<double>& local_K_data,
1495 std::vector<double>& local_b_data, std::vector<double>& local_Jac_data)
1498 if (process_id == 0)
1500 assembleWithJacobianForPressureEquations(t, dt, local_x, local_x_prev,
1501 local_M_data, local_K_data,
1502 local_b_data, local_Jac_data);
1507 assembleWithJacobianForDeformationEquations(t, dt, local_x, local_x_prev,
1508 local_M_data, local_K_data,
1509 local_b_data, local_Jac_data);
1512template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1513 int DisplacementDim>
1515 ShapeFunctionPressure, DisplacementDim>::
1516 computeSecondaryVariableConcrete(
double const t,
double const dt,
1517 Eigen::VectorXd
const& local_x,
1518 Eigen::VectorXd
const& local_x_prev)
1520 auto p_L = local_x.template segment<pressure_size>(pressure_index);
1521 auto u = local_x.template segment<displacement_size>(displacement_index);
1524 local_x_prev.template segment<pressure_size>(pressure_index);
1526 local_x_prev.template segment<displacement_size>(displacement_index);
1530 DisplacementDim)>::identity2;
1532 auto const& medium = _process_data.media_map.getMedium(_element.getID());
1533 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
1534 auto const& solid_phase = medium->phase(
"Solid");
1541 unsigned const n_integration_points =
1542 _integration_method.getNumberOfPoints();
1544 double saturation_avg = 0;
1545 double porosity_avg = 0;
1548 KV sigma_avg = KV::Zero();
1550 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1553 auto const& N_p = _ip_data[ip].N_p;
1554 auto const& N_u = _ip_data[ip].N_u;
1555 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1557 auto const x_coord =
1563 ShapeFunctionDisplacement::NPOINTS,
1565 dNdx_u, N_u, x_coord, _is_axially_symmetric);
1570 double p_cap_prev_ip;
1576 auto const temperature =
1577 medium->property(MPL::PropertyType::reference_temperature)
1578 .template value<double>(variables, x_position, t, dt);
1581 auto& eps = _ip_data[ip].eps;
1582 eps.noalias() = B * u;
1583 auto& eps_m = _ip_data[ip].eps_m;
1584 auto& S_L = _ip_data[ip].saturation;
1585 auto const S_L_prev = _ip_data[ip].saturation_prev;
1586 S_L = medium->property(MPL::PropertyType::saturation)
1587 .template value<double>(variables, x_position, t, dt);
1591 auto const chi = [medium, x_position, t, dt](
double const S_L)
1595 return medium->property(MPL::PropertyType::bishops_effective_stress)
1596 .template value<double>(vs, x_position, t, dt);
1598 double const chi_S_L = chi(S_L);
1599 double const chi_S_L_prev = chi(S_L_prev);
1602 medium->property(MPL::PropertyType::biot_coefficient)
1603 .template value<double>(variables, x_position, t, dt);
1605 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
1606 t, x_position, dt, temperature);
1608 auto const beta_SR =
1610 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
1620 auto& phi = _ip_data[ip].porosity;
1622 variables_prev.
porosity = _ip_data[ip].porosity_prev;
1623 phi = medium->property(MPL::PropertyType::porosity)
1624 .template value<double>(variables, variables_prev,
1630 liquid_phase.property(MPL::PropertyType::density)
1631 .template value<double>(variables, x_position, t, dt);
1634 liquid_phase.property(MPL::PropertyType::viscosity)
1635 .template value<double>(variables, x_position, t, dt);
1638 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
1639 _ip_data[ip], *medium, solid_phase, C_el, rho_LR, mu,
1640 _process_data.micro_porosity_parameters, alpha, phi, p_cap_ip,
1641 variables, variables_prev, x_position, t, dt);
1643 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
1645 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
1648 _ip_data[ip].transport_porosity_prev;
1650 _ip_data[ip].transport_porosity =
1651 medium->property(MPL::PropertyType::transport_porosity)
1652 .template value<double>(variables, variables_prev,
1665 auto const sigma_total = (_ip_data[ip].sigma_eff +
1666 alpha * chi_S_L * identity2 * p_cap_ip)
1675 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
1677 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
1678 medium->property(MPL::PropertyType::permeability)
1679 .value(variables, x_position, t, dt));
1681 double const k_rel =
1682 medium->property(MPL::PropertyType::relative_permeability)
1683 .template value<double>(variables, x_position, t, dt);
1687 auto const& sigma_eff = _ip_data[ip].sigma_eff;
1688 double const p_FR = -chi_S_L * p_cap_ip;
1691 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1693 solid_phase.property(MPL::PropertyType::density)
1694 .template value<double>(variables, x_position, t, dt);
1695 _ip_data[ip].dry_density_solid = (1 - phi) * rho_SR;
1697 auto& sigma_sw = _ip_data[ip].sigma_sw;
1700 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1701 ? eps + C_el.inverse() * sigma_sw
1707 _ip_data[ip].updateConstitutiveRelation(variables, t, x_position, dt,
1710 auto const& b = _process_data.specific_body_force;
1713 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1714 _ip_data[ip].v_darcy.noalias() =
1715 -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1717 saturation_avg += S_L;
1718 porosity_avg += phi;
1719 sigma_avg += sigma_eff;
1721 saturation_avg /= n_integration_points;
1722 porosity_avg /= n_integration_points;
1723 sigma_avg /= n_integration_points;
1725 (*_process_data.element_saturation)[_element.getID()] = saturation_avg;
1726 (*_process_data.element_porosity)[_element.getID()] = porosity_avg;
1728 Eigen::Map<KV>(&(*_process_data.element_stresses)[_element.getID() *
1729 KV::RowsAtCompileTime]) =
1733 ShapeFunctionPressure,
typename ShapeFunctionDisplacement::MeshElement,
1734 DisplacementDim>(_element, _is_axially_symmetric, p_L,
1735 *_process_data.pressure_interpolated);
1738template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1739 int DisplacementDim>
1741 ShapeFunctionDisplacement, ShapeFunctionPressure,
1742 DisplacementDim>::getNumberOfIntegrationPoints()
const
1744 return _integration_method.getNumberOfPoints();
1747template <
typename ShapeFunctionDisplacement,
typename ShapeFunctionPressure,
1748 int DisplacementDim>
1750 DisplacementDim>::MaterialStateVariables
const&
1752 ShapeFunctionPressure, DisplacementDim>::
1753 getMaterialStateVariablesAt(
unsigned integration_point)
const
1755 return *_ip_data[integration_point].material_state_variables;
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Property const & property(PropertyType const &p) const
bool hasProperty(PropertyType const &p) const
Property const & property(PropertyType const &p) const
bool hasProperty(PropertyType const &p) const
double solid_grain_pressure
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > mechanical_strain
double transport_porosity
double grain_compressibility
double effective_pore_pressure
double equivalent_plastic_strain
double capillary_pressure
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > total_stress
virtual std::size_t getID() const final
Returns the ID of the element.
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
unsigned getNumberOfPoints() const
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
ShapeMatrixPolicyType< ShapeFunctionPressure, DisplacementDim > ShapeMatricesTypePressure
typename ShapeMatricesTypePressure::GlobalDimMatrixType GlobalDimMatrixType
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > _secondary_data
Eigen::Matrix< double, KelvinVectorSize, 1 > SymmetricTensor
ShapeMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > ShapeMatricesTypeDisplacement
NumLib::GenericIntegrationMethod const & _integration_method
MeshLib::Element const & _element
RichardsMechanicsProcessData< DisplacementDim > & _process_data
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
auto & selectSolidConstitutiveRelation(SolidMaterialsMap const &constitutive_relations, MeshLib::PropertyVector< int > const *const material_ids, std::size_t const element_id)
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
void interpolateToHigherOrderNodes(MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, const double radius, const bool is_axially_symmetric)
Fills a B-matrix based on given shape function dN/dx values.
void updateSwellingStressAndVolumetricStrain(IPData &ip_data, MaterialPropertyLib::Medium const &medium, MaterialPropertyLib::Phase const &solid_phase, MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > const &C_el, double const rho_LR, double const mu, std::optional< MicroPorosityParameters > micro_porosity_parameters, double const alpha, double const phi, double const p_cap_ip, MPL::VariableArray &variables, MPL::VariableArray &variables_prev, ParameterLib::SpatialPosition const &x_position, double const t, double const dt)
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)
std::size_t setIntegrationPointDataMaterialStateVariables(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span)
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)
void setIPDataInitialConditions(std::vector< std::unique_ptr< MeshLib::IntegrationPointWriter > > const &_integration_point_writer, MeshLib::Properties const &mesh_properties, LocalAssemblersVector &local_assemblers, bool const remove_name_suffix=false)
std::size_t setIntegrationPointScalarData(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType IpData::*const member)
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< GlobalDim > GlobalDimVectorType
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u