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 121 of file RichardsMechanicsFEM-impl.h.

130{
131 unsigned const n_integration_points =
132 this->integration_method_.getNumberOfPoints();
133
136
137 auto const shape_matrices_u =
141 this->integration_method_);
142
143 auto const shape_matrices_p =
147
148 auto const& medium =
149 this->process_data_.media_map.getMedium(this->element_.getID());
150
151 for (unsigned ip = 0; ip < n_integration_points; ip++)
152 {
153 auto& ip_data = ip_data_[ip];
154 auto const& sm_u = shape_matrices_u[ip];
155 ip_data_[ip].integration_weight =
156 this->integration_method_.getWeightedPoint(ip).getWeight() *
157 sm_u.integralMeasure * sm_u.detJ;
158
159 ip_data.N_u = sm_u.N;
160 ip_data.dNdx_u = sm_u.dNdx;
161
163 std::nullopt, this->element_.getID(),
167 this->element_, ip_data.N_u))};
168
169 ip_data.N_p = shape_matrices_p[ip].N;
170 ip_data.dNdx_p = shape_matrices_p[ip].dNdx;
171
172 // Initial porosity. Could be read from integration point data or mesh.
173 auto& porosity =
175 this->current_states_[ip])
176 .phi;
177 porosity = medium->property(MPL::porosity)
178 .template initialValue<double>(
181 double>::quiet_NaN() /* t independent */);
182
183 auto& transport_porosity =
184 std::get<
186 this->current_states_[ip])
187 .phi;
190 {
193 .template initialValue<double>(
196 double>::quiet_NaN() /* t independent */);
197 }
198
200 }
201}
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 366 of file RichardsMechanicsFEM-impl.h.

