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 28 of file CreateThermoHydroMechanicsProcess.cpp.

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

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

References BaseLib::ConfigTree::checkConfigParameter(), ProcessLib::checkThermoOsmosisProperties(), 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 )