OGS
ConstitutiveSetting.cpp
Go to the documentation of this file.
1
11#include "ConstitutiveSetting.h"
12
15
17{
18namespace ConstitutiveStressSaturation_StrainPressureTemperature
19{
20template <int DisplacementDim>
22{
23 INFO(
24 "Checking correct model evaluation order in the constitutive setting.");
25
26 using namespace boost::mp11;
27
28 constexpr auto D = DisplacementDim;
29
30 using Inputs =
31 mp_list<SpaceTimeData, MediaData, TemperatureData<D>,
33 //, MaterialStateData<D> /*TODO material state data is a special
34 // case: it's both input and output data.*/
35 >;
36
37 using InputsAndPrevState = mp_append<Inputs, StatefulDataPrev<D>>;
38
39 bool const is_correct = ProcessLib::Graph::isEvalOrderCorrectRT<
40 ConstitutiveModels<DisplacementDim>, InputsAndPrevState>();
41
42 if (!is_correct)
43 {
44 OGS_FATAL("The constitutive setting has a wrong evaluation order.");
45 }
46
47 INFO("Model evaluation order is correct.");
48
49 return is_correct;
50}
51
52template <int DisplacementDim>
54 ConstitutiveModels<DisplacementDim>&, double const /*t*/,
55 double const /*dt*/, ParameterLib::SpatialPosition const&, MediaData const&,
58{
59 [[maybe_unused]] static const bool model_order_correct =
61}
62
63template <int DisplacementDim>
65 ConstitutiveModels<DisplacementDim>& models, double const t,
66 double const dt, ParameterLib::SpatialPosition const& x_position,
67 MaterialPropertyLib::Medium const& medium,
70 KelvinVector<DisplacementDim> const& eps_arg,
72 StatefulDataPrev<DisplacementDim> const& prev_state,
77{
78 auto const aux_data = std::tuple{SpaceTimeData{x_position, t, dt},
79 MediaData{medium}, T_data, p_cap_data};
80
81 auto const mat_state_tuple = std::tie(mat_state);
82
83 // TODO will eps lag one iteration behind? (since it's not updated after
84 // solving the global equation system)
85 std::get<StrainData<DisplacementDim>>(state).eps.noalias() = eps_arg;
86
87 ProcessLib::Graph::evalAllInOrder(models, aux_data, cd, mat_state_tuple,
88 out, prev_state, state, tmp);
89
90 // TODO why not ordinary state tracking for BishopsPrevModel?
91
92 {
93 auto const& biot_data = std::get<BiotData>(tmp);
94 auto const& poro_data = std::get<PorosityData>(state);
95
96 if (biot_data() < poro_data.phi)
97 {
99 "ThermoRichardsMechanics: Biot-coefficient {} is smaller than "
100 "porosity {} in element/integration point {}/{}.",
101 biot_data(), poro_data.phi, *x_position.getElementID(),
102 *x_position.getIntegrationPoint());
103 }
104 }
105
106 // TODO Solid thermal expansion is not needed for solid mechanics (it is
107 // computed by the solid material model itself), but for fluid expansion.
108 // This duplication should be avoided in the future.
109}
110
111template struct ConstitutiveSetting<2>;
112template struct ConstitutiveSetting<3>;
113} // namespace ConstitutiveStressSaturation_StrainPressureTemperature
114} // namespace ProcessLib::ThermoRichardsMechanics
#define OGS_FATAL(...)
Definition Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
std::optional< std::size_t > getElementID() const
std::optional< unsigned > getIntegrationPoint() const
void evalAllInOrder(Functions &fs, Tuples &... ts)
Definition Apply.h:294
std::tuple< SolidMechanicsDataStateless< DisplacementDim >, GravityData< DisplacementDim >, TRMHeatStorageAndFluxData< DisplacementDim >, TRMVaporDiffusionData< DisplacementDim >, TRMStorageData, EqPData< DisplacementDim >, EqTData< DisplacementDim >, ThermoOsmosisData< DisplacementDim > > ConstitutiveData
Data that is needed for the equation system assembly.
std::tuple< BiotModel, SolidMechanicsModel< DisplacementDim >, SolidCompressibilityModel< DisplacementDim, SolidConstitutiveRelation< DisplacementDim > >, BishopsModel, BishopsPrevModel, PorosityModel< DisplacementDim >, LiquidDensityModel< DisplacementDim >, SolidDensityModel< DisplacementDim >, GravityModel< DisplacementDim >, LiquidViscosityModel< DisplacementDim >, TransportPorosityModel< DisplacementDim >, PermeabilityModel< DisplacementDim >, ThermoOsmosisModel< DisplacementDim >, DarcyLawModel< DisplacementDim >, TRMHeatStorageAndFluxModel< DisplacementDim >, TRMVaporDiffusionModel< DisplacementDim >, SolidThermalExpansionModel< DisplacementDim >, FluidThermalExpansionModel< DisplacementDim >, TRMStorageModel< DisplacementDim >, EqPModel< DisplacementDim >, EqTModel< DisplacementDim > > ConstitutiveModels
Constitutive models used for assembly.
std::tuple< DarcyLawData< DisplacementDim >, LiquidDensityData, LiquidViscosityData, SolidDensityData, PermeabilityData< DisplacementDim > > OutputData
Data that is needed for output purposes, but not directly for the assembly.
std::tuple< BiotData, SolidCompressibilityData, SaturationDataDeriv, BishopsData, PrevState< BishopsData >, SolidThermalExpansionData< DisplacementDim >, FluidThermalExpansionData, EquivalentPlasticStrainData > ConstitutiveTempData
std::tuple< SaturationData, PorosityData, TransportPorosityData, StrainData< DisplacementDim >, TotalStressData< DisplacementDim > > StatefulData
Data whose state must be tracked by the TRM process.
KV::KelvinVectorType< DisplacementDim > KelvinVector
Definition Base.h:26
void eval(ConstitutiveModels< DisplacementDim > &models, double const t, double const dt, ParameterLib::SpatialPosition const &x_position, MaterialPropertyLib::Medium const &medium, TemperatureData< DisplacementDim > const &T_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, KelvinVector< DisplacementDim > const &eps_arg, StatefulData< DisplacementDim > &state, StatefulDataPrev< DisplacementDim > const &prev_state, MaterialStateData< DisplacementDim > &mat_state, ConstitutiveTempData< DisplacementDim > &tmp, OutputData< DisplacementDim > &out, ConstitutiveData< DisplacementDim > &cd) const
Evaluate the constitutive setting.
void init(ConstitutiveModels< DisplacementDim > &, double const, double const, ParameterLib::SpatialPosition const &, MediaData const &, TemperatureData< DisplacementDim > const &, StatefulData< DisplacementDim > &, StatefulDataPrev< DisplacementDim > &) const