OGS
ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim > Class Template Reference

Detailed Description

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
class ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >

Definition at line 45 of file RichardsMechanicsFEM.h.

#include <RichardsMechanicsFEM.h>

Inheritance diagram for ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >:
[legend]

Public Types

using ShapeMatricesTypeDisplacement
using ShapeMatricesTypePressure
using GlobalDimMatrixType
using BMatricesType
using KelvinVectorType = typename BMatricesType::KelvinVectorType
using IpData
using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>
using SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>

Public Member Functions

 RichardsMechanicsLocalAssembler (RichardsMechanicsLocalAssembler const &)=delete
 RichardsMechanicsLocalAssembler (RichardsMechanicsLocalAssembler &&)=delete
 RichardsMechanicsLocalAssembler (MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &process_data)
void setInitialConditionsConcrete (Eigen::VectorXd const local_x, double const t, int const process_id) override
void assemble (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_rhs_data) override
void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_rhs_data, std::vector< double > &local_Jac_data) override
void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
void initializeConcrete () override
void computeSecondaryVariableConcrete (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev) override
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
int getNumberOfVectorElementsForDeformation () const override
Public Member Functions inherited from ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >
 LocalAssemblerInterface (MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &process_data)
std::size_t setIPDataInitialConditions (std::string_view name, double const *values, int const integration_order)
std::vector< double > getMaterialStateVariableInternalState (std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const
unsigned getNumberOfIntegrationPoints () const
int getMaterialID () const
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override final
Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual void preAssemble (double const, double const, std::vector< double > const &)
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default

Static Public Attributes

static int const KelvinVectorSize
static constexpr auto & N_u_op

Private Member Functions

void assembleWithJacobianForDeformationEquations (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
void assembleWithJacobianForPressureEquations (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)

Static Private Member Functions

static void assembleWithJacobianEvalConstitutiveSetting (double const t, double const dt, ParameterLib::SpatialPosition const &x_position, IpData &ip_data, MPL::VariableArray &variables, MPL::VariableArray &variables_prev, MPL::Medium const *const medium, TemperatureData const T_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, ConstitutiveData< DisplacementDim > &CD, StatefulData< DisplacementDim > &SD, StatefulDataPrev< DisplacementDim > const &SD_prev, std::optional< MicroPorosityParameters > const &micro_porosity_parameters, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material, ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > &material_state_data)
static constexpr auto localDOF (auto const &x)

Private Attributes

std::vector< IpData, Eigen::aligned_allocator< IpData > > ip_data_
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > secondary_data_

Static Private Attributes

static const int pressure_index = 0
static const int pressure_size = ShapeFunctionPressure::NPOINTS
static const int displacement_index = ShapeFunctionPressure::NPOINTS
static const int displacement_size

Additional Inherited Members

Static Public Member Functions inherited from ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >
static auto getReflectionDataForOutput ()
Protected Attributes inherited from ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >
RichardsMechanicsProcessData< DisplacementDim > & process_data_
NumLib::GenericIntegrationMethod const & integration_method_
MeshLib::Element const & element_
bool const is_axially_symmetric_
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_
std::vector< StatefulData< DisplacementDim > > current_states_
std::vector< StatefulDataPrev< DisplacementDim > > prev_states_
std::vector< ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > > material_states_
std::vector< OutputData< DisplacementDim > > output_data_

Member Typedef Documentation

◆ BMatricesType

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::BMatricesType

◆ GlobalDimMatrixType

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::GlobalDimMatrixType
Initial value:

Definition at line 54 of file RichardsMechanicsFEM.h.

◆ Invariants

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>

Definition at line 68 of file RichardsMechanicsFEM.h.

◆ IpData

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::IpData
Initial value:
ShapeMatricesTypePressure, DisplacementDim,
ShapeFunctionDisplacement::NPOINTS>
ShapeMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > ShapeMatricesTypeDisplacement
ShapeMatrixPolicyType< ShapeFunctionPressure, DisplacementDim > ShapeMatricesTypePressure
BMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > BMatricesType

Definition at line 61 of file RichardsMechanicsFEM.h.

◆ KelvinVectorType

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::KelvinVectorType = typename BMatricesType::KelvinVectorType

Definition at line 59 of file RichardsMechanicsFEM.h.

◆ ShapeMatricesTypeDisplacement

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ShapeMatricesTypeDisplacement
Initial value:
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType

Definition at line 49 of file RichardsMechanicsFEM.h.

◆ ShapeMatricesTypePressure

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ShapeMatricesTypePressure

◆ SymmetricTensor

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
using ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::SymmetricTensor = Eigen::Matrix<double, KelvinVectorSize, 1>

Definition at line 70 of file RichardsMechanicsFEM.h.

Constructor & Destructor Documentation

◆ RichardsMechanicsLocalAssembler() [1/3]

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::RichardsMechanicsLocalAssembler ( RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim > const & )
delete

◆ RichardsMechanicsLocalAssembler() [2/3]

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::RichardsMechanicsLocalAssembler ( RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim > && )
delete

◆ RichardsMechanicsLocalAssembler() [3/3]

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::RichardsMechanicsLocalAssembler ( MeshLib::Element const & e,
std::size_t const ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
RichardsMechanicsProcessData< DisplacementDim > & process_data )

Definition at line 122 of file RichardsMechanicsFEM-impl.h.

131{
132 unsigned const n_integration_points =
133 this->integration_method_.getNumberOfPoints();
134
137
138 auto const shape_matrices_u =
142 this->integration_method_);
143
144 auto const shape_matrices_p =
148
149 auto const& medium =
150 this->process_data_.media_map.getMedium(this->element_.getID());
151
152 for (unsigned ip = 0; ip < n_integration_points; ip++)
153 {
154 auto& ip_data = ip_data_[ip];
155 auto const& sm_u = shape_matrices_u[ip];
156 ip_data_[ip].integration_weight =
157 this->integration_method_.getWeightedPoint(ip).getWeight() *
158 sm_u.integralMeasure * sm_u.detJ;
159
160 ip_data.N_u = sm_u.N;
161 ip_data.dNdx_u = sm_u.dNdx;
162
164 std::nullopt, this->element_.getID(),
168 this->element_, ip_data.N_u))};
169
170 ip_data.N_p = shape_matrices_p[ip].N;
171 ip_data.dNdx_p = shape_matrices_p[ip].dNdx;
172
173 // Initial porosity. Could be read from integration point data or mesh.
174 auto& porosity =
176 this->current_states_[ip])
177 .phi;
178 porosity = medium->property(MPL::porosity)
179 .template initialValue<double>(
182 double>::quiet_NaN() /* t independent */);
183
184 auto& transport_porosity =
185 std::get<
187 this->current_states_[ip])
188 .phi;
191 {
194 .template initialValue<double>(
197 double>::quiet_NaN() /* t independent */);
198 }
199
201 }
202}
ShapeMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > ShapeMatricesTypeDisplacement
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > secondary_data_
ShapeMatrixPolicyType< ShapeFunctionPressure, DisplacementDim > ShapeMatricesTypePressure
std::vector< IpData, Eigen::aligned_allocator< IpData > > ip_data_
LocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &process_data)

References ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::LocalAssemblerInterface().

Member Function Documentation

◆ assemble()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assemble ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_M_data,
std::vector< double > & local_K_data,
std::vector< double > & local_rhs_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 371 of file RichardsMechanicsFEM-impl.h.

377{
379
380 auto const [p_L, u] = localDOF(local_x);
381 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
382
389
396
401
405
406 auto const& medium =
407 this->process_data_.media_map.getMedium(this->element_.getID());
408 auto const& liquid_phase =
410 auto const& solid_phase =
414
416 x_position.setElementID(this->element_.getID());
417
418 unsigned const n_integration_points =
419 this->integration_method_.getNumberOfPoints();
420 for (unsigned ip = 0; ip < n_integration_points; ip++)
421 {
422 auto const& w = ip_data_[ip].integration_weight;
423
424 auto const& N_u = ip_data_[ip].N_u;
425 auto const& dNdx_u = ip_data_[ip].dNdx_u;
426
427 auto const& N_p = ip_data_[ip].N_p;
428 auto const& dNdx_p = ip_data_[ip].dNdx_p;
429
430 x_position = {
431 std::nullopt, this->element_.getID(),
435 this->element_, N_u))};
436 auto const x_coord = x_position.getCoordinates().value()[0];
437
438 auto const B =
443
444 auto& eps =
446 eps.eps.noalias() = B * u;
447
448 auto& S_L =
450 this->current_states_[ip])
451 .S_L;
452 auto const S_L_prev =
453 std::get<
455 this->prev_states_[ip])
456 ->S_L;
457
458 double p_cap_ip;
460
461 double p_cap_prev_ip;
463
464 variables.capillary_pressure = p_cap_ip;
465 variables.liquid_phase_pressure = -p_cap_ip;
466 // setting pG to 1 atm
467 // TODO : rewrite equations s.t. p_L = pG-p_cap
468 variables.gas_phase_pressure = 1.0e5;
469
470 auto const temperature =
472 .template value<double>(variables, x_position, t, dt);
473 variables.temperature = temperature;
474
475 auto const alpha =
477 .template value<double>(variables, x_position, t, dt);
478 auto& SD = this->current_states_[ip];
479 variables.stress =
482 .sigma_eff;
483 // Set mechanical strain temporary to compute tangent stiffness.
484 variables.mechanical_strain
486 eps.eps);
487 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
490
491 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
492 t, x_position, &C_el);
493 variables.grain_compressibility = beta_SR;
494
495 auto const rho_LR =
497 .template value<double>(variables, x_position, t, dt);
498 variables.density = rho_LR;
499
500 auto const& b = this->process_data_.specific_body_force;
501
503 .template value<double>(variables, x_position, t, dt);
504 variables.liquid_saturation = S_L;
505 variables_prev.liquid_saturation = S_L_prev;
506
507 // tangent derivative for Jacobian
508 double const dS_L_dp_cap =
510 .template dValue<double>(variables,
512 x_position, t, dt);
513 // secant derivative from time discretization for storage
514 // use tangent, if secant is not available
515 double const DeltaS_L_Deltap_cap =
519
520 auto const chi = [medium, x_position, t, dt](double const S_L)
521 {
523 vs.liquid_saturation = S_L;
525 .template value<double>(vs, x_position, t, dt);
526 };
527 double const chi_S_L = chi(S_L);
528 double const chi_S_L_prev = chi(S_L_prev);
529
530 double const p_FR = -chi_S_L * p_cap_ip;
531 variables.effective_pore_pressure = p_FR;
532 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
533
534 // Set volumetric strain rate for the general case without swelling.
535 variables.volumetric_strain = Invariants::trace(eps.eps);
536 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
537
539 this->current_states_[ip])
540 .phi;
541 { // Porosity update
542 auto const phi_prev = std::get<PrevState<
544 this->prev_states_[ip])
545 ->phi;
546 variables_prev.porosity = phi_prev;
549 x_position, t, dt);
550 variables.porosity = phi;
551 }
552
553 if (alpha < phi)
554 {
555 OGS_FATAL(
556 "RichardsMechanics: Biot-coefficient {} is smaller than "
557 "porosity {} in element/integration point {}/{}.",
558 alpha, phi, this->element_.getID(), ip);
559 }
560
561 // Swelling and possibly volumetric strain rate update.
562 {
563 auto& sigma_sw =
567 this->current_states_[ip])
568 .sigma_sw;
569 auto const& sigma_sw_prev = std::get<PrevState<
573 ->sigma_sw;
574
575 // If there is swelling, compute it. Update volumetric strain rate,
576 // s.t. it corresponds to the mechanical part only.
578 if (solid_phase.hasProperty(
580 {
581 auto const sigma_sw_dot =
586 dt)));
588
589 variables.volumetric_mechanical_strain =
590 variables.volumetric_strain +
591 identity2.transpose() * C_el.inverse() * sigma_sw;
592 variables_prev.volumetric_mechanical_strain =
593 variables_prev.volumetric_strain +
594 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
595 }
596 else
597 {
598 variables.volumetric_mechanical_strain =
599 variables.volumetric_strain;
600 variables_prev.volumetric_mechanical_strain =
601 variables_prev.volumetric_strain;
602 }
603
605 {
606 auto& transport_porosity =
609 this->current_states_[ip])
610 .phi;
611 auto const transport_porosity_prev =
614 this->prev_states_[ip])
615 ->phi;
616 variables_prev.transport_porosity = transport_porosity_prev;
617
621 x_position, t, dt);
622 variables.transport_porosity = transport_porosity;
623 }
624 else
625 {
626 variables.transport_porosity = phi;
627 }
628 }
629
630 double const k_rel =
632 .template value<double>(variables, x_position, t, dt);
633 auto const mu =
635 .template value<double>(variables, x_position, t, dt);
636
637 auto const& sigma_sw =
641 this->current_states_[ip])
642 .sigma_sw;
643 auto const& sigma_eff =
646 .sigma_eff;
647
648 // Set mechanical variables for the intrinsic permeability model
649 // For stress dependent permeability.
650 {
651 auto const sigma_total =
653
654 // For stress dependent permeability.
655 variables.total_stress.emplace<SymmetricTensor>(
657 sigma_total));
658 }
659
660 variables.equivalent_plastic_strain =
661 this->material_states_[ip]
662 .material_state_variables->getEquivalentPlasticStrain();
663
666 .value(variables, x_position, t, dt));
667
670
671 //
672 // displacement equation, displacement part
673 //
674 {
677 this->current_states_[ip])
678 .eps_m;
679 eps_m.noalias() =
681 ? eps.eps + C_el.inverse() * sigma_sw
682 : eps.eps;
683 variables.mechanical_strain.emplace<
685 eps_m);
686 }
687
688 {
689 auto& SD = this->current_states_[ip];
690 auto const& SD_prev = this->prev_states_[ip];
691 auto& sigma_eff =
694 auto const& sigma_eff_prev =
697 SD_prev);
698 auto const& eps_m =
701 auto& eps_m_prev =
704 SD_prev);
705
706 auto const C = ip_data_[ip].updateConstitutiveRelation(
710
711 if (this->process_data_.use_numerical_jacobian)
712 {
715 .noalias() += B.transpose() * C * B * w;
716 }
717 }
718
719 // p_SR
720 variables.solid_grain_pressure =
721 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
722 auto const rho_SR =
724 .template value<double>(variables, x_position, t, dt);
725
726 //
727 // displacement equation, displacement part
728 //
729 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
731 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
732
733 //
734 // pressure equation, pressure part.
735 //
736 auto const beta_LR =
737 1 / rho_LR *
739 .template dValue<double>(variables,
741 x_position, t, dt);
742
743 double const a0 = S_L * (alpha - phi) * beta_SR;
744 // Volumetric average specific storage of the solid and fluid phases.
745 double const specific_storage =
747 S_L * (phi * beta_LR + a0);
750 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
751
754 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
755
756 rhs.template segment<pressure_size>(pressure_index).noalias() +=
757 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
758
759 //
760 // displacement equation, pressure part
761 //
764 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
765
766 //
767 // pressure equation, displacement part.
768 //
771 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
772 identity2.transpose() * B * w;
773 }
774
775 if (this->process_data_.apply_mass_lumping)
776 {
779 Mpp = Mpp.colwise().sum().eval().asDiagonal();
780 }
781}
#define OGS_FATAL(...)
Definition Error.h:10
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
Eigen::Matrix< double, KelvinVectorSize, 1 > SymmetricTensor
typename ShapeMatricesTypePressure::GlobalDimMatrixType GlobalDimMatrixType
constexpr Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
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.
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
static double trace(Eigen::Matrix< double, KelvinVectorSize, 1 > const &v)
Trace of the corresponding tensor.
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_
std::vector< ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > > material_states_

