37 std::optional<BaseLib::ConfigTree>
const& config)
44 auto const coupling_scheme_type =
46 config->getConfigParameter<std::string>(
"type");
48 if (coupling_scheme_type ==
"monolithic")
54 double const fixed_stress_stabilization_parameter =
56 config->getConfigParameter<
double>(
57 "fixed_stress_stabilization_parameter", 0.5);
59 DBUG(
"Using value {:g} for coupling parameter of staggered scheme.",
60 fixed_stress_stabilization_parameter);
64 double const csp_min = 1.0 / 6.0;
65 double const csp_max = 1.0;
66 if (fixed_stress_stabilization_parameter < csp_min ||
67 fixed_stress_stabilization_parameter > csp_max)
70 "Value of coupling scheme parameter = {:g} is out of "
71 "reasonable range ({:g}, {:g}).",
72 fixed_stress_stabilization_parameter, csp_min, csp_max);
76 bool const fixed_stress_over_time_step =
78 config->getConfigParameter<std::string>(
"fixed_stress_over_time_step",
81 return Staggered{fixed_stress_stabilization_parameter,
82 fixed_stress_over_time_step};
88 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
89 std::vector<ProcessVariable>
const& variables,
90 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
91 std::optional<ParameterLib::CoordinateSystem>
const&
92 local_coordinate_system,
94 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
98 DBUG(
"Create HydroMechanicsProcess.");
100 if (DisplacementDim == 2)
106 "Mesh {:s} is on a plane rotated around the vertical axis. The "
107 "axisymmetric problem can not use such mesh.",
123 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
126 int const hydraulic_process_id = 0;
127 int mechanics_related_process_id = 0;
129 if (std::holds_alternative<Monolithic>(coupling_scheme))
134 variables, pv_config,
139 variable_p = &per_process_variables[0].get();
140 variable_u = &per_process_variables[1].get();
141 process_variables.push_back(std::move(per_process_variables));
144 if (std::holds_alternative<Staggered>(coupling_scheme))
146 using namespace std::string_literals;
147 for (
auto const& variable_name : {
"pressure"s,
"displacement"s})
149 auto per_process_variables =
151 process_variables.push_back(std::move(per_process_variables));
153 mechanics_related_process_id = 1;
154 variable_p = &process_variables[hydraulic_process_id][0].get();
155 variable_u = &process_variables[mechanics_related_process_id][0].get();
158 DBUG(
"Associate displacement with process variable '{:s}'.",
164 "Number of components of the process variable '{:s}' is different "
165 "from the displacement dimension: got {:d}, expected {:d}",
171 DBUG(
"Associate pressure with process variable '{:s}'.",
176 "Pressure process variable '{:s}' is not a scalar variable but has "
182 auto solid_constitutive_relations =
184 parameters, local_coordinate_system, materialIDs(mesh), config);
188 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
190 std::vector<double>
const b =
193 "specific_body_force");
194 if (b.size() != DisplacementDim)
197 "The size of the specific body force vector does not match the "
198 "displacement dimension. Vector size is {:d}, displacement "
200 b.size(), DisplacementDim);
203 std::copy_n(b.data(), b.size(), specific_body_force.data());
212 std::array
const requiredMediumProperties = {
225 (*ranges::begin(media_map.media()))->hasPhase(
"Gas")
228 for (
auto const& medium : media_map.media())
230 checkRequiredProperties(*medium, requiredMediumProperties);
231 checkRequiredProperties(fluidPhase(*medium), requiredFluidProperties);
232 checkRequiredProperties(medium->phase(
"Solid"),
233 requiredSolidProperties);
235 DBUG(
"Media properties verified.");
239 config, parameters, mesh);
246 std::move(media_map),
247 std::move(solid_constitutive_relations),
252 hydraulic_process_id,
253 mechanics_related_process_id,
254 use_taylor_hood_elements,
261 return std::make_unique<HydroMechanicsProcess<DisplacementDim>>(
262 std::move(name), mesh, std::move(jacobian_assembler), parameters,
263 integration_order, std::move(process_variables),
264 std::move(process_data), std::move(secondary_variables),
265 std::holds_alternative<Monolithic>(coupling_scheme));