OGS
ProcessLib::RichardsMechanics Namespace Reference

Classes

struct  CapillaryPressureData
 
struct  ConstitutiveSetting
 
struct  CreateConstitutiveSetting
 
struct  IntegrationPointData
 
struct  LocalAssemblerInterface
 
struct  MediaData
 
struct  MicroPorosityParameters
 
struct  MicroPorosityStateSpace
 
class  RichardsMechanicsLocalAssembler
 
class  RichardsMechanicsProcess
 
struct  RichardsMechanicsProcessData
 
struct  SaturationSecantDerivative
 
struct  SecondaryData
 

Typedefs

template<int DisplacementDim>
using KelvinVector = KV::KelvinVectorType<DisplacementDim>
 
template<int DisplacementDim>
using KelvinMatrix = KV::KelvinMatrixType<DisplacementDim>
 
template<int DisplacementDim>
using GlobalDimVector = Eigen::Vector<double, DisplacementDim>
 
template<int DisplacementDim>
using GlobalDimMatrix
 
using TemperatureData = BaseLib::StrongType<double, struct TemperatureDataTag>
 
template<int DisplacementDim>
using StatefulData
 Data whose state must be tracked by the process.
 
template<int DisplacementDim>
using StatefulDataPrev
 
template<int DisplacementDim>
using OutputData
 Data that is needed for output purposes, but not directly for the assembly.
 
template<int DisplacementDim>
using ConstitutiveData
 Data that is needed for the equation system assembly.
 
template<int DisplacementDim>
using ConstitutiveTempData = std::tuple<>
 
template<int DisplacementDim>
using ConstitutiveModels = std::tuple<>
 Constitutive models used for assembly.
 
using Density = BaseLib::StrongType<double, struct DensityTag>
 
using DrySolidDensity = BaseLib::StrongType<double, struct DrySolidDensityTag>
 
using EffectivePorePressure
 
using LiquidDensity = BaseLib::StrongType<double, struct LiquidDensityTag>
 
using MicroPressure = BaseLib::StrongType<double, struct MicroPressureTag>
 
using MicroSaturation = BaseLib::StrongType<double, struct MicroSaturationTag>
 
template<int DisplacementDim>
using StiffnessTensor
 

Functions

template<int DisplacementDim>
std::ostream & operator<< (std::ostream &os, MicroPorosityStateSpace< DisplacementDim > const &state)
 
template<int DisplacementDim>
MicroPorosityStateSpace< DisplacementDim > computeMicroPorosity (MathLib::KelvinVector::KelvinVectorType< DisplacementDim > const &I_2_C_el_inverse, double const rho_LR_m, double const mu_LR, MicroPorosityParameters const &micro_porosity_parameters, double const alpha_B, double const phi, double const p_L, double const p_L_m_prev, MaterialPropertyLib::VariableArray const &, double const S_L_m_prev, double const phi_m_prev, ParameterLib::SpatialPosition const pos, double const t, double const dt, MaterialPropertyLib::Property const &saturation_micro, MaterialPropertyLib::Property const &swelling_stress_rate)
 
template<int D>
constexpr GlobalDimVector< D > DVnan ()
 Used to set a D dimensional vector to all not-a-number.
 
template<int D>
constexpr GlobalDimMatrix< D > DMnan ()
 Used to set a D x D matrix to all not-a-number.
 
template<int DisplacementDim, typename TRMProcessData >
ConstitutiveModels< DisplacementDim > createConstitutiveModels (TRMProcessData const &process_data, MaterialLib::Solids::MechanicsBase< DisplacementDim > const &solid_material)
 
constexpr std::string_view ioName (struct DrySolidDensityTag *)
 
constexpr std::string_view ioName (struct MicroPressureTag *)
 
constexpr std::string_view ioName (struct MicroSaturationTag *)
 