References MaterialPropertyLib::AqueousLiquid, assemble(), MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, displacement_index, displacement_size, MaterialPropertyLib::VariableArray::effective_pore_pressure, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MaterialPropertyLib::VariableArray::equivalent_plastic_strain, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), MaterialPropertyLib::VariableArray::grain_compressibility, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ip_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, MathLib::KelvinVector::kelvin_vector_dimensions(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, localDOF(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, MaterialPropertyLib::VariableArray::mechanical_strain, N_u_op, OGS_FATAL, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, pressure_index, pressure_size, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::Solid, MaterialPropertyLib::VariableArray::solid_grain_pressure, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::swelling_stress_rate, MaterialPropertyLib::VariableArray::temperature, MathLib::KelvinVector::tensorToKelvin(), MaterialPropertyLib::VariableArray::total_stress, MathLib::KelvinVector::Invariants< KelvinVectorSize >::trace(), MaterialPropertyLib::transport_porosity, MaterialPropertyLib::VariableArray::transport_porosity, MaterialPropertyLib::viscosity, MaterialPropertyLib::VariableArray::volumetric_mechanical_strain, and MaterialPropertyLib::VariableArray::volumetric_strain.

Referenced by assemble().

◆ assembleWithJacobian()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobian ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_rhs_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 1101 of file RichardsMechanicsFEM-impl.h.

1107{
1109
1110 auto const [p_L, u] = localDOF(local_x);
1111 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1112
1119
1124
1128
1132
1136
1140
1144
1150
1156
1157 auto const& medium =
1158 this->process_data_.media_map.getMedium(this->element_.getID());
1159 auto const& liquid_phase =
1161 auto const& solid_phase =
1165
1166 unsigned const n_integration_points =
1167 this->integration_method_.getNumberOfPoints();
1168 for (unsigned ip = 0; ip < n_integration_points; ip++)
1169 {
1171 auto& SD = this->current_states_[ip];
1172 auto const& SD_prev = this->prev_states_[ip];
1174 this->process_data_, this->solid_material_);
1175
1176 auto const& w = ip_data_[ip].integration_weight;
1177
1178 auto const& N_u = ip_data_[ip].N_u;
1179 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1180
1181 auto const& N_p = ip_data_[ip].N_p;
1182 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1183
1185 std::nullopt, this->element_.getID(),
1189 this->element_, N_u))};
1190 auto const x_coord = x_position.getCoordinates().value()[0];
1191
1192 auto const B =
1197
1198 double p_cap_ip;
1200
1201 double p_cap_prev_ip;
1203
1204 variables.capillary_pressure = p_cap_ip;
1205 variables.liquid_phase_pressure = -p_cap_ip;
1206 // setting pG to 1 atm
1207 // TODO : rewrite equations s.t. p_L = pG-p_cap
1208 variables.gas_phase_pressure = 1.0e5;
1209
1210 auto const temperature =
1212 .template value<double>(variables, x_position, t, dt);
1213 variables.temperature = temperature;
1214
1216
1223 CD, SD, SD_prev, this->process_data_.micro_porosity_parameters,
1224 this->solid_material_, this->material_states_[ip]);
1225
1226 {
1228 local_Jac
1231 .noalias() += B.transpose() * C * B * w;
1232 }
1233
1234 auto const& b = this->process_data_.specific_body_force;
1235
1236 {
1237 auto const& sigma_eff =
1240 .sigma_eff;
1241 double const rho = *std::get<Density>(CD);
1243 .noalias() -= (B.transpose() * sigma_eff -
1244 N_u_op(N_u).transpose() * rho * b) *
1245 w;
1246 }
1247
1248 //
1249 // displacement equation, pressure part
1250 //
1251
1252 double const alpha =
1254 double const dS_L_dp_cap =
1256 CD)
1257 .dS_L_dp_cap;
1258
1259 {
1260 double const chi_S_L =
1262 .chi_S_L;
1263 Kup.noalias() +=
1264 B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
1265 double const dchi_dS_L =
1267 .dchi_dS_L;
1268
1269 local_Jac
1272 .noalias() -= B.transpose() * alpha *
1274 identity2 * N_p * w;
1275 }
1276
1277 double const phi =
1279 double const rho_LR = *std::get<LiquidDensity>(CD);
1280 local_Jac
1283 .noalias() +=
1284 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1285
1286 // For the swelling stress with double structure model the corresponding
1287 // Jacobian u-p entry would be required, but it does not improve
1288 // convergence and sometimes worsens it:
1289 // if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1290 // {
1291 // -B.transpose() *
1292 // dsigma_sw_dS_L_m* dS_L_m_dp_cap_m*(p_L_m - p_L_m_prev) /
1293 // (p_cap_ip - p_cap_prev_ip) * N_p* w;
1294 // }
1295 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1297 {
1299 auto const dsigma_sw_dS_L =
1303 .template dValue<DimMatrix>(
1306 dt));
1307 local_Jac
1310 .noalias() +=
1311 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1312 }
1313 //
1314 // pressure equation, displacement part.
1315 //
1316 double const S_L =
1318 this->current_states_[ip])
1319 .S_L;
1320 if (this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1321 {
1322 double const chi_S_L_prev = std::get<PrevState<
1324 ->chi_S_L;
1325 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1326 identity2.transpose() * B * w;
1327 }
1328 else
1329 {
1330 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1331 identity2.transpose() * B * w;
1332 }
1333
1334 //
1335 // pressure equation, pressure part.
1336 //
1337
1338 double const k_rel =
1341 .k_rel;
1342 auto const& K_intrinsic =
1345 .Ki;
1346 double const mu =
1348 CD);
1349
1351
1352 laplace_p.noalias() +=
1353 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1354
1355 auto const beta_LR =
1356 1 / rho_LR *
1358 .template dValue<double>(variables,
1360 x_position, t, dt);
1361
1362 double const beta_SR =
1363 std::get<
1365 CD)
1366 .beta_SR;
1367 double const a0 = (alpha - phi) * beta_SR;
1368 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1369 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1370
1371 double const dspecific_storage_a_p_dp_cap =
1372 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1373 double const dspecific_storage_a_S_dp_cap =
1374 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1375
1376 storage_p_a_p.noalias() +=
1377 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1378
1379 double const DeltaS_L_Deltap_cap =
1380 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap;
1381 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1383 N_p * w;
1384
1385 local_Jac
1388 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1390
1391 double const S_L_prev =
1392 std::get<
1394 this->prev_states_[ip])
1395 ->S_L;
1396 storage_p_a_S_Jpp.noalias() -=
1397 N_p.transpose() * rho_LR *
1400 dt * N_p * w;
1401
1402 if (!this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1403 {
1404 local_Jac
1407 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1408 identity2.transpose() * B * (u - u_prev) / dt *
1409 N_p * w;
1410 }
1411
1412 double const dk_rel_dS_l =
1414 .template dValue<double>(variables,
1416 x_position, t, dt);
1418 grad_p_cap = -dNdx_p * p_L;
1419 local_Jac
1422 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1424
1425 local_Jac
1428 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1430
1431 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1432 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1433
1435 {
1436 double const alpha_bar =
1437 this->process_data_.micro_porosity_parameters
1438 ->mass_exchange_coefficient;
1439 auto const p_L_m =
1442 .noalias() -=
1443 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1444
1445 local_Jac
1448 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1449 if (p_cap_ip != p_cap_prev_ip)
1450 {
1452 this->prev_states_[ip]);
1453 local_Jac
1456 .noalias() += N_p.transpose() * alpha_bar / mu *
1457 (p_L_m - p_L_m_prev) /
1458 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1459 }
1460 }
1461 }
1462
1463 if (this->process_data_.apply_mass_lumping)
1464 {
1465 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1466 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1468 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1469 }
1470
1471 // pressure equation, pressure part.
1472 local_Jac
1475 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1476
1477 // pressure equation, displacement part.
1478 local_Jac
1481 .noalias() = Kpu / dt;
1482
1483 // pressure equation
1484 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1485 laplace_p * p_L +
1487 Kpu * (u - u_prev) / dt;
1488
1489 // displacement equation
1491 .noalias() += Kup * p_L;
1492}
static void assembleWithJacobianEvalConstitutiveSetting(double const t, double const dt, ParameterLib::SpatialPosition const &x_position, IpData &ip_data, MPL::VariableArray &variables, MPL::VariableArray &variables_prev, MPL::Medium const *const medium, TemperatureData const T_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, ConstitutiveData< DisplacementDim > &CD, StatefulData< DisplacementDim > &SD, StatefulDataPrev< DisplacementDim > const &SD_prev, std::optional< MicroPorosityParameters > const &micro_porosity_parameters, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material, ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > &material_state_data)
ConstitutiveModels< DisplacementDim > createConstitutiveModels(TRMProcessData const &process_data, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material)
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< GlobalDim > GlobalDimVectorType

