OGS
ProcessLib::ThermoHydroMechanics Namespace Reference

Classes

struct  ConstitutiveRelationsValues
struct  IntegrationPointData
struct  IntegrationPointDataForOutput
struct  LocalAssemblerInterface
struct  SecondaryData
class  ThermoHydroMechanicsLocalAssembler
class  ThermoHydroMechanicsProcess
struct  ThermoHydroMechanicsProcessData

Functions

template<int DisplacementDim>
std::unique_ptr< ProcesscreateThermoHydroMechanicsProcess (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< ProcesscreateThermoHydroMechanicsProcess< 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< ProcesscreateThermoHydroMechanicsProcess< 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)
template<int DisplacementDim>
THERMOHYDROMECHANICS_EXPORT std::unique_ptr< ProcesscreateThermoHydroMechanicsProcess (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

◆ createThermoHydroMechanicsProcess() [1/2]

template<int DisplacementDim>
std::unique_ptr< Process > ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess ( 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_HYDRO_MECHANICS__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables

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

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__temperature
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__pressure
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__displacement

Process Parameters

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__specific_body_force
Input File Parameter
prj__processes__process__linear
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__equation_balance_type

Definition at line 27 of file CreateThermoHydroMechanicsProcess.cpp.

36{
38 config.checkConfigParameter("type", "THERMO_HYDRO_MECHANICS");
39 DBUG("Create ThermoHydroMechanicsProcess.");
40
41 auto const coupling_scheme =
43 config.getConfigParameterOptional<std::string>("coupling_scheme");
44 const bool use_monolithic_scheme =
45 !(coupling_scheme && (*coupling_scheme == "staggered"));
46
48
50 auto const pv_config = config.getConfigSubtree("process_variables");
51
52 ProcessVariable* variable_T;
53 ProcessVariable* variable_p;
54 ProcessVariable* variable_u;
55 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
56 process_variables;
57 if (use_monolithic_scheme) // monolithic scheme.
58 {
61 auto per_process_variables = findProcessVariables(
62 variables, pv_config,
63 {
64 "temperature",
66 "pressure",
68 "displacement"});
69 variable_T = &per_process_variables[0].get();
70 variable_p = &per_process_variables[1].get();
71 variable_u = &per_process_variables[2].get();
72 process_variables.push_back(std::move(per_process_variables));
73 }
74 else // staggered scheme.
75 {
76 using namespace std::string_literals;
77 for (auto const& variable_name :
78 {"temperature"s, "pressure"s, "displacement"s})
79 {
80 auto per_process_variables =
81 findProcessVariables(variables, pv_config, {variable_name});
82 process_variables.push_back(std::move(per_process_variables));
83 }
84 variable_T = &process_variables[0][0].get();
85 variable_p = &process_variables[1][0].get();
86 variable_u = &process_variables[2][0].get();
87 }
88
89 if (variable_T->getShapeFunctionOrder() != 1)
90 {
92 "The shape function order of temperature must be 1 but its input "
93 "value in <process_variable><order> is {:d}. Please correct it.",
94 variable_T->getShapeFunctionOrder());
95 }
96 if (variable_p->getShapeFunctionOrder() != 1)
97 {
99 "The shape function order of pressure must be 1 but its input "
100 "value in <process_variable><order> is {:d}. Please correct it.",
101 variable_p->getShapeFunctionOrder());
102 }
103
104 DBUG("Associate displacement with process variable '{:s}'.",
105 variable_u->getName());
106
107 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
108 {
109 OGS_FATAL(
110 "Number of components of the process variable '{:s}' is different "
111 "from the displacement dimension: got {:d}, expected {:d}",
112 variable_u->getName(),
113 variable_u->getNumberOfGlobalComponents(),
114 DisplacementDim);
115 }
116
117 DBUG("Associate pressure with process variable '{:s}'.",
118 variable_p->getName());
119 if (variable_p->getNumberOfGlobalComponents() != 1)
120 {
121 OGS_FATAL(
122 "Pressure process variable '{:s}' is not a scalar variable but has "
123 "{:d} components.",
124 variable_p->getName(),
125 variable_p->getNumberOfGlobalComponents());
126 }
127
128 DBUG("Associate temperature with process variable '{:s}'.",
129 variable_T->getName());
130 if (variable_T->getNumberOfGlobalComponents() != 1)
131 {
132 OGS_FATAL(
133 "temperature process variable '{:s}' is not a scalar variable but "
134 "has {:d} components.",
135 variable_T->getName(),
136 variable_T->getNumberOfGlobalComponents());
137 }
138
140 auto solid_constitutive_relations =
142 parameters, local_coordinate_system, materialIDs(mesh), config);
143
144 auto ice_constitutive_relation =
146 parameters, local_coordinate_system, config);
147
148 // Specific body force
149 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
150 {
151 std::vector<double> const b =
153 config.getConfigParameter<std::vector<double>>(
154 "specific_body_force");
155 if (b.size() != DisplacementDim)
156 {
157 OGS_FATAL(
158 "The size of the specific body force vector does not match the "
159 "displacement dimension. Vector size is {:d}, displacement "
160 "dimension is {:d}",
161 b.size(), DisplacementDim);
162 }
163
164 std::copy_n(b.data(), b.size(), specific_body_force.data());
165 }
166
167 auto const is_linear =
169 config.getConfigParameter("linear", false);
170
171 auto media_map =
173
174 auto const equation_balance_type_str =
176 config.getConfigParameter<std::string>("equation_balance_type",
177 "volume");
178 if (equation_balance_type_str == "volume")
179 {
181 media_map);
182 }
183
184 // Initial stress conditions
185
187 config, parameters, mesh);
188
189 auto stabilizer = NumLib::createNumericalStabilization(mesh, config);
190
191 bool const is_volume_balance_equation_type =
192 equation_balance_type_str == "volume";
194 materialIDs(mesh),
195 std::move(media_map),
196 std::move(solid_constitutive_relations),
197 std::move(ice_constitutive_relation),
198 is_volume_balance_equation_type,
199 std::move(initial_stress),
200 specific_body_force,
201 std::move(stabilizer)};
202
203 SecondaryVariableCollection secondary_variables;
204
205 ProcessLib::createSecondaryVariables(config, secondary_variables);
206
207 return std::make_unique<ThermoHydroMechanicsProcess<DisplacementDim>>(
208 std::move(name), mesh, std::move(jacobian_assembler), parameters,
209 integration_order, std::move(process_variables),
210 std::move(process_data), std::move(secondary_variables),
211 use_monolithic_scheme, is_linear);
212}
#define OGS_FATAL(...)
Definition Error.h:19
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
unsigned getShapeFunctionOrder() const
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)
std::unique_ptr< MaterialLib::Solids::MechanicsBase< DisplacementDim > > createConstitutiveRelationIce(std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, BaseLib::ConfigTree const &config)
MaterialSpatialDistributionMap createMaterialSpatialDistributionMap(std::map< int, std::shared_ptr< Medium > > const &media, MeshLib::Mesh const &mesh)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:258
NumericalStabilization createNumericalStabilization(MeshLib::Mesh const &mesh, BaseLib::ConfigTree const &config)
void checkVolumeBalanceEquationSetting(MaterialPropertyLib::MaterialSpatialDistributionMap const &media_map)
std::vector< std::reference_wrapper< ProcessVariable > > findProcessVariables(std::vector< ProcessVariable > const &variables, BaseLib::ConfigTree const &pv_config, std::initializer_list< std::string > tags)
InitialStress createInitialStress(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, MeshLib::Mesh const &mesh, bool const mandatory_stress_type)
void createSecondaryVariables(BaseLib::ConfigTree const &config, SecondaryVariableCollection &secondary_variables)

