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 49 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)
 
std::size_t setIPDataInitialConditions (std::string_view const name, double const *values, int const integration_order) override
 
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 > &, std::vector< double > &, 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_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
 
void initializeConcrete () override
 
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) 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.
 
std::vector< double > getSigma () const override
 
std::vector< double > const & getIntPtDarcyVelocity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getSaturation () const override
 
std::vector< double > const & getIntPtSaturation (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getMicroSaturation () const override
 
std::vector< double > const & getIntPtMicroSaturation (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getMicroPressure () const override
 
std::vector< double > const & getIntPtMicroPressure (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getPorosity () const override
 
std::vector< double > const & getIntPtPorosity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getTransportPorosity () const override
 
std::vector< double > const & getIntPtTransportPorosity (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtSigma (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getSwellingStress () const override
 
std::vector< double > const & getIntPtSwellingStress (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > getEpsilon () const override
 
std::vector< double > const & getIntPtEpsilon (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
int getMaterialID () const override
 
std::vector< double > getMaterialStateVariableInternalState (std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const &get_values_span, int const &n_components) const override
 
std::vector< double > const & getIntPtDryDensitySolid (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
- 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_M_data, std::vector< double > &local_K_data, 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_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
unsigned getNumberOfIntegrationPoints () const override
 
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const override
 

Private Attributes

RichardsMechanicsProcessData< DisplacementDim > & _process_data
 
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
 
NumLib::GenericIntegrationMethod const & _integration_method
 
MeshLib::Element const & _element
 
bool const _is_axially_symmetric
 
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
 

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 61 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 58 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 72 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 65 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 63 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 74 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 117 of file RichardsMechanicsFEM-impl.h.

124 : _process_data(process_data),
125 _integration_method(integration_method),
126 _element(e),
127 _is_axially_symmetric(is_axially_symmetric)
128{
129 unsigned const n_integration_points =
131
132 _ip_data.reserve(n_integration_points);
133 _secondary_data.N_u.resize(n_integration_points);
134
135 auto const shape_matrices_u =
136 NumLib::initShapeMatrices<ShapeFunctionDisplacement,
138 DisplacementDim>(e, is_axially_symmetric,
140
141 auto const shape_matrices_p =
142 NumLib::initShapeMatrices<ShapeFunctionPressure,
143 ShapeMatricesTypePressure, DisplacementDim>(
144 e, is_axially_symmetric, _integration_method);
145
146 auto const& solid_material =
148 _process_data.solid_materials, _process_data.material_ids,
149 e.getID());
150
151 auto const& medium = _process_data.media_map.getMedium(_element.getID());
152
154 x_position.setElementID(_element.getID());
155 for (unsigned ip = 0; ip < n_integration_points; ip++)
156 {
157 x_position.setIntegrationPoint(ip);
158 _ip_data.emplace_back(solid_material);
159 auto& ip_data = _ip_data[ip];
160 auto const& sm_u = shape_matrices_u[ip];
161 _ip_data[ip].integration_weight =
163 sm_u.integralMeasure * sm_u.detJ;
164
165 ip_data.N_u = sm_u.N;
166 ip_data.dNdx_u = sm_u.dNdx;
167
168 ip_data.N_p = shape_matrices_p[ip].N;
169 ip_data.dNdx_p = shape_matrices_p[ip].dNdx;
170
171 // Initial porosity. Could be read from integration point data or mesh.
172 ip_data.porosity =
173 medium->property(MPL::porosity)
174 .template initialValue<double>(
175 x_position,
176 std::numeric_limits<
177 double>::quiet_NaN() /* t independent */);
178
179 ip_data.transport_porosity = ip_data.porosity;
180 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
181 {
182 ip_data.transport_porosity =
183 medium->property(MPL::transport_porosity)
184 .template initialValue<double>(
185 x_position,
186 std::numeric_limits<
187 double>::quiet_NaN() /* t independent */);
188 }
189
190 _secondary_data.N_u[ip] = shape_matrices_u[ip].N;
191 }
192}
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
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
SecondaryData< typename ShapeMatricesTypeDisplacement::ShapeMatrices::ShapeType > _secondary_data
RichardsMechanicsProcessData< DisplacementDim > & _process_data
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
auto & selectSolidConstitutiveRelation(SolidMaterialsMap const &constitutive_relations, MeshLib::PropertyVector< int > const *const material_ids, std::size_t const element_id)
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::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N_u

References ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_element, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_integration_method, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_ip_data, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_process_data, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_secondary_data, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), MathLib::WeightedPoint::getWeight(), NumLib::GenericIntegrationMethod::getWeightedPoint(), NumLib::initShapeMatrices(), ProcessLib::HydroMechanics::SecondaryData< ShapeMatrixType >::N_u, MaterialPropertyLib::porosity, MaterialLib::Solids::selectSolidConstitutiveRelation(), ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), and MaterialPropertyLib::transport_porosity.

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

360{
361 assert(local_x.size() == pressure_size + displacement_size);
362
363 auto p_L =
364 Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
365 pressure_size> const>(local_x.data() + pressure_index,
367
368 auto u =
369 Eigen::Map<typename ShapeMatricesTypeDisplacement::template VectorType<
370 displacement_size> const>(local_x.data() + displacement_index,
372
373 auto p_L_prev =
374 Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
375 pressure_size> const>(local_x_prev.data() + pressure_index,
377
378 auto u_prev =
379 Eigen::Map<typename ShapeMatricesTypeDisplacement::template VectorType<
380 displacement_size> const>(local_x_prev.data() + displacement_index,
382
384 typename ShapeMatricesTypeDisplacement::template MatrixType<
387 local_K_data, displacement_size + pressure_size,
389
391 typename ShapeMatricesTypeDisplacement::template MatrixType<
394 local_M_data, displacement_size + pressure_size,
396
398 typename ShapeMatricesTypeDisplacement::template VectorType<
400 local_rhs_data, displacement_size + pressure_size);
401
402 auto const& identity2 = MathLib::KelvinVector::Invariants<
404 DisplacementDim)>::identity2;
405
406 auto const& medium = _process_data.media_map.getMedium(_element.getID());
407 auto const& liquid_phase = medium->phase("AqueousLiquid");
408 auto const& solid_phase = medium->phase("Solid");
409 MPL::VariableArray variables;
410 MPL::VariableArray variables_prev;
411
413 x_position.setElementID(_element.getID());
414
415 unsigned const n_integration_points =
417 for (unsigned ip = 0; ip < n_integration_points; ip++)
418 {
419 x_position.setIntegrationPoint(ip);
420 auto const& w = _ip_data[ip].integration_weight;
421
422 auto const& N_u = _ip_data[ip].N_u;
423 auto const& dNdx_u = _ip_data[ip].dNdx_u;
424
425 auto const& N_p = _ip_data[ip].N_p;
426 auto const& dNdx_p = _ip_data[ip].dNdx_p;
427
428 auto const x_coord =
429 NumLib::interpolateXCoordinate<ShapeFunctionDisplacement,
431 _element, N_u);
432 auto const B =
433 LinearBMatrix::computeBMatrix<DisplacementDim,
434 ShapeFunctionDisplacement::NPOINTS,
436 dNdx_u, N_u, x_coord, _is_axially_symmetric);
437
438 auto& eps = _ip_data[ip].eps;
439 auto& eps_m = _ip_data[ip].eps_m;
440 eps.noalias() = B * u;
441
442 auto& S_L = _ip_data[ip].saturation;
443 auto const S_L_prev = _ip_data[ip].saturation_prev;
444
445 double p_cap_ip;
446 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
447
448 double p_cap_prev_ip;
449 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
450
451 variables.capillary_pressure = p_cap_ip;
452 variables.liquid_phase_pressure = -p_cap_ip;
453 // setting pG to 1 atm
454 // TODO : rewrite equations s.t. p_L = pG-p_cap
455 variables.gas_phase_pressure = 1.0e5;
456
457 auto const temperature =
458 medium->property(MPL::PropertyType::reference_temperature)
459 .template value<double>(variables, x_position, t, dt);
460 variables.temperature = temperature;
461
462 auto const alpha =
463 medium->property(MPL::PropertyType::biot_coefficient)
464 .template value<double>(variables, x_position, t, dt);
465 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
466 t, x_position, dt, temperature);
467
468 auto const beta_SR =
469 (1 - alpha) /
470 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
471 variables.grain_compressibility = beta_SR;
472
473 auto const rho_LR =
474 liquid_phase.property(MPL::PropertyType::density)
475 .template value<double>(variables, x_position, t, dt);
476 variables.density = rho_LR;
477
478 auto const& b = _process_data.specific_body_force;
479
480 S_L = medium->property(MPL::PropertyType::saturation)
481 .template value<double>(variables, x_position, t, dt);
482 variables.liquid_saturation = S_L;
483 variables_prev.liquid_saturation = S_L_prev;
484
485 // tangent derivative for Jacobian
486 double const dS_L_dp_cap =
487 medium->property(MPL::PropertyType::saturation)
488 .template dValue<double>(variables,
489 MPL::Variable::capillary_pressure,
490 x_position, t, dt);
491 // secant derivative from time discretization for storage
492 // use tangent, if secant is not available
493 double const DeltaS_L_Deltap_cap =
494 (p_cap_ip == p_cap_prev_ip)
495 ? dS_L_dp_cap
496 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
497
498 auto const chi = [medium, x_position, t, dt](double const S_L)
499 {
501 vs.liquid_saturation = S_L;
502 return medium->property(MPL::PropertyType::bishops_effective_stress)
503 .template value<double>(vs, x_position, t, dt);
504 };
505 double const chi_S_L = chi(S_L);
506 double const chi_S_L_prev = chi(S_L_prev);
507
508 double const p_FR = -chi_S_L * p_cap_ip;
509 variables.effective_pore_pressure = p_FR;
510 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
511
512 // Set volumetric strain rate for the general case without swelling.
513 variables.volumetric_strain = Invariants::trace(_ip_data[ip].eps);
514 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
515
516 auto& phi = _ip_data[ip].porosity;
517 { // Porosity update
518 variables_prev.porosity = _ip_data[ip].porosity_prev;
519 phi = medium->property(MPL::PropertyType::porosity)
520 .template value<double>(variables, variables_prev,
521 x_position, t, dt);
522 variables.porosity = phi;
523 }
524
525 if (alpha < phi)
526 {
527 OGS_FATAL(
528 "RichardsMechanics: Biot-coefficient {} is smaller than "
529 "porosity {} in element/integration point {}/{}.",
530 alpha, phi, _element.getID(), ip);
531 }
532
533 // Swelling and possibly volumetric strain rate update.
534 {
535 auto& sigma_sw = _ip_data[ip].sigma_sw;
536 auto const& sigma_sw_prev = _ip_data[ip].sigma_sw_prev;
537
538 // If there is swelling, compute it. Update volumetric strain rate,
539 // s.t. it corresponds to the mechanical part only.
540 sigma_sw = sigma_sw_prev;
541 if (solid_phase.hasProperty(
542 MPL::PropertyType::swelling_stress_rate))
543 {
544 auto const sigma_sw_dot =
545 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
547 solid_phase[MPL::PropertyType::swelling_stress_rate]
548 .value(variables, variables_prev, x_position, t,
549 dt)));
550 sigma_sw += sigma_sw_dot * dt;
551
552 // !!! Misusing volumetric strain for mechanical volumetric
553 // strain just to update the transport porosity !!!
554 variables.volumetric_strain +=
555 identity2.transpose() * C_el.inverse() * sigma_sw;
556 variables_prev.volumetric_strain +=
557 identity2.transpose() * C_el.inverse() * sigma_sw_prev;
558 }
559
560 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
561 {
562 variables_prev.transport_porosity =
563 _ip_data[ip].transport_porosity_prev;
564
565 _ip_data[ip].transport_porosity =
566 medium->property(MPL::PropertyType::transport_porosity)
567 .template value<double>(variables, variables_prev,
568 x_position, t, dt);
569 variables.transport_porosity = _ip_data[ip].transport_porosity;
570 }
571 else
572 {
573 variables.transport_porosity = phi;
574 }
575 }
576
577 double const k_rel =
578 medium->property(MPL::PropertyType::relative_permeability)
579 .template value<double>(variables, x_position, t, dt);
580 auto const mu =
581 liquid_phase.property(MPL::PropertyType::viscosity)
582 .template value<double>(variables, x_position, t, dt);
583
584 auto const& sigma_sw = _ip_data[ip].sigma_sw;
585 auto const& sigma_eff = _ip_data[ip].sigma_eff;
586
587 // Set mechanical variables for the intrinsic permeability model
588 // For stress dependent permeability.
589 {
590 auto const sigma_total =
591 (sigma_eff - alpha * p_FR * identity2).eval();
592
593 // For stress dependent permeability.
594 variables.total_stress.emplace<SymmetricTensor>(
596 sigma_total));
597 }
598
599 variables.equivalent_plastic_strain =
600 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
601
602 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
603 medium->property(MPL::PropertyType::permeability)
604 .value(variables, x_position, t, dt));
605
606 GlobalDimMatrixType const rho_K_over_mu =
607 K_intrinsic * rho_LR * k_rel / mu;
608
609 //
610 // displacement equation, displacement part
611 //
612 eps_m.noalias() =
613 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
614 ? eps + C_el.inverse() * sigma_sw
615 : eps;
616 variables.mechanical_strain
618 eps_m);
619
620 _ip_data[ip].updateConstitutiveRelation(variables, t, x_position, dt,
621 temperature);
622
623 // p_SR
624 variables.solid_grain_pressure =
625 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
626 auto const rho_SR =
627 solid_phase.property(MPL::PropertyType::density)
628 .template value<double>(variables, x_position, t, dt);
629
630 //
631 // displacement equation, displacement part
632 //
633 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
634 rhs.template segment<displacement_size>(displacement_index).noalias() -=
635 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
636
637 //
638 // pressure equation, pressure part.
639 //
640 auto const beta_LR =
641 1 / rho_LR *
642 liquid_phase.property(MPL::PropertyType::density)
643 .template dValue<double>(variables,
644 MPL::Variable::liquid_phase_pressure,
645 x_position, t, dt);
646
647 double const a0 = S_L * (alpha - phi) * beta_SR;
648 // Volumetric average specific storage of the solid and fluid phases.
649 double const specific_storage =
650 DeltaS_L_Deltap_cap * (p_cap_ip * a0 - phi) +
651 S_L * (phi * beta_LR + a0);
652 M.template block<pressure_size, pressure_size>(pressure_index,
654 .noalias() += N_p.transpose() * rho_LR * specific_storage * N_p * w;
655
656 K.template block<pressure_size, pressure_size>(pressure_index,
658 .noalias() += dNdx_p.transpose() * rho_K_over_mu * dNdx_p * w;
659
660 rhs.template segment<pressure_size>(pressure_index).noalias() +=
661 dNdx_p.transpose() * rho_LR * rho_K_over_mu * b * w;
662
663 //
664 // displacement equation, pressure part
665 //
666 K.template block<displacement_size, pressure_size>(displacement_index,
668 .noalias() -= B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
669
670 //
671 // pressure equation, displacement part.
672 //
673 M.template block<pressure_size, displacement_size>(pressure_index,
675 .noalias() += N_p.transpose() * S_L * rho_LR * alpha *
676 identity2.transpose() * B * w;
677 }
678
679 if (_process_data.apply_mass_lumping)
680 {
681 auto Mpp = M.template block<pressure_size, pressure_size>(
683 Mpp = Mpp.colwise().sum().eval().asDiagonal();
684 }
685}
#define OGS_FATAL(...)
Definition Error.h:26
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > mechanical_strain
std::variant< std::monostate, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 > > total_stress
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
Eigen::Matrix< double, KelvinVectorSize, 1 > SymmetricTensor
typename ShapeMatricesTypePressure::GlobalDimMatrixType GlobalDimMatrixType
@ rho
density. For some models, rho substitutes p
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(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
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 &)
double interpolateXCoordinate(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
auto eval(Function &f, Tuples &... ts) -> typename detail::GetFunctionReturnType< decltype(&Function::eval)>::type
Definition Apply.h:267
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.

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< 3 >(), MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::VariableArray::grain_compressibility, NumLib::interpolateXCoordinate(), 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(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::temperature, MaterialPropertyLib::VariableArray::total_stress, MaterialPropertyLib::VariableArray::transport_porosity, 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 > & ,
std::vector< double > & ,
std::vector< double > & local_rhs_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

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

698{
699 assert(local_x.size() == pressure_size + displacement_size);
700
701 auto p_L =
702 Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
703 pressure_size> const>(local_x.data() + pressure_index,
705
706 auto u =
707 Eigen::Map<typename ShapeMatricesTypeDisplacement::template VectorType<
708 displacement_size> const>(local_x.data() + displacement_index,
710
711 auto p_L_prev =
712 Eigen::Map<typename ShapeMatricesTypePressure::template VectorType<
713 pressure_size> const>(local_x_prev.data() + pressure_index,
715 auto u_prev =
716 Eigen::Map<typename ShapeMatricesTypeDisplacement::template VectorType<
717 displacement_size> const>(local_x_prev.data() + displacement_index,
719
720 auto local_Jac = MathLib::createZeroedMatrix<
721 typename ShapeMatricesTypeDisplacement::template MatrixType<
724 local_Jac_data, displacement_size + pressure_size,
726
727 auto local_rhs = MathLib::createZeroedVector<
728 typename ShapeMatricesTypeDisplacement::template VectorType<
730 local_rhs_data, displacement_size + pressure_size);
731
732 auto const& identity2 = MathLib::KelvinVector::Invariants<
734 DisplacementDim)>::identity2;
735
737 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
739
740 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_p =
741 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
743
744 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_S_Jpp =
745 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
747
748 typename ShapeMatricesTypePressure::NodalMatrixType storage_p_a_S =
749 ShapeMatricesTypePressure::NodalMatrixType::Zero(pressure_size,
751
752 typename ShapeMatricesTypeDisplacement::template MatrixType<
754 Kup = ShapeMatricesTypeDisplacement::template MatrixType<
757
758 typename ShapeMatricesTypeDisplacement::template MatrixType<
760 Kpu = ShapeMatricesTypeDisplacement::template MatrixType<
763
764 auto const& medium = _process_data.media_map.getMedium(_element.getID());
765 auto const& liquid_phase = medium->phase("AqueousLiquid");
766 auto const& solid_phase = medium->phase("Solid");
767 MPL::VariableArray variables;
768 MPL::VariableArray variables_prev;
769
771 x_position.setElementID(_element.getID());
772
773 unsigned const n_integration_points =
775 for (unsigned ip = 0; ip < n_integration_points; ip++)
776 {
777 x_position.setIntegrationPoint(ip);
778 auto const& w = _ip_data[ip].integration_weight;
779
780 auto const& N_u = _ip_data[ip].N_u;
781 auto const& dNdx_u = _ip_data[ip].dNdx_u;
782
783 auto const& N_p = _ip_data[ip].N_p;
784 auto const& dNdx_p = _ip_data[ip].dNdx_p;
785
786 auto const x_coord =
787 NumLib::interpolateXCoordinate<ShapeFunctionDisplacement,
789 _element, N_u);
790 auto const B =
791 LinearBMatrix::computeBMatrix<DisplacementDim,
792 ShapeFunctionDisplacement::NPOINTS,
794 dNdx_u, N_u, x_coord, _is_axially_symmetric);
795
796 double p_cap_ip;
797 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
798
799 double p_cap_prev_ip;
800 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
801
802 variables.capillary_pressure = p_cap_ip;
803 variables.liquid_phase_pressure = -p_cap_ip;
804 // setting pG to 1 atm
805 // TODO : rewrite equations s.t. p_L = pG-p_cap
806 variables.gas_phase_pressure = 1.0e5;
807
808 auto const temperature =
809 medium->property(MPL::PropertyType::reference_temperature)
810 .template value<double>(variables, x_position, t, dt);
811 variables.temperature = temperature;
812
813 auto& eps = _ip_data[ip].eps;
814 auto& eps_m = _ip_data[ip].eps_m;
815 eps.noalias() = B * u;
816 auto const& sigma_eff = _ip_data[ip].sigma_eff;
817 auto& S_L = _ip_data[ip].saturation;
818 auto const S_L_prev = _ip_data[ip].saturation_prev;
819 auto const alpha =
820 medium->property(MPL::PropertyType::biot_coefficient)
821 .template value<double>(variables, x_position, t, dt);
822
823 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
824 t, x_position, dt, temperature);
825
826 auto const beta_SR =
827 (1 - alpha) /
828 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
829 variables.grain_compressibility = beta_SR;
830
831 auto const rho_LR =
832 liquid_phase.property(MPL::PropertyType::density)
833 .template value<double>(variables, x_position, t, dt);
834 variables.density = rho_LR;
835
836 auto const& b = _process_data.specific_body_force;
837
838 S_L = medium->property(MPL::PropertyType::saturation)
839 .template value<double>(variables, x_position, t, dt);
840 variables.liquid_saturation = S_L;
841 variables_prev.liquid_saturation = S_L_prev;
842
843 // tangent derivative for Jacobian
844 double const dS_L_dp_cap =
845 medium->property(MPL::PropertyType::saturation)
846 .template dValue<double>(variables,
847 MPL::Variable::capillary_pressure,
848 x_position, t, dt);
849 // secant derivative from time discretization for storage
850 // use tangent, if secant is not available
851 double const DeltaS_L_Deltap_cap =
852 (p_cap_ip == p_cap_prev_ip)
853 ? dS_L_dp_cap
854 : (S_L - S_L_prev) / (p_cap_ip - p_cap_prev_ip);
855
856 auto const chi = [medium, x_position, t, dt](double const S_L)
857 {
859 vs.liquid_saturation = S_L;
860 return medium->property(MPL::PropertyType::bishops_effective_stress)
861 .template value<double>(vs, x_position, t, dt);
862 };
863 double const chi_S_L = chi(S_L);
864 double const chi_S_L_prev = chi(S_L_prev);
865
866 double const p_FR = -chi_S_L * p_cap_ip;
867 variables.effective_pore_pressure = p_FR;
868 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
869
870 // Set volumetric strain rate for the general case without swelling.
871 variables.volumetric_strain = Invariants::trace(_ip_data[ip].eps);
872 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
873
874 auto& phi = _ip_data[ip].porosity;
875 { // Porosity update
876
877 variables_prev.porosity = _ip_data[ip].porosity_prev;
878 phi = medium->property(MPL::PropertyType::porosity)
879 .template value<double>(variables, variables_prev,
880 x_position, t, dt);
881 variables.porosity = phi;
882 }
883
884 if (alpha < phi)
885 {
886 OGS_FATAL(
887 "RichardsMechanics: Biot-coefficient {} is smaller than "
888 "porosity {} in element/integration point {}/{}.",
889 alpha, phi, _element.getID(), ip);
890 }
891
892 auto const mu =
893 liquid_phase.property(MPL::PropertyType::viscosity)
894 .template value<double>(variables, x_position, t, dt);
895
896 // Swelling and possibly volumetric strain rate update.
897 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
898 _ip_data[ip], *medium, solid_phase, C_el, rho_LR, mu,
899 _process_data.micro_porosity_parameters, alpha, phi, p_cap_ip,
900 variables, variables_prev, x_position, t, dt);
901
902 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
903 {
904 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
905 {
906 variables_prev.transport_porosity =
907 _ip_data[ip].transport_porosity_prev;
908
909 _ip_data[ip].transport_porosity =
910 medium->property(MPL::PropertyType::transport_porosity)
911 .template value<double>(variables, variables_prev,
912 x_position, t, dt);
913 variables.transport_porosity = _ip_data[ip].transport_porosity;
914 }
915 }
916 else
917 {
918 variables.transport_porosity = phi;
919 }
920
921 double const k_rel =
922 medium->property(MPL::PropertyType::relative_permeability)
923 .template value<double>(variables, x_position, t, dt);
924
925 // Set mechanical variables for the intrinsic permeability model
926 // For stress dependent permeability.
927 {
928 auto const sigma_total =
929 (_ip_data[ip].sigma_eff + alpha * p_FR * identity2).eval();
930 // For stress dependent permeability.
931 variables.total_stress.emplace<SymmetricTensor>(
933 sigma_total));
934 }
935
936 variables.equivalent_plastic_strain =
937 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
938
939 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
940 medium->property(MPL::PropertyType::permeability)
941 .value(variables, x_position, t, dt));
942
943 GlobalDimMatrixType const rho_Ki_over_mu = K_intrinsic * rho_LR / mu;
944
945 //
946 // displacement equation, displacement part
947 //
948 auto& sigma_sw = _ip_data[ip].sigma_sw;
949
950 eps_m.noalias() =
951 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
952 ? eps + C_el.inverse() * sigma_sw
953 : eps;
954 variables.mechanical_strain
956 eps_m);
957
958 auto C = _ip_data[ip].updateConstitutiveRelation(
959 variables, t, x_position, dt, temperature);
960
961 local_Jac
962 .template block<displacement_size, displacement_size>(
964 .noalias() += B.transpose() * C * B * w;
965
966 // p_SR
967 variables.solid_grain_pressure =
968 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
969 auto const rho_SR =
970 solid_phase.property(MPL::PropertyType::density)
971 .template value<double>(variables, x_position, t, dt);
972
973 double const rho = rho_SR * (1 - phi) + S_L * phi * rho_LR;
974 local_rhs.template segment<displacement_size>(displacement_index)
975 .noalias() -=
976 (B.transpose() * sigma_eff - N_u_op(N_u).transpose() * rho * b) * w;
977
978 //
979 // displacement equation, pressure part
980 //
981 Kup.noalias() += B.transpose() * alpha * chi_S_L * identity2 * N_p * w;
982
983 auto const dchi_dS_L =
984 medium->property(MPL::PropertyType::bishops_effective_stress)
985 .template dValue<double>(variables,
986 MPL::Variable::liquid_saturation,
987 x_position, t, dt);
988 local_Jac
989 .template block<displacement_size, pressure_size>(
991 .noalias() -= B.transpose() * alpha *
992 (chi_S_L + dchi_dS_L * p_cap_ip * dS_L_dp_cap) *
993 identity2 * N_p * w;
994
995 local_Jac
996 .template block<displacement_size, pressure_size>(
998 .noalias() +=
999 N_u_op(N_u).transpose() * phi * rho_LR * dS_L_dp_cap * b * N_p * w;
1000
1001 // For the swelling stress with double structure model the corresponding
1002 // Jacobian u-p entry would be required, but it does not improve
1003 // convergence and sometimes worsens it:
1004 // if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1005 // {
1006 // -B.transpose() *
1007 // dsigma_sw_dS_L_m* dS_L_m_dp_cap_m*(p_L_m - p_L_m_prev) /
1008 // (p_cap_ip - p_cap_prev_ip) * N_p* w;
1009 // }
1010 if (!medium->hasProperty(MPL::PropertyType::saturation_micro) &&
1011 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
1012 {
1013 using DimMatrix = Eigen::Matrix<double, 3, 3>;
1014 auto const dsigma_sw_dS_L =
1015 MathLib::KelvinVector::tensorToKelvin<DisplacementDim>(
1016 solid_phase
1017 .property(MPL::PropertyType::swelling_stress_rate)
1018 .template dValue<DimMatrix>(
1019 variables, variables_prev,
1020 MPL::Variable::liquid_saturation, x_position, t,
1021 dt));
1022 local_Jac
1023 .template block<displacement_size, pressure_size>(
1025 .noalias() +=
1026 B.transpose() * dsigma_sw_dS_L * dS_L_dp_cap * N_p * w;
1027 }
1028 //
1029 // pressure equation, displacement part.
1030 //
1031 if (_process_data.explicit_hm_coupling_in_unsaturated_zone)
1032 {
1033 Kpu.noalias() += N_p.transpose() * chi_S_L_prev * rho_LR * alpha *
1034 identity2.transpose() * B * w;
1035 }
1036 else
1037 {
1038 Kpu.noalias() += N_p.transpose() * S_L * rho_LR * alpha *
1039 identity2.transpose() * B * w;
1040 }
1041
1042 //
1043 // pressure equation, pressure part.
1044 //
1045 laplace_p.noalias() +=
1046 dNdx_p.transpose() * k_rel * rho_Ki_over_mu * dNdx_p * w;
1047
1048 auto const beta_LR =
1049 1 / rho_LR *
1050 liquid_phase.property(MPL::PropertyType::density)
1051 .template dValue<double>(variables,
1052 MPL::Variable::liquid_phase_pressure,
1053 x_position, t, dt);
1054
1055 double const a0 = (alpha - phi) * beta_SR;
1056 double const specific_storage_a_p = S_L * (phi * beta_LR + S_L * a0);
1057 double const specific_storage_a_S = phi - p_cap_ip * S_L * a0;
1058
1059 double const dspecific_storage_a_p_dp_cap =
1060 dS_L_dp_cap * (phi * beta_LR + 2 * S_L * a0);
1061 double const dspecific_storage_a_S_dp_cap =
1062 -a0 * (S_L + p_cap_ip * dS_L_dp_cap);
1063
1064 storage_p_a_p.noalias() +=
1065 N_p.transpose() * rho_LR * specific_storage_a_p * N_p * w;
1066
1067 storage_p_a_S.noalias() -= N_p.transpose() * rho_LR *
1068 specific_storage_a_S * DeltaS_L_Deltap_cap *
1069 N_p * w;
1070
1071 local_Jac
1072 .template block<pressure_size, pressure_size>(pressure_index,
1074 .noalias() += N_p.transpose() * (p_cap_ip - p_cap_prev_ip) / dt *
1075 rho_LR * dspecific_storage_a_p_dp_cap * N_p * w;
1076
1077 storage_p_a_S_Jpp.noalias() -=
1078 N_p.transpose() * rho_LR *
1079 ((S_L - S_L_prev) * dspecific_storage_a_S_dp_cap +
1080 specific_storage_a_S * dS_L_dp_cap) /
1081 dt * N_p * w;
1082
1083 if (!_process_data.explicit_hm_coupling_in_unsaturated_zone)
1084 {
1085 local_Jac
1086 .template block<pressure_size, pressure_size>(pressure_index,
1088 .noalias() -= N_p.transpose() * rho_LR * dS_L_dp_cap * alpha *
1089 identity2.transpose() * B * (u - u_prev) / dt *
1090 N_p * w;
1091 }
1092
1093 double const dk_rel_dS_l =
1094 medium->property(MPL::PropertyType::relative_permeability)
1095 .template dValue<double>(variables,
1096 MPL::Variable::liquid_saturation,
1097 x_position, t, dt);
1099 grad_p_cap = -dNdx_p * p_L;
1100 local_Jac
1101 .template block<pressure_size, pressure_size>(pressure_index,
1103 .noalias() += dNdx_p.transpose() * rho_Ki_over_mu * grad_p_cap *
1104 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1105
1106 local_Jac
1107 .template block<pressure_size, pressure_size>(pressure_index,
1109 .noalias() += dNdx_p.transpose() * rho_LR * rho_Ki_over_mu * b *
1110 dk_rel_dS_l * dS_L_dp_cap * N_p * w;
1111
1112 local_rhs.template segment<pressure_size>(pressure_index).noalias() +=
1113 dNdx_p.transpose() * rho_LR * k_rel * rho_Ki_over_mu * b * w;
1114
1115 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
1116 {
1117 double const alpha_bar = _process_data.micro_porosity_parameters
1118 ->mass_exchange_coefficient;
1119 auto const p_L_m = _ip_data[ip].liquid_pressure_m;
1120 local_rhs.template segment<pressure_size>(pressure_index)
1121 .noalias() -=
1122 N_p.transpose() * alpha_bar / mu * (-p_cap_ip - p_L_m) * w;
1123
1124 local_Jac
1125 .template block<pressure_size, pressure_size>(pressure_index,
1127 .noalias() += N_p.transpose() * alpha_bar / mu * N_p * w;
1128 if (p_cap_ip != p_cap_prev_ip)
1129 {
1130 double const p_L_m_prev = _ip_data[ip].liquid_pressure_m_prev;
1131 local_Jac
1132 .template block<pressure_size, pressure_size>(
1134 .noalias() += N_p.transpose() * alpha_bar / mu *
1135 (p_L_m - p_L_m_prev) /
1136 (p_cap_ip - p_cap_prev_ip) * N_p * w;
1137 }
1138 }
1139 }
1140
1141 if (_process_data.apply_mass_lumping)
1142 {
1143 storage_p_a_p = storage_p_a_p.colwise().sum().eval().asDiagonal();
1144 storage_p_a_S = storage_p_a_S.colwise().sum().eval().asDiagonal();
1145 storage_p_a_S_Jpp =
1146 storage_p_a_S_Jpp.colwise().sum().eval().asDiagonal();
1147 }
1148
1149 // pressure equation, pressure part.
1150 local_Jac
1151 .template block<pressure_size, pressure_size>(pressure_index,
1153 .noalias() += laplace_p + storage_p_a_p / dt + storage_p_a_S_Jpp;
1154
1155 // pressure equation, displacement part.
1156 local_Jac
1157 .template block<pressure_size, displacement_size>(pressure_index,
1159 .noalias() = Kpu / dt;
1160
1161 // pressure equation
1162 local_rhs.template segment<pressure_size>(pressure_index).noalias() -=
1163 laplace_p * p_L +
1164 (storage_p_a_p + storage_p_a_S) * (p_L - p_L_prev) / dt +
1165 Kpu * (u - u_prev) / dt;
1166
1167 // displacement equation
1168 local_rhs.template segment<displacement_size>(displacement_index)
1169 .noalias() += Kup * p_L;
1170}
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< GlobalDim > GlobalDimVectorType

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::VariableArray::gas_phase_pressure, MaterialPropertyLib::VariableArray::grain_compressibility, NumLib::interpolateXCoordinate(), 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(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::detail::shapeFunctionInterpolate(), MaterialPropertyLib::VariableArray::solid_grain_pressure, MaterialPropertyLib::VariableArray::temperature, MaterialPropertyLib::VariableArray::total_stress, MaterialPropertyLib::VariableArray::transport_porosity, 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_M_data,
std::vector< double > & local_K_data,
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_M_dataMass matrix of an element, which takes the form of \( \int N^T N\mathrm{d}\Omega\). Not used.
local_K_dataLaplacian matrix of an element, which takes the form of \( \int (\nabla N)^T K \nabla N\mathrm{d}\Omega\). Not used.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

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

1490{
1491 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1492}

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_M_data,
std::vector< double > & local_K_data,
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_M_dataMass matrix of an element, which takes the form of \( \int N^T N\mathrm{d}\Omega\). Not used.
local_K_dataLaplacian matrix of an element, which takes the form of \( \int (\nabla N)^T K \nabla N\mathrm{d}\Omega\). Not used.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

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

1474{
1475 OGS_FATAL("RichardsMechanics; The staggered scheme is not implemented.");
1476}

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_M_data,
std::vector< double > & local_K_data,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

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

1503{
1504 // For the equations with pressure
1505 if (process_id == 0)
1506 {
1507 assembleWithJacobianForPressureEquations(t, dt, local_x, local_x_prev,
1508 local_M_data, local_K_data,
1509 local_b_data, local_Jac_data);
1510 return;
1511 }
1512
1513 // For the equations with deformation
1514 assembleWithJacobianForDeformationEquations(t, dt, local_x, local_x_prev,
1515 local_M_data, local_K_data,
1516 local_b_data, local_Jac_data);
1517}
void assembleWithJacobianForDeformationEquations(double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_M_data, std::vector< double > &local_K_data, 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_M_data, std::vector< double > &local_K_data, 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 1522 of file RichardsMechanicsFEM-impl.h.

1526{
1527 auto p_L = local_x.template segment<pressure_size>(pressure_index);
1528 auto u = local_x.template segment<displacement_size>(displacement_index);
1529
1530 auto p_L_prev =
1531 local_x_prev.template segment<pressure_size>(pressure_index);
1532 auto u_prev =
1533 local_x_prev.template segment<displacement_size>(displacement_index);
1534
1535 auto const& identity2 = MathLib::KelvinVector::Invariants<
1537 DisplacementDim)>::identity2;
1538
1539 auto const& medium = _process_data.media_map.getMedium(_element.getID());
1540 auto const& liquid_phase = medium->phase("AqueousLiquid");
1541 auto const& solid_phase = medium->phase("Solid");
1542 MPL::VariableArray variables;
1543 MPL::VariableArray variables_prev;
1544
1546 x_position.setElementID(_element.getID());
1547
1548 unsigned const n_integration_points =
1550
1551 double saturation_avg = 0;
1552 double porosity_avg = 0;
1553
1555 KV sigma_avg = KV::Zero();
1556
1557 for (unsigned ip = 0; ip < n_integration_points; ip++)
1558 {
1559 x_position.setIntegrationPoint(ip);
1560 auto const& N_p = _ip_data[ip].N_p;
1561 auto const& N_u = _ip_data[ip].N_u;
1562 auto const& dNdx_u = _ip_data[ip].dNdx_u;
1563
1564 auto const x_coord =
1565 NumLib::interpolateXCoordinate<ShapeFunctionDisplacement,
1567 _element, N_u);
1568 auto const B =
1569 LinearBMatrix::computeBMatrix<DisplacementDim,
1570 ShapeFunctionDisplacement::NPOINTS,
1572 dNdx_u, N_u, x_coord, _is_axially_symmetric);
1573
1574 double p_cap_ip;
1575 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
1576
1577 double p_cap_prev_ip;
1578 NumLib::shapeFunctionInterpolate(-p_L_prev, N_p, p_cap_prev_ip);
1579
1580 variables.capillary_pressure = p_cap_ip;
1581 variables.liquid_phase_pressure = -p_cap_ip;
1582 // setting pG to 1 atm
1583 // TODO : rewrite equations s.t. p_L = pG-p_cap
1584 variables.gas_phase_pressure = 1.0e5;
1585
1586 auto const temperature =
1587 medium->property(MPL::PropertyType::reference_temperature)
1588 .template value<double>(variables, x_position, t, dt);
1589 variables.temperature = temperature;
1590
1591 auto& eps = _ip_data[ip].eps;
1592 eps.noalias() = B * u;
1593 auto& eps_m = _ip_data[ip].eps_m;
1594 auto& S_L = _ip_data[ip].saturation;
1595 auto const S_L_prev = _ip_data[ip].saturation_prev;
1596 S_L = medium->property(MPL::PropertyType::saturation)
1597 .template value<double>(variables, x_position, t, dt);
1598 variables.liquid_saturation = S_L;
1599 variables_prev.liquid_saturation = S_L_prev;
1600
1601 auto const chi = [medium, x_position, t, dt](double const S_L)
1602 {
1604 vs.liquid_saturation = S_L;
1605 return medium->property(MPL::PropertyType::bishops_effective_stress)
1606 .template value<double>(vs, x_position, t, dt);
1607 };
1608 double const chi_S_L = chi(S_L);
1609 double const chi_S_L_prev = chi(S_L_prev);
1610
1611 auto const alpha =
1612 medium->property(MPL::PropertyType::biot_coefficient)
1613 .template value<double>(variables, x_position, t, dt);
1614
1615 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
1616 t, x_position, dt, temperature);
1617
1618 auto const beta_SR =
1619 (1 - alpha) /
1620 _ip_data[ip].solid_material.getBulkModulus(t, x_position, &C_el);
1621 variables.grain_compressibility = beta_SR;
1622
1623 variables.effective_pore_pressure = -chi_S_L * p_cap_ip;
1624 variables_prev.effective_pore_pressure = -chi_S_L_prev * p_cap_prev_ip;
1625
1626 // Set volumetric strain rate for the general case without swelling.
1627 variables.volumetric_strain = Invariants::trace(_ip_data[ip].eps);
1628 variables_prev.volumetric_strain = Invariants::trace(B * u_prev);
1629
1630 auto& phi = _ip_data[ip].porosity;
1631 { // Porosity update
1632 variables_prev.porosity = _ip_data[ip].porosity_prev;
1633 phi = medium->property(MPL::PropertyType::porosity)
1634 .template value<double>(variables, variables_prev,
1635 x_position, t, dt);
1636 variables.porosity = phi;
1637 }
1638
1639 auto const rho_LR =
1640 liquid_phase.property(MPL::PropertyType::density)
1641 .template value<double>(variables, x_position, t, dt);
1642 variables.density = rho_LR;
1643 auto const mu =
1644 liquid_phase.property(MPL::PropertyType::viscosity)
1645 .template value<double>(variables, x_position, t, dt);
1646
1647 // Swelling and possibly volumetric strain rate update.
1648 updateSwellingStressAndVolumetricStrain<DisplacementDim>(
1649 _ip_data[ip], *medium, solid_phase, C_el, rho_LR, mu,
1650 _process_data.micro_porosity_parameters, alpha, phi, p_cap_ip,
1651 variables, variables_prev, x_position, t, dt);
1652
1653 if (medium->hasProperty(MPL::PropertyType::transport_porosity))
1654 {
1655 if (!medium->hasProperty(MPL::PropertyType::saturation_micro))
1656 {
1657 variables_prev.transport_porosity =
1658 _ip_data[ip].transport_porosity_prev;
1659
1660 _ip_data[ip].transport_porosity =
1661 medium->property(MPL::PropertyType::transport_porosity)
1662 .template value<double>(variables, variables_prev,
1663 x_position, t, dt);
1664 variables.transport_porosity = _ip_data[ip].transport_porosity;
1665 }
1666 }
1667 else
1668 {
1669 variables.transport_porosity = phi;
1670 }
1671
1672 // Set mechanical variables for the intrinsic permeability model
1673 // For stress dependent permeability.
1674 {
1675 auto const sigma_total = (_ip_data[ip].sigma_eff +
1676 alpha * chi_S_L * identity2 * p_cap_ip)
1677 .eval();
1678 // For stress dependent permeability.
1679 variables.total_stress.emplace<SymmetricTensor>(
1681 sigma_total));
1682 }
1683
1684 variables.equivalent_plastic_strain =
1685 _ip_data[ip].material_state_variables->getEquivalentPlasticStrain();
1686
1687 auto const K_intrinsic = MPL::formEigenTensor<DisplacementDim>(
1688 medium->property(MPL::PropertyType::permeability)
1689 .value(variables, x_position, t, dt));
1690
1691 double const k_rel =
1692 medium->property(MPL::PropertyType::relative_permeability)
1693 .template value<double>(variables, x_position, t, dt);
1694
1695 GlobalDimMatrixType const K_over_mu = k_rel * K_intrinsic / mu;
1696
1697 auto const& sigma_eff = _ip_data[ip].sigma_eff;
1698 double const p_FR = -chi_S_L * p_cap_ip;
1699 // p_SR
1700 variables.solid_grain_pressure =
1701 p_FR - sigma_eff.dot(identity2) / (3 * (1 - phi));
1702 auto const rho_SR =
1703 solid_phase.property(MPL::PropertyType::density)
1704 .template value<double>(variables, x_position, t, dt);
1705 _ip_data[ip].dry_density_solid = (1 - phi) * rho_SR;
1706
1707 auto& sigma_sw = _ip_data[ip].sigma_sw;
1708
1709 eps_m.noalias() =
1710 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
1711 ? eps + C_el.inverse() * sigma_sw
1712 : eps;
1713 variables.mechanical_strain
1715 eps_m);
1716
1717 _ip_data[ip].updateConstitutiveRelation(variables, t, x_position, dt,
1718 temperature);
1719
1720 auto const& b = _process_data.specific_body_force;
1721
1722 // Compute the velocity
1723 auto const& dNdx_p = _ip_data[ip].dNdx_p;
1724 _ip_data[ip].v_darcy.noalias() =
1725 -K_over_mu * dNdx_p * p_L + rho_LR * K_over_mu * b;
1726
1727 saturation_avg += S_L;
1728 porosity_avg += phi;
1729 sigma_avg += sigma_eff;
1730 }
1731 saturation_avg /= n_integration_points;
1732 porosity_avg /= n_integration_points;
1733 sigma_avg /= n_integration_points;
1734
1735 (*_process_data.element_saturation)[_element.getID()] = saturation_avg;
1736 (*_process_data.element_porosity)[_element.getID()] = porosity_avg;
1737
1738 Eigen::Map<KV>(&(*_process_data.element_stresses)[_element.getID() *
1739 KV::RowsAtCompileTime]) =
1741
1743 ShapeFunctionPressure, typename ShapeFunctionDisplacement::MeshElement,
1744 DisplacementDim>(_element, _is_axially_symmetric, p_L,
1745 *_process_data.pressure_interpolated);
1746}
void interpolateToHigherOrderNodes(MeshLib::Element const &element, bool const is_axially_symmetric, Eigen::MatrixBase< EigenMatrixType > const &node_values, MeshLib::PropertyVector< double > &interpolated_values_global_vector)

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

◆ getEpsilon()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getEpsilon ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1248{
1249 constexpr int kelvin_vector_size =
1251
1252 return transposeInPlace<kelvin_vector_size>(
1253 [this](std::vector<double>& values)
1254 { return getIntPtEpsilon(0, {}, {}, values); });
1255}
std::vector< double > const & getIntPtEpsilon(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References MathLib::KelvinVector::kelvin_vector_dimensions().

◆ getIntPtDarcyVelocity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtDarcyVelocity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1306{
1307 unsigned const n_integration_points =
1309
1310 cache.clear();
1311 auto cache_matrix = MathLib::createZeroedMatrix<Eigen::Matrix<
1312 double, DisplacementDim, Eigen::Dynamic, Eigen::RowMajor>>(
1313 cache, DisplacementDim, n_integration_points);
1314
1315 for (unsigned ip = 0; ip < n_integration_points; ip++)
1316 {
1317 cache_matrix.col(ip).noalias() = _ip_data[ip].v_darcy;
1318 }
1319
1320 return cache;
1321}

References MathLib::createZeroedMatrix().

◆ getIntPtDryDensitySolid()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtDryDensitySolid ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1457{
1460}
std::vector< double > const & getIntegrationPointScalarData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)

References ProcessLib::getIntegrationPointScalarData().

◆ getIntPtEpsilon()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtEpsilon ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1266{
1267 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
1268 _ip_data, &IpData::eps, cache);
1269}

◆ getIntPtMicroPressure()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtMicroPressure ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtMicroSaturation()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtMicroSaturation ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtPorosity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtPorosity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtSaturation()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtSaturation ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getIntPtSigma()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtSigma ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1195{
1196 return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
1197 _ip_data, &IpData::sigma_eff, cache);
1198}

◆ getIntPtSwellingStress()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtSwellingStress ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1223{
1224 constexpr int kelvin_vector_size =
1226 auto const n_integration_points = _ip_data.size();
1227
1228 cache.clear();
1229 auto cache_mat = MathLib::createZeroedMatrix<Eigen::Matrix<
1230 double, kelvin_vector_size, Eigen::Dynamic, Eigen::RowMajor>>(
1231 cache, kelvin_vector_size, n_integration_points);
1232
1233 for (unsigned ip = 0; ip < n_integration_points; ++ip)
1234 {
1235 auto const& sigma_sw = _ip_data[ip].sigma_sw;
1236 cache_mat.col(ip) =
1238 }
1239
1240 return cache;
1241}

References MathLib::createZeroedMatrix(), MathLib::KelvinVector::kelvin_vector_dimensions(), and MathLib::KelvinVector::kelvinVectorToSymmetricTensor().

◆ getIntPtTransportPorosity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getIntPtTransportPorosity ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overridevirtual

◆ getMaterialID()

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

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1276{
1277 return _process_data.material_ids == nullptr
1278 ? 0
1279 : (*_process_data.material_ids)[_element.getID()];
1280}

◆ getMaterialStateVariableInternalState()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getMaterialStateVariableInternalState ( std::function< std::span< double >(typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables &)> const & get_values_span,
int const & n_components ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1291{
1293 _ip_data, &IpData::material_state_variables, get_values_span,
1294 n_components);
1295}
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)
std::unique_ptr< typename MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables > material_state_variables

References ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_ip_data, ProcessLib::getIntegrationPointDataMaterialStateVariables(), and ProcessLib::RichardsMechanics::IntegrationPointData< BMatricesType, ShapeMatrixTypeDisplacement, ShapeMatricesTypePressure, DisplacementDim, NPoints >::material_state_variables.

◆ getMaterialStateVariablesAt()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getMaterialStateVariablesAt ( unsigned integration_point) const
overrideprivatevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1764{
1765 return *_ip_data[integration_point].material_state_variables;
1766}

◆ getMicroPressure()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getMicroPressure ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1378{
1379 std::vector<double> result;
1380 getIntPtMicroPressure(0, {}, {}, result);
1381 return result;
1382}
std::vector< double > const & getIntPtMicroPressure(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

◆ getMicroSaturation()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getMicroSaturation ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1353{
1354 std::vector<double> result;
1355 getIntPtMicroSaturation(0, {}, {}, result);
1356 return result;
1357}
std::vector< double > const & getIntPtMicroSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

◆ getNumberOfIntegrationPoints()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
unsigned ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getNumberOfIntegrationPoints ( ) const
overrideprivatevirtual

◆ getPorosity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getPorosity ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1403{
1404 std::vector<double> result;
1405 getIntPtPorosity(0, {}, {}, result);
1406 return result;
1407}
std::vector< double > const & getIntPtPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

◆ getSaturation()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getSaturation ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1328{
1329 std::vector<double> result;
1330 getIntPtSaturation(0, {}, {}, result);
1331 return result;
1332}
std::vector< double > const & getIntPtSaturation(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

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

178 {
179 auto const& N_u = _secondary_data.N_u[integration_point];
180
181 // assumes N is stored contiguously in memory
182 return Eigen::Map<const Eigen::RowVectorXd>(N_u.data(), N_u.size());
183 }

References ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_secondary_data, and ProcessLib::HydroMechanics::SecondaryData< ShapeMatrixType >::N_u.

◆ getSigma()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getSigma ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1177{
1178 constexpr int kelvin_vector_size =
1180
1181 return transposeInPlace<kelvin_vector_size>(
1182 [this](std::vector<double>& values)
1183 { return getIntPtSigma(0, {}, {}, values); });
1184}
std::vector< double > const & getIntPtSigma(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References MathLib::KelvinVector::kelvin_vector_dimensions().

◆ getSwellingStress()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getSwellingStress ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1205{
1206 constexpr int kelvin_vector_size =
1208
1209 return transposeInPlace<kelvin_vector_size>(
1210 [this](std::vector<double>& values)
1211 { return getIntPtSwellingStress(0, {}, {}, values); });
1212}
std::vector< double > const & getIntPtSwellingStress(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References MathLib::KelvinVector::kelvin_vector_dimensions().

◆ getTransportPorosity()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::vector< double > ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::getTransportPorosity ( ) const
overridevirtual

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

1428{
1429 std::vector<double> result;
1430 getIntPtTransportPorosity(0, {}, {}, result);
1431 return result;
1432}
std::vector< double > const & getIntPtTransportPorosity(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

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

124 {
125 unsigned const n_integration_points =
127
128 for (unsigned ip = 0; ip < n_integration_points; ip++)
129 {
130 auto& ip_data = _ip_data[ip];
131
132 ParameterLib::SpatialPosition const x_position{
133 std::nullopt, _element.getID(), ip,
136 ShapeFunctionDisplacement,
138
140 if (_process_data.initial_stress != nullptr)
141 {
142 ip_data.sigma_eff =
144 DisplacementDim>((*_process_data.initial_stress)(
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 ip_data.solid_material.initializeInternalStateVariables(
152 t, x_position, *ip_data.material_state_variables);
153
154 ip_data.pushBackState();
155 }
156 }
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)

References ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_element, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_integration_method, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_ip_data, ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_process_data, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), NumLib::interpolateCoordinates(), and MathLib::KelvinVector::symmetricTensorToKelvinVector().

◆ postTimestepConcrete()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
void ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlineoverridevirtual

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

284{
285 assert(local_x.size() == pressure_size + displacement_size);
286
287 auto const p_L = local_x.template segment<pressure_size>(pressure_index);
288
289 constexpr double dt = std::numeric_limits<double>::quiet_NaN();
290 auto const& medium = _process_data.media_map.getMedium(_element.getID());
291 MPL::VariableArray variables;
292
294 x_position.setElementID(_element.getID());
295
296 auto const& solid_phase = medium->phase("Solid");
297
298 unsigned const n_integration_points =
300 for (unsigned ip = 0; ip < n_integration_points; ip++)
301 {
302 x_position.setIntegrationPoint(ip);
303
304 auto const& N_p = _ip_data[ip].N_p;
305
306 double p_cap_ip;
307 NumLib::shapeFunctionInterpolate(-p_L, N_p, p_cap_ip);
308
309 variables.capillary_pressure = p_cap_ip;
310 variables.liquid_phase_pressure = -p_cap_ip;
311 // setting pG to 1 atm
312 // TODO : rewrite equations s.t. p_L = pG-p_cap
313 variables.gas_phase_pressure = 1.0e5;
314 _ip_data[ip].liquid_pressure_m_prev = -p_cap_ip;
315 _ip_data[ip].liquid_pressure_m = -p_cap_ip;
316
317 auto const temperature =
318 medium->property(MPL::PropertyType::reference_temperature)
319 .template value<double>(variables, x_position, t, dt);
320 variables.temperature = temperature;
321
322 _ip_data[ip].saturation_prev =
323 medium->property(MPL::PropertyType::saturation)
324 .template value<double>(variables, x_position, t, dt);
325
326 if (medium->hasProperty(MPL::PropertyType::saturation_micro))
327 {
329 vars.capillary_pressure = p_cap_ip;
330 double const S_L_m =
331 medium->property(MPL::PropertyType::saturation_micro)
332 .template value<double>(vars, x_position, t, dt);
333 _ip_data[ip].saturation_m_prev = S_L_m;
334 }
335
336 // Set eps_m_prev from potentially non-zero eps and sigma_sw from
337 // restart.
338 auto const C_el = _ip_data[ip].computeElasticTangentStiffness(
339 t, x_position, dt, temperature);
340 auto& eps = _ip_data[ip].eps;
341 auto& sigma_sw = _ip_data[ip].sigma_sw;
342
343 _ip_data[ip].eps_m_prev.noalias() =
344 solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate)
345 ? eps + C_el.inverse() * sigma_sw
346 : eps;
347 }
348}

References MaterialPropertyLib::VariableArray::capillary_pressure, MaterialPropertyLib::VariableArray::gas_phase_pressure, MaterialPropertyLib::VariableArray::liquid_phase_pressure, ParameterLib::SpatialPosition::setElementID(), ParameterLib::SpatialPosition::setIntegrationPoint(), NumLib::detail::shapeFunctionInterpolate(), and MaterialPropertyLib::VariableArray::temperature.

◆ setIPDataInitialConditions()

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
std::size_t ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::setIPDataInitialConditions ( std::string_view const name,
double const * values,
int const integration_order )
overridevirtual
Returns
the number of read integration points.

Implements ProcessLib::RichardsMechanics::LocalAssemblerInterface< DisplacementDim >.

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

201{
202 if (integration_order !=
203 static_cast<int>(_integration_method.getIntegrationOrder()))
204 {
205 OGS_FATAL(
206 "Setting integration point initial conditions; The integration "
207 "order of the local assembler for element {:d} is different "
208 "from the integration order in the initial condition.",
209 _element.getID());
210 }
211
212 if (name == "sigma")
213 {
214 if (_process_data.initial_stress != nullptr)
215 {
216 OGS_FATAL(
217 "Setting initial conditions for stress from integration "
218 "point data and from a parameter '{:s}' is not possible "
219 "simultaneously.",
220 _process_data.initial_stress->name);
221 }
222 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
223 values, _ip_data, &IpData::sigma_eff);
224 }
225
226 if (name == "saturation")
227 {
230 }
231 if (name == "porosity")
232 {
235 }
236 if (name == "transport_porosity")
237 {
240 }
241 if (name == "swelling_stress")
242 {
243 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
244 values, _ip_data, &IpData::sigma_sw);
245 }
246 if (name == "epsilon")
247 {
248 return ProcessLib::setIntegrationPointKelvinVectorData<DisplacementDim>(
249 values, _ip_data, &IpData::eps);
250 }
251 if (name.starts_with("material_state_variable_"))
252 {
253 name.remove_prefix(24);
254
255 // Using first ip data for solid material. TODO (naumov) move solid
256 // material into element, store only material state in IPs.
257 auto const& internal_variables =
258 _ip_data[0].solid_material.getInternalVariables();
259 if (auto const iv = std::find_if(
260 begin(internal_variables), end(internal_variables),
261 [&name](auto const& iv) { return iv.name == name; });
262 iv != end(internal_variables))
263 {
264 DBUG("Setting material state variable '{:s}'", name);
267 iv->reference);
268 }
269
270 ERR("Could not find variable {:s} in solid material model's internal "
271 "variables.",
272 name);
273 }
274 return 0;
275}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
std::size_t setIntegrationPointDataMaterialStateVariables(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span)
std::size_t setIntegrationPointScalarData(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType IpData::*const member)

References DBUG(), ERR(), OGS_FATAL, ProcessLib::setIntegrationPointDataMaterialStateVariables(), and ProcessLib::setIntegrationPointScalarData().

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _is_axially_symmetric

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
bool const ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::_is_axially_symmetric
private

Definition at line 337 of file RichardsMechanicsFEM.h.

◆ _process_data

◆ _secondary_data

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

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

◆ KelvinVectorSize

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

Definition at line 70 of file RichardsMechanicsFEM.h.

◆ N_u_op

template<typename ShapeFunctionDisplacement , typename ShapeFunctionPressure , int DisplacementDim>
constexpr 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 76 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 342 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 343 of file RichardsMechanicsFEM.h.


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