203 ShapeFunctionPressure, DisplacementDim>::
204 setInitialConditionsConcrete(Eigen::VectorXd
const local_x,
208 assert(local_x.size() == pressure_size + displacement_size);
210 auto const p_L = local_x.template segment<pressure_size>(pressure_index);
212 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
214 this->process_data_.media_map.getMedium(this->element_.getID());
220 auto const& solid_phase = medium->phase(
"Solid");
224 DisplacementDim)>::identity2;
226 unsigned const n_integration_points =
227 this->integration_method_.getNumberOfPoints();
228 for (
unsigned ip = 0; ip < n_integration_points; ip++)
232 auto const& N_p = _ip_data[ip].N_p;
244 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
246 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
247 **p_L_m_prev = -p_cap_ip;
251 auto const temperature =
252 medium->property(MPL::PropertyType::reference_temperature)
253 .template value<double>(variables, x_position, t, dt);
259 this->prev_states_[ip])
261 S_L_prev = medium->property(MPL::PropertyType::saturation)
262 .template value<double>(variables, x_position, t, dt);
264 if (this->process_data_.initial_stress.isTotalStress())
267 medium->property(MPL::PropertyType::biot_coefficient)
268 .template value<double>(variables, x_position, t, dt);
271 double const chi_S_L =
272 medium->property(MPL::PropertyType::bishops_effective_stress)
273 .template value<double>(variables, x_position, t, dt);
279 std::get<ProcessLib::ThermoRichardsMechanics::
280 ConstitutiveStress_StrainTemperature::
281 EffectiveStressData<DisplacementDim>>(
282 this->current_states_[ip]);
284 auto& sigma_eff_prev = std::get<
285 PrevState<ProcessLib::ThermoRichardsMechanics::
286 ConstitutiveStress_StrainTemperature::
287 EffectiveStressData<DisplacementDim>>>(
288 this->prev_states_[ip]);
291 sigma_eff.sigma_eff.noalias() +=
292 chi_S_L * alpha_b * (-p_cap_ip) * identity2;
293 sigma_eff_prev->sigma_eff = sigma_eff.sigma_eff;
296 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
301 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
303 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
305 *S_L_m = medium->property(MPL::PropertyType::saturation_micro)
306 .template value<double>(vars, x_position, t, dt);
312 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
313 t, x_position, dt, temperature, this->solid_material_,
314 *this->material_states_[ip].material_state_variables);
316 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
318 auto const& sigma_sw =
319 std::get<ProcessLib::ThermoRichardsMechanics::
320 ConstitutiveStress_StrainTemperature::
321 SwellingDataStateful<DisplacementDim>>(
322 this->current_states_[ip])
325 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
326 ConstitutiveStress_StrainTemperature::
327 MechanicalStrainData<DisplacementDim>>>(
328 this->prev_states_[ip])
331 eps_m_prev.noalias() =
332 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
333 ? eps + C_el.inverse() * sigma_sw
342 DisplacementDim>::assemble(
double const t,
double const dt,
343 std::vector<double>
const& local_x,
344 std::vector<double>
const& local_x_prev,
345 std::vector<double>& local_M_data,
346 std::vector<double>& local_K_data,
347 std::vector<double>& local_rhs_data)
349 assert(local_x.size() == pressure_size + displacement_size);
352 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
353 pressure_size>
const>(local_x.data() + pressure_index,
357 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
358 displacement_size>
const>(local_x.data() + displacement_index,
362 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
363 pressure_size>
const>(local_x_prev.data() + pressure_index,
367 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
368 displacement_size>
const>(local_x_prev.data() + displacement_index,
372 typename ShapeMatricesTypeDisplacement::template MatrixType<
373 displacement_size + pressure_size,
374 displacement_size + pressure_size>>(
375 local_K_data, displacement_size + pressure_size,
376 displacement_size + pressure_size);
379 typename ShapeMatricesTypeDisplacement::template MatrixType<
380 displacement_size + pressure_size,
381 displacement_size + pressure_size>>(
382 local_M_data, displacement_size + pressure_size,
383 displacement_size + pressure_size);
386 typename ShapeMatricesTypeDisplacement::template VectorType<
387 displacement_size + pressure_size>>(
388 local_rhs_data, displacement_size + pressure_size);
392 DisplacementDim)>::identity2;
395 this->process_data_.media_map.getMedium(this->element_.getID());
396 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
397 auto const& solid_phase = medium->phase(
"Solid");
404 unsigned const n_integration_points =
405 this->integration_method_.getNumberOfPoints();
406 for (
unsigned ip = 0; ip < n_integration_points; ip++)
409 auto const& w = _ip_data[ip].integration_weight;
411 auto const& N_u = _ip_data[ip].N_u;
412 auto const& dNdx_u = _ip_data[ip].dNdx_u;
414 auto const& N_p = _ip_data[ip].N_p;
415 auto const& dNdx_p = _ip_data[ip].dNdx_p;
420 this->element_, N_u);
423 ShapeFunctionDisplacement::NPOINTS,
425 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
428 std::get<StrainData<DisplacementDim>>(this->current_states_[ip]);
429 eps.eps.noalias() = B * u;
432 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
433 this->current_states_[ip])
435 auto const S_L_prev =
438 this->prev_states_[ip])
444 double p_cap_prev_ip;
453 auto const temperature =
454 medium->property(MPL::PropertyType::reference_temperature)
455 .template value<double>(variables, x_position, t, dt);
459 medium->property(MPL::PropertyType::biot_coefficient)
460 .template value<double>(variables, x_position, t, dt);
461 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
462 t, x_position, dt, temperature, this->solid_material_,
463 *this->material_states_[ip].material_state_variables);
465 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
466 t, x_position, &C_el);
470 liquid_phase.property(MPL::PropertyType::density)
471 .template value<double>(variables, x_position, t, dt);
474 auto const& b = this->process_data_.specific_body_force;
476 S_L = medium->property(MPL::PropertyType::saturation)
477 .template value<double>(variables, x_position, t, dt);
482 double const dS_L_dp_cap =
483 medium->property(MPL::PropertyType::saturation)
484 .template dValue<double>(variables,
485 MPL::Variable::capillary_pressure,
489 double const DeltaS_L_Deltap_cap =
490 (p_cap_ip == p_cap_prev_ip)
492 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
494 auto const chi = [medium, x_position, t, dt](
double const S_L)
498 return medium->property(MPL::PropertyType::bishops_effective_stress)
499 .template value<double>(vs, x_position, t, dt);
501 double const chi_S_L = chi(S_L);
502 double const chi_S_L_prev = chi(S_L_prev);
504 double const p_FR = -chi_S_L * p_cap_ip;
512 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
513 this->current_states_[ip])
516 auto const phi_prev = std::get<
PrevState<
518 this->prev_states_[ip])
521 phi = medium->property(MPL::PropertyType::porosity)
522 .template value<double>(variables, variables_prev,
530 "RichardsMechanics: Biot-coefficient {} is smaller than "
531 "porosity {} in element/integration point {}/{}.",
532 alpha, phi, this->element_.getID(), ip);
538 std::get<ProcessLib::ThermoRichardsMechanics::
539 ConstitutiveStress_StrainTemperature::
540 SwellingDataStateful<DisplacementDim>>(
541 this->current_states_[ip])
543 auto const& sigma_sw_prev = std::get<
PrevState<
544 ProcessLib::ThermoRichardsMechanics::
545 ConstitutiveStress_StrainTemperature::SwellingDataStateful<
546 DisplacementDim>>>(this->prev_states_[ip])
551 sigma_sw = sigma_sw_prev;
552 if (solid_phase.hasProperty(
553 MPL::PropertyType::swelling_stress_rate))
555 auto const sigma_sw_dot =
558 solid_phase[MPL::PropertyType::swelling_stress_rate]
559 .value(variables, variables_prev, x_position, t,
561 sigma_sw += sigma_sw_dot * dt;
566 identity2.transpose() * C_el.inverse() * sigma_sw;
568 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
571 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
573 auto& transport_porosity =
574 std::get<ProcessLib::ThermoRichardsMechanics::
575 TransportPorosityData>(
576 this->current_states_[ip])
578 auto const transport_porosity_prev =
579 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
580 TransportPorosityData>>(
581 this->prev_states_[ip])
586 medium->property(MPL::PropertyType::transport_porosity)
587 .template value<double>(variables, variables_prev,
598 medium->property(MPL::PropertyType::relative_permeability)
599 .template value<double>(variables, x_position, t, dt);
601 liquid_phase.property(MPL::PropertyType::viscosity)
602 .template value<double>(variables, x_position, t, dt);
604 auto const& sigma_sw =
605 std::get<ProcessLib::ThermoRichardsMechanics::
606 ConstitutiveStress_StrainTemperature::
607 SwellingDataStateful<DisplacementDim>>(
608 this->current_states_[ip])
610 auto const& sigma_eff =
611 std::get<ProcessLib::ThermoRichardsMechanics::
612 ConstitutiveStress_StrainTemperature::
613 EffectiveStressData<DisplacementDim>>(
614 this->current_states_[ip])
620 auto const sigma_total =
621 (sigma_eff - alpha * p_FR * identity2).eval();
630 this->material_states_[ip]
631 .material_state_variables->getEquivalentPlasticStrain();
634 medium->property(MPL::PropertyType::permeability)
635 .value(variables, x_position, t, dt));
638 K_intrinsic * rho_LR * k_rel / mu;
645 std::get<ProcessLib::ThermoRichardsMechanics::
646 ConstitutiveStress_StrainTemperature::
647 MechanicalStrainData<DisplacementDim>>(
648 this->current_states_[ip])
651 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
652 ? eps.eps + C_el.inverse() * sigma_sw
660 auto& SD = this->current_states_[ip];
661 auto const& SD_prev = this->prev_states_[ip];
663 std::get<ProcessLib::ThermoRichardsMechanics::
664 ConstitutiveStress_StrainTemperature::
665 EffectiveStressData<DisplacementDim>>(SD);
666 auto const& sigma_eff_prev = std::get<
667 PrevState<ProcessLib::ThermoRichardsMechanics::
668 ConstitutiveStress_StrainTemperature::
669 EffectiveStressData<DisplacementDim>>>(
672 std::get<ProcessLib::ThermoRichardsMechanics::
673 ConstitutiveStress_StrainTemperature::
674 MechanicalStrainData<DisplacementDim>>(SD);
675 auto& eps_m_prev = std::get<
676 PrevState<ProcessLib::ThermoRichardsMechanics::
677 ConstitutiveStress_StrainTemperature::
678 MechanicalStrainData<DisplacementDim>>>(
681 _ip_data[ip].updateConstitutiveRelation(
682 variables, t, x_position, dt, temperature, sigma_eff,
683 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
684 this->material_states_[ip].material_state_variables);
689 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
691 solid_phase.property(MPL::PropertyType::density)
692 .template value<double>(variables, x_position, t, dt);
697 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
698 rhs.template segment<displacement_size>(displacement_index).noalias() -=
699 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
706 liquid_phase.property(MPL::PropertyType::density)
707 .template dValue<double>(variables,
708 MPL::Variable::liquid_phase_pressure,
711 double const a0 = S_L * (alpha - phi) * beta_SR;
713 double const specific_storage =
714 DeltaS_L_Deltap_cap * (p_cap_ip * a0 - phi) +
715 S_L * (phi * beta_LR + a0);
716 M.template block<pressure_size, pressure_size>(pressure_index,
718 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
720 K.template block<pressure_size, pressure_size>(pressure_index,
722 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
724 rhs.template segment<pressure_size>(pressure_index).noalias() +=
725 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
730 K.template block<displacement_size, pressure_size>(displacement_index,
732 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
737 M.template block<pressure_size, displacement_size>(pressure_index,
739 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
740 identity2.transpose() * B * w;
743 if (this->process_data_.apply_mass_lumping)
745 auto Mpp = M.template block<pressure_size, pressure_size>(
746 pressure_index, pressure_index);
747 Mpp = Mpp.colwise().sum().eval().asDiagonal();
754 ShapeFunctionPressure, DisplacementDim>::
755 assembleWithJacobianEvalConstitutiveSetting(
756 double const t,
double const dt,
759 ShapeFunctionPressure,
760 DisplacementDim>::IpData& ip_data,
767 std::optional<MicroPorosityParameters>
const& micro_porosity_parameters,
773 auto const& liquid_phase = medium->
phase(
"AqueousLiquid");
774 auto const& solid_phase = medium->
phase(
"Solid");
778 DisplacementDim)>::identity2;
780 double const temperature = T_data();
781 double const p_cap_ip = p_cap_data.
p_cap;
782 double const p_cap_prev_ip = p_cap_data.
p_cap_prev;
784 auto const& eps = std::get<StrainData<DisplacementDim>>(SD);
786 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(SD).S_L;
787 auto const S_L_prev =
793 medium->
property(MPL::PropertyType::biot_coefficient)
794 .template value<double>(variables, x_position, t, dt);
795 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD) = alpha;
797 auto const C_el = ip_data.computeElasticTangentStiffness(
798 t, x_position, dt, temperature, solid_material,
802 (1 - alpha) / solid_material.
getBulkModulus(t, x_position, &C_el);
804 std::get<ProcessLib::ThermoRichardsMechanics::SolidCompressibilityData>(CD)
808 liquid_phase.property(MPL::PropertyType::density)
809 .template value<double>(variables, x_position, t, dt);
811 *std::get<LiquidDensity>(CD) = rho_LR;
813 S_L = medium->
property(MPL::PropertyType::saturation)
814 .template value<double>(variables, x_position, t, dt);
819 double const dS_L_dp_cap =
820 medium->
property(MPL::PropertyType::saturation)
821 .template dValue<double>(variables,
822 MPL::Variable::capillary_pressure,
824 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(CD)
825 .dS_L_dp_cap = dS_L_dp_cap;
828 double const DeltaS_L_Deltap_cap =
829 (p_cap_ip == p_cap_prev_ip)
831 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
832 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap =
835 auto const chi = [medium, x_position, t, dt](
double const S_L)
839 return medium->
property(MPL::PropertyType::bishops_effective_stress)
840 .template value<double>(vs, x_position, t, dt);
842 double const chi_S_L = chi(S_L);
843 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).chi_S_L =
845 double const chi_S_L_prev = chi(S_L_prev);
846 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::BishopsData>>(CD)
847 ->chi_S_L = chi_S_L_prev;
849 auto const dchi_dS_L =
850 medium->
property(MPL::PropertyType::bishops_effective_stress)
851 .template dValue<double>(
852 variables, MPL::Variable::liquid_saturation, x_position, t, dt);
853 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).dchi_dS_L =
856 double const p_FR = -chi_S_L * p_cap_ip;
868 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(SD).phi;
870 auto const phi_prev =
876 phi = medium->
property(MPL::PropertyType::porosity)
877 .template value<double>(variables, variables_prev, x_position,
881 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi = phi;
887 ?
static_cast<std::ptrdiff_t
>(*x_position.
getElementID())
888 :
static_cast<std::ptrdiff_t
>(-1);
892 :
static_cast<std::ptrdiff_t
>(-1);
894 "RichardsMechanics: Biot-coefficient {} is smaller than "
895 "porosity {} in element/integration point {}/{}.",
896 alpha, phi, eid, ip);
899 auto const mu = liquid_phase.property(MPL::PropertyType::viscosity)
900 .template value<double>(variables, x_position, t, dt);
901 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(CD) =
907 std::get<ProcessLib::ThermoRichardsMechanics::
908 ConstitutiveStress_StrainTemperature::
909 SwellingDataStateful<DisplacementDim>>(SD);
910 auto const& sigma_sw_prev =
911 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
912 ConstitutiveStress_StrainTemperature::
913 SwellingDataStateful<DisplacementDim>>>(
915 auto const transport_porosity_prev = std::get<
PrevState<
918 auto const phi_prev = std::get<
921 auto& transport_porosity = std::get<
923 auto& p_L_m = std::get<MicroPressure>(SD);
924 auto const p_L_m_prev = std::get<PrevState<MicroPressure>>(SD_prev);
925 auto& S_L_m = std::get<MicroSaturation>(SD);
926 auto const S_L_m_prev = std::get<PrevState<MicroSaturation>>(SD_prev);
929 *medium, solid_phase, C_el, rho_LR, mu, micro_porosity_parameters,
930 alpha, phi, p_cap_ip, variables, variables_prev, x_position, t, dt,
931 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
932 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
935 if (medium->
hasProperty(MPL::PropertyType::transport_porosity))
937 if (!medium->
hasProperty(MPL::PropertyType::saturation_micro))
939 auto& transport_porosity =
944 auto const transport_porosity_prev = std::get<
PrevState<
951 medium->
property(MPL::PropertyType::transport_porosity)
952 .template value<double>(variables, variables_prev,
966 auto const sigma_total =
967 (std::get<ProcessLib::ThermoRichardsMechanics::
968 ConstitutiveStress_StrainTemperature::
969 EffectiveStressData<DisplacementDim>>(SD)
971 alpha * p_FR * identity2)
980 ->getEquivalentPlasticStrain();
983 medium->
property(MPL::PropertyType::relative_permeability)
984 .template value<double>(variables, x_position, t, dt);
987 medium->
property(MPL::PropertyType::permeability)
988 .
value(variables, x_position, t, dt));
1005 std::get<ProcessLib::ThermoRichardsMechanics::
1006 ConstitutiveStress_StrainTemperature::
1007 SwellingDataStateful<DisplacementDim>>(SD)
1011 std::get<ProcessLib::ThermoRichardsMechanics::
1012 ConstitutiveStress_StrainTemperature::
1013 MechanicalStrainData<DisplacementDim>>(SD)
1016 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1017 ? eps.eps + C_el.inverse() * sigma_sw
1026 std::get<ProcessLib::ThermoRichardsMechanics::
1027 ConstitutiveStress_StrainTemperature::
1028 EffectiveStressData<DisplacementDim>>(SD);
1029 auto const& sigma_eff_prev =
1030 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
1031 ConstitutiveStress_StrainTemperature::
1032 EffectiveStressData<DisplacementDim>>>(
1035 std::get<ProcessLib::ThermoRichardsMechanics::
1036 ConstitutiveStress_StrainTemperature::
1037 MechanicalStrainData<DisplacementDim>>(SD);
1039 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
1040 ConstitutiveStress_StrainTemperature::
1041 MechanicalStrainData<DisplacementDim>>>(
1044 auto C = ip_data.updateConstitutiveRelation(
1045 variables, t, x_position, dt, temperature, sigma_eff,
1046 sigma_eff_prev, eps_m, eps_m_prev, solid_material,
1049 *std::get<StiffnessTensor<DisplacementDim>>(CD) = std::move(C);
1055 std::get<ProcessLib::ThermoRichardsMechanics::
1056 ConstitutiveStress_StrainTemperature::EffectiveStressData<
1057 DisplacementDim>>(SD)
1058 .sigma_eff.dot(identity2) /
1061 solid_phase.property(MPL::PropertyType::density)
1062 .template value<double>(variables, x_position, t, dt);
1064 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
1065 *std::get<Density>(CD) = rho;
1071 ShapeFunctionPressure, DisplacementDim>::
1072 assembleWithJacobian(
double const t,
double const dt,
1073 std::vector<double>
const& local_x,
1074 std::vector<double>
const& local_x_prev,
1075 std::vector<double>& local_rhs_data,
1076 std::vector<double>& local_Jac_data)
1078 assert(local_x.size() == pressure_size + displacement_size);
1081 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
1082 pressure_size>
const>(local_x.data() + pressure_index,
1086 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
1087 displacement_size>
const>(local_x.data() + displacement_index,
1091 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
1092 pressure_size>
const>(local_x_prev.data() + pressure_index,
1095 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
1096 displacement_size>
const>(local_x_prev.data() + displacement_index,
1100 typename ShapeMatricesTypeDisplacement::template MatrixType<
1101 displacement_size + pressure_size,
1102 displacement_size + pressure_size>>(
1103 local_Jac_data, displacement_size + pressure_size,
1104 displacement_size + pressure_size);
1107 typename ShapeMatricesTypeDisplacement::template VectorType<
1108 displacement_size + pressure_size>>(
1109 local_rhs_data, displacement_size + pressure_size);
1113 DisplacementDim)>::identity2;
1116 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1120 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1124 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1128 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1131 typename ShapeMatricesTypeDisplacement::template MatrixType<
1132 displacement_size, pressure_size>
1133 Kup = ShapeMatricesTypeDisplacement::template MatrixType<
1134 displacement_size, pressure_size>::Zero(displacement_size,
1137 typename ShapeMatricesTypeDisplacement::template MatrixType<
1138 pressure_size, displacement_size>
1139 Kpu = ShapeMatricesTypeDisplacement::template MatrixType<
1140 pressure_size, displacement_size>::Zero(pressure_size,
1143 auto const& medium =
1144 this->process_data_.media_map.getMedium(this->element_.getID());
1145 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
1146 auto const& solid_phase = medium->phase(
"Solid");
1153 unsigned const n_integration_points =
1154 this->integration_method_.getNumberOfPoints();
1155 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1158 auto& SD = this->current_states_[ip];
1159 auto const& SD_prev = this->prev_states_[ip];
1161 this->process_data_, this->solid_material_);
1164 auto const& w = _ip_data[ip].integration_weight;
1166 auto const& N_u = _ip_data[ip].N_u;
1167 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1169 auto const& N_p = _ip_data[ip].N_p;
1170 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1172 auto const x_coord =
1175 this->element_, N_u);
1178 ShapeFunctionDisplacement::NPOINTS,
1180 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1185 double p_cap_prev_ip;
1194 auto const temperature =
1195 medium->property(MPL::PropertyType::reference_temperature)
1196 .template value<double>(variables, x_position, t, dt);
1199 std::get<StrainData<DisplacementDim>>(SD).eps.noalias() = B * u;
1201 assembleWithJacobianEvalConstitutiveSetting(
1202 t, dt, x_position, _ip_data[ip], variables, variables_prev, medium,
1205 p_cap_ip, p_cap_prev_ip,
1206 Eigen::Vector<double, DisplacementDim>::Zero()},
1207 CD, SD, SD_prev, this->process_data_.micro_porosity_parameters,
1208 this->solid_material_, this->material_states_[ip]);
1211 auto const& C = *std::get<StiffnessTensor<DisplacementDim>>(CD);
1213 .template block<displacement_size, displacement_size>(
1214 displacement_index, displacement_index)
1215 .noalias() += B.transpose() * C * B * w;
1218 auto const& b = this->process_data_.specific_body_force;
1221 auto const& sigma_eff =
1222 std::get<ProcessLib::ThermoRichardsMechanics::
1223 ConstitutiveStress_StrainTemperature::
1224 EffectiveStressData<DisplacementDim>>(
1225 this->current_states_[ip])
1227 double const rho = *std::get<Density>(CD);
1228 local_rhs.template segment<displacement_size>(displacement_index)
1229 .noalias() -= (B.transpose() * sigma_eff -
1230 N_u_op(N_u).transpose() * rho * b) *
1238 double const alpha =
1239 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD);
1240 double const dS_L_dp_cap =
1241 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(
1246 double const chi_S_L =
1247 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1250 B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
1251 double const dchi_dS_L =
1252 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1256 .template block<displacement_size, pressure_size>(
1257 displacement_index, pressure_index)
1258 .noalias() -= B.transpose() * alpha *
1259 (chi_S_L + dchi_dS_L * p_cap_ip * dS_L_dp_cap) *
1260 identity2 * N_p * w;
1264 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi;
1265 double const rho_LR = *std::get<LiquidDensity>(CD);
1267 .template block<displacement_size, pressure_size>(
1268 displacement_index, pressure_index)
1270 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1281 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1282 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
1284 using DimMatrix = Eigen::Matrix<double, 3, 3>;
1285 auto const dsigma_sw_dS_L =
1288 .property(MPL::PropertyType::swelling_stress_rate)
1289 .
template dValue<DimMatrix>(
1290 variables, variables_prev,
1291 MPL::Variable::liquid_saturation, x_position, t,
1294 .template block<displacement_size, pressure_size>(
1295 displacement_index, pressure_index)
1297 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1303 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1304 this->current_states_[ip])
1306 if (this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1308 double const chi_S_L_prev = std::get<
PrevState<
1311 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1312 identity2.transpose() * B * w;
1316 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1317 identity2.transpose() * B * w;
1324 double const k_rel =
1326 DisplacementDim>>(CD)
1328 auto const& K_intrinsic =
1330 DisplacementDim>>(CD)
1333 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(
1338 laplace_p.noalias() +=
1339 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1341 auto const beta_LR =
1343 liquid_phase.property(MPL::PropertyType::density)
1344 .template dValue<double>(variables,
1345 MPL::Variable::liquid_phase_pressure,
1348 double const beta_SR =
1353 double const a0 = (alpha - phi) * beta_SR;
1354 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1355 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1357 double const dspecific_storage_a_p_dp_cap =
1358 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1359 double const dspecific_storage_a_S_dp_cap =
1360 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1362 storage_p_a_p.noalias() +=
1363 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1365 double const DeltaS_L_Deltap_cap =
1366 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap;
1367 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1368 specific_storage_a_S * DeltaS_L_Deltap_cap *
1372 .template block<pressure_size, pressure_size>(pressure_index,
1374 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1375 rho_LR * dspecific_storage_a_p_dp_cap * N_p * w;
1377 double const S_L_prev =
1380 this->prev_states_[ip])
1382 storage_p_a_S_Jpp.noalias() -=
1383 N_p.transpose() * rho_LR *
1384 ((S_L - S_L_prev) * dspecific_storage_a_S_dp_cap +
1385 specific_storage_a_S * dS_L_dp_cap) /
1388 if (!this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1391 .template block<pressure_size, pressure_size>(pressure_index,
1393 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1394 identity2.transpose() * B * (u - u_prev) / dt *
1398 double const dk_rel_dS_l =
1399 medium->property(MPL::PropertyType::relative_permeability)
1400 .template dValue<double>(variables,
1401 MPL::Variable::liquid_saturation,
1404 grad_p_cap = -dNdx_p * p_L;
1406 .template block<pressure_size, pressure_size>(pressure_index,
1408 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1409 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1412 .template block<pressure_size, pressure_size>(pressure_index,
1414 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1415 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1417 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1418 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1420 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1422 double const alpha_bar =
1423 this->process_data_.micro_porosity_parameters
1424 ->mass_exchange_coefficient;
1426 *std::get<MicroPressure>(this->current_states_[ip]);
1427 local_rhs.template segment<pressure_size>(pressure_index)
1429 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1432 .template block<pressure_size, pressure_size>(pressure_index,
1434 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1435 if (p_cap_ip != p_cap_prev_ip)
1437 auto const p_L_m_prev = **std::get<PrevState<MicroPressure>>(
1438 this->prev_states_[ip]);
1440 .template block<pressure_size, pressure_size>(
1441 pressure_index, pressure_index)
1442 .noalias() += N_p.transpose() * alpha_bar / mu *
1443 (p_L_m - p_L_m_prev) /
1444 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1449 if (this->process_data_.apply_mass_lumping)
1451 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1452 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1454 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1459 .template block<pressure_size, pressure_size>(pressure_index,
1461 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1465 .template block<pressure_size, displacement_size>(pressure_index,
1467 .noalias() = Kpu / dt;
1470 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1472 (storage_p_a_p + storage_p_a_S) * (p_L - p_L_prev) / dt +
1473 Kpu * (u - u_prev) / dt;
1476 local_rhs.template segment<displacement_size>(displacement_index)
1477 .noalias() += Kup * p_L;
1535 ShapeFunctionPressure, DisplacementDim>::
1536 computeSecondaryVariableConcrete(
double const t,
double const dt,
1537 Eigen::VectorXd
const& local_x,
1538 Eigen::VectorXd
const& local_x_prev)
1540 auto p_L = local_x.template segment<pressure_size>(pressure_index);
1541 auto u = local_x.template segment<displacement_size>(displacement_index);
1544 local_x_prev.template segment<pressure_size>(pressure_index);
1546 local_x_prev.template segment<displacement_size>(displacement_index);
1550 DisplacementDim)>::identity2;
1552 auto const& medium =
1553 this->process_data_.media_map.getMedium(this->element_.getID());
1554 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
1555 auto const& solid_phase = medium->phase(
"Solid");
1562 unsigned const n_integration_points =
1563 this->integration_method_.getNumberOfPoints();
1565 double saturation_avg = 0;
1566 double porosity_avg = 0;
1569 KV sigma_avg = KV::Zero();
1571 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1574 auto const& N_p = _ip_data[ip].N_p;
1575 auto const& N_u = _ip_data[ip].N_u;
1576 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1578 auto const x_coord =
1581 this->element_, N_u);
1584 ShapeFunctionDisplacement::NPOINTS,
1586 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1591 double p_cap_prev_ip;
1600 auto const temperature =
1601 medium->property(MPL::PropertyType::reference_temperature)
1602 .template value<double>(variables, x_position, t, dt);
1606 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
1608 eps.noalias() = B * u;
1610 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1611 this->current_states_[ip])
1613 auto const S_L_prev =
1616 this->prev_states_[ip])
1618 S_L = medium->property(MPL::PropertyType::saturation)
1619 .template value<double>(variables, x_position, t, dt);
1623 auto const chi = [medium, x_position, t, dt](
double const S_L)
1627 return medium->property(MPL::PropertyType::bishops_effective_stress)
1628 .template value<double>(vs, x_position, t, dt);
1630 double const chi_S_L = chi(S_L);
1631 double const chi_S_L_prev = chi(S_L_prev);
1634 medium->property(MPL::PropertyType::biot_coefficient)
1635 .template value<double>(variables, x_position, t, dt);
1637 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
1638 t, x_position, dt, temperature, this->solid_material_,
1639 *this->material_states_[ip].material_state_variables);
1641 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
1642 t, x_position, &C_el);
1652 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
1653 this->current_states_[ip])
1656 auto const phi_prev = std::get<
PrevState<
1658 this->prev_states_[ip])
1660 variables_prev.
porosity = phi_prev;
1661 phi = medium->property(MPL::PropertyType::porosity)
1662 .template value<double>(variables, variables_prev,
1668 liquid_phase.property(MPL::PropertyType::density)
1669 .template value<double>(variables, x_position, t, dt);
1672 liquid_phase.property(MPL::PropertyType::viscosity)
1673 .template value<double>(variables, x_position, t, dt);
1678 std::get<ProcessLib::ThermoRichardsMechanics::
1679 ConstitutiveStress_StrainTemperature::
1680 SwellingDataStateful<DisplacementDim>>(
1681 this->current_states_[ip]);
1682 auto const& sigma_sw_prev = std::get<
1683 PrevState<ProcessLib::ThermoRichardsMechanics::
1684 ConstitutiveStress_StrainTemperature::
1685 SwellingDataStateful<DisplacementDim>>>(
1686 this->prev_states_[ip]);
1687 auto const transport_porosity_prev = std::get<
PrevState<
1689 this->prev_states_[ip]);
1690 auto const phi_prev = std::get<
1692 this->prev_states_[ip]);
1693 auto& transport_porosity = std::get<
1695 this->current_states_[ip]);
1696 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
1697 auto const p_L_m_prev =
1698 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
1699 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
1700 auto const S_L_m_prev =
1701 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
1704 *medium, solid_phase, C_el, rho_LR, mu,
1705 this->process_data_.micro_porosity_parameters, alpha, phi,
1706 p_cap_ip, variables, variables_prev, x_position, t, dt,
1707 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
1708 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
1711 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
1713 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
1715 auto& transport_porosity =
1716 std::get<ProcessLib::ThermoRichardsMechanics::
1717 TransportPorosityData>(
1718 this->current_states_[ip])
1720 auto const transport_porosity_prev =
1721 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
1722 TransportPorosityData>>(
1723 this->prev_states_[ip])
1728 transport_porosity =
1729 medium->property(MPL::PropertyType::transport_porosity)
1730 .template value<double>(variables, variables_prev,
1740 auto const& sigma_eff =
1741 std::get<ProcessLib::ThermoRichardsMechanics::
1742 ConstitutiveStress_StrainTemperature::
1743 EffectiveStressData<DisplacementDim>>(
1744 this->current_states_[ip])
1750 auto const sigma_total =
1751 (sigma_eff + alpha * chi_S_L * identity2 * p_cap_ip).eval();
1759 this->material_states_[ip]
1760 .material_state_variables->getEquivalentPlasticStrain();
1763 medium->property(MPL::PropertyType::permeability)
1764 .value(variables, x_position, t, dt));
1766 double const k_rel =
1767 medium->property(MPL::PropertyType::relative_permeability)
1768 .template value<double>(variables, x_position, t, dt);
1772 double const p_FR = -chi_S_L * p_cap_ip;
1775 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1777 solid_phase.property(MPL::PropertyType::density)
1778 .template value<double>(variables, x_position, t, dt);
1779 *std::get<DrySolidDensity>(this->output_data_[ip]) = (1 - phi) * rho_SR;
1782 auto& SD = this->current_states_[ip];
1783 auto const& sigma_sw =
1784 std::get<ProcessLib::ThermoRichardsMechanics::
1785 ConstitutiveStress_StrainTemperature::
1786 SwellingDataStateful<DisplacementDim>>(SD)
1789 std::get<ProcessLib::ThermoRichardsMechanics::
1790 ConstitutiveStress_StrainTemperature::
1791 MechanicalStrainData<DisplacementDim>>(SD)
1794 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1795 ? eps + C_el.inverse() * sigma_sw
1803 auto& SD = this->current_states_[ip];
1804 auto const& SD_prev = this->prev_states_[ip];
1806 std::get<ProcessLib::ThermoRichardsMechanics::
1807 ConstitutiveStress_StrainTemperature::
1808 EffectiveStressData<DisplacementDim>>(SD);
1809 auto const& sigma_eff_prev = std::get<
1810 PrevState<ProcessLib::ThermoRichardsMechanics::
1811 ConstitutiveStress_StrainTemperature::
1812 EffectiveStressData<DisplacementDim>>>(
1815 std::get<ProcessLib::ThermoRichardsMechanics::
1816 ConstitutiveStress_StrainTemperature::
1817 MechanicalStrainData<DisplacementDim>>(SD);
1818 auto const& eps_m_prev = std::get<
1819 PrevState<ProcessLib::ThermoRichardsMechanics::
1820 ConstitutiveStress_StrainTemperature::
1821 MechanicalStrainData<DisplacementDim>>>(
1824 _ip_data[ip].updateConstitutiveRelation(
1825 variables, t, x_position, dt, temperature, sigma_eff,
1826 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
1827 this->material_states_[ip].material_state_variables);
1830 auto const& b = this->process_data_.specific_body_force;
1833 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1836 this->output_data_[ip])
1837 ->noalias() = -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1839 saturation_avg += S_L;
1840 porosity_avg += phi;
1841 sigma_avg += sigma_eff;
1843 saturation_avg /= n_integration_points;
1844 porosity_avg /= n_integration_points;
1845 sigma_avg /= n_integration_points;
1847 (*this->process_data_.element_saturation)[this->element_.getID()] =
1849 (*this->process_data_.element_porosity)[this->element_.getID()] =
1853 &(*this->process_data_.element_stresses)[this->element_.getID() *
1854 KV::RowsAtCompileTime]) =
1858 ShapeFunctionPressure,
typename ShapeFunctionDisplacement::MeshElement,
1859 DisplacementDim>(this->element_, this->is_axially_symmetric_, p_L,
1860 *this->process_data_.pressure_interpolated);