void checkMPLProperties (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
template<int DisplacementDim>
std::unique_ptr< ProcesscreateRichardsMechanicsProcess (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
template std::unique_ptr< ProcesscreateRichardsMechanicsProcess< 2 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
template std::unique_ptr< ProcesscreateRichardsMechanicsProcess< 3 > (std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
 
template<int DisplacementDim>
void updateSwellingStressAndVolumetricStrain (MaterialPropertyLib::Medium const &medium, MaterialPropertyLib::Phase const &solid_phase, MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > const &C_el, double const rho_LR, double const mu, std::optional< MicroPorosityParameters > micro_porosity_parameters, double const alpha, double const phi, double const p_cap_ip, MPL::VariableArray &variables, MPL::VariableArray &variables_prev, ParameterLib::SpatialPosition const &x_position, double const t, double const dt, ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > &sigma_sw, PrevState< ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > > const &sigma_sw_prev, PrevState< ProcessLib::ThermoRichardsMechanics::TransportPorosityData > const phi_M_prev, PrevState< ProcessLib::ThermoRichardsMechanics::PorosityData > const phi_prev, ProcessLib::ThermoRichardsMechanics::TransportPorosityData &phi_M, PrevState< MicroPressure > const p_L_m_prev, PrevState< MicroSaturation > const S_L_m_prev, MicroPressure &p_L_m, MicroSaturation &S_L_m)
 

Typedef Documentation

◆ ConstitutiveData

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::ConstitutiveData
Initial value:
std::tuple<
StiffnessTensor<DisplacementDim>,
PrevState<ProcessLib::ThermoRichardsMechanics::BishopsData>,
SaturationSecantDerivative>
BaseLib::StrongType< double, struct DensityTag > Density
Definition Density.h:18
BaseLib::StrongType< double, struct LiquidDensityTag > LiquidDensity
BaseLib::StrongType< double, struct BiotTag > BiotData
Definition Biot.h:18
BaseLib::StrongType< double, struct LiquidViscosityDataTag > LiquidViscosityData

Data that is needed for the equation system assembly.

Definition at line 60 of file ConstitutiveData.h.

◆ ConstitutiveModels

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::ConstitutiveModels = std::tuple<>

Constitutive models used for assembly.

Definition at line 21 of file ConstitutiveModels.h.

◆ ConstitutiveTempData

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::ConstitutiveTempData = std::tuple<>

Data that stores intermediate values, which are not needed outside the constitutive setting.

Definition at line 76 of file ConstitutiveData.h.

◆ Density

using ProcessLib::RichardsMechanics::Density = BaseLib::StrongType<double, struct DensityTag>

Definition at line 18 of file Density.h.

◆ DrySolidDensity

using ProcessLib::RichardsMechanics::DrySolidDensity = BaseLib::StrongType<double, struct DrySolidDensityTag>

Definition at line 20 of file DrySolidDensity.h.

◆ EffectivePorePressure

◆ GlobalDimMatrix

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::GlobalDimMatrix
Initial value:
Eigen::Matrix<double, DisplacementDim, DisplacementDim, Eigen::RowMajor>

Definition at line 36 of file Base.h.

◆ GlobalDimVector

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::GlobalDimVector = Eigen::Vector<double, DisplacementDim>

Definition at line 33 of file Base.h.

◆ KelvinMatrix

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::KelvinMatrix = KV::KelvinMatrixType<DisplacementDim>

Definition at line 30 of file Base.h.

◆ KelvinVector

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::KelvinVector = KV::KelvinVectorType<DisplacementDim>

Definition at line 27 of file Base.h.

◆ LiquidDensity

using ProcessLib::RichardsMechanics::LiquidDensity = BaseLib::StrongType<double, struct LiquidDensityTag>

Definition at line 17 of file LiquidDensity.h.

◆ MicroPressure

using ProcessLib::RichardsMechanics::MicroPressure = BaseLib::StrongType<double, struct MicroPressureTag>

Definition at line 19 of file MicroPressure.h.

◆ MicroSaturation

using ProcessLib::RichardsMechanics::MicroSaturation = BaseLib::StrongType<double, struct MicroSaturationTag>

Definition at line 19 of file MicroSaturation.h.

◆ OutputData

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::OutputData
Initial value:
std::tuple<
BaseLib::StrongType< double, struct DrySolidDensityTag > DrySolidDensity

Data that is needed for output purposes, but not directly for the assembly.

Definition at line 54 of file ConstitutiveData.h.

◆ StatefulData

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::StatefulData
Initial value:
std::tuple<
StrainData<DisplacementDim>,
ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::
EffectiveStressData<DisplacementDim>,
ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::
SwellingDataStateful<DisplacementDim>,
ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::
MechanicalStrainData<DisplacementDim>,
BaseLib::StrongType< double, struct MicroPressureTag > MicroPressure
BaseLib::StrongType< double, struct MicroSaturationTag > MicroSaturation

Data whose state must be tracked by the process.

Definition at line 35 of file ConstitutiveData.h.

◆ StatefulDataPrev

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::StatefulDataPrev
Initial value:
StatefulData<DisplacementDim>>
boost::mp11::mp_transform< PrevState, Tuple > PrevStateOf
Applies PrevState to a tuple of constitutive data.
Definition Base.h:50

Definition at line 49 of file ConstitutiveData.h.

◆ StiffnessTensor

template<int DisplacementDim>
using ProcessLib::RichardsMechanics::StiffnessTensor
Initial value:

Definition at line 18 of file StiffnessTensor.h.

◆ TemperatureData

using ProcessLib::RichardsMechanics::TemperatureData = BaseLib::StrongType<double, struct TemperatureDataTag>

Definition at line 67 of file Base.h.

Function Documentation

◆ checkMPLProperties()

void ProcessLib::RichardsMechanics::checkMPLProperties ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media)

Definition at line 32 of file CreateRichardsMechanicsProcess.cpp.

34{
35 std::array const required_medium_properties = {
42 std::array const required_liquid_properties = {
44 std::array const required_solid_properties = {MaterialPropertyLib::density};
45
46 for (auto const& m : media)
47 {
48 checkRequiredProperties(*m.second, required_medium_properties);
49 checkRequiredProperties(m.second->phase("AqueousLiquid"),
50 required_liquid_properties);
51 checkRequiredProperties(m.second->phase("Solid"),
52 required_solid_properties);
53 }
54}
void checkRequiredProperties(Component const &c, std::span< PropertyType const > const required_properties)
Definition Component.cpp:60

References MaterialPropertyLib::biot_coefficient, MaterialPropertyLib::bishops_effective_stress, MaterialPropertyLib::density, MaterialPropertyLib::porosity, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::relative_permeability, MaterialPropertyLib::saturation, and MaterialPropertyLib::viscosity.

Referenced by createRichardsMechanicsProcess().

◆ computeMicroPorosity()

template<int DisplacementDim>
MicroPorosityStateSpace< DisplacementDim > ProcessLib::RichardsMechanics::computeMicroPorosity ( MathLib::KelvinVector::KelvinVectorType< DisplacementDim > const & I_2_C_el_inverse,
double const rho_LR_m,
double const mu_LR,
MicroPorosityParameters const & micro_porosity_parameters,
double const alpha_B,
double const phi,
double const p_L,
double const p_L_m_prev,
MaterialPropertyLib::VariableArray const & ,
double const S_L_m_prev,
double const phi_m_prev,
ParameterLib::SpatialPosition const pos,
double const t,
double const dt,
MaterialPropertyLib::Property const & saturation_micro,
MaterialPropertyLib::Property const & swelling_stress_rate )

Definition at line 64 of file ComputeMicroPorosity.h.

77{
78 namespace MPL = MaterialPropertyLib;
79 static constexpr int kelvin_vector_size =
81 // phi_m, e_sw, p_L_m, sigma_sw
82 static constexpr int nls_size = 1 + 1 + 1 + kelvin_vector_size;
83
84 static constexpr int i_phi_m = 0;
85 static constexpr int i_e_sw = 1;
86 static constexpr int i_p_L_m = 2;
87 static constexpr int i_sigma_sw = 3;
88
89 using ResidualVectorType = Eigen::Matrix<double, nls_size, 1>;
90 using JacobianMatrix =
91 Eigen::Matrix<double, nls_size, nls_size, Eigen::RowMajor>;
92
93 Eigen::FullPivLU<Eigen::Matrix<double, nls_size, nls_size, Eigen::RowMajor>>
94 linear_solver;
95
96 JacobianMatrix jacobian;
97
98 // Agglomerated solution vector construction.
99 ResidualVectorType solution = ResidualVectorType::Zero();
100
101 if (p_L >= 0 && p_L_m_prev >= 0)
102 {
103 return {solution[i_phi_m], solution[i_e_sw], solution[i_p_L_m],
104 solution.template segment<kelvin_vector_size>(i_sigma_sw)};
105 }
106
107 double const alpha_bar =
108 micro_porosity_parameters.mass_exchange_coefficient;
109
110 auto const update_residual = [&](ResidualVectorType& residual)
111 {
112 double const delta_phi_m = solution[i_phi_m];
113 double const delta_e_sw = solution[i_e_sw];
114 auto const& delta_sigma_sw =
115 solution.template segment<kelvin_vector_size>(i_sigma_sw);
116 double const delta_p_L_m = solution[i_p_L_m];
117
118 double const phi_m = phi_m_prev + delta_phi_m;
119 double const p_L_m = p_L_m_prev + delta_p_L_m;
120 MPL::VariableArray variables_prev;
121 variables_prev.capillary_pressure = -p_L_m_prev;
122 variables_prev.liquid_saturation = S_L_m_prev;
123
124 MPL::VariableArray variables;
125 variables.capillary_pressure = -p_L_m;
126
127 double const S_L_m =
128 saturation_micro.template value<double>(variables, pos, t, dt);
129 variables.liquid_saturation = S_L_m;
130 double const delta_S_L_m = S_L_m - S_L_m_prev;
131
132 auto const sigma_sw_dot =
134 swelling_stress_rate.template value<Eigen::Matrix3d>(
135 variables, variables_prev, pos, t, dt));
136
137 residual[i_phi_m] = delta_phi_m - (alpha_B - phi) * delta_e_sw;
138 residual[i_e_sw] = delta_e_sw + I_2_C_el_inverse.dot(delta_sigma_sw);
139 residual.template segment<kelvin_vector_size>(i_sigma_sw).noalias() =
140 delta_sigma_sw - sigma_sw_dot * dt;
141
142 residual[i_p_L_m] =
143 rho_LR_m *
144 (phi_m * delta_S_L_m - (alpha_B - phi) * S_L_m * delta_e_sw) +
145 phi_m * S_L_m * rho_LR_m * delta_e_sw -
146 micro_porosity_parameters.mass_exchange_coefficient / mu_LR *
147 (p_L - p_L_m) * dt;
148 };
149
150 auto const update_jacobian = [&](JacobianMatrix& jacobian)
151 {
152 jacobian = JacobianMatrix::Identity();
153
154 double const delta_phi_m = solution[i_phi_m];
155 double const delta_e_sw = solution[i_e_sw];
156 double const delta_p_L_m = solution[i_p_L_m];
157
158 double const phi_m = phi_m_prev + delta_phi_m;
159 double const p_L_m = p_L_m_prev + delta_p_L_m;
160 MPL::VariableArray variables_prev;
161 variables_prev.capillary_pressure = -p_L_m_prev;
162 MPL::VariableArray variables;
163 variables.capillary_pressure = -p_L_m;
164
165 double const S_L_m =
166 saturation_micro.template value<double>(variables, pos, t, dt);
167 variables_prev.liquid_saturation = S_L_m_prev;
168 variables.liquid_saturation = S_L_m;
169 double const delta_S_L_m = S_L_m - S_L_m_prev;
170
171 double const dS_L_m_dp_cap_m = saturation_micro.template dValue<double>(
172 variables, MPL::Variable::capillary_pressure, pos, t, dt);
173 auto const dsigma_sw_dS_L_m =
175 swelling_stress_rate.template dValue<Eigen::Matrix3d>(
176 variables, variables_prev, MPL::Variable::liquid_saturation,
177 pos, t, dt));
178
179 jacobian(i_phi_m, i_e_sw) = -(alpha_B - phi);
180
181 jacobian.template block<1, kelvin_vector_size>(i_e_sw, i_sigma_sw) =
182 I_2_C_el_inverse.transpose();
183
184 jacobian.template block<kelvin_vector_size, 1>(i_sigma_sw, i_p_L_m) =
185 -dsigma_sw_dS_L_m * dS_L_m_dp_cap_m;
186
187 jacobian(i_p_L_m, i_phi_m) =
188 rho_LR_m * (delta_S_L_m + S_L_m * delta_e_sw);
189
190 jacobian(i_p_L_m, i_e_sw) = -rho_LR_m * S_L_m * (alpha_B - phi - phi_m);
191
192 jacobian(i_p_L_m, i_p_L_m) =
193 alpha_bar / mu_LR * dt -
194 rho_LR_m * (phi_m - (alpha_B - phi - phi_m) * delta_e_sw) *
195 dS_L_m_dp_cap_m;
196 };
197
198 auto const update_solution = [&](ResidualVectorType const& increment)
199 { solution += increment; };
200
201 auto newton_solver = NumLib::NewtonRaphson(
202 linear_solver, update_jacobian, update_residual, update_solution,
203 micro_porosity_parameters.nonlinear_solver_parameters);
204
205 auto const success_iterations = newton_solver.solve(jacobian);
206
207 if (!success_iterations)
208 {
209 OGS_FATAL(
210 "Could not find solution for local double structure nonlinear "
211 "problem.");
212 }
213
214 return {solution[i_phi_m], solution[i_e_sw], solution[i_p_L_m],
215 solution.template segment<kelvin_vector_size>(i_sigma_sw)};
216}
#define OGS_FATAL(...)
Definition Error.h:26
@ saturation_micro
capillary pressure saturation relationship for microstructure.
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)

References MaterialPropertyLib::VariableArray::capillary_pressure, MathLib::KelvinVector::kelvin_vector_dimensions(), MaterialPropertyLib::VariableArray::liquid_saturation, ProcessLib::RichardsMechanics::MicroPorosityParameters::mass_exchange_coefficient, ProcessLib::RichardsMechanics::MicroPorosityParameters::nonlinear_solver_parameters, OGS_FATAL, and MathLib::KelvinVector::tensorToKelvin().

Referenced by updateSwellingStressAndVolumetricStrain().

◆ createConstitutiveModels()

template<int DisplacementDim, typename TRMProcessData >
ConstitutiveModels< DisplacementDim > ProcessLib::RichardsMechanics::createConstitutiveModels ( TRMProcessData const & process_data,
MaterialLib::Solids::MechanicsBase< DisplacementDim > const & solid_material )

◆ createRichardsMechanicsProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::RichardsMechanics::createRichardsMechanicsProcess ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__process_variables__pressure
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__process_variables__displacement

Process Parameters

Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__specific_body_force
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__micro_porosity
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__micro_porosity__nonlinear_solver
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__micro_porosity__mass_exchange_coefficient
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__mass_lumping
Input File Parameter
prj__processes__process__RICHARDS_MECHANICS__explicit_hm_coupling_in_unsaturated_zone

Definition at line 57 of file CreateRichardsMechanicsProcess.cpp.

68{
70 config.checkConfigParameter("type", "RICHARDS_MECHANICS");
71 DBUG("Create RichardsMechanicsProcess.");
72
73 auto const coupling_scheme =
75 config.getConfigParameterOptional<std::string>("coupling_scheme");
76 const bool use_monolithic_scheme =
77 !(coupling_scheme && (*coupling_scheme == "staggered"));
78
80
82 auto const pv_config = config.getConfigSubtree("process_variables");
83
84 ProcessVariable* variable_p;
85 ProcessVariable* variable_u;
86 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
87 process_variables;
88 if (use_monolithic_scheme) // monolithic scheme.
89 {
92 auto per_process_variables = findProcessVariables(
93 variables, pv_config,
94 {
95 "pressure",
97 "displacement"});
98 variable_p = &per_process_variables[0].get();
99 variable_u = &per_process_variables[1].get();
100 process_variables.push_back(std::move(per_process_variables));
101 }
102 else // staggered scheme.
103 {
104 using namespace std::string_literals;
105 for (auto const& variable_name : {"pressure"s, "displacement"s})
106 {
107 auto per_process_variables =
108 findProcessVariables(variables, pv_config, {variable_name});
109 process_variables.push_back(std::move(per_process_variables));
110 }
111 variable_p = &process_variables[0][0].get();
112 variable_u = &process_variables[1][0].get();
113 }
114
115 DBUG("Associate displacement with process variable '{:s}'.",
116 variable_u->getName());
117
118 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
119 {
120 OGS_FATAL(
121 "Number of components of the process variable '{:s}' is different "
122 "from the displacement dimension: got {:d}, expected {:d}",
123 variable_u->getName(),
124 variable_u->getNumberOfGlobalComponents(),
125 DisplacementDim);
126 }
127
128 DBUG("Associate pressure with process variable '{:s}'.",
129 variable_p->getName());
130 if (variable_p->getNumberOfGlobalComponents() != 1)
131 {
132 OGS_FATAL(
133 "Pressure process variable '{:s}' is not a scalar variable but has "
134 "{:d} components.",
135 variable_p->getName(),
136 variable_p->getNumberOfGlobalComponents());
137 }
138
139 auto solid_constitutive_relations =
141 parameters, local_coordinate_system, materialIDs(mesh), config);
142
144 // Specific body force
145 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
146 {
147 std::vector<double> const b =
149 config.getConfigParameter<std::vector<double>>(
150 "specific_body_force");
151 if (b.size() != DisplacementDim)
152 {
153 OGS_FATAL(
154 "The size of the specific body force vector does not match the "
155 "displacement dimension. Vector size is {:d}, displacement "
156 "dimension is {:d}",
157 b.size(), DisplacementDim);
158 }
159
160 std::copy_n(b.data(), b.size(), specific_body_force.data());
161 }
162
163 auto media_map =
165 DBUG("Check the media properties of RichardsMechanics process ...");
166 checkMPLProperties(media);
167 DBUG("Media properties verified.");
168
169 // Initial stress conditions
170 auto const initial_stress =
172 mesh);
173
174 std::optional<MicroPorosityParameters> micro_porosity_parameters;
175 if (auto const micro_porosity_config =
177 config.getConfigSubtreeOptional("micro_porosity"))
178 {
179 micro_porosity_parameters = MicroPorosityParameters{
182 micro_porosity_config->getConfigSubtree("nonlinear_solver")),
184 micro_porosity_config->getConfigParameter<double>(
185 "mass_exchange_coefficient")};
186 }
187
188 auto const mass_lumping =
190 config.getConfigParameter<bool>("mass_lumping", false);
191
192 auto const explicit_hm_coupling_in_unsaturated_zone =
194 config.getConfigParameter<bool>(
195 "explicit_hm_coupling_in_unsaturated_zone", false);
196
197 RichardsMechanicsProcessData<DisplacementDim> process_data{
198 materialIDs(mesh),
199 std::move(media_map),
200 std::move(solid_constitutive_relations),
201 initial_stress,
202 specific_body_force,
203 micro_porosity_parameters,
204 mass_lumping,
205 explicit_hm_coupling_in_unsaturated_zone};
206
207 SecondaryVariableCollection secondary_variables;
208
209 ProcessLib::createSecondaryVariables(config, secondary_variables);
210
211 return std::make_unique<RichardsMechanicsProcess<DisplacementDim>>(
212 std::move(name), mesh, std::move(jacobian_assembler), parameters,
213 integration_order, std::move(process_variables),
214 std::move(process_data), std::move(secondary_variables),
215 use_monolithic_scheme);
216}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
NewtonRaphsonSolverParameters createNewtonRaphsonSolverParameters(BaseLib::ConfigTree const &config)
void checkMPLProperties(MeshLib::Mesh const &mesh, MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), checkMPLProperties(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createInitialStress(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), NumLib::createNewtonRaphsonSolverParameters(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), and OGS_FATAL.

◆ createRichardsMechanicsProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 2 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ createRichardsMechanicsProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 3 > ( std::string const & name,
MeshLib::Mesh & mesh,
std::unique_ptr< ProcessLib::AbstractJacobianAssembler > && jacobian_assembler,
std::vector< ProcessVariable > const & variables,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ DMnan()

template<int D>
GlobalDimMatrix< D > ProcessLib::RichardsMechanics::DMnan ( )
constexpr

Used to set a D x D matrix to all not-a-number.

Definition at line 48 of file Base.h.

49{
51}
Eigen::Matrix< double, DisplacementDim, DisplacementDim, Eigen::RowMajor > GlobalDimMatrix
Definition Base.h:36

References ProcessLib::ConstitutiveRelations::nan.

◆ DVnan()

template<int D>
GlobalDimVector< D > ProcessLib::RichardsMechanics::DVnan ( )
constexpr

Used to set a D dimensional vector to all not-a-number.

Definition at line 41 of file Base.h.

42{
44}
Eigen::Vector< double, DisplacementDim > GlobalDimVector
Definition Base.h:33

References ProcessLib::ConstitutiveRelations::nan.

◆ ioName() [1/3]

std::string_view ProcessLib::RichardsMechanics::ioName ( struct DrySolidDensityTag * )
constexpr

Definition at line 22 of file DrySolidDensity.h.

23{
24 return "dry_density_solid";
25}

◆ ioName() [2/3]

std::string_view ProcessLib::RichardsMechanics::ioName ( struct MicroPressureTag * )
constexpr

Definition at line 21 of file MicroPressure.h.

22{
23 return "micro_pressure";
24}

◆ ioName() [3/3]

std::string_view ProcessLib::RichardsMechanics::ioName ( struct MicroSaturationTag * )
constexpr

Definition at line 21 of file MicroSaturation.h.

22{
23 return "micro_saturation";
24}

◆ operator<<()

template<int DisplacementDim>
std::ostream & ProcessLib::RichardsMechanics::operator<< ( std::ostream & os,
MicroPorosityStateSpace< DisplacementDim > const & state )

◆ updateSwellingStressAndVolumetricStrain()

template<int DisplacementDim>
void ProcessLib::RichardsMechanics::updateSwellingStressAndVolumetricStrain ( MaterialPropertyLib::Medium const & medium,
MaterialPropertyLib::Phase const & solid_phase,
MathLib::KelvinVector::KelvinMatrixType< DisplacementDim > const & C_el,
double const rho_LR,
double const mu,
std::optional< MicroPorosityParameters > micro_porosity_parameters,
double const alpha,
double const phi,
double const p_cap_ip,
MPL::VariableArray & variables,
MPL::VariableArray & variables_prev,
ParameterLib::SpatialPosition const & x_position,
double const t,
double const dt,
ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > & sigma_sw,
PrevState< ProcessLib::ThermoRichardsMechanics::ConstitutiveStress_StrainTemperature::SwellingDataStateful< DisplacementDim > > const & sigma_sw_prev,
PrevState< ProcessLib::ThermoRichardsMechanics::TransportPorosityData > const phi_M_prev,
PrevState< ProcessLib::ThermoRichardsMechanics::PorosityData > const phi_prev,
ProcessLib::ThermoRichardsMechanics::TransportPorosityData & phi_M,
PrevState< MicroPressure > const p_L_m_prev,
PrevState< MicroSaturation > const S_L_m_prev,
MicroPressure & p_L_m,
MicroSaturation & S_L_m )

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

57{
58 auto const& identity2 = MathLib::KelvinVector::Invariants<
60 DisplacementDim)>::identity2;
61
62 if (!medium.hasProperty(MPL::PropertyType::saturation_micro))
63 {
64 // If there is swelling, compute it. Update volumetric strain rate,
65 // s.t. it corresponds to the mechanical part only.
66 sigma_sw = *sigma_sw_prev;
67 if (solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
68 {
69 auto const sigma_sw_dot =
72 solid_phase[MPL::PropertyType::swelling_stress_rate]
73 .value(variables, variables_prev, x_position, t,
74 dt)));
75 sigma_sw.sigma_sw += sigma_sw_dot * dt;
76
77 // !!! Misusing volumetric strain for mechanical volumetric
78 // strain just to update the transport porosity !!!
79 variables.volumetric_strain +=
80 identity2.transpose() * C_el.inverse() * sigma_sw.sigma_sw;
81 variables_prev.volumetric_strain += identity2.transpose() *
82 C_el.inverse() *
83 sigma_sw_prev->sigma_sw;
84 }
85 }
86
87 // TODO (naumov) saturation_micro must be always defined together with
88 // the micro_porosity_parameters.
89 if (medium.hasProperty(MPL::PropertyType::saturation_micro))
90 {
91 double const phi_m_prev = phi_prev->phi - phi_M_prev->phi;
92
93 auto const [delta_phi_m, delta_e_sw, delta_p_L_m, delta_sigma_sw] =
94 computeMicroPorosity<DisplacementDim>(
95 identity2.transpose() * C_el.inverse(), rho_LR, mu,
96 *micro_porosity_parameters, alpha, phi, -p_cap_ip, **p_L_m_prev,
97 variables_prev, **S_L_m_prev, phi_m_prev, x_position, t, dt,
98 medium.property(MPL::PropertyType::saturation_micro),
99 solid_phase.property(MPL::PropertyType::swelling_stress_rate));
100
101 phi_M.phi = phi - (phi_m_prev + delta_phi_m);
102 variables_prev.transport_porosity = phi_M_prev->phi;
103 variables.transport_porosity = phi_M.phi;
104
105 *p_L_m = **p_L_m_prev + delta_p_L_m;
106 { // Update micro saturation.
107 MPL::VariableArray variables_prev;
108 variables_prev.capillary_pressure = -**p_L_m_prev;
109 MPL::VariableArray variables;
110 variables.capillary_pressure = -*p_L_m;
111
112 *S_L_m = medium.property(MPL::PropertyType::saturation_micro)
113 .template value<double>(variables, x_position, t, dt);
114 }
115 sigma_sw.sigma_sw = sigma_sw_prev->sigma_sw + delta_sigma_sw;
116 }
117}
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)

References MaterialPropertyLib::VariableArray::capillary_pressure, computeMicroPorosity(), MaterialPropertyLib::formEigenTensor< 3 >(), MaterialPropertyLib::Medium::hasProperty(), MaterialPropertyLib::Phase::hasProperty(), MathLib::KelvinVector::kelvin_vector_dimensions(), ProcessLib::ThermoRichardsMechanics::TransportPorosityData::phi, MaterialPropertyLib::Medium::property(), MaterialPropertyLib::Phase::property(), MathLib::KelvinVector::tensorToKelvin(), MaterialPropertyLib::VariableArray::transport_porosity, and MaterialPropertyLib::VariableArray::volumetric_strain.

Referenced by ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::assembleWithJacobianEvalConstitutiveSetting(), and ProcessLib::RichardsMechanics::RichardsMechanicsLocalAssembler< ShapeFunctionDisplacement, ShapeFunctionPressure, DisplacementDim >::computeSecondaryVariableConcrete().