References BaseLib::ConfigTree::checkConfigParameter(), ProcessLib::Common::HydraulicProcess::checkVolumeBalanceEquationSetting(), MaterialLib::Solids::createConstitutiveRelationIce(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createInitialStress(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), NumLib::createNumericalStabilization(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), ProcessLib::ProcessVariable::getShapeFunctionOrder(), and OGS_FATAL.

◆ createThermoHydroMechanicsProcess() [2/2]

template<int DisplacementDim>
THERMOHYDROMECHANICS_EXPORT std::unique_ptr< Process > ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess ( 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_HYDRO_MECHANICS__coupling_scheme

Process Variables

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables

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

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__temperature
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__pressure
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__process_variables__displacement

Process Parameters

Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__specific_body_force
Input File Parameter
prj__processes__process__linear
Input File Parameter
prj__processes__process__THERMO_HYDRO_MECHANICS__equation_balance_type

Definition at line 27 of file CreateThermoHydroMechanicsProcess.cpp.

36{
38 config.checkConfigParameter("type", "THERMO_HYDRO_MECHANICS");
39 DBUG("Create ThermoHydroMechanicsProcess.");
40
41 auto const coupling_scheme =
43 config.getConfigParameterOptional<std::string>("coupling_scheme");
44 const bool use_monolithic_scheme =
45 !(coupling_scheme && (*coupling_scheme == "staggered"));
46
48
50 auto const pv_config = config.getConfigSubtree("process_variables");
51
52 ProcessVariable* variable_T;
53 ProcessVariable* variable_p;
54 ProcessVariable* variable_u;
55 std::vector<std::vector<std::reference_wrapper<ProcessVariable>>>
56 process_variables;
57 if (use_monolithic_scheme) // monolithic scheme.
58 {
61 auto per_process_variables = findProcessVariables(
62 variables, pv_config,
63 {
64 "temperature",
66 "pressure",
68 "displacement"});
69 variable_T = &per_process_variables[0].get();
70 variable_p = &per_process_variables[1].get();
71 variable_u = &per_process_variables[2].get();
72 process_variables.push_back(std::move(per_process_variables));
73 }
74 else // staggered scheme.
75 {
76 using namespace std::string_literals;
77 for (auto const& variable_name :
78 {"temperature"s, "pressure"s, "displacement"s})
79 {
80 auto per_process_variables =
81 findProcessVariables(variables, pv_config, {variable_name});
82 process_variables.push_back(std::move(per_process_variables));
83 }
84 variable_T = &process_variables[0][0].get();
85 variable_p = &process_variables[1][0].get();
86 variable_u = &process_variables[2][0].get();
87 }
88
89 if (variable_T->getShapeFunctionOrder() != 1)
90 {
92 "The shape function order of temperature must be 1 but its input "
93 "value in <process_variable><order> is {:d}. Please correct it.",
94 variable_T->getShapeFunctionOrder());
95 }
96 if (variable_p->getShapeFunctionOrder() != 1)
97 {
99 "The shape function order of pressure must be 1 but its input "
100 "value in <process_variable><order> is {:d}. Please correct it.",
101 variable_p->getShapeFunctionOrder());
102 }
103
104 DBUG("Associate displacement with process variable '{:s}'.",
105 variable_u->getName());
106
107 if (variable_u->getNumberOfGlobalComponents() != DisplacementDim)
108 {
109 OGS_FATAL(
110 "Number of components of the process variable '{:s}' is different "
111 "from the displacement dimension: got {:d}, expected {:d}",
112 variable_u->getName(),
113 variable_u->getNumberOfGlobalComponents(),
114 DisplacementDim);
115 }
116
117 DBUG("Associate pressure with process variable '{:s}'.",
118 variable_p->getName());
119 if (variable_p->getNumberOfGlobalComponents() != 1)
120 {
121 OGS_FATAL(
122 "Pressure process variable '{:s}' is not a scalar variable but has "
123 "{:d} components.",
124 variable_p->getName(),
125 variable_p->getNumberOfGlobalComponents());
126 }
127
128 DBUG("Associate temperature with process variable '{:s}'.",
129 variable_T->getName());
130 if (variable_T->getNumberOfGlobalComponents() != 1)
131 {
132 OGS_FATAL(
133 "temperature process variable '{:s}' is not a scalar variable but "
134 "has {:d} components.",
135 variable_T->getName(),
136 variable_T->getNumberOfGlobalComponents());
137 }
138
140 auto solid_constitutive_relations =
142 parameters, local_coordinate_system, materialIDs(mesh), config);
143
144 auto ice_constitutive_relation =
146 parameters, local_coordinate_system, config);
147
148 // Specific body force
149 Eigen::Matrix<double, DisplacementDim, 1> specific_body_force;
150 {
151 std::vector<double> const b =
153 config.getConfigParameter<std::vector<double>>(
154 "specific_body_force");
155 if (b.size() != DisplacementDim)
156 {
157 OGS_FATAL(
158 "The size of the specific body force vector does not match the "
159 "displacement dimension. Vector size is {:d}, displacement "
160 "dimension is {:d}",
161 b.size(), DisplacementDim);
162 }
163
164 std::copy_n(b.data(), b.size(), specific_body_force.data());
165 }
166
167 auto const is_linear =
169 config.getConfigParameter("linear", false);
170
171 auto media_map =
173
174 auto const equation_balance_type_str =
176 config.getConfigParameter<std::string>("equation_balance_type",
177 "volume");
178 if (equation_balance_type_str == "volume")
179 {
181 media_map);
182 }
183
184 // Initial stress conditions
185
187 config, parameters, mesh);
188
189 auto stabilizer = NumLib::createNumericalStabilization(mesh, config);
190
191 bool const is_volume_balance_equation_type =
192 equation_balance_type_str == "volume";
194 materialIDs(mesh),
195 std::move(media_map),
196 std::move(solid_constitutive_relations),
197 std::move(ice_constitutive_relation),
198 is_volume_balance_equation_type,
199 std::move(initial_stress),
200 specific_body_force,
201 std::move(stabilizer)};
202
203 SecondaryVariableCollection secondary_variables;
204
205 ProcessLib::createSecondaryVariables(config, secondary_variables);
206
207 return std::make_unique<ThermoHydroMechanicsProcess<DisplacementDim>>(
208 std::move(name), mesh, std::move(jacobian_assembler), parameters,
209 integration_order, std::move(process_variables),
210 std::move(process_data), std::move(secondary_variables),
211 use_monolithic_scheme, is_linear);
212}

References BaseLib::ConfigTree::checkConfigParameter(), ProcessLib::Common::HydraulicProcess::checkVolumeBalanceEquationSetting(), MaterialLib::Solids::createConstitutiveRelationIce(), MaterialLib::Solids::createConstitutiveRelations(), ProcessLib::createInitialStress(), MaterialPropertyLib::createMaterialSpatialDistributionMap(), NumLib::createNumericalStabilization(), ProcessLib::createSecondaryVariables(), DBUG(), ProcessLib::findProcessVariables(), BaseLib::ConfigTree::getConfigParameter(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), ProcessLib::ProcessVariable::getName(), ProcessLib::ProcessVariable::getNumberOfGlobalComponents(), ProcessLib::ProcessVariable::getShapeFunctionOrder(), and OGS_FATAL.

◆ createThermoHydroMechanicsProcess< 2 >()

template THERMOHYDROMECHANICS_EXPORT std::unique_ptr< Process > ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 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 )

◆ createThermoHydroMechanicsProcess< 3 >()

template THERMOHYDROMECHANICS_EXPORT std::unique_ptr< Process > ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 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 )