Loading [MathJax]/extensions/tex2jax.js
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 52 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.
 
- 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.
 
virtual std::optional< VectorSegmentgetVectorDeformationSegment () const
 
- 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
Initial value:
BMatrixPolicyType<ShapeFunctionDisplacement, DisplacementDim>

Definition at line 64 of file RichardsMechanicsFEM.h.

◆ GlobalDimMatrixType

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

Definition at line 61 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 75 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
BMatrixPolicyType< ShapeFunctionDisplacement, DisplacementDim > BMatricesType
ShapeMatrixPolicyType< ShapeFunctionPressure, DisplacementDim > ShapeMatricesTypePressure

Definition at line 68 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 66 of file RichardsMechanicsFEM.h.

◆ ShapeMatricesTypeDisplacement

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

◆ 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 77 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 129 of file RichardsMechanicsFEM-impl.h.

137 e, integration_method, is_axially_symmetric, process_data}
138{
139 unsigned const n_integration_points =
141
142 ip_data_.resize(n_integration_points);
143 secondary_data_.N_u.resize(n_integration_points);
144
145 auto const shape_matrices_u =
146 NumLib::initShapeMatrices<ShapeFunctionDisplacement,
148 DisplacementDim>(e, is_axially_symmetric,
149 this->integration_method_);
150
151 auto const shape_matrices_p =
152 NumLib::initShapeMatrices<ShapeFunctionPressure,
153 ShapeMatricesTypePressure, DisplacementDim>(
154 e, is_axially_symmetric, this->integration_method_);
155
156 auto const& medium =
157 this->process_data_.media_map.getMedium(this->element_.getID());
158
159 for (unsigned ip = 0; ip < n_integration_points; ip++)
160 {
161 auto& ip_data = ip_data_[ip];
162 auto const& sm_u = shape_matrices_u[ip];
163 ip_data_[ip].integration_weight =
165 sm_u.integralMeasure * sm_u.detJ;
166
167 ip_data.N_u = sm_u.N;
168 ip_data.dNdx_u = sm_u.dNdx;
169
170 ParameterLib::SpatialPosition x_position = {
171 std::nullopt, this->element_.getID(),
173 NumLib::interpolateCoordinates<ShapeFunctionDisplacement,
175 this->element_, ip_data.N_u))};
176
177 ip_data.N_p = shape_matrices_p[ip].N;
178 ip_data.dNdx_p = shape_matrices_p[ip].dNdx;
179
180 // Initial porosity. Could be read from integration point data or mesh.
181 auto& porosity =
182 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
183 this->current_states_[ip])
184 .phi;
185 porosity = medium->property(MPL::porosity)
186 .template initialValue<double>(
187 x_position,
188 std::numeric_limits<
189 double>::quiet_NaN() /* t independent */);
190
191 auto& transport_porosity =
192 std::get<
194 this->current_states_[ip])
195 .phi;
197 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
198 {
200 medium->property(MPL::transport_porosity)
201 .template initialValue<double>(
202 x_position,
203 std::numeric_limits<
204 double>::quiet_NaN() /* t independent */);
205 }
206
207 secondary_data_.N_u[ip] = shape_matrices_u[ip].N;
208 }
209}
constexpr double getWeight() const
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > secondary_data_
std::vector< IpData, Eigen::aligned_allocator< IpData > > ip_data_
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
std::vector< StatefulData< DisplacementDim > > current_states_
LocalAssemblerInterface(MeshLib::Element const &e, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, RichardsMechanicsProcessData< DisplacementDim > &process_data)
RichardsMechanicsProcessData< DisplacementDim > & process_data_
NumLib::GenericIntegrationMethod const & integration_method_
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u

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

