30 std::optional<BaseLib::ConfigTree>
const& config)
37 auto const coupling_scheme_type =
39 config->getConfigParameter<std::string>(
"type");
41 if (coupling_scheme_type ==
"monolithic")
47 double const fixed_stress_stabilization_parameter =
49 config->getConfigParameter<
double>(
50 "fixed_stress_stabilization_parameter", 0.5);
52 DBUG(
"Using value {:g} for coupling parameter of staggered scheme.",
53 fixed_stress_stabilization_parameter);
57 double const csp_min = 1.0 / 6.0;
58 double const csp_max = 1.0;
59 if (fixed_stress_stabilization_parameter < csp_min ||
60 fixed_stress_stabilization_parameter > csp_max)
63 "Value of coupling scheme parameter = {:g} is out of "
64 "reasonable range ({:g}, {:g}).",
65 fixed_stress_stabilization_parameter, csp_min, csp_max);
69 bool const fixed_stress_over_time_step =
71 config->getConfigParameter<std::string>(
"fixed_stress_over_time_step",
74 return Staggered{fixed_stress_stabilization_parameter,
75 fixed_stress_over_time_step};
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)
91 DBUG(
"Create HydroMechanicsProcess.");
93 if (DisplacementDim == 2)
99 "Mesh {:s} is on a plane rotated around the vertical axis. The "
100 "axisymmetric problem can not use such mesh.",
116 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
119 int const hydraulic_process_id = 0;
120 int mechanics_related_process_id = 0;
122 if (std::holds_alternative<Monolithic>(coupling_scheme))
127 variables, pv_config,
132 variable_p = &per_process_variables[0].get();
133 variable_u = &per_process_variables[1].get();
134 process_variables.push_back(std::move(per_process_variables));
137 if (std::holds_alternative<Staggered>(coupling_scheme))
139 using namespace std::string_literals;
140 for (
auto const& variable_name : {
"pressure"s,
"displacement"s})
142 auto per_process_variables =
144 process_variables.push_back(std::move(per_process_variables));
146 mechanics_related_process_id = 1;
147 variable_p = &process_variables[hydraulic_process_id][0].get();
148 variable_u = &process_variables[mechanics_related_process_id][0].get();
151 DBUG(
"Associate displacement with process variable '{:s}'.",
157 "Number of components of the process variable '{:s}' is different "
158 "from the displacement dimension: got {:d}, expected {:d}",
164 DBUG(
"Associate pressure with process variable '{:s}'.",
169 "Pressure process variable '{:s}' is not a scalar variable but has "
175 auto solid_constitutive_relations =
177 parameters, local_coordinate_system, materialIDs(mesh), config);
181 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
183 std::vector<double>
const b =
186 "specific_body_force");
187 if (b.size() != DisplacementDim)
190 "The size of the specific body force vector does not match the "
191 "displacement dimension. Vector size is {:d}, displacement "
193 b.size(), DisplacementDim);
196 std::copy_n(b.data(), b.size(), specific_body_force.data());
202 auto const is_linear =
209 std::array
const requiredMediumProperties = {
222 (*ranges::begin(media_map.media()))->hasPhase(
"Gas")
225 for (
auto const& medium : media_map.media())
227 checkRequiredProperties(*medium, requiredMediumProperties);
228 checkRequiredProperties(fluidPhase(*medium), requiredFluidProperties);
229 checkRequiredProperties(medium->phase(
"Solid"),
230 requiredSolidProperties);
232 DBUG(
"Media properties verified.");
236 config, parameters, mesh);
243 std::move(media_map),
244 std::move(solid_constitutive_relations),
249 hydraulic_process_id,
250 mechanics_related_process_id,
251 use_taylor_hood_elements,
258 return std::make_unique<HydroMechanicsProcess<DisplacementDim>>(
259 std::move(name), mesh, std::move(jacobian_assembler), parameters,
260 integration_order, std::move(process_variables),
261 std::move(process_data), std::move(secondary_variables),
262 std::holds_alternative<Monolithic>(coupling_scheme), is_linear);