35namespace ThermoRichardsMechanics
38 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
40 std::array
const required_medium_properties = {
44 std::array
const required_liquid_properties = {
50 for (
auto const& m : media)
52 checkRequiredProperties(*m.second, required_medium_properties);
53 checkRequiredProperties(m.second->phase(
"AqueousLiquid"),
54 required_liquid_properties);
55 checkRequiredProperties(m.second->phase(
"Solid"),
56 required_solid_properties);
63 DBUG(
"Associate displacement with process variable '{:s}'.",
69 "Number of components of the process variable '{:s}' is different "
70 "from the displacement dimension: got {:d}, expected {:d}",
77template <
int DisplacementDim,
typename ConstitutiveTraits,
78 typename CreateConstitutiveSetting>
81 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
82 std::vector<ProcessVariable>
const& variables,
83 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
84 std::optional<ParameterLib::CoordinateSystem>
const&
85 local_coordinate_system,
87 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media,
88 bool const mandatory_stress0_type)
90 auto const coupling_scheme =
93 const bool use_monolithic_scheme =
94 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
104 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
106 if (use_monolithic_scheme)
111 variables, pv_config,
118 variable_T = &per_process_variables[0].get();
119 variable_p = &per_process_variables[1].get();
120 variable_u = &per_process_variables[2].get();
121 process_variables.push_back(std::move(per_process_variables));
126 "So far, only the monolithic scheme is implemented for "
127 "THERMO_RICHARDS_MECHANICS");
136 auto solid_constitutive_relations =
137 CreateConstitutiveSetting::createSolidConstitutiveRelations(
138 parameters, local_coordinate_system, materialIDs(mesh), config);
141 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
143 std::vector<double>
const b =
146 "specific_body_force");
147 if (b.size() != DisplacementDim)
150 "The size of the specific body force vector does not match the "
151 "displacement dimension. Vector size is {:d}, displacement "
153 b.size(), DisplacementDim);
156 std::copy_n(b.data(), b.size(), specific_body_force.data());
162 "Check the media properties of ThermoRichardsMechanics process "
165 DBUG(
"Media properties verified.");
168 config, parameters, mesh, mandatory_stress0_type);
170 bool mass_lumping =
false;
171 if (
auto const mass_lumping_ptr =
175 DBUG(
"Using mass lumping for the Richards flow equation.");
176 mass_lumping = *mass_lumping_ptr;
179 bool const apply_body_force_for_deformation =
184 bool const initialize_porosity_from_medium_property =
189 const bool use_TaylorHood_elements =
196 process_data{materialIDs(mesh),
197 std::move(media_map),
198 std::move(solid_constitutive_relations),
199 std::move(initial_stress),
202 use_TaylorHood_elements,
203 apply_body_force_for_deformation,
205 initialize_porosity_from_medium_property}};
211 return std::make_unique<
213 name, mesh, std::move(jacobian_assembler), parameters,
214 integration_order, std::move(process_variables),
215 std::move(process_data), std::move(secondary_variables),
216 use_monolithic_scheme);
219template <
int DisplacementDim>
221 std::string
const& name,
223 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
224 std::vector<ProcessVariable>
const& variables,
225 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
226 std::optional<ParameterLib::CoordinateSystem>
const&
227 local_coordinate_system,
228 unsigned const integration_order,
230 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
234 DBUG(
"Create ThermoRichardsMechanicsProcess.");
239 "Stress_StrainTemperature");
240 INFO(
"TRM process subtype is '{}'", subtype);
242 if (subtype ==
"Stress_StrainTemperature")
244 bool const mandatory_stress0_type =
false;
250 DisplacementDim>>(name, mesh, std::move(jacobian_assembler),
251 variables, parameters,
252 local_coordinate_system, integration_order,
253 config, media, mandatory_stress0_type);
256 if (subtype ==
"StressSaturation_StrainPressureTemperature")
259 bool const mandatory_stress0_type =
true;
262 ConstitutiveStressSaturation_StrainPressureTemperature::
263 ConstitutiveTraits<DisplacementDim>,
264 ConstitutiveStressSaturation_StrainPressureTemperature::
265 CreateConstitutiveSetting<DisplacementDim>>(
266 name, mesh, std::move(jacobian_assembler), variables, parameters,
267 local_coordinate_system, integration_order, config, media,
268 mandatory_stress0_type);
271 "TRM process subtype 'StressSaturation_StrainPressureTemperature' "
272 "is not supported, because OGS has not been built with MFront.");
276 OGS_FATAL(
"Unknown TRM process subtype '{}'.", subtype);
280 std::string
const& name,
282 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
283 std::vector<ProcessVariable>
const& variables,
284 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
285 std::optional<ParameterLib::CoordinateSystem>
const&
286 local_coordinate_system,
287 unsigned const integration_order,
289 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
292 std::string
const& name,
294 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
295 std::vector<ProcessVariable>
const& variables,
296 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
297 std::optional<ParameterLib::CoordinateSystem>
const&
298 local_coordinate_system,
299 unsigned const integration_order,
301 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
unsigned getShapeFunctionOrder() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
Handles configuration of several secondary variables from the project file.
Global assembler for the monolithic scheme of the non-isothermal Richards flow coupled with mechanics...
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
@ bishops_effective_stress
void checkMPLProperties(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermoRichardsMechanicsProcessStage2(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 ¶meters, 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, bool const mandatory_stress0_type)
void checkProcessVariableComponents(ProcessVariable const &variable, const int dim)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 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 ¶meters, 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< Process > createThermoRichardsMechanicsProcess< 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 ¶meters, 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)
std::unique_ptr< Process > createThermoRichardsMechanicsProcess(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 ¶meters, 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)
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 ¶meters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)