371{
372 assert(local_x.size() == pressure_size + displacement_size);
373
374 auto const [p_L, u] = localDOF(local_x);
375 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
376
378 typename ShapeMatricesTypeDisplacement::template MatrixType<
381 local_K_data, displacement_size + pressure_size,
383
385 typename ShapeMatricesTypeDisplacement::template MatrixType<
388 local_M_data, displacement_size + pressure_size,
390
392 typename ShapeMatricesTypeDisplacement::template VectorType<
394 local_rhs_data, displacement_size + pressure_size);
395
396 auto const& identity2 = MathLib::KelvinVector::Invariants<
398 DisplacementDim)>::identity2;
399
400 auto const& medium =
401 this->process_data_.media_map.getMedium(this->element_.getID());
402 auto const& liquid_phase = medium->phase("AqueousLiquid");
403 auto const& solid_phase = medium->phase("Solid");
404 MPL::VariableArray variables;
405 MPL::VariableArray variables_prev;
406
408 x_position.setElementID(this->element_.getID());
409
410 unsigned const n_integration_points =
412 for (unsigned ip = 0; ip < n_integration_points; ip++)
413 {
414 auto const& w = ip_data_[ip].integration_weight;
415
416 auto const& N_u = ip_data_[ip].N_u;
417 auto const& dNdx_u = ip_data_[ip].dNdx_u;
418
419 auto const& N_p = ip_data_[ip].N_p;
420 auto const& dNdx_p = ip_data_[ip].dNdx_p;
421
422 x_position = {
423 std::nullopt, this->element_.getID(),
425 NumLib::interpolateCoordinates<ShapeFunctionDisplacement,
427 this->element_, N_u))};
428 auto const x_coord = x_position.getCoordinates().value()[0];
429
430 auto const B =
431 LinearBMatrix::computeBMatrix<DisplacementDim,
432 ShapeFunctionDisplacement::NPOINTS,
434 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
435
436 auto& eps =
437 std::get<StrainData<DisplacementDim>>(this->current_states_[ip]);
438 eps.eps.noalias() = B * u;
439
440 auto& S_L =
441 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
442 this->current_states_[ip])
443 .S_L;
444 auto const S_L_prev =
445 std::get<
446 PrevState<ProcessLib::ThermoRichardsMechanics::SaturationData>>(
447 this->prev_states_[ip])
448 ->S_L;
449
450 double p_cap_ip;
451 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
452
453 double p_cap_prev_ip;
454 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
455
456 variables.capillary_pressure = p_cap_ip;
457 variables.liquid_phase_pressure = -p_cap_ip;
458 // setting pG to 1 atm
459 // TODO : rewrite equations s.t. p_L = pG-p_cap
460 variables.gas_phase_pressure = 1.0e5;
461
462 auto const temperature =
463 medium->property(MPL::PropertyType::reference_temperature)
464 .template value<double>(variables, x_position, t, dt);
465 variables.temperature = temperature;
466
467 auto const alpha =
468 medium->property(MPL::PropertyType::biot_coefficient)
469 .template value<double>(variables, x_position, t, dt);
470 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
471 t, x_position, dt, temperature, this->solid_material_,
472 *this->material_states_[ip].material_state_variables);
473
474 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
475 t, x_position, &C_el);
476 variables.grain_compressibility = beta_SR;
477
478 auto const rho_LR =
479 liquid_phase.property(MPL::PropertyType::density)
480 .template value<double>(variables, x_position, t, dt);
481 variables.density = rho_LR;
482
483 auto const& b = this->process_data_.specific_body_force;
484
485 S_L = medium->property(MPL::PropertyType::saturation)
486 .template value<double>(variables, x_position, t, dt);
487 variables.liquid_saturation = S_L;
488 variables_prev.liquid_saturation = S_L_prev;
489
490 // tangent derivative for Jacobian
491 double const dS_L_dp_cap =
492 medium->property(MPL::PropertyType::saturation)
493 .template dValue<double>(variables,
494 MPL::Variable::capillary_pressure,
495 x_position, t, dt);
496 // secant derivative from time discretization for storage
497 // use tangent, if secant is not available
498 double const DeltaS_L_Deltap_cap =
499 (p_cap_ip == p_cap_prev_ip)
500 ? dS_L_dp_cap
501 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
502
503 auto const chi = [medium, x_position, t, dt](double const S_L)
504 {
506 vs.liquid_saturation = S_L;
507 return medium->property(MPL::PropertyType::bishops_effective_stress)
508 .template value<double>(vs, x_position, t, dt);
509 };
510 double const chi_S_L = chi(S_L);
511 double const chi_S_L_prev = chi(S_L_prev);
512
513 double const p_FR = -chi_S_L * p_cap_ip;
514 variables.effective_pore_pressure = p_FR;
515 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
516
517 // Set volumetric strain rate for the general case without swelling.
518 variables.volumetric_strain = Invariants::trace(eps.eps);
519 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
520
521 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
522 this->current_states_[ip])
523 .phi;
524 { // Porosity update
525 auto const phi_prev = std::get<PrevState<
527 this->prev_states_[ip])
528 ->phi;
529 variables_prev.porosity = phi_prev;
530 phi = medium->property(MPL::PropertyType::porosity)
531 .template value<double>(variables, variables_prev,
532 x_position, t, dt);
533 variables.porosity = phi;
534 }
535
536 if (alpha < phi)
537 {
538 OGS_FATAL(
539 "RichardsMechanics: Biot-coefficient {} is smaller than "
540 "porosity {} in element/integration point {}/{}.",
541 alpha, phi, this->element_.getID(), ip);
542 }
543
544 // Swelling and possibly volumetric strain rate update.
545 {
546 auto& sigma_sw =
547 std::get<ProcessLib::ThermoRichardsMechanics::
548 ConstitutiveStress_StrainTemperature::
549 SwellingDataStateful<DisplacementDim>>(
550 this->current_states_[ip])
551 .sigma_sw;
552 auto const& sigma_sw_prev = std::get<PrevState<
553 ProcessLib::ThermoRichardsMechanics::
554 ConstitutiveStress_StrainTemperature::SwellingDataStateful<
555 DisplacementDim>>>(this->prev_states_[ip])
556 ->sigma_sw;
557
558 // If there is swelling, compute it. Update volumetric strain rate,
559 // s.t. it corresponds to the mechanical part only.
560 sigma_sw = sigma_sw_prev;
561 if (solid_phase.hasProperty(
562 MPL::PropertyType::swelling_stress_rate))
563 {
564 auto const sigma_sw_dot =
567 solid_phase[MPL::PropertyType::swelling_stress_rate]
568 .value(variables, variables_prev, x_position, t,
569 dt)));
570 sigma_sw += sigma_sw_dot * dt;
571
573 variables.volumetric_strain +
574 identity2.transpose() * C_el.inverse() * sigma_sw;
575 variables_prev.volumetric_mechanical_strain =
576 variables_prev.volumetric_strain +
577 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
578 }
579 else
580 {
582 variables.volumetric_strain;
583 variables_prev.volumetric_mechanical_strain =
584 variables_prev.volumetric_strain;
585 }
586
587 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
588 {
589 auto& transport_porosity =
590 std::get<ProcessLib::ThermoRichardsMechanics::
591 TransportPorosityData>(
592 this->current_states_[ip])
593 .phi;
594 auto const transport_porosity_prev =
595 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::
596 TransportPorosityData>>(
597 this->prev_states_[ip])
598 ->phi;
599 variables_prev.transport_porosity = transport_porosity_prev;
600
602 medium->property(MPL::PropertyType::transport_porosity)
603 .template value<double>(variables, variables_prev,
604 x_position, t, dt);
606 }
607 else
608 {
609 variables.transport_porosity = phi;
610 }
611 }
612
613 double const k_rel =
614 medium->property(MPL::PropertyType::relative_permeability)
615 .template value<double>(variables, x_position, t, dt);
616 auto const mu =
617 liquid_phase.property(MPL::PropertyType::viscosity)
618 .template value<double>(variables, x_position, t, dt);
619
620 auto const& sigma_sw =
621 std::get<ProcessLib::ThermoRichardsMechanics::
622 ConstitutiveStress_StrainTemperature::
623 SwellingDataStateful<DisplacementDim>>(
624 this->current_states_[ip])
625 .sigma_sw;
626 auto const& sigma_eff =
628 DisplacementDim>>(this->current_states_[ip])
629 .sigma_eff;
630
631 // Set mechanical variables for the intrinsic permeability model
632 // For stress dependent permeability.
633 {
634 auto const sigma_total =
635 (sigma_eff - alpha * p_FR * identity2).eval();
636
637 // For stress dependent permeability.
638 variables.total_stress.emplace<SymmetricTensor>(
640 sigma_total));
641 }
642
643 variables.equivalent_plastic_strain =
644 this->material_states_[ip]
645 .material_state_variables->getEquivalentPlasticStrain();
646
647 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
648 medium->property(MPL::PropertyType::permeability)
649 .value(variables, x_position, t, dt));
650
651 GlobalDimMatrixType const rho_K_over_mu =
652 K_intrinsic * rho_LR * k_rel / mu;
653
654 //
655 // displacement equation, displacement part
656 //
657 {
658 auto& eps_m = std::get<ProcessLib::ConstitutiveRelations::
659 MechanicalStrainData<DisplacementDim>>(
660 this->current_states_[ip])
661 .eps_m;
662 eps_m.noalias() =
663 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
664 ? eps.eps + C_el.inverse() * sigma_sw
665 : eps.eps;
666 variables.mechanical_strain.emplace<
668 eps_m);
669 }
670
671 {
672 auto& SD = this->current_states_[ip];
673 auto const& SD_prev = this->prev_states_[ip];
674 auto& sigma_eff =
676 DisplacementDim>>(SD);
677 auto const& sigma_eff_prev =
678 std::get<PrevState<ProcessLib::ConstitutiveRelations::
679 EffectiveStressData<DisplacementDim>>>(
680 SD_prev);
681 auto const& eps_m =
682 std::get<ProcessLib::ConstitutiveRelations::
683 MechanicalStrainData<DisplacementDim>>(SD);
684 auto& eps_m_prev =
685 std::get<PrevState<ProcessLib::ConstitutiveRelations::
686 MechanicalStrainData<DisplacementDim>>>(
687 SD_prev);
688
689 ip_data_[ip].updateConstitutiveRelation(
690 variables, t, x_position, dt, temperature, sigma_eff,
691 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
692 this->material_states_[ip].material_state_variables);
693 }
694
695 // p_SR
696 variables.solid_grain_pressure =
697 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
698 auto const rho_SR =
699 solid_phase.property(MPL::PropertyType::density)
700 .template value<double>(variables, x_position, t, dt);
701
702 //
703 // displacement equation, displacement part
704 //
705 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
706 rhs.template segment<displacement_size>(displacement_index).noalias() -=
707 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
708
709 //
710 // pressure equation, pressure part.
711 //
712 auto const beta_LR =
713 1 / rho_LR *
714 liquid_phase.property(MPL::PropertyType::density)
715 .template dValue<double>(variables,
716 MPL::Variable::liquid_phase_pressure,
717 x_position, t, dt);
718
719 double const a0 = S_L * (alpha - phi) * beta_SR;
720 // Volumetric average specific storage of the solid and fluid phases.
721 double const specific_storage =
722 DeltaS_L_Deltap_cap * (p_cap_ip * a0 - phi) +
723 S_L * (phi * beta_LR + a0);
724 M.template block<pressure_size, pressure_size>(pressure_index,
726 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
727
728 K.template block<pressure_size, pressure_size>(pressure_index,
730 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
731
732 rhs.template segment<pressure_size>(pressure_index).noalias() +=
733 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
734
735 //
736 // displacement equation, pressure part
737 //
738 K.template block<displacement_size, pressure_size>(displacement_index,
740 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
741
742 //
743 // pressure equation, displacement part.
744 //
745 M.template block<pressure_size, displacement_size>(pressure_index,
747 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
748 identity2.transpose() * B * w;
749 }
750
751 if (this->process_data_.apply_mass_lumping)
752 {
753 auto Mpp = M.template block<pressure_size, pressure_size>(
755 Mpp = Mpp.colwise().sum().eval().asDiagonal();
756 }
757}
#define OGS_FATAL(...)
Definition Error.h:26
void setElementID(std::size_t element_id)
std::optional< MathLib::Point3d > const getCoordinates() const
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
Eigen::Matrix< double, KelvinVectorSize, 1 > SymmetricTensor
typename ShapeMatricesTypePressure::GlobalDimMatrixType GlobalDimMatrixType
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
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.
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
auto eval(Function &f, Tuples &... ts) -> typename detail::GetFunctionReturnType< decltype(&Function::eval)>::type
Definition Apply.h:274
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, const double radius, const bool is_axially_symmetric)
Fills a B-matrix based on given shape function dN/dx values.
static double trace(Eigen::Matrix< double, KelvinVectorSize, 1 > const &v)
Trace of the corresponding tensor.
std::vector< StatefulDataPrev< DisplacementDim > > prev_states_
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material_
std::vector< ProcessLib::ThermoRichardsMechanics::MaterialStateData< DisplacementDim > > material_states_

References MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::VariableArray::equivalent_plastic_strain, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::formEigenTensor< 3 >(), MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), MaterialPropertyLib::VariableArray::grain_compressibility, NumLib::interpolateCoordinates(), MathLib::KelvinVector::kelvin_vector_dimensions(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::VariableArray::mechanical_strain, OGS_FATAL, MaterialPropertyLib::VariableArray::porosity, ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::temperature, MathLib::KelvinVector::tensorToKelvin(), MaterialPropertyLib::VariableArray::total_stress, MaterialPropertyLib::VariableArray::transport_porosity, MaterialPropertyLib::VariableArray::volumetric_mechanical_strain, and MaterialPropertyLib::VariableArray::volumetric_strain.

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

1073{
1074 assert(local_x.size() == pressure_size + displacement_size);
1075
1076 auto const [p_L, u] = localDOF(local_x);
1077 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1078
1079 auto local_Jac = MathLib::createZeroedMatrix<
1080 typename ShapeMatricesTypeDisplacement::template MatrixType<
1083 local_Jac_data, displacement_size + pressure_size,
1085
1086 auto local_rhs = MathLib::createZeroedVector<
1087 typename ShapeMatricesTypeDisplacement::template VectorType<
1089 local_rhs_data, displacement_size + pressure_size);
1090
1091 auto const& identity2 = MathLib::KelvinVector::Invariants<
1093 DisplacementDim)>::identity2;
1094
1096 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1098
1099 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_p =
1100 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1102
1103 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_S_Jpp =
1104 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1106
1107 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_S =
1108 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
1110
1111 typename ShapeMatricesTypeDisplacement::template MatrixType<
1113 Kup = ShapeMatricesTypeDisplacement::template MatrixType<
1116
1117 typename ShapeMatricesTypeDisplacement::template MatrixType<
1119 Kpu = ShapeMatricesTypeDisplacement::template MatrixType<
1122
1123 auto const& medium =
1124 this->process_data_.media_map.getMedium(this->element_.getID());
1125 auto const& liquid_phase = medium->phase("AqueousLiquid");
1126 auto const& solid_phase = medium->phase("Solid");
1127 MPL::VariableArray variables;
1128 MPL::VariableArray variables_prev;
1129
1130 unsigned const n_integration_points =
1132 for (unsigned ip = 0; ip < n_integration_points; ip++)
1133 {
1135 auto& SD = this->current_states_[ip];
1136 auto const& SD_prev = this->prev_states_[ip];
1137 [[maybe_unused]] auto models = createConstitutiveModels(
1138 this->process_data_, this->solid_material_);
1139
1140 auto const& w = ip_data_[ip].integration_weight;
1141
1142 auto const& N_u = ip_data_[ip].N_u;
1143 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1144
1145 auto const& N_p = ip_data_[ip].N_p;
1146 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1147
1148 ParameterLib::SpatialPosition x_position = {
1149 std::nullopt, this->element_.getID(),
1151 NumLib::interpolateCoordinates<ShapeFunctionDisplacement,
1153 this->element_, N_u))};
1154 auto const x_coord = x_position.getCoordinates().value()[0];
1155
1156 auto const B =
1157 LinearBMatrix::computeBMatrix<DisplacementDim,
1158 ShapeFunctionDisplacement::NPOINTS,
1160 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1161
1162 double p_cap_ip;
1163 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
1164
1165 double p_cap_prev_ip;
1166 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
1167
1168 variables.capillary_pressure = p_cap_ip;
1169 variables.liquid_phase_pressure = -p_cap_ip;
1170 // setting pG to 1 atm
1171 // TODO : rewrite equations s.t. p_L = pG-p_cap
1172 variables.gas_phase_pressure = 1.0e5;
1173
1174 auto const temperature =
1175 medium->property(MPL::PropertyType::reference_temperature)
1176 .template value<double>(variables, x_position, t, dt);
1177 variables.temperature = temperature;
1178
1179 std::get<StrainData<DisplacementDim>>(SD).eps.noalias() = B * u;
1180
1182 t, dt, x_position, ip_data_[ip], variables, variables_prev, medium,
1184 CapillaryPressureData<DisplacementDim>{
1185 p_cap_ip, p_cap_prev_ip,
1186 Eigen::Vector<double, DisplacementDim>::Zero()},
1187 CD, SD, SD_prev, this->process_data_.micro_porosity_parameters,
1188 this->solid_material_, this->material_states_[ip]);
1189
1190 {
1191 auto const& C = *std::get<StiffnessTensor<DisplacementDim>>(CD);
1192 local_Jac
1193 .template block<displacement_size, displacement_size>(
1195 .noalias() += B.transpose() * C * B * w;
1196 }
1197
1198 auto const& b = this->process_data_.specific_body_force;
1199
1200 {
1201 auto const& sigma_eff =
1203 DisplacementDim>>(this->current_states_[ip])
1204 .sigma_eff;
1205 double const rho = *std::get<Density>(CD);
1206 local_rhs.template segment<displacement_size>(displacement_index)
1207 .noalias() -= (B.transpose() * sigma_eff -
1208 N_u_op(N_u).transpose() * rho * b) *
1209 w;
1210 }
1211
1212 //
1213 // displacement equation, pressure part
1214 //
1215
1216 double const alpha =
1217 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD);
1218 double const dS_L_dp_cap =
1219 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(
1220 CD)
1221 .dS_L_dp_cap;
1222
1223 {
1224 double const chi_S_L =
1225 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1226 .chi_S_L;
1227 Kup.noalias() +=
1228 B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
1229 double const dchi_dS_L =
1230 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD)
1231 .dchi_dS_L;
1232
1233 local_Jac
1234 .template block<displacement_size, pressure_size>(
1236 .noalias() -= B.transpose() * alpha *
1237 (chi_S_L + dchi_dS_L * p_cap_ip * dS_L_dp_cap) *
1238 identity2 * N_p * w;
1239 }
1240
1241 double const phi =
1242 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi;
1243 double const rho_LR = *std::get<LiquidDensity>(CD);
1244 local_Jac
1245 .template block<displacement_size, pressure_size>(
1247 .noalias() +=
1248 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1249
1250 // For the swelling stress with double structure model the corresponding
1251 // Jacobian u-p entry would be required, but it does not improve
1252 // convergence and sometimes worsens it:
1253 // if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1254 // {
1255 // -B.transpose() *
1256 // dsigma_sw_dS_L_m* dS_L_m_dp_cap_m*(p_L_m - p_L_m_prev) /
1257 // (p_cap_ip - p_cap_prev_ip) * N_p* w;
1258 // }
1259 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1260 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
1261 {
1262 using DimMatrix = Eigen::Matrix<double, 3, 3>;
1263 auto const dsigma_sw_dS_L =
1265 solid_phase
1266 .property(MPL::PropertyType::swelling_stress_rate)
1267 .template dValue<DimMatrix>(
1268 variables, variables_prev,
1269 MPL::Variable::liquid_saturation, x_position, t,
1270 dt));
1271 local_Jac
1272 .template block<displacement_size, pressure_size>(
1274 .noalias() +=
1275 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1276 }
1277 //
1278 // pressure equation, displacement part.
1279 //
1280 double const S_L =
1281 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1282 this->current_states_[ip])
1283 .S_L;
1284 if (this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1285 {
1286 double const chi_S_L_prev = std::get<PrevState<
1288 ->chi_S_L;
1289 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1290 identity2.transpose() * B * w;
1291 }
1292 else
1293 {
1294 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1295 identity2.transpose() * B * w;
1296 }
1297
1298 //
1299 // pressure equation, pressure part.
1300 //
1301
1302 double const k_rel =
1304 DisplacementDim>>(CD)
1305 .k_rel;
1306 auto const& K_intrinsic =
1308 DisplacementDim>>(CD)
1309 .Ki;
1310 double const mu =
1311 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(
1312 CD);
1313
1314 GlobalDimMatrixType const rho_Ki_over_mu = K_intrinsic * rho_LR / mu;
1315
1316 laplace_p.noalias() +=
1317 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1318
1319 auto const beta_LR =
1320 1 / rho_LR *
1321 liquid_phase.property(MPL::PropertyType::density)
1322 .template dValue<double>(variables,
1323 MPL::Variable::liquid_phase_pressure,
1324 x_position, t, dt);
1325
1326 double const beta_SR =
1327 std::get<
1329 CD)
1330 .beta_SR;
1331 double const a0 = (alpha - phi) * beta_SR;
1332 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1333 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1334
1335 double const dspecific_storage_a_p_dp_cap =
1336 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1337 double const dspecific_storage_a_S_dp_cap =
1338 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1339
1340 storage_p_a_p.noalias() +=
1341 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1342
1343 double const DeltaS_L_Deltap_cap =
1344 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap;
1345 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1346 specific_storage_a_S * DeltaS_L_Deltap_cap *
1347 N_p * w;
1348
1349 local_Jac
1350 .template block<pressure_size, pressure_size>(pressure_index,
1352 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1353 rho_LR * dspecific_storage_a_p_dp_cap * N_p * w;
1354
1355 double const S_L_prev =
1356 std::get<
1357 PrevState<ProcessLib::ThermoRichardsMechanics::SaturationData>>(
1358 this->prev_states_[ip])
1359 ->S_L;
1360 storage_p_a_S_Jpp.noalias() -=
1361 N_p.transpose() * rho_LR *
1362 ((S_L - S_L_prev) * dspecific_storage_a_S_dp_cap +
1363 specific_storage_a_S * dS_L_dp_cap) /
1364 dt * N_p * w;
1365
1366 if (!this->process_data_.explicit_hm_coupling_in_unsaturated_zone)
1367 {
1368 local_Jac
1369 .template block<pressure_size, pressure_size>(pressure_index,
1371 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1372 identity2.transpose() * B * (u - u_prev) / dt *
1373 N_p * w;
1374 }
1375
1376 double const dk_rel_dS_l =
1377 medium->property(MPL::PropertyType::relative_permeability)
1378 .template dValue<double>(variables,
1379 MPL::Variable::liquid_saturation,
1380 x_position, t, dt);
1382 grad_p_cap = -dNdx_p * p_L;
1383 local_Jac
1384 .template block<pressure_size, pressure_size>(pressure_index,
1386 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1387 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1388
1389 local_Jac
1390 .template block<pressure_size, pressure_size>(pressure_index,
1392 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1393 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1394
1395 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1396 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1397
1398 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1399 {
1400 double const alpha_bar =
1401 this->process_data_.micro_porosity_parameters
1402 ->mass_exchange_coefficient;
1403 auto const p_L_m =
1404 *std::get<MicroPressure>(this->current_states_[ip]);
1405 local_rhs.template segment<pressure_size>(pressure_index)
1406 .noalias() -=
1407 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1408
1409 local_Jac
1410 .template block<pressure_size, pressure_size>(pressure_index,
1412 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1413 if (p_cap_ip != p_cap_prev_ip)
1414 {
1415 auto const p_L_m_prev = **std::get<PrevState<MicroPressure>>(
1416 this->prev_states_[ip]);
1417 local_Jac
1418 .template block<pressure_size, pressure_size>(
1420 .noalias() += N_p.transpose() * alpha_bar / mu *
1421 (p_L_m - p_L_m_prev) /
1422 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1423 }
1424 }
1425 }
1426
1427 if (this->process_data_.apply_mass_lumping)
1428 {
1429 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1430 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1431 storage_p_a_S_Jpp =
1432 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1433 }
1434
1435 // pressure equation, pressure part.
1436 local_Jac
1437 .template block<pressure_size, pressure_size>(pressure_index,
1439 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1440
1441 // pressure equation, displacement part.
1442 local_Jac
1443 .template block<pressure_size, displacement_size>(pressure_index,
1445 .noalias() = Kpu / dt;
1446
1447 // pressure equation
1448 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1449 laplace_p * p_L +
1450 (storage_p_a_p + storage_p_a_S) * (p_L - p_L_prev) / dt +
1451 Kpu * (u - u_prev) / dt;
1452
1453 // displacement equation
1454 local_rhs.template segment<displacement_size>(displacement_index)
1455 .noalias() += Kup * p_L;
1456}
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)
BaseLib::StrongType< double, struct TemperatureDataTag > TemperatureData
Definition Base.h:67
ConstitutiveModels< DisplacementDim > createConstitutiveModels(TRMProcessData const &process_data, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material)
std::tuple< StiffnessTensor< DisplacementDim >, ProcessLib::ThermoRichardsMechanics::PorosityData, Density, LiquidDensity, ProcessLib::ThermoRichardsMechanics::BiotData, ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv, ProcessLib::ThermoRichardsMechanics::LiquidViscosityData, ProcessLib::ThermoRichardsMechanics::SolidCompressibilityData, ProcessLib::ThermoRichardsMechanics::BishopsData, PrevState< ProcessLib::ThermoRichardsMechanics::BishopsData >, ProcessLib::ThermoRichardsMechanics::PermeabilityData< DisplacementDim >, SaturationSecantDerivative > ConstitutiveData
Data that is needed for the equation system assembly.
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< GlobalDim > GlobalDimVectorType

References MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), ProcessLib::RichardsMechanics::createConstitutiveModels(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), NumLib::interpolateCoordinates(), MathLib::KelvinVector::kelvin_vector_dimensions(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, NumLib::detail::shapeFunctionInterpolate(), 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 762 of file RichardsMechanicsFEM-impl.h.

780{
781 auto const& liquid_phase = medium->phase("AqueousLiquid");
782 auto const& solid_phase = medium->phase("Solid");
783
784 auto const& identity2 = MathLib::KelvinVector::Invariants<
786 DisplacementDim)>::identity2;
787
788 double const temperature = T_data();
789 double const p_cap_ip = p_cap_data.p_cap;
790 double const p_cap_prev_ip = p_cap_data.p_cap_prev;
791
792 auto const& eps = std::get<StrainData<DisplacementDim>>(SD);
793 auto& S_L =
794 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(SD).S_L;
795 auto const S_L_prev =
796 std::get<
797 PrevState<ProcessLib::ThermoRichardsMechanics::SaturationData>>(
798 SD_prev)
799 ->S_L;
800 auto const alpha =
801 medium->property(MPL::PropertyType::biot_coefficient)
802 .template value<double>(variables, x_position, t, dt);
803 *std::get<ProcessLib::ThermoRichardsMechanics::BiotData>(CD) = alpha;
804
805 auto const C_el = ip_data.computeElasticTangentStiffness(
806 t, x_position, dt, temperature, solid_material,
807 *material_state_data.material_state_variables);
808
809 auto const beta_SR =
810 (1 - alpha) / solid_material.getBulkModulus(t, x_position, &C_el);
811 variables.grain_compressibility = beta_SR;
812 std::get<ProcessLib::ThermoRichardsMechanics::SolidCompressibilityData>(CD)
813 .beta_SR = beta_SR;
814
815 auto const rho_LR =
816 liquid_phase.property(MPL::PropertyType::density)
817 .template value<double>(variables, x_position, t, dt);
818 variables.density = rho_LR;
819 *std::get<LiquidDensity>(CD) = rho_LR;
820
821 S_L = medium->property(MPL::PropertyType::saturation)
822 .template value<double>(variables, x_position, t, dt);
823 variables.liquid_saturation = S_L;
824 variables_prev.liquid_saturation = S_L_prev;
825
826 // tangent derivative for Jacobian
827 double const dS_L_dp_cap =
828 medium->property(MPL::PropertyType::saturation)
829 .template dValue<double>(variables,
830 MPL::Variable::capillary_pressure,
831 x_position, t, dt);
832 std::get<ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv>(CD)
833 .dS_L_dp_cap = dS_L_dp_cap;
834 // secant derivative from time discretization for storage
835 // use tangent, if secant is not available
836 double const DeltaS_L_Deltap_cap =
837 (p_cap_ip == p_cap_prev_ip)
838 ? dS_L_dp_cap
839 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
840 std::get<SaturationSecantDerivative>(CD).DeltaS_L_Deltap_cap =
841 DeltaS_L_Deltap_cap;
842
843 auto const chi = [medium, x_position, t, dt](double const S_L)
844 {
846 vs.liquid_saturation = S_L;
847 return medium->property(MPL::PropertyType::bishops_effective_stress)
848 .template value<double>(vs, x_position, t, dt);
849 };
850 double const chi_S_L = chi(S_L);
851 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).chi_S_L =
852 chi_S_L;
853 double const chi_S_L_prev = chi(S_L_prev);
854 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::BishopsData>>(CD)
855 ->chi_S_L = chi_S_L_prev;
856
857 auto const dchi_dS_L =
858 medium->property(MPL::PropertyType::bishops_effective_stress)
859 .template dValue<double>(
860 variables, MPL::Variable::liquid_saturation, x_position, t, dt);
861 std::get<ProcessLib::ThermoRichardsMechanics::BishopsData>(CD).dchi_dS_L =
862 dchi_dS_L;
863
864 double const p_FR = -chi_S_L * p_cap_ip;
865 variables.effective_pore_pressure = p_FR;
866 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
867
868 // Set volumetric strain rate for the general case without swelling.
869 variables.volumetric_strain = Invariants::trace(eps.eps);
870 // TODO (CL) changed that, using eps_prev for the moment, not B * u_prev
871 // variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
872 variables_prev.volumetric_strain = Invariants::trace(
873 std::get<PrevState<StrainData<DisplacementDim>>>(SD_prev)->eps);
874
875 auto& phi =
876 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(SD).phi;
877 { // Porosity update
878 auto const phi_prev =
879 std::get<
880 PrevState<ProcessLib::ThermoRichardsMechanics::PorosityData>>(
881 SD_prev)
882 ->phi;
883 variables_prev.porosity = phi_prev;
884 phi = medium->property(MPL::PropertyType::porosity)
885 .template value<double>(variables, variables_prev, x_position,
886 t, dt);
887 variables.porosity = phi;
888 }
889 std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(CD).phi = phi;
890
891 if (alpha < phi)
892 {
893 auto const eid =
894 x_position.getElementID()
895 ? static_cast<std::ptrdiff_t>(*x_position.getElementID())
896 : static_cast<std::ptrdiff_t>(-1);
897 OGS_FATAL(
898 "RichardsMechanics: Biot-coefficient {} is smaller than porosity "
899 "{} in element {}.",
900 alpha, phi, eid);
901 }
902
903 auto const mu = liquid_phase.property(MPL::PropertyType::viscosity)
904 .template value<double>(variables, x_position, t, dt);
905 *std::get<ProcessLib::ThermoRichardsMechanics::LiquidViscosityData>(CD) =
906 mu;
907
908 {
909 // Swelling and possibly volumetric strain rate update.
910 auto& sigma_sw =
911 std::get<ProcessLib::ThermoRichardsMechanics::
912 ConstitutiveStress_StrainTemperature::
913 SwellingDataStateful<DisplacementDim>>(SD);
914 auto const& sigma_sw_prev =
915 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::
916 ConstitutiveStress_StrainTemperature::
917 SwellingDataStateful<DisplacementDim>>>(
918 SD_prev);
919 auto const transport_porosity_prev = std::get<PrevState<
921 SD_prev);
922 auto const phi_prev = std::get<
923 PrevState<ProcessLib::ThermoRichardsMechanics::PorosityData>>(
924 SD_prev);
925 auto& transport_porosity = std::get<
927 auto& p_L_m = std::get<MicroPressure>(SD);
928 auto const p_L_m_prev = std::get<PrevState<MicroPressure>>(SD_prev);
929 auto& S_L_m = std::get<MicroSaturation>(SD);
930 auto const S_L_m_prev = std::get<PrevState<MicroSaturation>>(SD_prev);
931
933 *medium, solid_phase, C_el, rho_LR, mu, micro_porosity_parameters,
934 alpha, phi, p_cap_ip, variables, variables_prev, x_position, t, dt,
935 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
936 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
937 }
938
939 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
940 {
941 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
942 {
943 auto& transport_porosity =
944 std::get<
946 SD)
947 .phi;
948 auto const transport_porosity_prev = std::get<PrevState<
950 SD_prev)
951 ->phi;
952 variables_prev.transport_porosity = transport_porosity_prev;
953
955 medium->property(MPL::PropertyType::transport_porosity)
956 .template value<double>(variables, variables_prev,
957 x_position, t, dt);
959 }
960 }
961 else
962 {
963 variables.transport_porosity = phi;
964 }
965
966 // Set mechanical variables for the intrinsic permeability model
967 // For stress dependent permeability.
968 {
969 // TODO mechanical constitutive relation will be evaluated afterwards
970 auto const sigma_total =
972 DisplacementDim>>(SD)
973 .sigma_eff +
974 alpha * p_FR * identity2)
975 .eval();
976 // For stress dependent permeability.
977 variables.total_stress.emplace<SymmetricTensor>(
979 }
980
981 variables.equivalent_plastic_strain =
982 material_state_data.material_state_variables
983 ->getEquivalentPlasticStrain();
984
985 double const k_rel =
986 medium->property(MPL::PropertyType::relative_permeability)
987 .template value<double>(variables, x_position, t, dt);
988
989 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
990 medium->property(MPL::PropertyType::permeability)
991 .value(variables, x_position, t, dt));
992
993 std::get<
995 CD)
996 .k_rel = k_rel;
997 std::get<
999 CD)
1000 .Ki = K_intrinsic;
1001
1002 //
1003 // displacement equation, displacement part
1004 //
1005
1006 {
1007 auto& sigma_sw =
1008 std::get<ProcessLib::ThermoRichardsMechanics::
1009 ConstitutiveStress_StrainTemperature::
1010 SwellingDataStateful<DisplacementDim>>(SD)
1011 .sigma_sw;
1012
1013 auto& eps_m =
1015 DisplacementDim>>(SD)
1016 .eps_m;
1017 eps_m.noalias() =
1018 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1019 ? eps.eps + C_el.inverse() * sigma_sw
1020 : eps.eps;
1021 variables.mechanical_strain
1023 eps_m);
1024 }
1025
1026 {
1027 auto& sigma_eff =
1029 DisplacementDim>>(SD);
1030 auto const& sigma_eff_prev =
1031 std::get<PrevState<ProcessLib::ConstitutiveRelations::
1032 EffectiveStressData<DisplacementDim>>>(
1033 SD_prev);
1034 auto const& eps_m =
1036 DisplacementDim>>(SD);
1037 auto& eps_m_prev =
1038 std::get<PrevState<ProcessLib::ConstitutiveRelations::
1039 MechanicalStrainData<DisplacementDim>>>(
1040 SD_prev);
1041
1042 auto C = ip_data.updateConstitutiveRelation(
1043 variables, t, x_position, dt, temperature, sigma_eff,
1044 sigma_eff_prev, eps_m, eps_m_prev, solid_material,
1045 material_state_data.material_state_variables);
1046
1047 *std::get<StiffnessTensor<DisplacementDim>>(CD) = std::move(C);
1048 }
1049
1050 // p_SR
1051 variables.solid_grain_pressure =
1053 DisplacementDim>>(SD)
1054 .sigma_eff.dot(identity2) /
1055 (3 * (1 - phi));
1056 auto const rho_SR =
1057 solid_phase.property(MPL::PropertyType::density)
1058 .template value<double>(variables, x_position, t, dt);
1059
1060 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
1061 *std::get<Density>(CD) = rho;
1062}
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)
virtual double getBulkModulus(double const, ParameterLib::SpatialPosition const &, KelvinMatrix const *const =nullptr) const
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > sigma_eff

