33 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
42 const bool phase_transition =
43 (media.begin()->second->phase(
"Gas").numberOfComponents() > 1) &&
44 (media.begin()->second->phase(
"AqueousLiquid").numberOfComponents() >
50 return std::make_unique<PhaseTransition>(media);
52 return std::make_unique<NoPhaseTransition>(media);
58 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
59 std::vector<ProcessVariable>
const& variables,
60 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
61 std::optional<ParameterLib::CoordinateSystem>
const&
62 local_coordinate_system,
64 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
68 DBUG(
"Create TH2M Process.");
71 auto const coupling_scheme =
74 const bool use_monolithic_scheme =
75 !(coupling_scheme && (*coupling_scheme ==
"staggered"));
86 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
88 if (use_monolithic_scheme)
102 variable_pGR = &per_process_variables[0].get();
103 variable_pCap = &per_process_variables[1].get();
104 variable_T = &per_process_variables[2].get();
105 variable_u = &per_process_variables[3].get();
106 process_variables.push_back(std::move(per_process_variables));
110 OGS_FATAL(
"A Staggered version of TH2M is not implemented.");
112 using namespace std::string_literals;
113 for (
auto const& variable_name :
114 {
"gas_pressure"s,
"capillary_pressure"s,
"temperature"s,
117 auto per_process_variables =
119 process_variables.push_back(std::move(per_process_variables));
121 variable_pGR = &process_variables[0][0].get();
122 variable_pCap = &process_variables[1][0].get();
123 variable_T = &process_variables[2][0].get();
124 variable_u = &process_variables[3][0].get();
127 DBUG(
"Associate displacement with process variable '{:s}'.",
133 "Number of components of the process variable '{:s}' is different "
134 "from the displacement dimension: got {:d}, expected {:d}",
140 DBUG(
"Associate gas pressure with process variable '{:s}'.",
145 "Gas pressure process variable '{:s}' is not a scalar variable but "
152 DBUG(
"Associate capillary pressure with process variable '{:s}'.",
157 "Capillary pressure process variable '{:s}' is not a scalar "
164 DBUG(
"Associate temperature with process variable '{:s}'.",
169 "temperature process variable '{:s}' is not a scalar variable but "
170 "has {:d} components.",
176 auto solid_constitutive_relations =
177 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
178 parameters, local_coordinate_system, config);
181 const auto& reference_temperature = ParameterLib::findParameter<double>(
184 "reference_temperature", parameters, 1, &mesh);
185 DBUG(
"Use '{:s}' as reference temperature parameter.",
186 reference_temperature.name);
189 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
191 std::vector<double>
const b =
194 "specific_body_force");
195 if (b.size() != DisplacementDim)
198 "The size of the specific body force vector does not match the "
199 "displacement dimension. Vector size is {:d}, displacement "
201 b.size(), DisplacementDim);
204 std::copy_n(b.data(), b.size(), specific_body_force.data());
208 auto initial_stress = ProcessLib::createInitialStress<DisplacementDim>(
209 config, parameters, mesh);
211 auto const mass_lumping =
220 const bool use_TaylorHood_elements =
228 std::move(media_map),
229 std::move(solid_constitutive_relations),
230 std::move(phase_transition_model),
231 reference_temperature,
232 std::move(initial_stress),
235 use_TaylorHood_elements};
241 return std::make_unique<TH2MProcess<DisplacementDim>>(
242 std::move(name), mesh, std::move(jacobian_assembler), parameters,
243 integration_order, std::move(process_variables),
244 std::move(process_data), std::move(secondary_variables),
245 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)