OGS
Swelling.cpp
Go to the documentation of this file.
1
11#include "Swelling.h"
12
13#include <Eigen/LU>
14
16
18{
19namespace ConstitutiveStress_StrainTemperature
20{
21template <int DisplacementDim>
23 SpaceTimeData const& x_t, MediaData const& media_data,
25 StrainData<DisplacementDim> const& eps_data,
26 PrevState<StrainData<DisplacementDim>> const& eps_prev_data,
27 SaturationData const& S_L_data, SaturationDataDeriv const& dS_L_data,
28 PrevState<SaturationData> const& S_L_prev_data,
32{
33 namespace MPL = MaterialPropertyLib;
34
35 static constexpr int kelvin_vector_size =
38
39 auto const& solid_phase = media_data.solid;
40
41 if (!solid_phase.hasProperty(MPL::PropertyType::swelling_stress_rate))
42 {
43 out.eps_m.setZero();
44 out.J_up_BT_K_N.setZero();
45 return;
46 }
47
48 MPL::VariableArray variables;
49 variables.liquid_saturation = S_L_data.S_L;
50
51 MPL::VariableArray variables_prev;
52 variables_prev.liquid_saturation = S_L_prev_data->S_L;
53
54 auto const& identity2 = MathLib::KelvinVector::Invariants<
56 DisplacementDim)>::identity2;
57
58 // Swelling and possibly volumetric strain rate update.
59
60 // If there is swelling, compute it. Update volumetric strain rate,
61 // s.t. it corresponds to the mechanical part only.
62 state.sigma_sw = prev_state->sigma_sw;
63
64 auto const sigma_sw_dot =
67 solid_phase[MPL::PropertyType::swelling_stress_rate].value(
68 variables, variables_prev, x_t.x, x_t.t, x_t.dt)));
69 state.sigma_sw += sigma_sw_dot * x_t.dt;
70
71 auto const C_el_inv = C_el_data.C_el.inverse().eval();
72
73 // !!! Misusing volumetric strain for mechanical volumetric
74 // strain just to update the transport porosity !!!
75 variables.volumetric_strain =
76 Invariants::trace(eps_data.eps) +
77 identity2.transpose() * C_el_inv * state.sigma_sw;
78 variables_prev.volumetric_strain =
79 Invariants::trace(eps_prev_data->eps) +
80 identity2.transpose() * C_el_inv * prev_state->sigma_sw;
81
82 out.eps_m.noalias() = C_el_inv * (state.sigma_sw - prev_state->sigma_sw);
83
84 using DimMatrix = Eigen::Matrix<double, 3, 3>;
85 auto const dsigma_sw_dS_L =
87 solid_phase.property(MPL::PropertyType::swelling_stress_rate)
88 .template dValue<DimMatrix>(variables, variables_prev,
89 MPL::Variable::liquid_saturation,
90 x_t.x, x_t.t, x_t.dt));
91
92 out.J_up_BT_K_N = -dsigma_sw_dS_L * dS_L_data.dS_L_dp_cap;
93}
94
95template struct SwellingModel<2>;
96template struct SwellingModel<3>;
97} // namespace ConstitutiveStress_StrainTemperature
98} // namespace ProcessLib::ThermoRichardsMechanics
template Eigen::Matrix< double, 3, 3 > formEigenTensor< 3 >(MaterialPropertyLib::PropertyDataType const &values)
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)
Represents a previous state of type T.
Definition Base.h:21
ParameterLib::SpatialPosition x
Definition Base.h:74
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > eps
Definition StrainData.h:20
void eval(SpaceTimeData const &x_t, MediaData const &media_data, ElasticTangentStiffnessData< DisplacementDim > const &C_el_data, StrainData< DisplacementDim > const &eps_data, PrevState< StrainData< DisplacementDim > > const &eps_prev_data, SaturationData const &S_L_data, SaturationDataDeriv const &dS_L_data, PrevState< SaturationData > const &S_L_prev_data, PrevState< SwellingDataStateful< DisplacementDim > > const &prev_state, SwellingDataStateful< DisplacementDim > &state, SwellingDataStateless< DisplacementDim > &out) const
Definition Swelling.cpp:22
MaterialPropertyLib::Phase const & solid
Definition Base.h:63