References 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::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::Medium::phase(), MaterialPropertyLib::VariableArray::porosity, MaterialPropertyLib::Medium::property(), ProcessLib::ConstitutiveRelations::EffectiveStressData< DisplacementDim >::sigma_eff, MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::total_stress, MaterialPropertyLib::VariableArray::transport_porosity, ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain(), MaterialPropertyLib::Property::value(), and MaterialPropertyLib::VariableArray::volumetric_strain.

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

1482{
1483 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1484}

References OGS_FATAL.

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

1468{
1469 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1470}

References OGS_FATAL.

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

1496{
1497 // For the equations with pressure
1498 if (process_id == 0)
1499 {
1500 assembleWithJacobianForPressureEquations(t, dt, local_x, local_x_prev,
1501 local_b_data, local_Jac_data);
1502 return;
1503 }
1504
1505 // For the equations with deformation
1506 assembleWithJacobianForDeformationEquations(t, dt, local_x, local_x_prev,
1507 local_b_data, local_Jac_data);
1508}
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)

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

1517{
1518 auto const [p_L, u] = localDOF(local_x);
1519 auto const [p_L_prev, u_prev] = localDOF(local_x_prev);
1520
1521 auto const& identity2 = MathLib::KelvinVector::Invariants<
1523 DisplacementDim)>::identity2;
1524
1525 auto const& medium =
1526 this->process_data_.media_map.getMedium(this->element_.getID());
1527 auto const& liquid_phase = medium->phase("AqueousLiquid");
1528 auto const& solid_phase = medium->phase("Solid");
1529 MPL::VariableArray variables;
1530 MPL::VariableArray variables_prev;
1531
1532 unsigned const n_integration_points =
1534
1535 double saturation_avg = 0;
1536 double porosity_avg = 0;
1537
1539 KV sigma_avg = KV::Zero();
1540
1541 for (unsigned ip = 0; ip < n_integration_points; ip++)
1542 {
1543 auto const& N_p = ip_data_[ip].N_p;
1544 auto const& N_u = ip_data_[ip].N_u;
1545 auto const& dNdx_u = ip_data_[ip].dNdx_u;
1546
1547 ParameterLib::SpatialPosition x_position = {
1548 std::nullopt, this->element_.getID(),
1550 NumLib::interpolateCoordinates<ShapeFunctionDisplacement,
1552 this->element_, N_u))};
1553 auto const x_coord = x_position.getCoordinates().value()[0];
1554
1555 auto const B =
1556 LinearBMatrix::computeBMatrix<DisplacementDim,
1557 ShapeFunctionDisplacement::NPOINTS,
1559 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
1560
1561 double p_cap_ip;
1562 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
1563
1564 double p_cap_prev_ip;
1565 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
1566
1567 variables.capillary_pressure = p_cap_ip;
1568 variables.liquid_phase_pressure = -p_cap_ip;
1569 // setting pG to 1 atm
1570 // TODO : rewrite equations s.t. p_L = pG-p_cap
1571 variables.gas_phase_pressure = 1.0e5;
1572
1573 auto const temperature =
1574 medium->property(MPL::PropertyType::reference_temperature)
1575 .template value<double>(variables, x_position, t, dt);
1576 variables.temperature = temperature;
1577
1578 auto& eps =
1579 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
1580 .eps;
1581 eps.noalias() = B * u;
1582 auto& S_L =
1583 std::get<ProcessLib::ThermoRichardsMechanics::SaturationData>(
1584 this->current_states_[ip])
1585 .S_L;
1586 auto const S_L_prev =
1587 std::get<
1588 PrevState<ProcessLib::ThermoRichardsMechanics::SaturationData>>(
1589 this->prev_states_[ip])
1590 ->S_L;
1591 S_L = medium->property(MPL::PropertyType::saturation)
1592 .template value<double>(variables, x_position, t, dt);
1593 variables.liquid_saturation = S_L;
1594 variables_prev.liquid_saturation = S_L_prev;
1595
1596 auto const chi = [medium, x_position, t, dt](double const S_L)
1597 {
1599 vs.liquid_saturation = S_L;
1600 return medium->property(MPL::PropertyType::bishops_effective_stress)
1601 .template value<double>(vs, x_position, t, dt);
1602 };
1603 double const chi_S_L = chi(S_L);
1604 double const chi_S_L_prev = chi(S_L_prev);
1605
1606 auto const alpha =
1607 medium->property(MPL::PropertyType::biot_coefficient)
1608 .template value<double>(variables, x_position, t, dt);
1609
1610 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
1611 t, x_position, dt, temperature, this->solid_material_,
1612 *this->material_states_[ip].material_state_variables);
1613
1614 auto const beta_SR = (1 - alpha) / this->solid_material_.getBulkModulus(
1615 t, x_position, &C_el);
1616 variables.grain_compressibility = beta_SR;
1617
1618 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1619 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1620
1621 // Set volumetric strain rate for the general case without swelling.
1622 variables.volumetric_strain = Invariants::trace(eps);
1623 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
1624
1625 auto& phi = std::get<ProcessLib::ThermoRichardsMechanics::PorosityData>(
1626 this->current_states_[ip])
1627 .phi;
1628 { // Porosity update
1629 auto const phi_prev = std::get<PrevState<
1631 this->prev_states_[ip])
1632 ->phi;
1633 variables_prev.porosity = phi_prev;
1634 phi = medium->property(MPL::PropertyType::porosity)
1635 .template value<double>(variables, variables_prev,
1636 x_position, t, dt);
1637 variables.porosity = phi;
1638 }
1639
1640 auto const rho_LR =
1641 liquid_phase.property(MPL::PropertyType::density)
1642 .template value<double>(variables, x_position, t, dt);
1643 variables.density = rho_LR;
1644 auto const mu =
1645 liquid_phase.property(MPL::PropertyType::viscosity)
1646 .template value<double>(variables, x_position, t, dt);
1647
1648 {
1649 // Swelling and possibly volumetric strain rate update.
1650 auto& sigma_sw =
1651 std::get<ProcessLib::ThermoRichardsMechanics::
1652 ConstitutiveStress_StrainTemperature::
1653 SwellingDataStateful<DisplacementDim>>(
1654 this->current_states_[ip]);
1655 auto const& sigma_sw_prev = std::get<
1656 PrevState<ProcessLib::ThermoRichardsMechanics::
1657 ConstitutiveStress_StrainTemperature::
1658 SwellingDataStateful<DisplacementDim>>>(
1659 this->prev_states_[ip]);
1660 auto const transport_porosity_prev = std::get<PrevState<
1662 this->prev_states_[ip]);
1663 auto const phi_prev = std::get<
1664 PrevState<ProcessLib::ThermoRichardsMechanics::PorosityData>>(
1665 this->prev_states_[ip]);
1666 auto& transport_porosity = std::get<
1668 this->current_states_[ip]);
1669 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
1670 auto const p_L_m_prev =
1671 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
1672 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
1673 auto const S_L_m_prev =
1674 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
1675
1677 *medium, solid_phase, C_el, rho_LR, mu,
1678 this->process_data_.micro_porosity_parameters, alpha, phi,
1679 p_cap_ip, variables, variables_prev, x_position, t, dt,
1680 sigma_sw, sigma_sw_prev, transport_porosity_prev, phi_prev,
1681 transport_porosity, p_L_m_prev, S_L_m_prev, p_L_m, S_L_m);
1682 }
1683
1684 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
1685 {
1686 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
1687 {
1688 auto& transport_porosity =
1689 std::get<ProcessLib::ThermoRichardsMechanics::
1690 TransportPorosityData>(
1691 this->current_states_[ip])
1692 .phi;
1693 auto const transport_porosity_prev =
1694 std::get<PrevState<ProcessLib::ThermoRichardsMechanics::
1695 TransportPorosityData>>(
1696 this->prev_states_[ip])
1697 ->phi;
1698
1699 variables_prev.transport_porosity = transport_porosity_prev;
1700
1702 medium->property(MPL::PropertyType::transport_porosity)
1703 .template value<double>(variables, variables_prev,
1704 x_position, t, dt);
1706 }
1707 }
1708 else
1709 {
1710 variables.transport_porosity = phi;
1711 }
1712
1713 auto const& sigma_eff =
1715 DisplacementDim>>(this->current_states_[ip])
1716 .sigma_eff;
1717
1718 // Set mechanical variables for the intrinsic permeability model
1719 // For stress dependent permeability.
1720 {
1721 auto const sigma_total =
1722 (sigma_eff + alpha * chi_S_L * identity2 * p_cap_ip).eval();
1723 // For stress dependent permeability.
1724 variables.total_stress.emplace<SymmetricTensor>(
1726 sigma_total));
1727 }
1728
1729 variables.equivalent_plastic_strain =
1730 this->material_states_[ip]
1731 .material_state_variables->getEquivalentPlasticStrain();
1732
1733 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
1734 medium->property(MPL::PropertyType::permeability)
1735 .value(variables, x_position, t, dt));
1736
1737 double const k_rel =
1738 medium->property(MPL::PropertyType::relative_permeability)
1739 .template value<double>(variables, x_position, t, dt);
1740
1741 GlobalDimMatrixType const K_over_mu = k_rel * K_intrinsic / mu;
1742
1743 double const p_FR = -chi_S_L * p_cap_ip;
1744 // p_SR
1745 variables.solid_grain_pressure =
1746 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1747 auto const rho_SR =
1748 solid_phase.property(MPL::PropertyType::density)
1749 .template value<double>(variables, x_position, t, dt);
1750 *std::get<DrySolidDensity>(this->output_data_[ip]) = (1 - phi) * rho_SR;
1751
1752 {
1753 auto& SD = this->current_states_[ip];
1754 auto const& sigma_sw =
1755 std::get<ProcessLib::ThermoRichardsMechanics::
1756 ConstitutiveStress_StrainTemperature::
1757 SwellingDataStateful<DisplacementDim>>(SD)
1758 .sigma_sw;
1759 auto& eps_m =
1760 std::get<ProcessLib::ConstitutiveRelations::
1761 MechanicalStrainData<DisplacementDim>>(SD)
1762 .eps_m;
1763 eps_m.noalias() =
1764 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1765 ? eps + C_el.inverse() * sigma_sw
1766 : eps;
1767 variables.mechanical_strain.emplace<
1769 eps_m);
1770 }
1771
1772 {
1773 auto& SD = this->current_states_[ip];
1774 auto const& SD_prev = this->prev_states_[ip];
1775 auto& sigma_eff =
1777 DisplacementDim>>(SD);
1778 auto const& sigma_eff_prev =
1779 std::get<PrevState<ProcessLib::ConstitutiveRelations::
1780 EffectiveStressData<DisplacementDim>>>(
1781 SD_prev);
1782 auto const& eps_m =
1783 std::get<ProcessLib::ConstitutiveRelations::
1784 MechanicalStrainData<DisplacementDim>>(SD);
1785 auto const& eps_m_prev =
1786 std::get<PrevState<ProcessLib::ConstitutiveRelations::
1787 MechanicalStrainData<DisplacementDim>>>(
1788 SD_prev);
1789
1790 ip_data_[ip].updateConstitutiveRelation(
1791 variables, t, x_position, dt, temperature, sigma_eff,
1792 sigma_eff_prev, eps_m, eps_m_prev, this->solid_material_,
1793 this->material_states_[ip].material_state_variables);
1794 }
1795
1796 auto const& b = this->process_data_.specific_body_force;
1797
1798 // Compute the velocity
1799 auto const& dNdx_p = ip_data_[ip].dNdx_p;
1800 std::get<
1802 this->output_data_[ip])
1803 ->noalias() = -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1804
1805 saturation_avg += S_L;
1806 porosity_avg += phi;
1807 sigma_avg += sigma_eff;
1808 }
1809 saturation_avg /= n_integration_points;
1810 porosity_avg /= n_integration_points;
1811 sigma_avg /= n_integration_points;
1812
1813 (*this->process_data_.element_saturation)[this->element_.getID()] =
1814 saturation_avg;
1815 (*this->process_data_.element_porosity)[this->element_.getID()] =
1816 porosity_avg;
1817
1818 Eigen::Map<KV>(
1819 &(*this->process_data_.element_stresses)[this->element_.getID() *
1820 KV::RowsAtCompileTime]) =
1822
1824 ShapeFunctionPressure, typename ShapeFunctionDisplacement::MeshElement,
1825 DisplacementDim>(this->element_, this->is_axially_symmetric_, p_L,
1826 *this->process_data_.pressure_interpolated);
1827}
void interpolateToHigherOrderNodes(MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)
std::vector< OutputData< DisplacementDim > > output_data_

References MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), MaterialPropertyLib::VariableArray::density, MaterialPropertyLib::VariableArray::effective_pore_pressure, MaterialPropertyLib::VariableArray::equivalent_plastic_strain, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::VariableArray::gas_phase_pressure, ParameterLib::SpatialPosition::getCoordinates(), MaterialPropertyLib::VariableArray::grain_compressibility, NumLib::interpolateCoordinates(), NumLib::interpolateToHigherOrderNodes(), MathLib::KelvinVector::kelvin_vector_dimensions(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, MaterialPropertyLib::VariableArray::mechanical_strain, MaterialPropertyLib::VariableArray::porosity, NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::temperature, MaterialPropertyLib::VariableArray::total_stress, MaterialPropertyLib::VariableArray::transport_porosity, ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain(), and MaterialPropertyLib::VariableArray::volumetric_strain.

◆ 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 165 of file RichardsMechanicsFEM.h.

167 {
168 auto const& N_u = secondary_data_.N_u[integration_point];
169
170 // assumes N is stored contiguously in memory
171 return Eigen::Map<const Eigen::RowVectorXd>(N_u.data(), N_u.size());
172 }

References ProcessLib::RichardsMechanics::SecondaryData< ShapeMatrixType >::N_u, and ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::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 117 of file RichardsMechanicsFEM.h.

118 {
119 unsigned const n_integration_points =
121
122 for (unsigned ip = 0; ip < n_integration_points; ip++)
123 {
124 auto& SD = this->current_states_[ip];
125 auto& ip_data = ip_data_[ip];
126
127 ParameterLib::SpatialPosition const x_position{
128 std::nullopt, this->element_.getID(),
130 ShapeFunctionDisplacement,
132 ip_data.N_u))};
133
135 if (this->process_data_.initial_stress.value)
136 {
138 DisplacementDim>>(SD)
139 .sigma_eff =
141 DisplacementDim>(
142 // The data in process_data_.initial_stress.value can
143 // be total stress or effective stress.
144 (*this->process_data_.initial_stress.value)(
145 std::numeric_limits<
146 double>::quiet_NaN() /* time independent */,
147 x_position));
148 }
149
150 double const t = 0; // TODO (naumov) pass t from top
151 this->solid_material_.initializeInternalStateVariables(
152 t, x_position,
153 *this->material_states_[ip].material_state_variables);
154
155 this->material_states_[ip].pushBackState();
156
157 this->prev_states_[ip] = SD;
158 }
159 }
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)

References ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::current_states_, ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::element_, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >::integration_method_, NumLib::interpolateCoordinates(), ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::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>
static constexpr auto ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::localDOF ( auto const & x)
inlinestaticconstexprprivate

Definition at line 240 of file RichardsMechanicsFEM.h.

241 {
242 return NumLib::localDOF<
243 ShapeFunctionPressure,
245 }
auto localDOF(ElementDOFVector const &x)
Definition LocalDOF.h:64

References NumLib::localDOF().

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

218{
219 assert(local_x.size() == pressure_size + displacement_size);
220
221 auto const [p_L, u] = localDOF(local_x);
222
223 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
224 auto const& medium =
225 this->process_data_.media_map.getMedium(this->element_.getID());
226 MPL::VariableArray variables;
227
228 auto const& solid_phase = medium->phase("Solid");
229
230 auto const& identity2 = MathLib::KelvinVector::Invariants<
232 DisplacementDim)>::identity2;
233
234 unsigned const n_integration_points =
236 for (unsigned ip = 0; ip < n_integration_points; ip++)
237 {
238 auto const& N_p = ip_data_[ip].N_p;
239
240 ParameterLib::SpatialPosition x_position = {
241 std::nullopt, this->element_.getID(),
243 NumLib::interpolateCoordinates<ShapeFunctionPressure,
245 this->element_, N_p))};
246
247 double p_cap_ip;
248 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
249
250 variables.capillary_pressure = p_cap_ip;
251 variables.liquid_phase_pressure = -p_cap_ip;
252 // setting pG to 1 atm
253 // TODO : rewrite equations s.t. p_L = pG-p_cap
254 variables.gas_phase_pressure = 1.0e5;
255
256 {
257 auto& p_L_m = std::get<MicroPressure>(this->current_states_[ip]);
258 auto& p_L_m_prev =
259 std::get<PrevState<MicroPressure>>(this->prev_states_[ip]);
260 **p_L_m_prev = -p_cap_ip;
261 *p_L_m = -p_cap_ip;
262 }
263
264 auto const temperature =
265 medium->property(MPL::PropertyType::reference_temperature)
266 .template value<double>(variables, x_position, t, dt);
267 variables.temperature = temperature;
268
269 auto& S_L_prev =
270 std::get<
271 PrevState<ProcessLib::ThermoRichardsMechanics::SaturationData>>(
272 this->prev_states_[ip])
273 ->S_L;
274 S_L_prev = medium->property(MPL::PropertyType::saturation)
275 .template value<double>(variables, x_position, t, dt);
276
277 if (this->process_data_.initial_stress.isTotalStress())
278 {
279 auto const alpha_b =
280 medium->property(MPL::PropertyType::biot_coefficient)
281 .template value<double>(variables, x_position, t, dt);
282
283 variables.liquid_saturation = S_L_prev;
284 double const chi_S_L =
285 medium->property(MPL::PropertyType::bishops_effective_stress)
286 .template value<double>(variables, x_position, t, dt);
287
288 // Initial stresses are total stress, which were assigned to
289 // sigma_eff in
290 // RichardsMechanicsLocalAssembler::initializeConcrete().
291 auto& sigma_eff =
293 DisplacementDim>>(this->current_states_[ip]);
294
295 auto& sigma_eff_prev =
296 std::get<PrevState<ProcessLib::ConstitutiveRelations::
297 EffectiveStressData<DisplacementDim>>>(
298 this->prev_states_[ip]);
299
300 // Reset sigma_eff to effective stress
301 sigma_eff.sigma_eff.noalias() +=
302 chi_S_L * alpha_b * (-p_cap_ip) * identity2;
303 sigma_eff_prev->sigma_eff = sigma_eff.sigma_eff;
304 }
305
306 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
307 {
309 vars.capillary_pressure = p_cap_ip;
310
311 auto& S_L_m = std::get<MicroSaturation>(this->current_states_[ip]);
312 auto& S_L_m_prev =
313 std::get<PrevState<MicroSaturation>>(this->prev_states_[ip]);
314
315 *S_L_m = medium->property(MPL::PropertyType::saturation_micro)
316 .template value<double>(vars, x_position, t, dt);
317 *S_L_m_prev = S_L_m;
318 }
319
320 // Set eps_m_prev from potentially non-zero eps and sigma_sw from
321 // restart.
322 auto const C_el = ip_data_[ip].computeElasticTangentStiffness(
323 t, x_position, dt, temperature, this->solid_material_,
324 *this->material_states_[ip].material_state_variables);
325
326 auto const& N_u = ip_data_[ip].N_u;
327 auto const& dNdx_u = ip_data_[ip].dNdx_u;
328 auto const x_coord =
329 NumLib::interpolateXCoordinate<ShapeFunctionDisplacement,
331 this->element_, N_u);
332 auto const B =
333 LinearBMatrix::computeBMatrix<DisplacementDim,
334 ShapeFunctionDisplacement::NPOINTS,
336 dNdx_u, N_u, x_coord, this->is_axially_symmetric_);
337 auto& eps =
338 std::get<StrainData<DisplacementDim>>(this->current_states_[ip])
339 .eps;
340 eps.noalias() = B * u;
341
342 auto const& sigma_sw =
343 std::get<ProcessLib::ThermoRichardsMechanics::
344 ConstitutiveStress_StrainTemperature::
345 SwellingDataStateful<DisplacementDim>>(
346 this->current_states_[ip])
347 .sigma_sw;
348 auto& eps_m_prev =
349 std::get<PrevState<ProcessLib::ConstitutiveRelations::
350 MechanicalStrainData<DisplacementDim>>>(
351 this->prev_states_[ip])
352 ->eps_m;
353
354 eps_m_prev.noalias() =
355 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
356 ? eps + C_el.inverse() * sigma_sw
357 : eps;
358 }
359}
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)

References MaterialPropertyLib::VariableArray::capillary_pressure, ProcessLib::LinearBMatrix::computeBMatrix(), MaterialPropertyLib::VariableArray::gas_phase_pressure, NumLib::interpolateCoordinates(), NumLib::interpolateXCoordinate(), MathLib::KelvinVector::kelvin_vector_dimensions(), MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, NumLib::detail::shapeFunctionInterpolate(), 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 255 of file RichardsMechanicsFEM.h.

◆ 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 256 of file RichardsMechanicsFEM.h.

◆ 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 73 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 79 of file RichardsMechanicsFEM.h.

◆ pressure_index

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

Definition at line 253 of file RichardsMechanicsFEM.h.

◆ pressure_size

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

Definition at line 254 of file RichardsMechanicsFEM.h.

◆ secondary_data_

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

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