31 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
33 std::array
const required_medium_properties = {
37 std::array
const required_liquid_properties = {
43 for (
auto const& m : media)
45 checkRequiredProperties(*m.second, required_medium_properties);
46 checkRequiredProperties(m.second->phase(
"AqueousLiquid"),
47 required_liquid_properties);
48 checkRequiredProperties(m.second->phase(
"Solid"),
49 required_solid_properties);
56 DBUG(
"Associate displacement with process variable '{:s}'.",
62 "Number of components of the process variable '{:s}' is different "
63 "from the displacement dimension: got {:d}, expected {:d}",
70template <
int DisplacementDim,
typename ConstitutiveTraits,
71 typename CreateConstitutiveSetting>
74 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
75 std::vector<ProcessVariable>
const& variables,
76 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
77 std::optional<ParameterLib::CoordinateSystem>
const&
78 local_coordinate_system,
80 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media,
81 bool const mandatory_stress0_type)
83 auto const coupling_scheme =
86 const bool use_monolithic_scheme =
87 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
97 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
99 if (use_monolithic_scheme)
104 variables, pv_config,
111 variable_T = &per_process_variables[0].get();
112 variable_p = &per_process_variables[1].get();
113 variable_u = &per_process_variables[2].get();
114 process_variables.push_back(std::move(per_process_variables));
119 "So far, only the monolithic scheme is implemented for "
120 "THERMO_RICHARDS_MECHANICS");
129 auto solid_constitutive_relations =
130 CreateConstitutiveSetting::createSolidConstitutiveRelations(
131 parameters, local_coordinate_system, materialIDs(mesh), config);
134 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
136 std::vector<double>
const b =
139 "specific_body_force");
140 if (b.size() != DisplacementDim)
143 "The size of the specific body force vector does not match the "
144 "displacement dimension. Vector size is {:d}, displacement "
146 b.size(), DisplacementDim);
149 std::copy_n(b.data(), b.size(), specific_body_force.data());
155 "Check the media properties of ThermoRichardsMechanics process "
158 DBUG(
"Media properties verified.");
161 config, parameters, mesh, mandatory_stress0_type);
163 bool mass_lumping =
false;
164 if (
auto const mass_lumping_ptr =
168 DBUG(
"Using mass lumping for the Richards flow equation.");
169 mass_lumping = *mass_lumping_ptr;
172 bool const apply_body_force_for_deformation =
177 bool const initialize_porosity_from_medium_property =
182 auto const is_linear =
186 const bool use_TaylorHood_elements =
193 process_data{materialIDs(mesh),
194 std::move(media_map),
195 std::move(solid_constitutive_relations),
196 std::move(initial_stress),
199 use_TaylorHood_elements,
200 apply_body_force_for_deformation,
202 initialize_porosity_from_medium_property}};
208 return std::make_unique<
210 name, mesh, std::move(jacobian_assembler), parameters,
211 integration_order, std::move(process_variables),
212 std::move(process_data), std::move(secondary_variables),
213 use_monolithic_scheme, is_linear);
216template <
int DisplacementDim>
218 std::string
const& name,
220 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
221 std::vector<ProcessVariable>
const& variables,
222 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
223 std::optional<ParameterLib::CoordinateSystem>
const&
224 local_coordinate_system,
225 unsigned const integration_order,
227 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
231 DBUG(
"Create ThermoRichardsMechanicsProcess.");
236 "Stress_StrainTemperature");
237 INFO(
"TRM process subtype is '{}'", subtype);
239 if (subtype ==
"Stress_StrainTemperature")
241 bool const mandatory_stress0_type =
false;
247 DisplacementDim>>(name, mesh, std::move(jacobian_assembler),
248 variables, parameters,
249 local_coordinate_system, integration_order,
250 config, media, mandatory_stress0_type);
253 if (subtype ==
"StressSaturation_StrainPressureTemperature")
256 bool const mandatory_stress0_type =
true;
259 ConstitutiveStressSaturation_StrainPressureTemperature::
260 ConstitutiveTraits<DisplacementDim>,
261 ConstitutiveStressSaturation_StrainPressureTemperature::
262 CreateConstitutiveSetting<DisplacementDim>>(
263 name, mesh, std::move(jacobian_assembler), variables, parameters,
264 local_coordinate_system, integration_order, config, media,
265 mandatory_stress0_type);
268 "TRM process subtype 'StressSaturation_StrainPressureTemperature' "
269 "is not supported, because OGS has not been built with MFront.");
273 OGS_FATAL(
"Unknown TRM process subtype '{}'.", subtype);
277 std::string
const& name,
279 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
280 std::vector<ProcessVariable>
const& variables,
281 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
282 std::optional<ParameterLib::CoordinateSystem>
const&
283 local_coordinate_system,
284 unsigned const integration_order,
286 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
289 std::string
const& name,
291 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
292 std::vector<ProcessVariable>
const& variables,
293 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
294 std::optional<ParameterLib::CoordinateSystem>
const&
295 local_coordinate_system,
296 unsigned const integration_order,
298 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)
BaseLib::StrongType< bool, struct InitializePorosityFromMediumPropertyTag > InitializePorosityFromMediumProperty
A type helping to avoid confusion of different boolean values.
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)