372{
374
375 auto const [p_L, u] = localDOF(local_x);
376 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
377
384
391
396
400
401 auto const& medium =
402 this->process_data_.media_map.getMedium(this->element_.getID());
403 auto const& liquid_phase = medium->phase("AqueousLiquid");
404 auto const& solid_phase = medium->phase("Solid");
407
409 x_position.setElementID(this->element_.getID());
410
411 unsigned const n_integration_points =
412 this->integration_method_.getNumberOfPoints();
413 for (unsigned ip = 0; ip < n_integration_points; ip++)
414 {
415 auto const& w = ip_data_[ip].integration_weight;
416
417 auto const& N_u = ip_data_[ip].N_u;
418 auto const& dNdx_u = ip_data_[ip].dNdx_u;
419
420 auto const& N_p = ip_data_[ip].N_p;
421 auto const& dNdx_p = ip_data_[ip].dNdx_p;
422
423 x_position = {
424 std::nullopt, this->element_.getID(),
428 this->element_, N_u))};
429 auto const x_coord = x_position.getCoordinates().value()[0];
430
431 auto const B =
436
437 auto& eps =
439 eps.eps.noalias() = B * u;
440
441 auto& S_L =
443 this->current_states_[ip])
444 .S_L;
445 auto const S_L_prev =
446 std::get<
448 this->prev_states_[ip])
449 ->S_L;
450
451 double p_cap_ip;
453
454 double p_cap_prev_ip;
456
457 variables.capillary_pressure = p_cap_ip;
458 variables.liquid_phase_pressure = -p_cap_ip;
459 // setting pG to 1 atm
460 // TODO : rewrite equations s.t. p_L = pG-p_cap
461 variables.gas_phase_pressure = 1.0e5;
462
463 auto const temperature =
465 .template value<double>(variables, x_position, t, dt);
466 variables.temperature = temperature;
467
468 auto const alpha =
470 .template value<double>(variables, x_position, t, dt);
471 auto& SD = this->current_states_[ip];
472 variables.stress =
475 .sigma_eff;
476 // Set mechanical strain temporary to compute tangent stiffness.
477 variables.mechanical_strain
479 eps.eps);
480 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
483
484 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
485 t, x_position, &C_el);
486 variables.grain_compressibility = beta_SR;
487
488 auto const rho_LR =
490 .template value<double>(variables, x_position, t, dt);
491 variables.density = rho_LR;
492
493 auto const& b = this->process_data_.specific_body_force;
494
496 .template value<double>(variables, x_position, t, dt);
497 variables.liquid_saturation = S_L;
498 variables_prev.liquid_saturation = S_L_prev;
499
500 // tangent derivative for Jacobian
501 double const dS_L_dp_cap =
503 .template dValue<double>(variables,
505 x_position, t, dt);
506 // secant derivative from time discretization for storage
507 // use tangent, if secant is not available
508 double const DeltaS_L_Deltap_cap =
512
513 auto const chi = [medium, x_position, t, dt](double const S_L)
514 {
516 vs.liquid_saturation = S_L;
518 .template value<double>(vs, x_position, t, dt);
519 };
520 double const chi_S_L = chi(S_L);
521 double const chi_S_L_prev = chi(S_L_prev);
522
523 double const p_FR = -chi_S_L * p_cap_ip;
524 variables.effective_pore_pressure = p_FR;
525 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
526
527 // Set volumetric strain rate for the general case without swelling.
528 variables.volumetric_strain = Invariants::trace(eps.eps);
529 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
530
532 this->current_states_[ip])
533 .phi;
534 { // Porosity update
535 auto const phi_prev = std::get<PrevState<
537 this->prev_states_[ip])
538 ->phi;
539 variables_prev.porosity = phi_prev;
542 x_position, t, dt);
543 variables.porosity = phi;
544 }
545
546 if (alpha < phi)
547 {
548 OGS_FATAL(
549 "RichardsMechanics: Biot-coefficient {} is smaller than "
550 "porosity {} in element/integration point {}/{}.",
551 alpha, phi, this->element_.getID(), ip);
552 }
553
554 // Swelling and possibly volumetric strain rate update.
555 {
556 auto& sigma_sw =
560 this->current_states_[ip])
561 .sigma_sw;
562 auto const& sigma_sw_prev = std::get<PrevState<
566 ->sigma_sw;
567
568 // If there is swelling, compute it. Update volumetric strain rate,
569 // s.t. it corresponds to the mechanical part only.
571 if (solid_phase.hasProperty(
573 {
574 auto const sigma_sw_dot =
579 dt)));
581
582 variables.volumetric_mechanical_strain =
583 variables.volumetric_strain +
584 identity2.transpose() * C_el.inverse() * sigma_sw;
585 variables_prev.volumetric_mechanical_strain =
586 variables_prev.volumetric_strain +
587 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
588 }
589 else
590 {
591 variables.volumetric_mechanical_strain =
592 variables.volumetric_strain;
593 variables_prev.volumetric_mechanical_strain =
594 variables_prev.volumetric_strain;
595 }
596
598 {
599 auto& transport_porosity =
602 this->current_states_[ip])
603 .phi;
604 auto const transport_porosity_prev =
607 this->prev_states_[ip])
608 ->phi;
609 variables_prev.transport_porosity = transport_porosity_prev;
610
614 x_position, t, dt);
615 variables.transport_porosity = transport_porosity;
616 }
617 else
618 {
619 variables.transport_porosity = phi;
620 }
621 }
622
623 double const k_rel =
625 .template value<double>(variables, x_position, t, dt);
626 auto const mu =
628 .template value<double>(variables, x_position, t, dt);
629
630 auto const& sigma_sw =
634 this->current_states_[ip])
635 .sigma_sw;
636 auto const& sigma_eff =
639 .sigma_eff;
640
641 // Set mechanical variables for the intrinsic permeability model
642 // For stress dependent permeability.
643 {
644 auto const sigma_total =
646
647 // For stress dependent permeability.
648 variables.total_stress.emplace<SymmetricTensor>(
650 sigma_total));
651 }
652
653 variables.equivalent_plastic_strain =
654 this->material_states_[ip]
655 .material_state_variables->getEquivalentPlasticStrain();
656
659 .value(variables, x_position, t, dt));
660
663
664 //
665 // displacement equation, displacement part
666 //
667 {
670 this->current_states_[ip])
671 .eps_m;
672 eps_m.noalias() =
674 ? eps.eps + C_el.inverse() * sigma_sw
675 : eps.eps;
676 variables.mechanical_strain.emplace<
678 eps_m);
679 }
680
681 {
682 auto& SD = this->current_states_[ip];
683 auto const& SD_prev = this->prev_states_[ip];
684 auto& sigma_eff =
687 auto const& sigma_eff_prev =
690 SD_prev);
691 auto const& eps_m =
694 auto& eps_m_prev =
697 SD_prev);
698
699 auto const C = ip_data_[ip].updateConstitutiveRelation(
703
704 if (this->process_data_.use_numerical_jacobian)
705 {
708 .noalias() += B.transpose() * C * B * w;
709 }
710 }
711
712 // p_SR
713 variables.solid_grain_pressure =
714 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
715 auto const rho_SR =
717 .template value<double>(variables, x_position, t, dt);
718
719 //
720 // displacement equation, displacement part
721 //
722 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
724 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
725
726 //
727 // pressure equation, pressure part.
728 //
729 auto const beta_LR =
730 1 / rho_LR *
732 .template dValue<double>(variables,
734 x_position, t, dt);
735
736 double const a0 = S_L * (alpha - phi) * beta_SR;
737 // Volumetric average specific storage of the solid and fluid phases.
738 double const specific_storage =
740 S_L * (phi * beta_LR + a0);
743 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
744
747 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
748
749 rhs.template segment<pressure_size>(pressure_index).noalias() +=
750 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
751
752 //
753 // displacement equation, pressure part
754 //
757 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
758
759 //
760 // pressure equation, displacement part.
761 //
764 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
765 identity2.transpose() * B * w;
766 }
767
768 if (this->process_data_.apply_mass_lumping)
769 {
772 Mpp = Mpp.colwise().sum().eval().asDiagonal();
773 }
774}
#define OGS_FATAL(...)
Definition Error.h:19
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 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::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 1092 of file RichardsMechanicsFEM-impl.h.