References MaterialPropertyLib::AqueousLiquid, assembleWithJacobianEvalConstitutiveSetting(), MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::RichardsMechanics::createConstitutiveModels(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, MaterialPropertyLib::density, displacement_index, displacement_size, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ip_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, MathLib::KelvinVector::kelvin_vector_dimensions(), MaterialPropertyLib::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::liquid_saturation, localDOF(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, N_u_op, pressure_index, pressure_size, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation_micro, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::Solid, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_, MaterialPropertyLib::swelling_stress_rate, MaterialPropertyLib::VariableArray::temperature, and MathLib::KelvinVector::tensorToKelvin().

◆ assembleWithJacobianEvalConstitutiveSetting()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianEvalConstitutiveSetting ( double const t,
double const dt,
ParameterLib::SpatialPosition const & x_position,
IpData & ip_data,
MPL::VariableArray & variables,
MPL::VariableArray & variables_prev,
MPL::Medium const *const medium,
TemperatureData const T_data,
CapillaryPressureData< DisplacementDim > const & p_cap_data,
ConstitutiveData< DisplacementDim > & CD,
StatefulData< DisplacementDim > & SD,
StatefulDataPrev< DisplacementDim > const & SD_prev,
std::optional< MicroPorosityParameters > const & micro_porosity_parameters,
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material,
ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > & material_state_data )
staticprivate

Definition at line 786 of file RichardsMechanicsFEM-impl.h.

804{
805 auto const& liquid_phase =
807 auto const& solid_phase =
809
813
814 double const temperature = T_data();
815 double const p_cap_ip = p_cap_data.p_cap;
816 double const p_cap_prev_ip = p_cap_data.p_cap_prev;
817
819 auto& S_L =
821 auto const S_L_prev =
822 std::get<
824 SD_prev)
825 ->S_L;
826 auto const alpha =
828 .template value<double>(variables, x_position, t, dt);
830
831 variables.stress =
834 .sigma_eff;
835 // Set mechanical strain temporary to compute tangent stiffness.
836 variables.mechanical_strain
838 eps.eps);
839 auto const C_el = ip_data.computeElasticTangentStiffness(
841 *material_state_data.material_state_variables);
842
843 auto const beta_SR =
844 (1 - alpha) / solid_material.getBulkModulus(t, x_position, &C_el);
845 variables.grain_compressibility = beta_SR;
847 .beta_SR = beta_SR;
848
849 auto const rho_LR =
851 .template value<double>(variables, x_position, t, dt);
852 variables.density = rho_LR;
854
856 .template value<double>(variables, x_position, t, dt);
857 variables.liquid_saturation = S_L;
858 variables_prev.liquid_saturation = S_L_prev;
859
860 // tangent derivative for Jacobian
861 double const dS_L_dp_cap =
863 .template dValue<double>(variables,
865 x_position, t, dt);
867 .dS_L_dp_cap = dS_L_dp_cap;
868 // secant derivative from time discretization for storage
869 // use tangent, if secant is not available
870 double const DeltaS_L_Deltap_cap =
874 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap =
876
877 auto const chi = [medium, x_position, t, dt](double const S_L)
878 {
880 vs.liquid_saturation = S_L;
882 .template value<double>(vs, x_position, t, dt);
883 };
884 double const chi_S_L = chi(S_L);
886 chi_S_L;
887 double const chi_S_L_prev = chi(S_L_prev);
890
891 auto const dchi_dS_L =
893 .template dValue<double>(
896 dchi_dS_L;
897
898 double const p_FR = -chi_S_L * p_cap_ip;
899 variables.effective_pore_pressure = p_FR;
900 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
901
902 // Set volumetric strain rate for the general case without swelling.
903 variables.volumetric_strain = Invariants::trace(eps.eps);
904 // TODO (CL) changed that, using eps_prev for the moment, not B * u_prev
905 // variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
906 variables_prev.volumetric_strain = Invariants::trace(
908
909 auto& phi =
911 { // Porosity update
912 auto const phi_prev =
913 std::get<
915 SD_prev)
916 ->phi;
917 variables_prev.porosity = phi_prev;
920 t, dt);
921 variables.porosity = phi;
922 }
924
925 if (alpha < phi)
926 {
927 auto const eid =
928 x_position.getElementID()
929 ? static_cast<std::ptrdiff_t>(*x_position.getElementID())
930 : static_cast<std::ptrdiff_t>(-1);
931 OGS_FATAL(
932 "RichardsMechanics: Biot-coefficient {} is smaller than porosity "
933 "{} in element {}.",
934 alpha, phi, eid);
935 }
936
937 auto const mu = liquid_phase.property(MPL::PropertyType::viscosity)
938 .template value<double>(variables, x_position, t, dt);
940 mu;
941
942 {
943 // Swelling and possibly volumetric strain rate update.
944 auto& sigma_sw =
948 auto const& sigma_sw_prev =
952 SD_prev);
955 SD_prev);
956 auto const phi_prev = std::get<
958 SD_prev);
965
971 }
972
974 {
976 {
977 auto& transport_porosity =
978 std::get<
980 SD)
981 .phi;
984 SD_prev)
985 ->phi;
986 variables_prev.transport_porosity = transport_porosity_prev;
987
991 x_position, t, dt);
992 variables.transport_porosity = transport_porosity;
993 }
994 }
995 else
996 {
997 variables.transport_porosity = phi;
998 }
999
1000 // Set mechanical variables for the intrinsic permeability model
1001 // For stress dependent permeability.
1002 {
1003 // TODO mechanical constitutive relation will be evaluated afterwards
1004 auto const sigma_total =
1007 .sigma_eff +
1008 alpha * p_FR * identity2)
1009 .eval();
1010 // For stress dependent permeability.
1011 variables.total_stress.emplace<SymmetricTensor>(
1013 }
1014
1015 variables.equivalent_plastic_strain =
1016 material_state_data.material_state_variables
1017 ->getEquivalentPlasticStrain();
1018
1019 double const k_rel =
1021 .template value<double>(variables, x_position, t, dt);
1022
1025 .value(variables, x_position, t, dt));
1026
1027 std::get<
1029 CD)
1030 .k_rel = k_rel;
1031 std::get<
1033 CD)
1034 .Ki = K_intrinsic;
1035
1036 //
1037 // displacement equation, displacement part
1038 //
1039
1040 {
1041 auto& sigma_sw =
1045 .sigma_sw;
1046
1047 auto& eps_m =
1050 .eps_m;
1051 eps_m.noalias() =
1053 ? eps.eps + C_el.inverse() * sigma_sw
1054 : eps.eps;
1055 variables.mechanical_strain
1057 eps_m);
1058 }
1059
1060 {
1061 auto& sigma_eff =
1064 auto const& sigma_eff_prev =
1067 SD_prev);
1068 auto const& eps_m =
1071 auto& eps_m_prev =
1074 SD_prev);
1075
1076 auto C = ip_data.updateConstitutiveRelation(
1079 material_state_data.material_state_variables);
1080
1082 }
1083
1084 // p_SR
1085 variables.solid_grain_pressure =
1088 .sigma_eff.dot(identity2) /
1089 (3 * (1 - phi));
1090 auto const rho_SR =
1092 .template value<double>(variables, x_position, t, dt);
1093
1094 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
1096}
void updateSwellingStressAndVolumetricStrain(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, ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > &sigma_sw, PrevState< ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > > const &sigma_sw_prev, PrevState< ProcessLib::ThermoRichardsMechanics::TransportPorosityData > const phi_M_prev, PrevState< ProcessLib::ThermoRichardsMechanics::PorosityData > const phi_prev, ProcessLib::ThermoRichardsMechanics::TransportPorosityData &phi_M, PrevState< MicroPressure > const p_L_m_prev, PrevState< MicroSaturation > const S_L_m_prev, MicroPressure &p_L_m, MicroSaturation &S_L_m)

