32std::unique_ptr<ConstitutiveRelations::PhaseTransitionModel>
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);
56template <
int DisplacementDim>
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 =
179 parameters, local_coordinate_system, materialIDs(mesh), config);
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());
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);
250 std::string
const& name,
252 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
253 std::vector<ProcessVariable>
const& variables,
254 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
255 std::optional<ParameterLib::CoordinateSystem>
const&
256 local_coordinate_system,
257 unsigned const integration_order,
259 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
262 std::string
const& name,
264 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
265 std::vector<ProcessVariable>
const& variables,
266 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
267 std::optional<ParameterLib::CoordinateSystem>
const&
268 local_coordinate_system,
269 unsigned const integration_order,
271 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media);
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) const
void checkConfigParameter(std::string const ¶m, std::string_view const value) const
unsigned getShapeFunctionOrder() const
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
Handles configuration of several secondary variables from the project file.
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
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< ConstitutiveRelations::PhaseTransitionModel > createPhaseTransitionModel(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)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)