OGS
ProcessLib::ThermoMechanicalPhaseField Namespace Reference

Classes

struct  IntegrationPointData
 
struct  SecondaryData
 
class  ThermoMechanicalPhaseFieldLocalAssembler
 
struct  ThermoMechanicalPhaseFieldLocalAssemblerInterface
 
class  ThermoMechanicalPhaseFieldProcess
 A class to simulate thermo-mechanical fracturing process using phase-field approach in solids described by. More...
 
struct  ThermoMechanicalPhaseFieldProcessData
 

Functions

template<int DisplacementDim>
std::unique_ptr< ProcesscreateThermoMechanicalPhaseFieldProcess (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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreateThermoMechanicalPhaseFieldProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 
template std::unique_ptr< ProcesscreateThermoMechanicalPhaseFieldProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
 

Function Documentation

◆ createThermoMechanicalPhaseFieldProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess ( 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 & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )
Input File Parameter
prj__processes__process__type

Process Variables

Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__process_variables

Primary process variables as they appear in the global component vector:

Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__process_variables__temperature
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__process_variables__displacement
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__process_variables__phasefield

Process Parameters

Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__residual_stiffness
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__crack_resistance
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__crack_length_scale
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__phasefield_parameters__kinetic_coefficient
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__reference_solid_density
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__linear_thermal_expansion_coefficient
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__specific_heat_capacity
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__thermal_conductivity
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__thermal_parameters__residual_thermal_conductivity
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__reference_temperature
Input File Parameter
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__specific_body_force

Definition at line 28 of file CreateThermoMechanicalPhaseFieldProcess.cpp.

38{
40 config.checkConfigParameter("type", "THERMO_MECHANICAL_PHASE_FIELD");
41 DBUG("Create ThermoMechanicalPhaseFieldProcess.");
42
43 INFO(
44 "Solve the coupling with the staggered scheme,"
45 "which is the only option for TM-Phasefield in the current code");
46
48
50 auto const pv_config = config.getConfigSubtree("process_variables");
51 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
52 process_variables;
53 int heat_conduction_process_id = 0;
54 int mechanics_related_process_id = 1;
55 int phase_field_process_id = 2;
56
58 auto process_variable_T = findProcessVariables(
59 variables, pv_config,
60 {
61 "temperature"});
62 process_variables.push_back(std::move(process_variable_T));
63 ProcessVariable* variable_T =
64 &process_variables[process_variables.size() - 1][0].get();
65
66 auto process_variable_u = findProcessVariables(
67 variables, pv_config,
68 {
69 "displacement"});
70 process_variables.push_back(std::move(process_variable_u));
71 ProcessVariable* variable_u =
72 &process_variables[process_variables.size() - 1][0].get();
73 auto process_variable_ph = findProcessVariables(
74 variables, pv_config,
75 {
76 "phasefield"});
77 process_variables.push_back(std::move(process_variable_ph));
78 ProcessVariable* variable_ph =
79 &process_variables[process_variables.size() - 1][0].get();
80
81 DBUG("Associate displacement with process variable '{:s}'.",
82 variable_u->getName());
83
84 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
85 {
87 "Number of components of the process variable '{:s}' is different "
88 "from the displacement dimension: got {:d}, expected {:d}",
89 variable_u->getName(),
90 variable_u->getNumberOfGlobalComponents(),
91 DisplacementDim);
92 }
93
94 DBUG("Associate phase field with process variable '{:s}'.",
95 variable_ph->getName());
96 if (variable_ph->getNumberOfGlobalComponents() != 1)
97 {
99 "Phasefield process variable '{:s}' is not a scalar variable but "
100 "has {:d} components.",
101 variable_ph->getName(),
102 variable_ph->getNumberOfGlobalComponents());
103 }
104
105 DBUG("Associate temperature with process variable '{:s}'.",
106 variable_T->getName());
107 if (variable_T->getNumberOfGlobalComponents() != 1)
108 {
109 OGS_FATAL(
110 "Temperature process variable '{:s}' is not a scalar variable but "
111 "has {:d} components.",
112 variable_T->getName(),
113 variable_T->getNumberOfGlobalComponents());
114 }
115
117 auto solid_constitutive_relations =
119 parameters, local_coordinate_system, materialIDs(mesh), config);
120
121 auto const phasefield_parameters_config =
123 config.getConfigSubtree("phasefield_parameters");
124
125 auto const thermal_parameters_config =
127 config.getConfigSubtree("thermal_parameters");
128
129 // Residual stiffness
130 auto const& residual_stiffness = ParameterLib::findParameter<double>(
131 phasefield_parameters_config,
133 "residual_stiffness", parameters, 1, &mesh);
134 DBUG("Use '{:s}' as residual stiffness.", residual_stiffness.name);
135
136 // Crack resistance
137 auto const& crack_resistance = ParameterLib::findParameter<double>(
138 phasefield_parameters_config,
140 "crack_resistance", parameters, 1, &mesh);
141 DBUG("Use '{:s}' as crack resistance.", crack_resistance.name);
142
143 // Crack length scale
144 auto const& crack_length_scale = ParameterLib::findParameter<double>(
145 phasefield_parameters_config,
147 "crack_length_scale", parameters, 1, &mesh);
148 DBUG("Use '{:s}' as crack length scale.", crack_length_scale.name);
149
150 // Kinetic coefficient
151 auto const& kinetic_coefficient = ParameterLib::findParameter<double>(
152 phasefield_parameters_config,
154 "kinetic_coefficient", parameters, 1, &mesh);
155 DBUG("Use '{:s}' as kinetic coefficient.", kinetic_coefficient.name);
156
157 // Solid density
158 auto const& solid_density = ParameterLib::findParameter<double>(
159 config,
161 "solid_density", parameters, 1, &mesh);
162 DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
163
164 // Linear thermal expansion coefficient
165 auto const& linear_thermal_expansion_coefficient =
167 thermal_parameters_config,
169 "linear_thermal_expansion_coefficient", parameters, 1, &mesh);
170 DBUG("Use '{:s}' as linear thermal expansion coefficient.",
171 linear_thermal_expansion_coefficient.name);
172
173 // Specific heat capacity
175 thermal_parameters_config,
177 "specific_heat_capacity", parameters, 1, &mesh);
178 DBUG("Use '{:s}' as specific heat capacity.", specific_heat_capacity.name);
179
180 // Thermal conductivity
182 thermal_parameters_config,
184 "thermal_conductivity", parameters, 1, &mesh);
185 DBUG("Use '{:s}' as thermal conductivity parameter.",
187 // Residual thermal conductivity
188 auto const& residual_thermal_conductivity = ParameterLib::findParameter<
189 double>(
190 thermal_parameters_config,
192 "residual_thermal_conductivity", parameters, 1, &mesh);
193 DBUG("Use '{:s}' as residual thermal conductivity parameter.",
194 residual_thermal_conductivity.name);
195 // Reference temperature
196 const auto reference_temperature =
198 config.getConfigParameter<double>("reference_temperature");
199
200 // Specific body force
201 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
202 {
203 std::vector<double> const b =
205 config.getConfigParameter<std::vector<double>>(
206 "specific_body_force");
207 if (specific_body_force.size() != DisplacementDim)
208 {
209 OGS_FATAL(
210 "The size of the specific body force vector does not match the "
211 "displacement dimension. Vector size is {:d}, displacement "
212 "dimension is {:d}",
213 specific_body_force.size(), DisplacementDim);
214 }
215
216 std::copy_n(b.data(), b.size(), specific_body_force.data());
217 }
218
219 ThermoMechanicalPhaseFieldProcessData<DisplacementDim> process_data{
220 materialIDs(mesh),
221 std::move(solid_constitutive_relations),
222 residual_stiffness,
223 crack_resistance,
224 crack_length_scale,
225 kinetic_coefficient,
226 solid_density,
227 linear_thermal_expansion_coefficient,
230 residual_thermal_conductivity,
231 specific_body_force,
233
234 SecondaryVariableCollection secondary_variables;
235
236 ProcessLib::createSecondaryVariables(config, secondary_variables);
237
238 return std::make_unique<ThermoMechanicalPhaseFieldProcess<DisplacementDim>>(
239 std::move(name), mesh, std::move(jacobian_assembler), parameters,
240 integration_order, std::move(process_variables),
241 std::move(process_data), std::move(secondary_variables),
242 mechanics_related_process_id, phase_field_process_id,
243 heat_conduction_process_id);
244}
#define OGS_FATAL(...)
Definition Error.h:26
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::string const & getName() const
int getNumberOfGlobalComponents() const
Returns the number of components of the process variable.
std::map< int, std::shared_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > > createConstitutiveRelations(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, MeshLib::PropertyVector< int > const *const material_ids, BaseLib::ConfigTree const &config)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102
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)

References BaseLib::ConfigTree::checkConfigParameter(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), INFO(), and OGS_FATAL.

◆ createThermoMechanicalPhaseFieldProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 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 & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )

◆ createThermoMechanicalPhaseFieldProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 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 & parameters,
std::optional< ParameterLib::CoordinateSystem > const & local_coordinate_system,
unsigned const integration_order,
BaseLib::ConfigTree const & config )