OGS
SolidMechanics.cpp
Go to the documentation of this file.
1
11#include "SolidMechanics.h"
12
14{
15namespace ConstitutiveStressSaturation_StrainPressureTemperature
16{
17template <int DisplacementDim>
19 SpaceTimeData const& x_t, TemperatureData<DisplacementDim> const& T_data,
21 StrainData<DisplacementDim> const& eps_data,
22 PrevState<StrainData<DisplacementDim>> const& eps_prev_data,
24 PrevState<TotalStressData<DisplacementDim>> const& total_stress_data_prev,
25 TotalStressData<DisplacementDim>& total_stress_data,
26 EquivalentPlasticStrainData& equiv_plast_strain_data,
28 PrevState<SaturationData> const& S_L_prev_data, SaturationData& S_L_data,
29 SaturationDataDeriv& dS_L_data) const
30{
31 namespace MPL = MaterialPropertyLib;
32
33 double const T_prev = T_data.T_prev;
34 auto const& eps_total = eps_data.eps;
35 auto const& eps_total_prev = eps_prev_data->eps;
36 auto const& sigma_total_prev = total_stress_data_prev->sigma_total;
37
38 // current state
39 MPL::VariableArray variables;
40 {
41 // gradients
42 // TODO currently we always pass strain via mechanical_strain
43 variables.mechanical_strain = eps_total;
44 variables.liquid_phase_pressure = -p_cap_data.p_cap;
45
46 // external state variables
47 variables.temperature = T_data.T;
48 }
49
50 // previous state
51 MPL::VariableArray variables_prev;
52 {
53 // thermodynamic forces
54 variables_prev.stress = sigma_total_prev;
55 variables_prev.liquid_saturation = S_L_prev_data->S_L;
56
57 // gradients
58 // TODO currently we always pass strain via mechanical_strain
59 variables_prev.mechanical_strain = eps_total_prev;
60 variables_prev.liquid_phase_pressure = -p_cap_data.p_cap_prev;
61
62 // external state variables
63 variables_prev.temperature = T_prev;
64 }
65
66 auto solution = solid_material_.integrateStress(
67 variables_prev, variables, x_t.t, x_t.x, x_t.dt,
68 *mat_state.material_state_variables);
69
70 if (!solution)
71 {
72 OGS_FATAL("Computation of local constitutive relation failed.");
73 }
74
75 auto& tdyn_forces_data = std::get<0>(*solution);
76
77 auto const view = solid_material_.createThermodynamicForcesView();
78
79 total_stress_data.sigma_total = view.block(MSM::stress, tdyn_forces_data);
80 S_L_data.S_L = view.block(MSM::saturation, tdyn_forces_data);
81 mat_state.material_state_variables = std::move(std::get<1>(*solution));
82
83 auto const& tangent_operator_data = std::get<2>(*solution);
84
85 current_stateless.stiffness_tensor = tangent_operator_blocks_view_.block(
86 MSM::stress, MSM::strain, tangent_operator_data);
87
88 dS_L_data.dS_L_dp_cap = -tangent_operator_blocks_view_.block(
89 MSM::saturation, MSM::liquid_pressure, tangent_operator_data);
90
91 current_stateless.J_uT_BT_K_N = tangent_operator_blocks_view_.block(
92 MSM::stress, MSM::temperature, tangent_operator_data);
93
94 current_stateless.J_up_BT_K_N = tangent_operator_blocks_view_.block(
95 MSM::stress, MSM::liquid_pressure, tangent_operator_data);
96
97 equiv_plast_strain_data.equivalent_plastic_strain =
98 mat_state.material_state_variables->getEquivalentPlasticStrain();
99}
100
101template struct SolidMechanicsModel<2>;
102template struct SolidMechanicsModel<3>;
103} // namespace ConstitutiveStressSaturation_StrainPressureTemperature
104} // namespace ProcessLib::ThermoRichardsMechanics
#define OGS_FATAL(...)
Definition Error.h:26
static constexpr Temperature temperature
Definition Variable.h:193
static constexpr LiquidPressure liquid_pressure
Definition Variable.h:143
static constexpr Strain strain
Instance that can be used for overload resolution/template type deduction.
Definition Variable.h:92
static constexpr Saturation saturation
Definition Variable.h:180
static constexpr Stress stress
Definition Variable.h:155
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(const SpaceTimeData &x_t, TemperatureData< DisplacementDim > const &T_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, StrainData< DisplacementDim > const &eps_data, PrevState< StrainData< DisplacementDim > > const &eps_prev_data, MaterialStateData< DisplacementDim > &mat_state, PrevState< TotalStressData< DisplacementDim > > const &total_stress_data_prev, TotalStressData< DisplacementDim > &total_stress_data, EquivalentPlasticStrainData &equiv_plast_strain_data, SolidMechanicsDataStateless< DisplacementDim > &current_stateless, PrevState< SaturationData > const &S_L_prev_data, SaturationData &S_L_data, SaturationDataDeriv &dS_L_data) const