OGS
ProcessLib::ThermoMechanicalPhaseField Namespace Reference

Classes

struct  ThermoMechanicalPhaseFieldLocalAssemblerInterface
 
struct  IntegrationPointData
 
struct  SecondaryData
 
class  ThermoMechanicalPhaseFieldLocalAssembler
 
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 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 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 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  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
Input File Parameter:
prj__processes__process__THERMO_MECHANICAL_PHASE_FIELD__process_variables
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
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 
47  // Process variable.
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 
57  auto process_variable_T = findProcessVariables(
58  variables, pv_config,
59  {
60  "temperature"});
61  process_variables.push_back(std::move(process_variable_T));
62  ProcessVariable* variable_T =
63  &process_variables[process_variables.size() - 1][0].get();
64 
65  auto process_variable_u = findProcessVariables(
66  variables, pv_config,
67  {
68  "displacement"});
69  process_variables.push_back(std::move(process_variable_u));
70  ProcessVariable* variable_u =
71  &process_variables[process_variables.size() - 1][0].get();
72  auto process_variable_ph = findProcessVariables(
73  variables, pv_config,
74  {
75  "phasefield"});
76  process_variables.push_back(std::move(process_variable_ph));
77  ProcessVariable* variable_ph =
78  &process_variables[process_variables.size() - 1][0].get();
79 
80  DBUG("Associate displacement with process variable '{:s}'.",
81  variable_u->getName());
82 
83  if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
84  {
85  OGS_FATAL(
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(),
90  DisplacementDim);
91  }
92 
93  DBUG("Associate phase field with process variable '{:s}'.",
94  variable_ph->getName());
95  if (variable_ph->getNumberOfGlobalComponents() != 1)
96  {
97  OGS_FATAL(
98  "Phasefield process variable '{:s}' is not a scalar variable but "
99  "has {:d} components.",
100  variable_ph->getName(),
101  variable_ph->getNumberOfGlobalComponents());
102  }
103 
104  DBUG("Associate temperature with process variable '{:s}'.",
105  variable_T->getName());
106  if (variable_T->getNumberOfGlobalComponents() != 1)
107  {
108  OGS_FATAL(
109  "Temperature process variable '{:s}' is not a scalar variable but "
110  "has {:d} components.",
111  variable_T->getName(),
112  variable_T->getNumberOfGlobalComponents());
113  }
114 
115  auto solid_constitutive_relations =
116  MaterialLib::Solids::createConstitutiveRelations<DisplacementDim>(
117  parameters, local_coordinate_system, config);
118 
119  auto const phasefield_parameters_config =
121  config.getConfigSubtree("phasefield_parameters");
122 
123  auto const thermal_parameters_config =
125  config.getConfigSubtree("thermal_parameters");
126 
127  // Residual stiffness
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);
133 
134  // Crack resistance
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);
140 
141  // Crack length scale
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);
147 
148  // Kinetic coefficient
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);
154 
155  // Solid density
156  auto const& solid_density = ParameterLib::findParameter<double>(
157  config,
159  "solid_density", parameters, 1, &mesh);
160  DBUG("Use '{:s}' as solid density parameter.", solid_density.name);
161 
162  // Linear thermal expansion coefficient
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);
170 
171  // Specific heat capacity
172  auto const& specific_heat_capacity = ParameterLib::findParameter<double>(
173  thermal_parameters_config,
175  "specific_heat_capacity", parameters, 1, &mesh);
176  DBUG("Use '{:s}' as specific heat capacity.", specific_heat_capacity.name);
177 
178  // Thermal conductivity
179  auto const& thermal_conductivity = ParameterLib::findParameter<double>(
180  thermal_parameters_config,
182  "thermal_conductivity", parameters, 1, &mesh);
183  DBUG("Use '{:s}' as thermal conductivity parameter.",
184  thermal_conductivity.name);
185  // Residual thermal conductivity
186  auto const& residual_thermal_conductivity = ParameterLib::findParameter<
187  double>(
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);
193  // Reference temperature
194  const auto reference_temperature =
196  config.getConfigParameter<double>("reference_temperature");
197 
198  // Specific body force
199  Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
200  {
201  std::vector<double> const b =
203  config.getConfigParameter<std::vector<double>>(
204  "specific_body_force");
205  if (specific_body_force.size() != DisplacementDim)
206  {
207  OGS_FATAL(
208  "The size of the specific body force vector does not match the "
209  "displacement dimension. Vector size is {:d}, displacement "
210  "dimension is {:d}",
211  specific_body_force.size(), DisplacementDim);
212  }
213 
214  std::copy_n(b.data(), b.size(), specific_body_force.data());
215  }
216 
217  ThermoMechanicalPhaseFieldProcessData<DisplacementDim> process_data{
218  materialIDs(mesh),
219  std::move(solid_constitutive_relations),
220  residual_stiffness,
221  crack_resistance,
222  crack_length_scale,
223  kinetic_coefficient,
224  solid_density,
225  linear_thermal_expansion_coefficient,
228  residual_thermal_conductivity,
229  specific_body_force,
231 
232  SecondaryVariableCollection secondary_variables;
233 
234  ProcessLib::createSecondaryVariables(config, secondary_variables);
235 
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);
242 }
#define OGS_FATAL(...)
Definition: Error.h:26
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition: Mesh.cpp:258
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(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), INFO(), MeshLib::materialIDs(), MaterialPropertyLib::name, OGS_FATAL, MaterialPropertyLib::reference_temperature, MaterialPropertyLib::specific_heat_capacity, and MaterialPropertyLib::thermal_conductivity.

◆ createThermoMechanicalPhaseFieldProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::ThermoMechanicalPhaseField::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 &  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  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 
)