References RichardsMechanicsLocalAssembler(), MaterialPropertyLib::AqueousLiquid, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::capillary_pressure, MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::VariableArray::equivalent_plastic_strain, MaterialPropertyLib::formEigenTensor(), MaterialLib::Solids::MechanicsBase< DisplacementDim >::getBulkModulus(), ParameterLib::SpatialPosition::getElementID(), MaterialPropertyLib::VariableArray::grain_compressibility, MaterialPropertyLib::Medium::hasProperty(), MathLib::KelvinVector::kelvin_vector_dimensions(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::liquid_saturation, MaterialPropertyLib::VariableArray::liquid_saturation, ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim >::material_state_variables, MaterialPropertyLib::VariableArray::mechanical_strain, OGS_FATAL, ProcessLib::RichardsMechanics::CapillaryPressureData< DisplacementDim >::p_cap, ProcessLib::RichardsMechanics::CapillaryPressureData< DisplacementDim >::p_cap_prev, MaterialPropertyLib::permeability, MaterialPropertyLib::Medium::phase(), MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, MaterialPropertyLib::Medium::property(), MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, MaterialPropertyLib::saturation_micro, ProcessLib::ConstitutiveRelations::EffectiveStressData< DisplacementDim >::sigma_eff, MaterialPropertyLib::Solid, MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::swelling_stress_rate, MaterialPropertyLib::VariableArray::total_stress, MathLib::KelvinVector::Invariants< KelvinVectorSize >::trace(), MaterialPropertyLib::transport_porosity, MaterialPropertyLib::VariableArray::transport_porosity, ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain(), MaterialPropertyLib::Property::value(), MaterialPropertyLib::viscosity, and MaterialPropertyLib::VariableArray::volumetric_strain.

Referenced by assembleWithJacobian().

◆ assembleWithJacobianForDeformationEquations()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForDeformationEquations ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
private

Assemble local matrices and vectors arise from the linearized discretized weak form of the residual of the momentum balance equation,

\[ \nabla (\sigma - \alpha_b p \mathrm{I}) = f \]

where \( \sigma\) is the effective stress tensor, \(p\) is the pore pressure, \(\alpha_b\) is the Biot constant, \(\mathrm{I}\) is the identity tensor, and \(f\) is the body force.

Parameters
tTime
dtTime increment
local_xNodal values of \(x\) of an element.
local_x_prevNodal values of \(x_{prev}\) of an element.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

Definition at line 1511 of file RichardsMechanicsFEM-impl.h.

1518{
1519 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1520}

References OGS_FATAL.

Referenced by assembleWithJacobianForStaggeredScheme().

◆ assembleWithJacobianForPressureEquations()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForPressureEquations ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
private

Assemble local matrices and vectors arise from the linearized discretized weak form of the residual of the mass balance equation of single phase flow,

\[ \alpha \cdot{p} - \nabla (K (\nabla p + \rho g \nabla z) + \alpha_b \nabla \cdot \dot{u} = Q \]

where \( alpha\) is a coefficient may depend on storage or the fluid density change, \( \rho\) is the fluid density, \(g\) is the gravitational acceleration, \(z\) is the vertical coordinate, \(u\) is the displacement, and \(Q\) is the source/sink term.

Parameters
tTime
dtTime increment
local_xNodal values of \(x\) of an element.
local_x_prevNodal values of \(x_{prev}\) of an element.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

Definition at line 1497 of file RichardsMechanicsFEM-impl.h.

1504{
1505 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1506}

References OGS_FATAL.

Referenced by assembleWithJacobianForStaggeredScheme().

◆ assembleWithJacobianForStaggeredScheme()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianForStaggeredScheme ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
int const process_id,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 1525 of file RichardsMechanicsFEM-impl.h.

1532{
1533 // For the equations with pressure
1534 if (process_id == 0)
1535 {
1538 return;
1539 }
1540
1541 // For the equations with deformation
1544}
void assembleWithJacobianForPressureEquations(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
void assembleWithJacobianForDeformationEquations(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)

References assembleWithJacobianForDeformationEquations(), and assembleWithJacobianForPressureEquations().

◆ computeSecondaryVariableConcrete()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 1549 of file RichardsMechanicsFEM-impl.h.

1553{
1554 auto const [p_L, u] = localDOF(local_x);
1555 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1556
1560
1561 auto const& medium =
1562 this->process_data_.media_map.getMedium(this->element_.getID());
1563 auto const& liquid_phase =
1565 auto const& solid_phase =
1569
1570 unsigned const n_integration_points =
1571 this->integration_method_.getNumberOfPoints();
1572
1573 double saturation_avg = 0;
1574 double porosity_avg = 0;
1575
1577 KV sigma_avg = KV::Zero();
1578
1579 for (unsigned ip = 0; ip < n_integration_points; ip++)
1580 {
1581 auto const& N_p = ip_data_[ip].N_p;
1582 auto const& N_u = ip_data_[ip].N_u;
1583 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1584
1586 std::nullopt, this->element_.getID(),
1590 this->element_, N_u))};
1591 auto const x_coord = x_position.getCoordinates().value()[0];
1592
1593 auto const B =
1598
1599 double p_cap_ip;
1601
1602 double p_cap_prev_ip;
1604
1605 variables.capillary_pressure = p_cap_ip;
1606 variables.liquid_phase_pressure = -p_cap_ip;
1607 // setting pG to 1 atm
1608 // TODO : rewrite equations s.t. p_L = pG-p_cap
1609 variables.gas_phase_pressure = 1.0e5;
1610
1611 auto const temperature =
1613 .template value<double>(variables, x_position, t, dt);
1614 variables.temperature = temperature;
1615
1616 auto& eps =
1618 .eps;
1619 eps.noalias() = B * u;
1620 auto& S_L =
1622 this->current_states_[ip])
1623 .S_L;
1624 auto const S_L_prev =
1625 std::get<
1627 this->prev_states_[ip])
1628 ->S_L;
1630 .template value<double>(variables, x_position, t, dt);
1631 variables.liquid_saturation = S_L;
1632 variables_prev.liquid_saturation = S_L_prev;
1633
1634 auto const chi = [medium, x_position, t, dt](double const S_L)
1635 {
1637 vs.liquid_saturation = S_L;
1639 .template value<double>(vs, x_position, t, dt);
1640 };
1641 double const chi_S_L = chi(S_L);
1642 double const chi_S_L_prev = chi(S_L_prev);
1643
1644 auto const alpha =
1646 .template value<double>(variables, x_position, t, dt);
1647 auto& SD = this->current_states_[ip];
1648 variables.stress =
1651 .sigma_eff;
1652 // Set mechanical strain temporary to compute tangent stiffness.
1653 variables.mechanical_strain
1655 eps);
1656 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
1659
1660 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
1661 t, x_position, &C_el);
1662 variables.grain_compressibility = beta_SR;
1663
1664 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1665 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1666
1667 // Set volumetric strain rate for the general case without swelling.
1668 variables.volumetric_strain = Invariants::trace(eps);
1669 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
1670
1672 this->current_states_[ip])
1673 .phi;
1674 { // Porosity update
1675 auto const phi_prev = std::get<PrevState<
1677 this->prev_states_[ip])
1678 ->phi;
1679 variables_prev.porosity = phi_prev;
1682 x_position, t, dt);
1683 variables.porosity = phi;
1684 }
1685
1686 auto const rho_LR =
1688 .template value<double>(variables, x_position, t, dt);
1689 variables.density = rho_LR;
1690 auto const mu =
1692 .template value<double>(variables, x_position, t, dt);
1693
1694 {
1695 // Swelling and possibly volumetric strain rate update.
1696 auto& sigma_sw =
1700 this->current_states_[ip]);
1701 auto const& sigma_sw_prev = std::get<
1705 this->prev_states_[ip]);
1708 this->prev_states_[ip]);
1709 auto const phi_prev = std::get<
1711 this->prev_states_[ip]);
1714 this->current_states_[ip]);
1716 auto const p_L_m_prev =
1719 auto const S_L_m_prev =
1721
1724 this->process_data_.micro_porosity_parameters, alpha, phi,
1728 }
1729
1731 {
1733 {
1734 auto& transport_porosity =
1737 this->current_states_[ip])
1738 .phi;
1739 auto const transport_porosity_prev =
1742 this->prev_states_[ip])
1743 ->phi;
1744
1745 variables_prev.transport_porosity = transport_porosity_prev;
1746
1750 x_position, t, dt);
1751 variables.transport_porosity = transport_porosity;
1752 }
1753 }
1754 else
1755 {
1756 variables.transport_porosity = phi;
1757 }
1758
1759 auto const& sigma_eff =
1762 .sigma_eff;
1763
1764 // Set mechanical variables for the intrinsic permeability model
1765 // For stress dependent permeability.
1766 {
1767 auto const sigma_total =
1769 // For stress dependent permeability.
1770 variables.total_stress.emplace<SymmetricTensor>(
1772 sigma_total));
1773 }
1774
1775 variables.equivalent_plastic_strain =
1776 this->material_states_[ip]
1777 .material_state_variables->getEquivalentPlasticStrain();
1778
1781 .value(variables, x_position, t, dt));
1782
1783 double const k_rel =
1785 .template value<double>(variables, x_position, t, dt);
1786
1788
1789 double const p_FR = -chi_S_L * p_cap_ip;
1790 // p_SR
1791 variables.solid_grain_pressure =
1792 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1793 auto const rho_SR =
1795 .template value<double>(variables, x_position, t, dt);
1797
1798 {
1799 auto& SD = this->current_states_[ip];
1800 auto const& sigma_sw =
1804 .sigma_sw;
1805 auto& eps_m =
1808 .eps_m;
1809 eps_m.noalias() =
1811 ? eps + C_el.inverse() * sigma_sw
1812 : eps;
1813 variables.mechanical_strain.emplace<
1815 eps_m);
1816 }
1817
1818 {
1819 auto& SD = this->current_states_[ip];
1820 auto const& SD_prev = this->prev_states_[ip];
1821 auto& sigma_eff =
1824 auto const& sigma_eff_prev =
1827 SD_prev);
1828 auto const& eps_m =
1831 auto const& eps_m_prev =
1834 SD_prev);
1835
1836 ip_data_[ip].updateConstitutiveRelation(
1840 }
1841
1842 auto const& b = this->process_data_.specific_body_force;
1843
1844 // Compute the velocity
1845 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1846 std::get<
1848 this->output_data_[ip])
1849 ->noalias() = -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1850
1852 porosity_avg += phi;
1854 }
1858
1859 (*this->process_data_.element_saturation)[this->element_.getID()] =
1861 (*this->process_data_.element_porosity)[this->element_.getID()] =
1863
1865 &(*this->process_data_.element_stresses)[this->element_.getID() *
1868
1872 *this->process_data_.pressure_interpolated);
1873}
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:80

References MaterialPropertyLib::AqueousLiquid, MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::VariableArray::effective_pore_pressure, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MaterialPropertyLib::VariableArray::equivalent_plastic_strain, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), MaterialPropertyLib::VariableArray::grain_compressibility, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), NumLib::interpolateToHigherOrderNodes(), ip_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, MathLib::KelvinVector::kelvin_vector_dimensions(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, localDOF(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, MaterialPropertyLib::VariableArray::mechanical_strain, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::output_data_, MaterialPropertyLib::permeability, MaterialPropertyLib::porosity, MaterialPropertyLib::VariableArray::porosity, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, MaterialPropertyLib::saturation_micro, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::Solid, MaterialPropertyLib::VariableArray::solid_grain_pressure, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::swelling_stress_rate, MaterialPropertyLib::VariableArray::temperature, MaterialPropertyLib::VariableArray::total_stress, MathLib::KelvinVector::Invariants< KelvinVectorSize >::trace(), MaterialPropertyLib::transport_porosity, MaterialPropertyLib::VariableArray::transport_porosity, ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain(), MaterialPropertyLib::viscosity, and MaterialPropertyLib::VariableArray::volumetric_strain.

◆ getNumberOfVectorElementsForDeformation()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
int ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getNumberOfVectorElementsForDeformation ( ) const
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 167 of file RichardsMechanicsFEM.h.

168 {
169 return displacement_size;
170 }

References displacement_size.

◆ getShapeMatrix()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 158 of file RichardsMechanicsFEM.h.

160 {
161 auto const& N_u = secondary_data_.N_u[integration_point];
162
163 // assumes N is stored contiguously in memory
164 return Eigen::Map<const Eigen::RowVectorXd>(N_u.data(), N_u.size());
165 }

References secondary_data_.

◆ initializeConcrete()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::initializeConcrete ( )
inlineoverridevirtual

Set initial stress from parameter.

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 110 of file RichardsMechanicsFEM.h.

111 {
112 unsigned const n_integration_points =
113 this->integration_method_.getNumberOfPoints();
114
115 for (unsigned ip = 0; ip < n_integration_points; ip++)
116 {
117 auto& SD = this->current_states_[ip];
118 auto& ip_data = ip_data_[ip];
119
121 std::nullopt, this->element_.getID(),
125 ip_data.N_u))};
126
128 if (this->process_data_.initial_stress.value)
129 {
132 .sigma_eff =
135 // The data in process_data_.initial_stress.value can
136 // be total stress or effective stress.
137 (*this->process_data_.initial_stress.value)(
139 double>::quiet_NaN() /* time independent */,
140 x_position));
141 }
142
143 double const t = 0; // TODO (naumov) pass t from top
144 this->solid_material_.initializeInternalStateVariables(
145 t, x_position,
147
148 this->material_states_[ip].pushBackState();
149
150 this->prev_states_[ip] = SD;
151 }
152 }

References ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ip_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_, and MathLib::KelvinVector::symmetricTensorToKelvinVector().

◆ localDOF()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
constexpr auto ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::localDOF ( auto const & x)
inlinestaticconstexprprivate

◆ setInitialConditionsConcrete()

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setInitialConditionsConcrete ( Eigen::VectorXd const local_x,
double const t,
int const process_id )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 207 of file RichardsMechanicsFEM-impl.h.

211{
213
214 auto const [p_L, u] = localDOF(local_x);
215
216 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
217 auto const& medium =
218 this->process_data_.media_map.getMedium(this->element_.getID());
220
221 auto const& solid_phase =
223
227
228 unsigned const n_integration_points =
229 this->integration_method_.getNumberOfPoints();
230 for (unsigned ip = 0; ip < n_integration_points; ip++)
231 {
232 auto const& N_p = ip_data_[ip].N_p;
233
235 std::nullopt, this->element_.getID(),
239 this->element_, N_p))};
240
241 double p_cap_ip;
243
244 variables.capillary_pressure = p_cap_ip;
245 variables.liquid_phase_pressure = -p_cap_ip;
246 // setting pG to 1 atm
247 // TODO : rewrite equations s.t. p_L = pG-p_cap
248 variables.gas_phase_pressure = 1.0e5;
249
250 {
252 auto& p_L_m_prev =
254 **p_L_m_prev = -p_cap_ip;
255 *p_L_m = -p_cap_ip;
256 }
257
258 auto const temperature =
260 .template value<double>(variables, x_position, t, dt);
261 variables.temperature = temperature;
262
263 auto& S_L_prev =
264 std::get<
266 this->prev_states_[ip])
267 ->S_L;
269 .template value<double>(variables, x_position, t, dt);
270
271 if (this->process_data_.initial_stress.isTotalStress())
272 {
273 auto const alpha_b =
275 .template value<double>(variables, x_position, t, dt);
276
277 variables.liquid_saturation = S_L_prev;
278 double const chi_S_L =
280 .template value<double>(variables, x_position, t, dt);
281
282 // Initial stresses are total stress, which were assigned to
283 // sigma_eff in
284 // RichardsMechanicsLocalAssembler::initializeConcrete().
285 auto& sigma_eff =
288
289 auto& sigma_eff_prev =
292 this->prev_states_[ip]);
293
294 // Reset sigma_eff to effective stress
295 sigma_eff.sigma_eff.noalias() +=
297 sigma_eff_prev->sigma_eff = sigma_eff.sigma_eff;
298 }
299
301 {
303 vars.capillary_pressure = p_cap_ip;
304
306 auto& S_L_m_prev =
308
310 .template value<double>(vars, x_position, t, dt);
311 *S_L_m_prev = S_L_m;
312 }
313
314 // Set eps_m_prev from potentially non-zero eps and sigma_sw from
315 // restart.
316 auto& SD = this->current_states_[ip];
317 variables.stress =
320 .sigma_eff;
321
322 auto const& N_u = ip_data_[ip].N_u;
323 auto const& dNdx_u = ip_data_[ip].dNdx_u;
324 auto const x_coord =
325 x_position.getCoordinates().value()[0]; // r for axisymetric
326 auto const B =
331 auto& eps =
333 .eps;
334 eps.noalias() = B * u;
335
336 // Set mechanical strain temporary to compute tangent stiffness.
337 variables.mechanical_strain
339 eps);
340
341 // dt = 0 at initialization: there is no time step yet, which yields
342 // the elastic tangent. The function-wide dt is NaN to keep
343 // initialization and integration strictly separated.
344 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
345 variables, t, x_position, 0.0 /*dt*/, this->solid_material_,
347
348 auto const& sigma_sw =
352 this->current_states_[ip])
353 .sigma_sw;
354 auto& eps_m_prev =
357 this->prev_states_[ip])
358 ->eps_m;
359
360 eps_m_prev.noalias() =
362 ? eps + C_el.inverse() * sigma_sw
363 : eps;
364 }
365}

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, displacement_size, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ip_data_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::is_axially_symmetric_, MathLib::KelvinVector::kelvin_vector_dimensions(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, localDOF(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::material_states_, MaterialPropertyLib::VariableArray::mechanical_strain, pressure_size, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::prev_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::process_data_, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::saturation, MaterialPropertyLib::saturation_micro, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::Solid, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::solid_material_, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::swelling_stress_rate, and MaterialPropertyLib::VariableArray::temperature.

Member Data Documentation

◆ displacement_index

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
const int ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::displacement_index = ShapeFunctionPressure::NPOINTS
staticprivate

Definition at line 253 of file RichardsMechanicsFEM.h.

Referenced by assemble(), and assembleWithJacobian().

◆ displacement_size

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
const int ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::displacement_size
staticprivate
Initial value:
=
ShapeFunctionDisplacement::NPOINTS * DisplacementDim

Definition at line 254 of file RichardsMechanicsFEM.h.

Referenced by assemble(), assembleWithJacobian(), getNumberOfVectorElementsForDeformation(), and setInitialConditionsConcrete().

◆ ip_data_

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
std::vector<IpData, Eigen::aligned_allocator<IpData> > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::ip_data_
private

◆ KelvinVectorSize

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
int const ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::KelvinVectorSize
static
Initial value:

Definition at line 66 of file RichardsMechanicsFEM.h.

◆ N_u_op

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
auto& ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::N_u_op
staticconstexpr
Initial value:
DisplacementDim,
constexpr Eigen::CwiseNullaryOp< EigenBlockMatrixViewFunctor< D, M >, typename EigenBlockMatrixViewFunctor< D, M >::Matrix > eigenBlockMatrixView(const Eigen::MatrixBase< M > &matrix)
RowVectorType< ShapeFunction::NPOINTS > NodalRowVectorType

Definition at line 72 of file RichardsMechanicsFEM.h.

Referenced by assemble(), and assembleWithJacobian().

◆ pressure_index

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
const int ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::pressure_index = 0
staticprivate

Definition at line 251 of file RichardsMechanicsFEM.h.

Referenced by assemble(), and assembleWithJacobian().

◆ pressure_size

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
const int ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::pressure_size = ShapeFunctionPressure::NPOINTS
staticprivate

◆ secondary_data_

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure, int DisplacementDim>
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType> ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::secondary_data_
private

Definition at line 249 of file RichardsMechanicsFEM.h.

Referenced by getShapeMatrix().


The documentation for this class was generated from the following files: