OGS
ProcessLib::ThermoMechanics Namespace Reference

Classes

struct  IntegrationPointData
struct  SecondaryData
class  ThermoMechanicsLocalAssembler
 Local assembler of ThermoMechanics process. More...
struct  ThermoMechanicsLocalAssemblerInterface
class  ThermoMechanicsProcess
struct  ThermoMechanicsProcessData

Functions

void checkMPLProperties (std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template<int DisplacementDim>
std::unique_ptr< ProcesscreateThermoMechanicsProcess (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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< ProcesscreateThermoMechanicsProcess< 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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< ProcesscreateThermoMechanicsProcess< 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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)

Function Documentation

◆ checkMPLProperties()

void ProcessLib::ThermoMechanics::checkMPLProperties ( std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media)

Definition at line 23 of file CreateThermoMechanicsProcess.cpp.

25{
26 std::array const required_solid_properties = {
30
31 for (auto const& m : media)
32 {
33 checkRequiredProperties(m.second->phase("Solid"),
34 required_solid_properties);
35 }
36}

References MaterialPropertyLib::density, MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::thermal_conductivity, and MaterialPropertyLib::thermal_expansivity.

Referenced by createThermoMechanicsProcess().

◆ createThermoMechanicsProcess()

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::ThermoMechanics::createThermoMechanicsProcess ( 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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__THERMO_MECHANICS__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__THERMO_MECHANICS__process_variables

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

Input File Parameter
prj__processes__process__THERMO_MECHANICS__process_variables__temperature
Input File Parameter
prj__processes__process__THERMO_MECHANICS__process_variables__displacement

Process Parameters

Input File Parameter
prj__processes__process__THERMO_MECHANICS__constitutive_relation
Input File Parameter
prj__processes__process__THERMO_MECHANICS__specific_body_force
Input File Parameter
prj__processes__process__THERMO_MECHANICS__initial_stress

Definition at line 39 of file CreateThermoMechanicsProcess.cpp.

48{
50 config.checkConfigParameter("type", "THERMO_MECHANICS");
51 DBUG("Create ThermoMechanicsProcess.");
52
53 auto const coupling_scheme =
55 config.getConfigParameterOptional<std::string>("coupling_scheme");
56 const bool use_monolithic_scheme =
57 !(coupling_scheme && (*coupling_scheme == "staggered"));
58
60
62 auto const pv_config = config.getConfigSubtree("process_variables");
63
64 // Process IDs, which are set according to the appearance order of the
65 int heat_conduction_process_id = 0;
66 int mechanics_process_id = 0;
67
68 ProcessVariable* variable_T;
69 ProcessVariable* variable_u;
70 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
71 process_variables;
72 if (use_monolithic_scheme) // monolithic scheme.
73 {
76 auto per_process_variables = findProcessVariables(
77 variables, pv_config,
78 {
79 "temperature",
81 "displacement"});
82 variable_T = &per_process_variables[0].get();
83 variable_u = &per_process_variables[1].get();
84 process_variables.push_back(std::move(per_process_variables));
85 }
86 else // staggered scheme.
87 {
88 using namespace std::string_literals;
89 for (auto const& variable_name : {"temperature"s, "displacement"s})
90 {
91 auto per_process_variables =
92 findProcessVariables(variables, pv_config, {variable_name});
93 process_variables.push_back(std::move(per_process_variables));
94 }
95 variable_T = &process_variables[0][0].get();
96 variable_u = &process_variables[1][0].get();
97 // process variables. Up to now, the ordering is fixed as:
98 heat_conduction_process_id = 0;
99 mechanics_process_id = 1;
100 }
101
102 DBUG("Associate displacement with process variable '{:s}'.",
103 variable_u->getName());
104
105 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
106 {
107 OGS_FATAL(
108 "Number of components of the process variable '{:s}' is different "
109 "from the displacement dimension: got {:d}, expected {:d}",
110 variable_u->getName(),
111 variable_u->getNumberOfGlobalComponents(),
112 DisplacementDim);
113 }
114
115 DBUG("Associate temperature with process variable '{:s}'.",
116 variable_T->getName());
117 if (variable_T->getNumberOfGlobalComponents() != 1)
118 {
119 OGS_FATAL(
120 "Pressure process variable '{:s}' is not a scalar variable but has "
121 "{:d} components.",
122 variable_T->getName(),
123 variable_T->getNumberOfGlobalComponents());
124 }
125
128 config.peekConfigParameter<std::string>("constitutive_relation");
129 auto solid_constitutive_relations =
131 parameters, local_coordinate_system, materialIDs(mesh), config);
132
133 // Specific body force
134 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
135 {
136 std::vector<double> const b =
138 config.getConfigParameter<std::vector<double>>(
139 "specific_body_force");
140 if (b.size() != DisplacementDim)
141 {
142 OGS_FATAL(
143 "The size of the specific body force vector does not match the "
144 "displacement dimension. Vector size is {:d}, displacement "
145 "dimension is {:d}",
146 b.size(), DisplacementDim);
147 }
148
149 std::copy_n(b.data(), b.size(), specific_body_force.data());
150 }
151
152 // Initial stress conditions
153 auto const initial_stress = ParameterLib::findOptionalTagParameter<double>(
155 config, "initial_stress", parameters,
156 // Symmetric tensor size, 4 or 6, not a Kelvin vector.
158 &mesh);
159
160 auto media_map =
162 DBUG("Check the solid properties of ThermoMechanics process ...");
163 checkMPLProperties(media);
164 DBUG("Solid properties verified.");
165
167 materialIDs(mesh),
168 std::move(media_map),
169 std::move(solid_constitutive_relations),
170 initial_stress,
171 specific_body_force,
172 mechanics_process_id,
173 heat_conduction_process_id};
174
175 SecondaryVariableCollection secondary_variables;
176
177 ProcessLib::createSecondaryVariables(config, secondary_variables);
178
179 return std::make_unique<ThermoMechanicsProcess<DisplacementDim>>(
180 std::move(name), mesh, std::move(jacobian_assembler), parameters,
181 integration_order, std::move(process_variables),
182 std::move(process_data), std::move(secondary_variables),
183 use_monolithic_scheme);
184}
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:258
Parameter< ParameterDataType > * findOptionalTagParameter(BaseLib::ConfigTree const &process_config, std::string const &tag, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
void checkMPLProperties(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)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), checkMPLProperties(), MaterialLib::Solids::createConstitutiveRelations(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), ProcessLib::createSecondaryVariables(), DBUG(), ParameterLib::findOptionalTagParameter(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), MathLib::KelvinVector::kelvin_vector_dimensions(), OGS_FATAL, and BaseLib::ConfigTree::peekConfigParameter().

◆ createThermoMechanicsProcess< 2 >()

template std::unique_ptr< Process > ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )

◆ createThermoMechanicsProcess< 3 >()

template std::unique_ptr< Process > ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 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,
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & media )