OGS
TH2M/ConstitutiveRelations/SolidMechanics.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "SolidMechanics.h"
5
6namespace ProcessLib::TH2M
7{
9{
10template <int DisplacementDim>
12 const SpaceTimeData& x_t,
13 TemperatureData const& T_data,
14 MechanicalStrainData<DisplacementDim> const& mechanical_strain_data,
16 mechanical_strain_prev_data,
18 DisplacementDim>> const& eff_stress_prev_data,
20 eff_stress_data,
23 EquivalentPlasticStrainData& equivalent_plastic_strain) const
24{
25 namespace MPL = MaterialPropertyLib;
26 MPL::VariableArray variables;
27
29 mechanical_strain_data.eps_m);
30 variables.temperature = T_data.T;
31
32 MPL::VariableArray variables_prev;
33 variables_prev.stress.emplace<KelvinVector<DisplacementDim>>(
34 eff_stress_prev_data->sigma_eff);
36 mechanical_strain_prev_data->eps_m);
37 variables_prev.temperature = T_data.T_prev;
38
39 auto solution = solid_material_.integrateStress(
40 variables_prev, variables, x_t.t, x_t.x, x_t.dt,
41 *mat_state.material_state_variables);
42
43 if (!solution)
44 {
45 OGS_FATAL("Computation of local constitutive relation failed.");
46 }
47
48 std::tie(eff_stress_data.sigma_eff, mat_state.material_state_variables,
49 out.stiffness_tensor) = std::move(*solution);
50
51 *equivalent_plastic_strain =
52 mat_state.material_state_variables->getEquivalentPlasticStrain();
53}
54
55template struct SolidMechanicsModel<2>;
56template struct SolidMechanicsModel<3>;
57} // namespace ConstitutiveRelations
58} // namespace ProcessLib::TH2M
#define OGS_FATAL(...)
Definition Error.h:19
KV::KelvinVectorType< DisplacementDim > KelvinVector
BaseLib::StrongType< double, struct EquivalentPlasticStrainTag > EquivalentPlasticStrainData
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > sigma_eff
MathLib::KelvinVector::KelvinVectorType< DisplacementDim > eps_m
void eval(const SpaceTimeData &x_t, TemperatureData const &T_data, MechanicalStrainData< DisplacementDim > const &mechanical_strain_data, PrevState< MechanicalStrainData< DisplacementDim > > const &mechanical_strain_prev_data, PrevState< ProcessLib::ConstitutiveRelations::EffectiveStressData< DisplacementDim > > const &eff_stress_prev_data, ProcessLib::ConstitutiveRelations::EffectiveStressData< DisplacementDim > &eff_stress_data, MaterialStateData< DisplacementDim > &mat_state, SolidMechanicsDataStateless< DisplacementDim > &out, EquivalentPlasticStrainData &equivalent_plastic_strain) const