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");
222 unsigned const n_integration_points =
223 this->integration_method_.getNumberOfPoints();
224 for (
unsigned ip = 0; ip < n_integration_points; ip++)
228 auto const& N_p = _ip_data[ip].N_p;
240 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
242 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
243 **p_L_m_prev = -p_cap_ip;
247 auto const temperature =
248 medium->property(MPL::PropertyType::reference_temperature)
249 .template value<double>(variables, x_position, t, dt);
255 this->prev_states_[ip])
257 S_L_prev = medium->property(MPL::PropertyType::saturation)
258 .template value<double>(variables, x_position, t, dt);
260 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
265 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
267 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
269 *S_L_m = medium->property(MPL::PropertyType::saturation_micro)
270 .template value<double>(vars, x_position, t, dt);
276 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
277 t, x_position, dt, temperature, this->solid_material_,
278 *this->material_states_[ip].material_state_variables);
280 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
282 auto const& sigma_sw =
283 std::get<ProcessLib::ThermoRichardsMechanics::
284 ConstitutiveStress_StrainTemperature::
285 SwellingDataStateful<DisplacementDim>>(
286 this->current_states_[ip])
289 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
290 ConstitutiveStress_StrainTemperature::
291 MechanicalStrainData<DisplacementDim>>>(
292 this->prev_states_[ip])
295 eps_m_prev.noalias() =
296 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
297 ? eps + C_el.inverse() * sigma_sw
306 DisplacementDim>::assemble(
double const t,
double const dt,
307 std::vector<double>
const& local_x,
308 std::vector<double>
const& local_x_prev,
309 std::vector<double>& local_M_data,
310 std::vector<double>& local_K_data,
311 std::vector<double>& local_rhs_data)
313 assert(local_x.size() == pressure_size + displacement_size);
316 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
317 pressure_size>
const>(local_x.data() + pressure_index,
321 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
322 displacement_size>
const>(local_x.data() + displacement_index,
326 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
327 pressure_size>
const>(local_x_prev.data() + pressure_index,
331 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
332 displacement_size>
const>(local_x_prev.data() + displacement_index,
336 typename ShapeMatricesTypeDisplacement::template MatrixType<
337 displacement_size + pressure_size,
338 displacement_size + pressure_size>>(
339 local_K_data, displacement_size + pressure_size,
340 displacement_size + pressure_size);
343 typename ShapeMatricesTypeDisplacement::template MatrixType<
344 displacement_size + pressure_size,
345 displacement_size + pressure_size>>(
346 local_M_data, displacement_size + pressure_size,
347 displacement_size + pressure_size);
350 typename ShapeMatricesTypeDisplacement::template VectorType<
351 displacement_size + pressure_size>>(
352 local_rhs_data, displacement_size + pressure_size);
356 DisplacementDim)>::identity2;
359 this->process_data_.media_map.getMedium(this->element_.getID());
360 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
361 auto const& solid_phase = medium->phase(
"Solid");
368 unsigned const n_integration_points =
369 this->integration_method_.getNumberOfPoints();
370 for (
unsigned ip = 0; ip < n_integration_points; ip++)
373 auto const& w = _ip_data[ip].integration_weight;
375 auto const& N_u = _ip_data[ip].N_u;
376 auto const& dNdx_u = _ip_data[ip].dNdx_u;
378 auto const& N_p = _ip_data[ip].N_p;
379 auto const& dNdx_p = _ip_data[ip].dNdx_p;
384 this->element_, N_u);
387 ShapeFunctionDisplacement::NPOINTS,
389 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
392 std::get<StrainData<DisplacementDim>>(this->current_states_[ip]);
393 eps.eps.noalias() = B * u;
396 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
397 this->current_states_[ip])
399 auto const S_L_prev =
402 this->prev_states_[ip])
408 double p_cap_prev_ip;
417 auto const temperature =
418 medium->property(MPL::PropertyType::reference_temperature)
419 .template value<double>(variables, x_position, t, dt);
423 medium->property(MPL::PropertyType::biot_coefficient)
424 .template value<double>(variables, x_position, t, dt);
425 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
426 t, x_position, dt, temperature, this->solid_material_,
427 *this->material_states_[ip].material_state_variables);
429 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
430 t, x_position, &C_el);
434 liquid_phase.property(MPL::PropertyType::density)
435 .template value<double>(variables, x_position, t, dt);
438 auto const& b = this->process_data_.specific_body_force;
440 S_L = medium->property(MPL::PropertyType::saturation)
441 .template value<double>(variables, x_position, t, dt);
446 double const dS_L_dp_cap =
447 medium->property(MPL::PropertyType::saturation)
448 .template dValue<double>(variables,
449 MPL::Variable::capillary_pressure,
453 double const DeltaS_L_Deltap_cap =
454 (p_cap_ip == p_cap_prev_ip)
456 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
458 auto const chi = [medium, x_position, t, dt](
double const S_L)
462 return medium->property(MPL::PropertyType::bishops_effective_stress)
463 .template value<double>(vs, x_position, t, dt);
465 double const chi_S_L = chi(S_L);
466 double const chi_S_L_prev = chi(S_L_prev);
468 double const p_FR = -chi_S_L * p_cap_ip;
476 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
477 this->current_states_[ip])
480 auto const phi_prev = std::get<
PrevState<
482 this->prev_states_[ip])
485 phi = medium->property(MPL::PropertyType::porosity)
486 .template value<double>(variables, variables_prev,
494 "RichardsMechanics: Biot-coefficient {} is smaller than "
495 "porosity {} in element/integration point {}/{}.",
496 alpha, phi, this->element_.getID(), ip);
502 std::get<ProcessLib::ThermoRichardsMechanics::
503 ConstitutiveStress_StrainTemperature::
504 SwellingDataStateful<DisplacementDim>>(
505 this->current_states_[ip])
507 auto const& sigma_sw_prev = std::get<
PrevState<
508 ProcessLib::ThermoRichardsMechanics::
509 ConstitutiveStress_StrainTemperature::SwellingDataStateful<
510 DisplacementDim>>>(this->prev_states_[ip])
515 sigma_sw = sigma_sw_prev;
516 if (solid_phase.hasProperty(
517 MPL::PropertyType::swelling_stress_rate))
519 auto const sigma_sw_dot =
520 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
522 solid_phase[MPL::PropertyType::swelling_stress_rate]
523 .value(variables, variables_prev, x_position, t,
525 sigma_sw += sigma_sw_dot * dt;
530 identity2.transpose() * C_el.inverse() * sigma_sw;
532 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
535 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
537 auto& transport_porosity =
538 std::get<ProcessLib::ThermoRichardsMechanics::
539 TransportPorosityData>(
540 this->current_states_[ip])
542 auto const transport_porosity_prev =
543 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
544 TransportPorosityData>>(
545 this->prev_states_[ip])
550 medium->property(MPL::PropertyType::transport_porosity)
551 .template value<double>(variables, variables_prev,
562 medium->property(MPL::PropertyType::relative_permeability)
563 .template value<double>(variables, x_position, t, dt);
565 liquid_phase.property(MPL::PropertyType::viscosity)
566 .template value<double>(variables, x_position, t, dt);
568 auto const& sigma_sw =
569 std::get<ProcessLib::ThermoRichardsMechanics::
570 ConstitutiveStress_StrainTemperature::
571 SwellingDataStateful<DisplacementDim>>(
572 this->current_states_[ip])
574 auto const& sigma_eff =
575 std::get<ProcessLib::ThermoRichardsMechanics::
576 ConstitutiveStress_StrainTemperature::
577 EffectiveStressData<DisplacementDim>>(
578 this->current_states_[ip])
584 auto const sigma_total =
585 (sigma_eff - alpha * p_FR * identity2).eval();
594 this->material_states_[ip]
595 .material_state_variables->getEquivalentPlasticStrain();
597 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
598 medium->property(MPL::PropertyType::permeability)
599 .value(variables, x_position, t, dt));
602 K_intrinsic * rho_LR * k_rel / mu;
609 std::get<ProcessLib::ThermoRichardsMechanics::
610 ConstitutiveStress_StrainTemperature::
611 MechanicalStrainData<DisplacementDim>>(
612 this->current_states_[ip])
615 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
616 ? eps.eps + C_el.inverse() * sigma_sw
624 auto& SD = this->current_states_[ip];
625 auto const& SD_prev = this->prev_states_[ip];
627 std::get<ProcessLib::ThermoRichardsMechanics::
628 ConstitutiveStress_StrainTemperature::
629 EffectiveStressData<DisplacementDim>>(SD);
630 auto const& sigma_eff_prev = std::get<
631 PrevState<ProcessLib::ThermoRichardsMechanics::
632 ConstitutiveStress_StrainTemperature::
633 EffectiveStressData<DisplacementDim>>>(
636 std::get<ProcessLib::ThermoRichardsMechanics::
637 ConstitutiveStress_StrainTemperature::
638 MechanicalStrainData<DisplacementDim>>(SD);
639 auto& eps_m_prev = std::get<
640 PrevState<ProcessLib::ThermoRichardsMechanics::
641 ConstitutiveStress_StrainTemperature::
642 MechanicalStrainData<DisplacementDim>>>(
645 _ip_data[ip].updateConstitutiveRelation(
646 variables, t, x_position, dt, temperature, sigma_eff,
647 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
648 this->material_states_[ip].material_state_variables);
653 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
655 solid_phase.property(MPL::PropertyType::density)
656 .template value<double>(variables, x_position, t, dt);
661 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
662 rhs.template segment<displacement_size>(displacement_index).noalias() -=
663 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
670 liquid_phase.property(MPL::PropertyType::density)
671 .template dValue<double>(variables,
672 MPL::Variable::liquid_phase_pressure,
675 double const a0 = S_L * (alpha - phi) * beta_SR;
677 double const specific_storage =
678 DeltaS_L_Deltap_cap * (p_cap_ip * a0 - phi) +
679 S_L * (phi * beta_LR + a0);
680 M.template block<pressure_size, pressure_size>(pressure_index,
682 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
684 K.template block<pressure_size, pressure_size>(pressure_index,
686 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
688 rhs.template segment<pressure_size>(pressure_index).noalias() +=
689 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
694 K.template block<displacement_size, pressure_size>(displacement_index,
696 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
701 M.template block<pressure_size, displacement_size>(pressure_index,
703 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
704 identity2.transpose() * B * w;
707 if (this->process_data_.apply_mass_lumping)
709 auto Mpp = M.template block<pressure_size, pressure_size>(
710 pressure_index, pressure_index);
711 Mpp = Mpp.colwise().sum().eval().asDiagonal();
718 ShapeFunctionPressure, DisplacementDim>::
719 assembleWithJacobianEvalConstitutiveSetting(
720 double const t,
double const dt,
723 ShapeFunctionPressure,
724 DisplacementDim>::IpData& ip_data,
731 std::optional<MicroPorosityParameters>
const& micro_porosity_parameters,
737 auto const& liquid_phase = medium->
phase(
"AqueousLiquid");
738 auto const& solid_phase = medium->
phase(
"Solid");
742 DisplacementDim)>::identity2;
744 double const temperature = T_data();
745 double const p_cap_ip = p_cap_data.
p_cap;
746 double const p_cap_prev_ip = p_cap_data.
p_cap_prev;
748 auto const& eps = std::get<StrainData<DisplacementDim>>(SD);
750 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(SD).S_L;
751 auto const S_L_prev =
757 medium->
property(MPL::PropertyType::biot_coefficient)
758 .template value<double>(variables, x_position, t, dt);
759 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD) = alpha;
761 auto const C_el = ip_data.computeElasticTangentStiffness(
762 t, x_position, dt, temperature, solid_material,
766 (1 - alpha) / solid_material.
getBulkModulus(t, x_position, &C_el);
768 std::get<ProcessLib::ThermoRichardsMechanics::SolidCompressibilityData>(CD)
772 liquid_phase.property(MPL::PropertyType::density)
773 .template value<double>(variables, x_position, t, dt);
775 *std::get<LiquidDensity>(CD) = rho_LR;
777 S_L = medium->
property(MPL::PropertyType::saturation)
778 .template value<double>(variables, x_position, t, dt);
783 double const dS_L_dp_cap =
784 medium->
property(MPL::PropertyType::saturation)
785 .template dValue<double>(variables,
786 MPL::Variable::capillary_pressure,
788 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(CD)
789 .dS_L_dp_cap = dS_L_dp_cap;
792 double const DeltaS_L_Deltap_cap =
793 (p_cap_ip == p_cap_prev_ip)
795 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
796 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap =
799 auto const chi = [medium, x_position, t, dt](
double const S_L)
803 return medium->
property(MPL::PropertyType::bishops_effective_stress)
804 .template value<double>(vs, x_position, t, dt);
806 double const chi_S_L = chi(S_L);
807 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).chi_S_L =
809 double const chi_S_L_prev = chi(S_L_prev);
810 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::BishopsData>>(CD)
811 ->chi_S_L = chi_S_L_prev;
813 auto const dchi_dS_L =
814 medium->
property(MPL::PropertyType::bishops_effective_stress)
815 .template dValue<double>(
816 variables, MPL::Variable::liquid_saturation, x_position, t, dt);
817 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).dchi_dS_L =
820 double const p_FR = -chi_S_L * p_cap_ip;
832 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(SD).phi;
834 auto const phi_prev =
840 phi = medium->
property(MPL::PropertyType::porosity)
841 .template value<double>(variables, variables_prev, x_position,
845 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi = phi;
851 ?
static_cast<std::ptrdiff_t
>(*x_position.
getElementID())
852 :
static_cast<std::ptrdiff_t
>(-1);
856 :
static_cast<std::ptrdiff_t
>(-1);
858 "RichardsMechanics: Biot-coefficient {} is smaller than "
859 "porosity {} in element/integration point {}/{}.",
860 alpha, phi, eid, ip);
863 auto const mu = liquid_phase.property(MPL::PropertyType::viscosity)
864 .template value<double>(variables, x_position, t, dt);
865 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(CD) =
871 std::get<ProcessLib::ThermoRichardsMechanics::
872 ConstitutiveStress_StrainTemperature::
873 SwellingDataStateful<DisplacementDim>>(SD);
874 auto const& sigma_sw_prev =
875 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
876 ConstitutiveStress_StrainTemperature::
877 SwellingDataStateful<DisplacementDim>>>(
879 auto const transport_porosity_prev = std::get<
PrevState<
882 auto const phi_prev = std::get<
885 auto& transport_porosity = std::get<
887 auto& p_L_m = std::get<MicroPressure>(SD);
888 auto const p_L_m_prev = std::get<PrevState<MicroPressure>>(SD_prev);
889 auto& S_L_m = std::get<MicroSaturation>(SD);
890 auto const S_L_m_prev = std::get<PrevState<MicroSaturation>>(SD_prev);
892 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
893 *medium, solid_phase, C_el, rho_LR, mu, micro_porosity_parameters,
894 alpha, phi, p_cap_ip, variables, variables_prev, x_position, t, dt,
895 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
896 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
899 if (medium->
hasProperty(MPL::PropertyType::transport_porosity))
901 if (!medium->
hasProperty(MPL::PropertyType::saturation_micro))
903 auto& transport_porosity =
908 auto const transport_porosity_prev = std::get<
PrevState<
915 medium->
property(MPL::PropertyType::transport_porosity)
916 .template value<double>(variables, variables_prev,
930 auto const sigma_total =
931 (std::get<ProcessLib::ThermoRichardsMechanics::
932 ConstitutiveStress_StrainTemperature::
933 EffectiveStressData<DisplacementDim>>(SD)
935 alpha * p_FR * identity2)
944 ->getEquivalentPlasticStrain();
947 medium->
property(MPL::PropertyType::relative_permeability)
948 .template value<double>(variables, x_position, t, dt);
950 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
951 medium->
property(MPL::PropertyType::permeability)
952 .
value(variables, x_position, t, dt));
969 std::get<ProcessLib::ThermoRichardsMechanics::
970 ConstitutiveStress_StrainTemperature::
971 SwellingDataStateful<DisplacementDim>>(SD)
975 std::get<ProcessLib::ThermoRichardsMechanics::
976 ConstitutiveStress_StrainTemperature::
977 MechanicalStrainData<DisplacementDim>>(SD)
980 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
981 ? eps.eps + C_el.inverse() * sigma_sw
990 std::get<ProcessLib::ThermoRichardsMechanics::
991 ConstitutiveStress_StrainTemperature::
992 EffectiveStressData<DisplacementDim>>(SD);
993 auto const& sigma_eff_prev =
994 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
995 ConstitutiveStress_StrainTemperature::
996 EffectiveStressData<DisplacementDim>>>(
999 std::get<ProcessLib::ThermoRichardsMechanics::
1000 ConstitutiveStress_StrainTemperature::
1001 MechanicalStrainData<DisplacementDim>>(SD);
1003 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
1004 ConstitutiveStress_StrainTemperature::
1005 MechanicalStrainData<DisplacementDim>>>(
1008 auto C = ip_data.updateConstitutiveRelation(
1009 variables, t, x_position, dt, temperature, sigma_eff,
1010 sigma_eff_prev, eps_m, eps_m_prev, solid_material,
1013 *std::get<StiffnessTensor<DisplacementDim>>(CD) = std::move(C);
1019 std::get<ProcessLib::ThermoRichardsMechanics::
1020 ConstitutiveStress_StrainTemperature::EffectiveStressData<
1021 DisplacementDim>>(SD)
1022 .sigma_eff.dot(identity2) /
1025 solid_phase.property(MPL::PropertyType::density)
1026 .template value<double>(variables, x_position, t, dt);
1028 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
1029 *std::get<Density>(CD) = rho;
1035 ShapeFunctionPressure, DisplacementDim>::
1036 assembleWithJacobian(
double const t,
double const dt,
1037 std::vector<double>
const& local_x,
1038 std::vector<double>
const& local_x_prev,
1039 std::vector<double>& local_rhs_data,
1040 std::vector<double>& local_Jac_data)
1042 assert(local_x.size() == pressure_size + displacement_size);
1045 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
1046 pressure_size>
const>(local_x.data() + pressure_index,
1050 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
1051 displacement_size>
const>(local_x.data() + displacement_index,
1055 Eigen::Map<
typename ShapeMatricesTypePressure::template VectorType<
1056 pressure_size>
const>(local_x_prev.data() + pressure_index,
1059 Eigen::Map<
typename ShapeMatricesTypeDisplacement::template VectorType<
1060 displacement_size>
const>(local_x_prev.data() + displacement_index,
1064 typename ShapeMatricesTypeDisplacement::template MatrixType<
1065 displacement_size + pressure_size,
1066 displacement_size + pressure_size>>(
1067 local_Jac_data, displacement_size + pressure_size,
1068 displacement_size + pressure_size);
1071 typename ShapeMatricesTypeDisplacement::template VectorType<
1072 displacement_size + pressure_size>>(
1073 local_rhs_data, displacement_size + pressure_size);
1077 DisplacementDim)>::identity2;
1080 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1084 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1088 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1092 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1095 typename ShapeMatricesTypeDisplacement::template MatrixType<
1096 displacement_size, pressure_size>
1097 Kup = ShapeMatricesTypeDisplacement::template MatrixType<
1098 displacement_size, pressure_size>::Zero(displacement_size,
1101 typename ShapeMatricesTypeDisplacement::template MatrixType<
1102 pressure_size, displacement_size>
1103 Kpu = ShapeMatricesTypeDisplacement::template MatrixType<
1104 pressure_size, displacement_size>::Zero(pressure_size,
1107 auto const& medium =
1108 this->process_data_.media_map.getMedium(this->element_.getID());
1109 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
1110 auto const& solid_phase = medium->phase(
"Solid");
1117 unsigned const n_integration_points =
1118 this->integration_method_.getNumberOfPoints();
1119 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1122 auto& SD = this->current_states_[ip];
1123 auto const& SD_prev = this->prev_states_[ip];
1125 this->process_data_, this->solid_material_);
1128 auto const& w = _ip_data[ip].integration_weight;
1130 auto const& N_u = _ip_data[ip].N_u;
1131 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1133 auto const& N_p = _ip_data[ip].N_p;
1134 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1136 auto const x_coord =
1139 this->element_, N_u);
1142 ShapeFunctionDisplacement::NPOINTS,
1144 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1149 double p_cap_prev_ip;
1158 auto const temperature =
1159 medium->property(MPL::PropertyType::reference_temperature)
1160 .template value<double>(variables, x_position, t, dt);
1163 std::get<StrainData<DisplacementDim>>(SD).eps.noalias() = B * u;
1165 assembleWithJacobianEvalConstitutiveSetting(
1166 t, dt, x_position, _ip_data[ip], variables, variables_prev, medium,
1169 p_cap_ip, p_cap_prev_ip,
1170 Eigen::Vector<double, DisplacementDim>::Zero()},
1171 CD, SD, SD_prev, this->process_data_.micro_porosity_parameters,
1172 this->solid_material_, this->material_states_[ip]);
1175 auto const& C = *std::get<StiffnessTensor<DisplacementDim>>(CD);
1177 .template block<displacement_size, displacement_size>(
1178 displacement_index, displacement_index)
1179 .noalias() += B.transpose() * C * B * w;
1182 auto const& b = this->process_data_.specific_body_force;
1185 auto const& sigma_eff =
1186 std::get<ProcessLib::ThermoRichardsMechanics::
1187 ConstitutiveStress_StrainTemperature::
1188 EffectiveStressData<DisplacementDim>>(
1189 this->current_states_[ip])
1191 double const rho = *std::get<Density>(CD);
1192 local_rhs.template segment<displacement_size>(displacement_index)
1193 .noalias() -= (B.transpose() * sigma_eff -
1194 N_u_op(N_u).transpose() * rho * b) *
1202 double const alpha =
1203 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD);
1204 double const dS_L_dp_cap =
1205 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(
1210 double const chi_S_L =
1211 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1214 B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
1215 double const dchi_dS_L =
1216 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1220 .template block<displacement_size, pressure_size>(
1221 displacement_index, pressure_index)
1222 .noalias() -= B.transpose() * alpha *
1223 (chi_S_L + dchi_dS_L * p_cap_ip * dS_L_dp_cap) *
1224 identity2 * N_p * w;
1228 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi;
1229 double const rho_LR = *std::get<LiquidDensity>(CD);
1231 .template block<displacement_size, pressure_size>(
1232 displacement_index, pressure_index)
1234 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1245 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1246 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
1248 using DimMatrix = Eigen::Matrix<double, 3, 3>;
1249 auto const dsigma_sw_dS_L =
1250 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
1252 .property(MPL::PropertyType::swelling_stress_rate)
1253 .
template dValue<DimMatrix>(
1254 variables, variables_prev,
1255 MPL::Variable::liquid_saturation, x_position, t,
1258 .template block<displacement_size, pressure_size>(
1259 displacement_index, pressure_index)
1261 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1267 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1268 this->current_states_[ip])
1270 if (this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1272 double const chi_S_L_prev = std::get<
PrevState<
1275 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1276 identity2.transpose() * B * w;
1280 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1281 identity2.transpose() * B * w;
1288 double const k_rel =
1290 DisplacementDim>>(CD)
1292 auto const& K_intrinsic =
1294 DisplacementDim>>(CD)
1297 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(
1302 laplace_p.noalias() +=
1303 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1305 auto const beta_LR =
1307 liquid_phase.property(MPL::PropertyType::density)
1308 .template dValue<double>(variables,
1309 MPL::Variable::liquid_phase_pressure,
1312 double const beta_SR =
1317 double const a0 = (alpha - phi) * beta_SR;
1318 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1319 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1321 double const dspecific_storage_a_p_dp_cap =
1322 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1323 double const dspecific_storage_a_S_dp_cap =
1324 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1326 storage_p_a_p.noalias() +=
1327 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1329 double const DeltaS_L_Deltap_cap =
1330 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap;
1331 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1332 specific_storage_a_S * DeltaS_L_Deltap_cap *
1336 .template block<pressure_size, pressure_size>(pressure_index,
1338 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1339 rho_LR * dspecific_storage_a_p_dp_cap * N_p * w;
1341 double const S_L_prev =
1344 this->prev_states_[ip])
1346 storage_p_a_S_Jpp.noalias() -=
1347 N_p.transpose() * rho_LR *
1348 ((S_L - S_L_prev) * dspecific_storage_a_S_dp_cap +
1349 specific_storage_a_S * dS_L_dp_cap) /
1352 if (!this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1355 .template block<pressure_size, pressure_size>(pressure_index,
1357 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1358 identity2.transpose() * B * (u - u_prev) / dt *
1362 double const dk_rel_dS_l =
1363 medium->property(MPL::PropertyType::relative_permeability)
1364 .template dValue<double>(variables,
1365 MPL::Variable::liquid_saturation,
1368 grad_p_cap = -dNdx_p * p_L;
1370 .template block<pressure_size, pressure_size>(pressure_index,
1372 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1373 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1376 .template block<pressure_size, pressure_size>(pressure_index,
1378 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1379 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1381 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1382 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1384 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1386 double const alpha_bar =
1387 this->process_data_.micro_porosity_parameters
1388 ->mass_exchange_coefficient;
1390 *std::get<MicroPressure>(this->current_states_[ip]);
1391 local_rhs.template segment<pressure_size>(pressure_index)
1393 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1396 .template block<pressure_size, pressure_size>(pressure_index,
1398 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1399 if (p_cap_ip != p_cap_prev_ip)
1401 auto const p_L_m_prev = **std::get<PrevState<MicroPressure>>(
1402 this->prev_states_[ip]);
1404 .template block<pressure_size, pressure_size>(
1405 pressure_index, pressure_index)
1406 .noalias() += N_p.transpose() * alpha_bar / mu *
1407 (p_L_m - p_L_m_prev) /
1408 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1413 if (this->process_data_.apply_mass_lumping)
1415 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1416 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1418 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1423 .template block<pressure_size, pressure_size>(pressure_index,
1425 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1429 .template block<pressure_size, displacement_size>(pressure_index,
1431 .noalias() = Kpu / dt;
1434 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1436 (storage_p_a_p + storage_p_a_S) * (p_L - p_L_prev) / dt +
1437 Kpu * (u - u_prev) / dt;
1440 local_rhs.template segment<displacement_size>(displacement_index)
1441 .noalias() += Kup * p_L;
1499 ShapeFunctionPressure, DisplacementDim>::
1500 computeSecondaryVariableConcrete(
double const t,
double const dt,
1501 Eigen::VectorXd
const& local_x,
1502 Eigen::VectorXd
const& local_x_prev)
1504 auto p_L = local_x.template segment<pressure_size>(pressure_index);
1505 auto u = local_x.template segment<displacement_size>(displacement_index);
1508 local_x_prev.template segment<pressure_size>(pressure_index);
1510 local_x_prev.template segment<displacement_size>(displacement_index);
1514 DisplacementDim)>::identity2;
1516 auto const& medium =
1517 this->process_data_.media_map.getMedium(this->element_.getID());
1518 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
1519 auto const& solid_phase = medium->phase(
"Solid");
1526 unsigned const n_integration_points =
1527 this->integration_method_.getNumberOfPoints();
1529 double saturation_avg = 0;
1530 double porosity_avg = 0;
1533 KV sigma_avg = KV::Zero();
1535 for (
unsigned ip = 0; ip < n_integration_points; ip++)
1538 auto const& N_p = _ip_data[ip].N_p;
1539 auto const& N_u = _ip_data[ip].N_u;
1540 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1542 auto const x_coord =
1545 this->element_, N_u);
1548 ShapeFunctionDisplacement::NPOINTS,
1550 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1555 double p_cap_prev_ip;
1564 auto const temperature =
1565 medium->property(MPL::PropertyType::reference_temperature)
1566 .template value<double>(variables, x_position, t, dt);
1570 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
1572 eps.noalias() = B * u;
1574 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1575 this->current_states_[ip])
1577 auto const S_L_prev =
1580 this->prev_states_[ip])
1582 S_L = medium->property(MPL::PropertyType::saturation)
1583 .template value<double>(variables, x_position, t, dt);
1587 auto const chi = [medium, x_position, t, dt](
double const S_L)
1591 return medium->property(MPL::PropertyType::bishops_effective_stress)
1592 .template value<double>(vs, x_position, t, dt);
1594 double const chi_S_L = chi(S_L);
1595 double const chi_S_L_prev = chi(S_L_prev);
1598 medium->property(MPL::PropertyType::biot_coefficient)
1599 .template value<double>(variables, x_position, t, dt);
1601 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
1602 t, x_position, dt, temperature, this->solid_material_,
1603 *this->material_states_[ip].material_state_variables);
1605 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
1606 t, x_position, &C_el);
1616 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
1617 this->current_states_[ip])
1620 auto const phi_prev = std::get<
PrevState<
1622 this->prev_states_[ip])
1624 variables_prev.
porosity = phi_prev;
1625 phi = medium->property(MPL::PropertyType::porosity)
1626 .template value<double>(variables, variables_prev,
1632 liquid_phase.property(MPL::PropertyType::density)
1633 .template value<double>(variables, x_position, t, dt);
1636 liquid_phase.property(MPL::PropertyType::viscosity)
1637 .template value<double>(variables, x_position, t, dt);
1642 std::get<ProcessLib::ThermoRichardsMechanics::
1643 ConstitutiveStress_StrainTemperature::
1644 SwellingDataStateful<DisplacementDim>>(
1645 this->current_states_[ip]);
1646 auto const& sigma_sw_prev = std::get<
1647 PrevState<ProcessLib::ThermoRichardsMechanics::
1648 ConstitutiveStress_StrainTemperature::
1649 SwellingDataStateful<DisplacementDim>>>(
1650 this->prev_states_[ip]);
1651 auto const transport_porosity_prev = std::get<
PrevState<
1653 this->prev_states_[ip]);
1654 auto const phi_prev = std::get<
1656 this->prev_states_[ip]);
1657 auto& transport_porosity = std::get<
1659 this->current_states_[ip]);
1660 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
1661 auto const p_L_m_prev =
1662 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
1663 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
1664 auto const S_L_m_prev =
1665 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
1667 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
1668 *medium, solid_phase, C_el, rho_LR, mu,
1669 this->process_data_.micro_porosity_parameters, alpha, phi,
1670 p_cap_ip, variables, variables_prev, x_position, t, dt,
1671 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
1672 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
1675 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
1677 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
1679 auto& transport_porosity =
1680 std::get<ProcessLib::ThermoRichardsMechanics::
1681 TransportPorosityData>(
1682 this->current_states_[ip])
1684 auto const transport_porosity_prev =
1685 std::get<
PrevState<ProcessLib::ThermoRichardsMechanics::
1686 TransportPorosityData>>(
1687 this->prev_states_[ip])
1692 transport_porosity =
1693 medium->property(MPL::PropertyType::transport_porosity)
1694 .template value<double>(variables, variables_prev,
1704 auto const& sigma_eff =
1705 std::get<ProcessLib::ThermoRichardsMechanics::
1706 ConstitutiveStress_StrainTemperature::
1707 EffectiveStressData<DisplacementDim>>(
1708 this->current_states_[ip])
1714 auto const sigma_total =
1715 (sigma_eff + alpha * chi_S_L * identity2 * p_cap_ip).eval();
1723 this->material_states_[ip]
1724 .material_state_variables->getEquivalentPlasticStrain();
1726 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
1727 medium->property(MPL::PropertyType::permeability)
1728 .value(variables, x_position, t, dt));
1730 double const k_rel =
1731 medium->property(MPL::PropertyType::relative_permeability)
1732 .template value<double>(variables, x_position, t, dt);
1736 double const p_FR = -chi_S_L * p_cap_ip;
1739 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1741 solid_phase.property(MPL::PropertyType::density)
1742 .template value<double>(variables, x_position, t, dt);
1743 *std::get<DrySolidDensity>(this->output_data_[ip]) = (1 - phi) * rho_SR;
1746 auto& SD = this->current_states_[ip];
1747 auto const& sigma_sw =
1748 std::get<ProcessLib::ThermoRichardsMechanics::
1749 ConstitutiveStress_StrainTemperature::
1750 SwellingDataStateful<DisplacementDim>>(SD)
1753 std::get<ProcessLib::ThermoRichardsMechanics::
1754 ConstitutiveStress_StrainTemperature::
1755 MechanicalStrainData<DisplacementDim>>(SD)
1758 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1759 ? eps + C_el.inverse() * sigma_sw
1767 auto& SD = this->current_states_[ip];
1768 auto const& SD_prev = this->prev_states_[ip];
1770 std::get<ProcessLib::ThermoRichardsMechanics::
1771 ConstitutiveStress_StrainTemperature::
1772 EffectiveStressData<DisplacementDim>>(SD);
1773 auto const& sigma_eff_prev = std::get<
1774 PrevState<ProcessLib::ThermoRichardsMechanics::
1775 ConstitutiveStress_StrainTemperature::
1776 EffectiveStressData<DisplacementDim>>>(
1779 std::get<ProcessLib::ThermoRichardsMechanics::
1780 ConstitutiveStress_StrainTemperature::
1781 MechanicalStrainData<DisplacementDim>>(SD);
1782 auto const& eps_m_prev = std::get<
1783 PrevState<ProcessLib::ThermoRichardsMechanics::
1784 ConstitutiveStress_StrainTemperature::
1785 MechanicalStrainData<DisplacementDim>>>(
1788 _ip_data[ip].updateConstitutiveRelation(
1789 variables, t, x_position, dt, temperature, sigma_eff,
1790 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
1791 this->material_states_[ip].material_state_variables);
1794 auto const& b = this->process_data_.specific_body_force;
1797 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1800 this->output_data_[ip])
1801 ->noalias() = -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1803 saturation_avg += S_L;
1804 porosity_avg += phi;
1805 sigma_avg += sigma_eff;
1807 saturation_avg /= n_integration_points;
1808 porosity_avg /= n_integration_points;
1809 sigma_avg /= n_integration_points;
1811 (*this->process_data_.element_saturation)[this->element_.getID()] =
1813 (*this->process_data_.element_porosity)[this->element_.getID()] =
1817 &(*this->process_data_.element_stresses)[this->element_.getID() *
1818 KV::RowsAtCompileTime]) =
1822 ShapeFunctionPressure,
typename ShapeFunctionDisplacement::MeshElement,
1823 DisplacementDim>(this->element_, this->is_axially_symmetric_, p_L,
1824 *this->process_data_.pressure_interpolated);