34 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
43 const bool phase_transition =
44 (media.begin()->second->phase(
"Gas").numberOfComponents() > 1) &&
45 (media.begin()->second->phase(
"AqueousLiquid").numberOfComponents() >
51 return std::make_unique<ConstitutiveRelations::PhaseTransition>(media);
53 return std::make_unique<ConstitutiveRelations::NoPhaseTransition>(media);
59 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
60 std::vector<ProcessVariable>
const& variables,
61 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
62 std::optional<ParameterLib::CoordinateSystem>
const&
63 local_coordinate_system,
65 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
69 DBUG(
"Create TH2M Process.");
72 auto const coupling_scheme =
75 const bool use_monolithic_scheme =
76 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
87 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
89 if (use_monolithic_scheme)
103 variable_pGR = &per_process_variables[0].get();
104 variable_pCap = &per_process_variables[1].get();
105 variable_T = &per_process_variables[2].get();
106 variable_u = &per_process_variables[3].get();
107 process_variables.push_back(std::move(per_process_variables));
111 OGS_FATAL(
"A Staggered version of TH2M is not implemented.");
113 using namespace std::string_literals;
114 for (
auto const& variable_name :
115 {
"gas_pressure"s,
"capillary_pressure"s,
"temperature"s,
118 auto per_process_variables =
120 process_variables.push_back(std::move(per_process_variables));
122 variable_pGR = &process_variables[0][0].get();
123 variable_pCap = &process_variables[1][0].get();
124 variable_T = &process_variables[2][0].get();
125 variable_u = &process_variables[3][0].get();
128 DBUG(
"Associate displacement with process variable '{:s}'.",
134 "Number of components of the process variable '{:s}' is different "
135 "from the displacement dimension: got {:d}, expected {:d}",
141 DBUG(
"Associate gas pressure with process variable '{:s}'.",
146 "Gas pressure process variable '{:s}' is not a scalar variable but "
153 DBUG(
"Associate capillary pressure with process variable '{:s}'.",
158 "Capillary pressure process variable '{:s}' is not a scalar "
165 DBUG(
"Associate temperature with process variable '{:s}'.",
170 "temperature process variable '{:s}' is not a scalar variable but "
171 "has {:d} components.",
177 auto solid_constitutive_relations =
178 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
179 parameters, local_coordinate_system, materialIDs(mesh), config);
182 const auto& reference_temperature = ParameterLib::findParameter<double>(
185 "reference_temperature", parameters, 1, &mesh);
186 DBUG(
"Use '{:s}' as reference temperature parameter.",
187 reference_temperature.name);
190 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
192 std::vector<double>
const b =
195 "specific_body_force");
196 if (b.size() != DisplacementDim)
199 "The size of the specific body force vector does not match the "
200 "displacement dimension. Vector size is {:d}, displacement "
202 b.size(), DisplacementDim);
205 std::copy_n(b.data(), b.size(), specific_body_force.data());
209 auto initial_stress = ProcessLib::createInitialStress<DisplacementDim>(
210 config, parameters, mesh);
212 auto const mass_lumping =
221 const bool use_TaylorHood_elements =
229 std::move(media_map),
230 std::move(solid_constitutive_relations),
231 std::move(phase_transition_model),
232 reference_temperature,
233 std::move(initial_stress),
236 use_TaylorHood_elements};
242 return std::make_unique<TH2MProcess<DisplacementDim>>(
243 std::move(name), mesh, std::move(jacobian_assembler), parameters,
244 integration_order, std::move(process_variables),
245 std::move(process_data), std::move(secondary_variables),
246 use_monolithic_scheme);
template std::unique_ptr< Process > createTH2MProcess< 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 > createTH2MProcess< 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 > createTH2MProcess(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)