1098{
1100
1101 auto const [p_L, u] = localDOF(local_x);
1102 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1103
1110
1115
1119
1123
1127
1131
1135
1141
1147
1148 auto const& medium =
1149 this->process_data_.media_map.getMedium(this->element_.getID());
1150 auto const& liquid_phase = medium->phase("AqueousLiquid");
1151 auto const& solid_phase = medium->phase("Solid");
1154
1155 unsigned const n_integration_points =
1156 this->integration_method_.getNumberOfPoints();
1157 for (unsigned ip = 0; ip < n_integration_points; ip++)
1158 {
1160 auto& SD = this->current_states_[ip];
1161 auto const& SD_prev = this->prev_states_[ip];
1163 this->process_data_, this->solid_material_);
1164
1165 auto const& w = ip_data_[ip].integration_weight;
1166
1167 auto const& N_u = ip_data_[ip].N_u;
1168 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1169
1170 auto const& N_p = ip_data_[ip].N_p;
1171 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1172
1174 std::nullopt, this->element_.getID(),
1178 this->element_, N_u))};
1179 auto const x_coord = x_position.getCoordinates().value()[0];
1180
1181 auto const B =
1186
1187 double p_cap_ip;
1189
1190 double p_cap_prev_ip;
1192
1193 variables.capillary_pressure = p_cap_ip;
1194 variables.liquid_phase_pressure = -p_cap_ip;
1195 // setting pG to 1 atm
1196 // TODO : rewrite equations s.t. p_L = pG-p_cap
1197 variables.gas_phase_pressure = 1.0e5;
1198
1199 auto const temperature =
1201 .template value<double>(variables, x_position, t, dt);
1202 variables.temperature = temperature;
1203
1205
1212 CD, SD, SD_prev, this->process_data_.micro_porosity_parameters,
1213 this->solid_material_, this->material_states_[ip]);
1214
1215 {
1217 local_Jac
1220 .noalias() += B.transpose() * C * B * w;
1221 }
1222
1223 auto const& b = this->process_data_.specific_body_force;
1224
1225 {
1226 auto const& sigma_eff =
1229 .sigma_eff;
1230 double const rho = *std::get<Density>(CD);
1232 .noalias() -= (B.transpose() * sigma_eff -
1233 N_u_op(N_u).transpose() * rho * b) *
1234 w;
1235 }
1236
1237 //
1238 // displacement equation, pressure part
1239 //
1240
1241 double const alpha =
1243 double const dS_L_dp_cap =
1245 CD)
1246 .dS_L_dp_cap;
1247
1248 {
1249 double const chi_S_L =
1251 .chi_S_L;
1252 Kup.noalias() +=
1253 B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
1254 double const dchi_dS_L =
1256 .dchi_dS_L;
1257
1258 local_Jac
1261 .noalias() -= B.transpose() * alpha *
1263 identity2 * N_p * w;
1264 }
1265
1266 double const phi =
1268 double const rho_LR = *std::get<LiquidDensity>(CD);
1269 local_Jac
1272 .noalias() +=
1273 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1274
1275 // For the swelling stress with double structure model the corresponding
1276 // Jacobian u-p entry would be required, but it does not improve
1277 // convergence and sometimes worsens it:
1278 // if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1279 // {
1280 // -B.transpose() *
1281 // dsigma_sw_dS_L_m* dS_L_m_dp_cap_m*(p_L_m - p_L_m_prev) /
1282 // (p_cap_ip - p_cap_prev_ip) * N_p* w;
1283 // }
1284 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1286 {
1288 auto const dsigma_sw_dS_L =
1292 .template dValue<DimMatrix>(
1295 dt));
1296 local_Jac
1299 .noalias() +=
1300 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1301 }
1302 //
1303 // pressure equation, displacement part.
1304 //
1305 double const S_L =
1307 this->current_states_[ip])
1308 .S_L;
1309 if (this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1310 {
1311 double const chi_S_L_prev = std::get<PrevState<
1313 ->chi_S_L;
1314 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1315 identity2.transpose() * B * w;
1316 }
1317 else
1318 {
1319 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1320 identity2.transpose() * B * w;
1321 }
1322
1323 //
1324 // pressure equation, pressure part.
1325 //
1326
1327 double const k_rel =
1330 .k_rel;
1331 auto const& K_intrinsic =
1334 .Ki;
1335 double const mu =
1337 CD);
1338
1340
1341 laplace_p.noalias() +=
1342 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1343
1344 auto const beta_LR =
1345 1 / rho_LR *
1347 .template dValue<double>(variables,
1349 x_position, t, dt);
1350
1351 double const beta_SR =
1352 std::get<
1354 CD)
1355 .beta_SR;
1356 double const a0 = (alpha - phi) * beta_SR;
1357 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1358 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1359
1360 double const dspecific_storage_a_p_dp_cap =
1361 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1362 double const dspecific_storage_a_S_dp_cap =
1363 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1364
1365 storage_p_a_p.noalias() +=
1366 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1367
1368 double const DeltaS_L_Deltap_cap =
1369 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap;
1370 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1372 N_p * w;
1373
1374 local_Jac
1377 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1379
1380 double const S_L_prev =
1381 std::get<
1383 this->prev_states_[ip])
1384 ->S_L;
1385 storage_p_a_S_Jpp.noalias() -=
1386 N_p.transpose() * rho_LR *
1389 dt * N_p * w;
1390
1391 if (!this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1392 {
1393 local_Jac
1396 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1397 identity2.transpose() * B * (u - u_prev) / dt *
1398 N_p * w;
1399 }
1400
1401 double const dk_rel_dS_l =
1403 .template dValue<double>(variables,
1405 x_position, t, dt);
1407 grad_p_cap = -dNdx_p * p_L;
1408 local_Jac
1411 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1413
1414 local_Jac
1417 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1419
1420 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1421 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1422
1424 {
1425 double const alpha_bar =
1426 this->process_data_.micro_porosity_parameters
1427 ->mass_exchange_coefficient;
1428 auto const p_L_m =
1431 .noalias() -=
1432 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1433
1434 local_Jac
1437 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1438 if (p_cap_ip != p_cap_prev_ip)
1439 {
1441 this->prev_states_[ip]);
1442 local_Jac
1445 .noalias() += N_p.transpose() * alpha_bar / mu *
1446 (p_L_m - p_L_m_prev) /
1447 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1448 }
1449 }
1450 }
1451
1452 if (this->process_data_.apply_mass_lumping)
1453 {
1454 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1455 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1457 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1458 }
1459
1460 // pressure equation, pressure part.
1461 local_Jac
1464 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1465
1466 // pressure equation, displacement part.
1467 local_Jac
1470 .noalias() = Kpu / dt;
1471
1472 // pressure equation
1473 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1474 laplace_p * p_L +
1476 Kpu * (u - u_prev) / dt;
1477
1478 // displacement equation
1480 .noalias() += Kup * p_L;
1481}
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 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(), 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 779 of file RichardsMechanicsFEM-impl.h.

797{
798 auto const& liquid_phase = medium->phase("AqueousLiquid");
799 auto const& solid_phase = medium->phase("Solid");
800
804
805 double const temperature = T_data();
806 double const p_cap_ip = p_cap_data.p_cap;
807 double const p_cap_prev_ip = p_cap_data.p_cap_prev;
808
810 auto& S_L =
812 auto const S_L_prev =
813 std::get<
815 SD_prev)
816 ->S_L;
817 auto const alpha =
819 .template value<double>(variables, x_position, t, dt);
821
822 variables.stress =
825 .sigma_eff;
826 // Set mechanical strain temporary to compute tangent stiffness.
827 variables.mechanical_strain
829 eps.eps);
830 auto const C_el = ip_data.computeElasticTangentStiffness(
832 *material_state_data.material_state_variables);
833
834 auto const beta_SR =
835 (1 - alpha) / solid_material.getBulkModulus(t, x_position, &C_el);
836 variables.grain_compressibility = beta_SR;
838 .beta_SR = beta_SR;
839
840 auto const rho_LR =
842 .template value<double>(variables, x_position, t, dt);
843 variables.density = rho_LR;
845
847 .template value<double>(variables, x_position, t, dt);
848 variables.liquid_saturation = S_L;
849 variables_prev.liquid_saturation = S_L_prev;
850
851 // tangent derivative for Jacobian
852 double const dS_L_dp_cap =
854 .template dValue<double>(variables,
856 x_position, t, dt);
858 .dS_L_dp_cap = dS_L_dp_cap;
859 // secant derivative from time discretization for storage
860 // use tangent, if secant is not available
861 double const DeltaS_L_Deltap_cap =
865 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap =
867
868 auto const chi = [medium, x_position, t, dt](double const S_L)
869 {
871 vs.liquid_saturation = S_L;
873 .template value<double>(vs, x_position, t, dt);
874 };
875 double const chi_S_L = chi(S_L);
877 chi_S_L;
878 double const chi_S_L_prev = chi(S_L_prev);
881
882 auto const dchi_dS_L =
884 .template dValue<double>(
887 dchi_dS_L;
888
889 double const p_FR = -chi_S_L * p_cap_ip;
890 variables.effective_pore_pressure = p_FR;
891 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
892
893 // Set volumetric strain rate for the general case without swelling.
894 variables.volumetric_strain = Invariants::trace(eps.eps);
895 // TODO (CL) changed that, using eps_prev for the moment, not B * u_prev
896 // variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
897 variables_prev.volumetric_strain = Invariants::trace(
899
900 auto& phi =
902 { // Porosity update
903 auto const phi_prev =
904 std::get<
906 SD_prev)
907 ->phi;
908 variables_prev.porosity = phi_prev;
911 t, dt);
912 variables.porosity = phi;
913 }
915
916 if (alpha < phi)
917 {
918 auto const eid =
919 x_position.getElementID()
920 ? static_cast<std::ptrdiff_t>(*x_position.getElementID())
921 : static_cast<std::ptrdiff_t>(-1);
922 OGS_FATAL(
923 "RichardsMechanics: Biot-coefficient {} is smaller than porosity "
924 "{} in element {}.",
925 alpha, phi, eid);
926 }
927
928 auto const mu = liquid_phase.property(MPL::PropertyType::viscosity)
929 .template value<double>(variables, x_position, t, dt);
931 mu;
932
933 {
934 // Swelling and possibly volumetric strain rate update.
935 auto& sigma_sw =
939 auto const& sigma_sw_prev =
943 SD_prev);
946 SD_prev);
947 auto const phi_prev = std::get<
949 SD_prev);
956
962 }
963
965 {
967 {
968 auto& transport_porosity =
969 std::get<
971 SD)
972 .phi;
975 SD_prev)
976 ->phi;
977 variables_prev.transport_porosity = transport_porosity_prev;
978
982 x_position, t, dt);
983 variables.transport_porosity = transport_porosity;
984 }
985 }
986 else
987 {
988 variables.transport_porosity = phi;
989 }
990
991 // Set mechanical variables for the intrinsic permeability model
992 // For stress dependent permeability.
993 {
994 // TODO mechanical constitutive relation will be evaluated afterwards
995 auto const sigma_total =
998 .sigma_eff +
999 alpha * p_FR * identity2)
1000 .eval();
1001 // For stress dependent permeability.
1002 variables.total_stress.emplace<SymmetricTensor>(
1004 }
1005
1006 variables.equivalent_plastic_strain =
1007 material_state_data.material_state_variables
1008 ->getEquivalentPlasticStrain();
1009
1010 double const k_rel =
1012 .template value<double>(variables, x_position, t, dt);
1013
1016 .value(variables, x_position, t, dt));
1017
1018 std::get<
1020 CD)
1021 .k_rel = k_rel;
1022 std::get<
1024 CD)
1025 .Ki = K_intrinsic;
1026
1027 //
1028 // displacement equation, displacement part
1029 //
1030
1031 {
1032 auto& sigma_sw =
1036 .sigma_sw;
1037
1038 auto& eps_m =
1041 .eps_m;
1042 eps_m.noalias() =
1044 ? eps.eps + C_el.inverse() * sigma_sw
1045 : eps.eps;
1046 variables.mechanical_strain
1048 eps_m);
1049 }
1050
1051 {
1052 auto& sigma_eff =
1055 auto const& sigma_eff_prev =
1058 SD_prev);
1059 auto const& eps_m =
1062 auto& eps_m_prev =
1065 SD_prev);
1066
1067 auto C = ip_data.updateConstitutiveRelation(
1070 material_state_data.material_state_variables);
1071
1073 }
1074
1075 // p_SR
1076 variables.solid_grain_pressure =
1079 .sigma_eff.dot(identity2) /
1080 (3 * (1 - phi));
1081 auto const rho_SR =
1083 .template value<double>(variables, x_position, t, dt);
1084
1085 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
1087}
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::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::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 1500 of file RichardsMechanicsFEM-impl.h.

