25 namespace ThermoMechanicalPhaseField
27 template <
int DisplacementDim>
31 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
32 std::vector<ProcessVariable>
const& variables,
33 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
34 std::optional<ParameterLib::CoordinateSystem>
const&
35 local_coordinate_system,
36 unsigned const integration_order,
41 DBUG(
"Create ThermoMechanicalPhaseFieldProcess.");
44 "Solve the coupling with the staggered scheme,"
45 "which is the only option for TM-Phasefield in the current code");
51 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
53 int heat_conduction_process_id = 0;
54 int mechanics_related_process_id = 1;
55 int phase_field_process_id = 2;
61 process_variables.push_back(std::move(process_variable_T));
63 &process_variables[process_variables.size() - 1][0].get();
69 process_variables.push_back(std::move(process_variable_u));
71 &process_variables[process_variables.size() - 1][0].get();
76 process_variables.push_back(std::move(process_variable_ph));
78 &process_variables[process_variables.size() - 1][0].get();
80 DBUG(
"Associate displacement with process variable '{:s}'.",
86 "Number of components of the process variable '{:s}' is different "
87 "from the displacement dimension: got {:d}, expected {:d}",
93 DBUG(
"Associate phase field with process variable '{:s}'.",
98 "Phasefield process variable '{:s}' is not a scalar variable but "
99 "has {:d} components.",
104 DBUG(
"Associate temperature with process variable '{:s}'.",
109 "Temperature process variable '{:s}' is not a scalar variable but "
110 "has {:d} components.",
115 auto solid_constitutive_relations =
116 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
117 parameters, local_coordinate_system, config);
119 auto const phasefield_parameters_config =
123 auto const thermal_parameters_config =
128 auto const& residual_stiffness = ParameterLib::findParameter<double>(
129 phasefield_parameters_config,
131 "residual_stiffness", parameters, 1, &mesh);
132 DBUG(
"Use '{:s}' as residual stiffness.", residual_stiffness.name);
135 auto const& crack_resistance = ParameterLib::findParameter<double>(
136 phasefield_parameters_config,
138 "crack_resistance", parameters, 1, &mesh);
139 DBUG(
"Use '{:s}' as crack resistance.", crack_resistance.name);
142 auto const& crack_length_scale = ParameterLib::findParameter<double>(
143 phasefield_parameters_config,
145 "crack_length_scale", parameters, 1, &mesh);
146 DBUG(
"Use '{:s}' as crack length scale.", crack_length_scale.name);
149 auto const& kinetic_coefficient = ParameterLib::findParameter<double>(
150 phasefield_parameters_config,
152 "kinetic_coefficient", parameters, 1, &mesh);
153 DBUG(
"Use '{:s}' as kinetic coefficient.", kinetic_coefficient.name);
156 auto const& solid_density = ParameterLib::findParameter<double>(
159 "solid_density", parameters, 1, &mesh);
160 DBUG(
"Use '{:s}' as solid density parameter.", solid_density.name);
163 auto const& linear_thermal_expansion_coefficient =
164 ParameterLib::findParameter<double>(
165 thermal_parameters_config,
167 "linear_thermal_expansion_coefficient", parameters, 1, &mesh);
168 DBUG(
"Use '{:s}' as linear thermal expansion coefficient.",
169 linear_thermal_expansion_coefficient.name);
173 thermal_parameters_config,
175 "specific_heat_capacity", parameters, 1, &mesh);
180 thermal_parameters_config,
182 "thermal_conductivity", parameters, 1, &mesh);
183 DBUG(
"Use '{:s}' as thermal conductivity parameter.",
188 thermal_parameters_config,
190 "residual_thermal_conductivity", parameters, 1, &mesh);
191 DBUG(
"Use '{:s}' as residual thermal conductivity parameter.",
192 residual_thermal_conductivity.name);
199 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
201 std::vector<double>
const b =
204 "specific_body_force");
205 if (specific_body_force.size() != DisplacementDim)
208 "The size of the specific body force vector does not match the "
209 "displacement dimension. Vector size is {:d}, displacement "
211 specific_body_force.size(), DisplacementDim);
214 std::copy_n(b.data(), b.size(), specific_body_force.data());
219 std::move(solid_constitutive_relations),
225 linear_thermal_expansion_coefficient,
228 residual_thermal_conductivity,
236 return std::make_unique<ThermoMechanicalPhaseFieldProcess<DisplacementDim>>(
237 std::move(
name), mesh, std::move(jacobian_assembler), parameters,
238 integration_order, std::move(process_variables),
239 std::move(process_data), std::move(secondary_variables),
240 mechanics_related_process_id, phase_field_process_id,
241 heat_conduction_process_id);
247 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
248 std::vector<ProcessVariable>
const& variables,
249 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
250 std::optional<ParameterLib::CoordinateSystem>
const&
251 local_coordinate_system,
252 unsigned const integration_order,
258 std::unique_ptr<ProcessLib::AbstractJacobianAssembler>&& jacobian_assembler,
259 std::vector<ProcessVariable>
const& variables,
260 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters,
261 std::optional<ParameterLib::CoordinateSystem>
const&
262 local_coordinate_system,
263 unsigned const integration_order,
void INFO(char const *fmt, Args const &... args)
void DBUG(char const *fmt, Args const &... args)
void checkConfigParameter(std::string const ¶m, T const &value) const
T getConfigParameter(std::string const ¶m) const
ConfigTree getConfigSubtree(std::string const &root) 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.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
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)
std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess(std::string 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)
template std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess< 2 >(std::string 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)
template std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess< 3 >(std::string 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::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)