40 config.checkConfigParameter(
"type",
"THERMO_MECHANICAL_PHASE_FIELD");
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");
50 auto const pv_config = config.getConfigSubtree(
"process_variables");
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));
62 ProcessVariable* variable_T =
63 &process_variables[process_variables.size() - 1][0].get();
69 process_variables.push_back(std::move(process_variable_u));
70 ProcessVariable* variable_u =
71 &process_variables[process_variables.size() - 1][0].get();
76 process_variables.push_back(std::move(process_variable_ph));
77 ProcessVariable* variable_ph =
78 &process_variables[process_variables.size() - 1][0].get();
80 DBUG(
"Associate displacement with process variable '{:s}'.",
81 variable_u->getName());
83 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
86 "Number of components of the process variable '{:s}' is different "
87 "from the displacement dimension: got {:d}, expected {:d}",
88 variable_u->getName(),
89 variable_u->getNumberOfGlobalComponents(),
93 DBUG(
"Associate phase field with process variable '{:s}'.",
94 variable_ph->getName());
95 if (variable_ph->getNumberOfGlobalComponents() != 1)
98 "Phasefield process variable '{:s}' is not a scalar variable but "
99 "has {:d} components.",
100 variable_ph->getName(),
101 variable_ph->getNumberOfGlobalComponents());
104 DBUG(
"Associate temperature with process variable '{:s}'.",
105 variable_T->getName());
106 if (variable_T->getNumberOfGlobalComponents() != 1)
109 "Temperature process variable '{:s}' is not a scalar variable but "
110 "has {:d} components.",
111 variable_T->getName(),
112 variable_T->getNumberOfGlobalComponents());
115 auto solid_constitutive_relations =
116 MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
117 parameters, local_coordinate_system, config);
119 auto const phasefield_parameters_config =
121 config.getConfigSubtree(
"phasefield_parameters");
123 auto const thermal_parameters_config =
125 config.getConfigSubtree(
"thermal_parameters");
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);
196 config.getConfigParameter<
double>(
"reference_temperature");
199 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
201 std::vector<double>
const b =
203 config.getConfigParameter<std::vector<double>>(
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());
217 ThermoMechanicalPhaseFieldProcessData<DisplacementDim> process_data{
219 std::move(solid_constitutive_relations),
225 linear_thermal_expansion_coefficient,
228 residual_thermal_conductivity,
232 SecondaryVariableCollection secondary_variables;
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);
void INFO(char const *fmt, Args const &... args)
void DBUG(char const *fmt, Args const &... args)
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::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)