1507{
1508 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1509}

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 1486 of file RichardsMechanicsFEM-impl.h.

1493{
1494 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1495}

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 1514 of file RichardsMechanicsFEM-impl.h.

1521{
1522 // For the equations with pressure
1523 if (process_id == 0)
1524 {
1527 return;
1528 }
1529
1530 // For the equations with deformation
1533}
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 1538 of file RichardsMechanicsFEM-impl.h.

1542{
1543 auto const [p_L, u] = localDOF(local_x);
1544 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1545
1549
1550 auto const& medium =
1551 this->process_data_.media_map.getMedium(this->element_.getID());
1552 auto const& liquid_phase = medium->phase("AqueousLiquid");
1553 auto const& solid_phase = medium->phase("Solid");
1556
1557 unsigned const n_integration_points =
1558 this->integration_method_.getNumberOfPoints();
1559
1560 double saturation_avg = 0;
1561 double porosity_avg = 0;
1562
1564 KV sigma_avg = KV::Zero();
1565
1566 for (unsigned ip = 0; ip < n_integration_points; ip++)
1567 {
1568 auto const& N_p = ip_data_[ip].N_p;
1569 auto const& N_u = ip_data_[ip].N_u;
1570 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1571
1573 std::nullopt, this->element_.getID(),
1577 this->element_, N_u))};
1578 auto const x_coord = x_position.getCoordinates().value()[0];
1579
1580 auto const B =
1585
1586 double p_cap_ip;
1588
1589 double p_cap_prev_ip;
1591
1592 variables.capillary_pressure = p_cap_ip;
1593 variables.liquid_phase_pressure = -p_cap_ip;
1594 // setting pG to 1 atm
1595 // TODO : rewrite equations s.t. p_L = pG-p_cap
1596 variables.gas_phase_pressure = 1.0e5;
1597
1598 auto const temperature =
1600 .template value<double>(variables, x_position, t, dt);
1601 variables.temperature = temperature;
1602
1603 auto& eps =
1605 .eps;
1606 eps.noalias() = B * u;
1607 auto& S_L =
1609 this->current_states_[ip])
1610 .S_L;
1611 auto const S_L_prev =
1612 std::get<
1614 this->prev_states_[ip])
1615 ->S_L;
1617 .template value<double>(variables, x_position, t, dt);
1618 variables.liquid_saturation = S_L;
1619 variables_prev.liquid_saturation = S_L_prev;
1620
1621 auto const chi = [medium, x_position, t, dt](double const S_L)
1622 {
1624 vs.liquid_saturation = S_L;
1626 .template value<double>(vs, x_position, t, dt);
1627 };
1628 double const chi_S_L = chi(S_L);
1629 double const chi_S_L_prev = chi(S_L_prev);
1630
1631 auto const alpha =
1633 .template value<double>(variables, x_position, t, dt);
1634 auto& SD = this->current_states_[ip];
1635 variables.stress =
1638 .sigma_eff;
1639 // Set mechanical strain temporary to compute tangent stiffness.
1640 variables.mechanical_strain
1642 eps);
1643 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
1646
1647 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
1648 t, x_position, &C_el);
1649 variables.grain_compressibility = beta_SR;
1650
1651 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1652 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1653
1654 // Set volumetric strain rate for the general case without swelling.
1655 variables.volumetric_strain = Invariants::trace(eps);
1656 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
1657
1659 this->current_states_[ip])
1660 .phi;
1661 { // Porosity update
1662 auto const phi_prev = std::get<PrevState<
1664 this->prev_states_[ip])
1665 ->phi;
1666 variables_prev.porosity = phi_prev;
1669 x_position, t, dt);
1670 variables.porosity = phi;
1671 }
1672
1673 auto const rho_LR =
1675 .template value<double>(variables, x_position, t, dt);
1676 variables.density = rho_LR;
1677 auto const mu =
1679 .template value<double>(variables, x_position, t, dt);
1680
1681 {
1682 // Swelling and possibly volumetric strain rate update.
1683 auto& sigma_sw =
1687 this->current_states_[ip]);
1688 auto const& sigma_sw_prev = std::get<
1692 this->prev_states_[ip]);
1695 this->prev_states_[ip]);
1696 auto const phi_prev = std::get<
1698 this->prev_states_[ip]);
1701 this->current_states_[ip]);
1703 auto const p_L_m_prev =
1706 auto const S_L_m_prev =
1708
1711 this->process_data_.micro_porosity_parameters, alpha, phi,
1715 }
1716
1718 {
1720 {
1721 auto& transport_porosity =
1724 this->current_states_[ip])
1725 .phi;
1726 auto const transport_porosity_prev =
1729 this->prev_states_[ip])
1730 ->phi;
1731
1732 variables_prev.transport_porosity = transport_porosity_prev;
1733
1737 x_position, t, dt);
1738 variables.transport_porosity = transport_porosity;
1739 }
1740 }
1741 else
1742 {
1743 variables.transport_porosity = phi;
1744 }
1745
1746 auto const& sigma_eff =
1749 .sigma_eff;
1750
1751 // Set mechanical variables for the intrinsic permeability model
1752 // For stress dependent permeability.
1753 {
1754 auto const sigma_total =
1756 // For stress dependent permeability.
1757 variables.total_stress.emplace<SymmetricTensor>(
1759 sigma_total));
1760 }
1761
1762 variables.equivalent_plastic_strain =
1763 this->material_states_[ip]
1764 .material_state_variables->getEquivalentPlasticStrain();
1765
1768 .value(variables, x_position, t, dt));
1769
1770 double const k_rel =
1772 .template value<double>(variables, x_position, t, dt);
1773
1775
1776 double const p_FR = -chi_S_L * p_cap_ip;
1777 // p_SR
1778 variables.solid_grain_pressure =
1779 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1780 auto const rho_SR =
1782 .template value<double>(variables, x_position, t, dt);
1784
1785 {
1786 auto& SD = this->current_states_[ip];
1787 auto const& sigma_sw =
1791 .sigma_sw;
1792 auto& eps_m =
1795 .eps_m;
1796 eps_m.noalias() =
1798 ? eps + C_el.inverse() * sigma_sw
1799 : eps;
1800 variables.mechanical_strain.emplace<
1802 eps_m);
1803 }
1804
1805 {
1806 auto& SD = this->current_states_[ip];
1807 auto const& SD_prev = this->prev_states_[ip];
1808 auto& sigma_eff =
1811 auto const& sigma_eff_prev =
1814 SD_prev);
1815 auto const& eps_m =
1818 auto const& eps_m_prev =
1821 SD_prev);
1822
1823 ip_data_[ip].updateConstitutiveRelation(
1827 }
1828
1829 auto const& b = this->process_data_.specific_body_force;
1830
1831 // Compute the velocity
1832 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1833 std::get<
1835 this->output_data_[ip])
1836 ->noalias() = -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1837
1839 porosity_avg += phi;
1841 }
1845
1846 (*this->process_data_.element_saturation)[this->element_.getID()] =
1848 (*this->process_data_.element_porosity)[this->element_.getID()] =
1850
1852 &(*this->process_data_.element_stresses)[this->element_.getID() *
1855
1859 *this->process_data_.pressure_interpolated);
1860}
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:80

References 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::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 206 of file RichardsMechanicsFEM-impl.h.

210{
212
213 auto const [p_L, u] = localDOF(local_x);
214
215 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
216 auto const& medium =
217 this->process_data_.media_map.getMedium(this->element_.getID());
219
220 auto const& solid_phase = medium->phase("Solid");
221
225
226 unsigned const n_integration_points =
227 this->integration_method_.getNumberOfPoints();
228 for (unsigned ip = 0; ip < n_integration_points; ip++)
229 {
230 auto const& N_p = ip_data_[ip].N_p;
231
233 std::nullopt, this->element_.getID(),
237 this->element_, N_p))};
238
239 double p_cap_ip;
241
242 variables.capillary_pressure = p_cap_ip;
243 variables.liquid_phase_pressure = -p_cap_ip;
244 // setting pG to 1 atm
245 // TODO : rewrite equations s.t. p_L = pG-p_cap
246 variables.gas_phase_pressure = 1.0e5;
247
248 {
250 auto& p_L_m_prev =
252 **p_L_m_prev = -p_cap_ip;
253 *p_L_m = -p_cap_ip;
254 }
255
256 auto const temperature =
258 .template value<double>(variables, x_position, t, dt);
259 variables.temperature = temperature;
260
261 auto& S_L_prev =
262 std::get<
264 this->prev_states_[ip])
265 ->S_L;
267 .template value<double>(variables, x_position, t, dt);
268
269 if (this->process_data_.initial_stress.isTotalStress())
270 {
271 auto const alpha_b =
273 .template value<double>(variables, x_position, t, dt);
274
275 variables.liquid_saturation = S_L_prev;
276 double const chi_S_L =
278 .template value<double>(variables, x_position, t, dt);
279
280 // Initial stresses are total stress, which were assigned to
281 // sigma_eff in
282 // RichardsMechanicsLocalAssembler::initializeConcrete().
283 auto& sigma_eff =
286
287 auto& sigma_eff_prev =
290 this->prev_states_[ip]);
291
292 // Reset sigma_eff to effective stress
293 sigma_eff.sigma_eff.noalias() +=
295 sigma_eff_prev->sigma_eff = sigma_eff.sigma_eff;
296 }
297
299 {
301 vars.capillary_pressure = p_cap_ip;
302
304 auto& S_L_m_prev =
306
308 .template value<double>(vars, x_position, t, dt);
309 *S_L_m_prev = S_L_m;
310 }
311
312 // Set eps_m_prev from potentially non-zero eps and sigma_sw from
313 // restart.
314 auto& SD = this->current_states_[ip];
315 variables.stress =
318 .sigma_eff;
319
320 auto const& N_u = ip_data_[ip].N_u;
321 auto const& dNdx_u = ip_data_[ip].dNdx_u;
322 auto const x_coord =
323 x_position.getCoordinates().value()[0]; // r for axisymetric
324 auto const B =
329 auto& eps =
331 .eps;
332 eps.noalias() = B * u;
333
334 // Set mechanical strain temporary to compute tangent stiffness.
335 variables.mechanical_strain
337 eps);
338
339 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
342
343 auto const& sigma_sw =
347 this->current_states_[ip])
348 .sigma_sw;
349 auto& eps_m_prev =
352 this->prev_states_[ip])
353 ->eps_m;
354
355 eps_m_prev.noalias() =
357 ? eps + C_el.inverse() * sigma_sw
358 : eps;
359 }
360}

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(), 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: