35 std::optional<BaseLib::ConfigTree>
const& config)
42 auto const coupling_scheme_type =
44 config->getConfigParameter<std::string>(
"type");
46 if (coupling_scheme_type ==
"monolithic")
52 double const fixed_stress_stabilization_parameter =
54 config->getConfigParameter<
double>(
55 "fixed_stress_stabilization_parameter", 0.5);
57 DBUG(
"Using value {:g} for coupling parameter of staggered scheme.",
58 fixed_stress_stabilization_parameter);
62 double const csp_min = 1.0 / 6.0;
63 double const csp_max = 1.0;
64 if (fixed_stress_stabilization_parameter < csp_min ||
65 fixed_stress_stabilization_parameter > csp_max)
68 "Value of coupling scheme parameter = {:g} is out of "
69 "reasonable range ({:g}, {:g}).",
70 fixed_stress_stabilization_parameter, csp_min, csp_max);
74 bool const fixed_stress_over_time_step =
76 config->getConfigParameter<std::string>(
"fixed_stress_over_time_step",
79 return Staggered{fixed_stress_stabilization_parameter,
80 fixed_stress_over_time_step};
86 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
87 std::vector<ProcessVariable>
const& variables,
88 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
89 std::optional<ParameterLib::CoordinateSystem>
const&
90 local_coordinate_system,
92 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
96 DBUG(
"Create HydroMechanicsProcess.");
98 if (DisplacementDim == 2)
104 "Mesh {:s} is on a plane rotated around the vertical axis. The "
105 "axisymmetric problem can not use such mesh.",
121 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
124 int const hydraulic_process_id = 0;
125 int mechanics_related_process_id = 0;
127 if (std::holds_alternative<Monolithic>(coupling_scheme))
132 variables, pv_config,
137 variable_p = &per_process_variables[0].get();
138 variable_u = &per_process_variables[1].get();
139 process_variables.push_back(std::move(per_process_variables));
142 if (std::holds_alternative<Staggered>(coupling_scheme))
144 using namespace std::string_literals;
145 for (
auto const& variable_name : {
"pressure"s,
"displacement"s})
147 auto per_process_variables =
149 process_variables.push_back(std::move(per_process_variables));
151 mechanics_related_process_id = 1;
152 variable_p = &process_variables[hydraulic_process_id][0].get();
153 variable_u = &process_variables[mechanics_related_process_id][0].get();
156 DBUG(
"Associate displacement with process variable '{:s}'.",
162 "Number of components of the process variable '{:s}' is different "
163 "from the displacement dimension: got {:d}, expected {:d}",
169 DBUG(
"Associate pressure with process variable '{:s}'.",
174 "Pressure process variable '{:s}' is not a scalar variable but has "
180 auto solid_constitutive_relations =
181 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
182 parameters, local_coordinate_system, config);
186 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
188 std::vector<double>
const b =
191 "specific_body_force");
192 if (b.size() != DisplacementDim)
195 "The size of the specific body force vector does not match the "
196 "displacement dimension. Vector size is {:d}, displacement "
198 b.size(), DisplacementDim);
201 std::copy_n(b.data(), b.size(), specific_body_force.data());
210 std::array
const requiredMediumProperties = {
223 media_map.checkElementHasMedium(element_id);
224 auto const& medium = *media_map.getMedium(element_id);
228 medium.hasPhase(
"Gas")
234 auto const phase_pressure_tmp =
235 medium.hasPhase(
"Gas")
238 if (phase_pressure != phase_pressure_tmp)
241 "You are mixing liquid and gas phases in your model domain."
242 "OGS does not yet know how to handle this.");
245 checkRequiredProperties(medium, requiredMediumProperties);
246 checkRequiredProperties(fluidPhase(medium), requiredFluidProperties);
247 checkRequiredProperties(medium.phase(
"Solid"), requiredSolidProperties);
249 DBUG(
"Media properties verified.");
252 auto initial_stress = ProcessLib::createInitialStress<DisplacementDim>(
253 config, parameters, mesh);
260 std::move(media_map),
261 std::move(solid_constitutive_relations),
266 hydraulic_process_id,
267 mechanics_related_process_id,
268 use_taylor_hood_elements,
275 return std::make_unique<HydroMechanicsProcess<DisplacementDim>>(
276 std::move(name), mesh, std::move(jacobian_assembler), parameters,
277 integration_order, std::move(process_variables),
278 std::move(process_data), std::move(secondary_variables),
279 std::holds_alternative<Monolithic>(coupling_scheme));